mirror of
https://github.com/m1k1o/neko-rooms.git
synced 2026-11-02 22:51:34 -06:00
mount path on persistent data.
This commit is contained in:
@@ -333,13 +333,14 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Vue, Component, Ref } from 'vue-property-decorator'
|
||||
import { Vue, Component, Ref, Watch } from 'vue-property-decorator'
|
||||
|
||||
import {
|
||||
RoomSettings,
|
||||
BrowserPolicyContent,
|
||||
BrowserPolicyExtension,
|
||||
BrowserPolicyTypeEnum,
|
||||
RoomMountTypeEnum,
|
||||
} from '@/api/index'
|
||||
|
||||
export type VForm = Vue & {
|
||||
@@ -453,6 +454,20 @@ export default class RoomsCreate extends Vue {
|
||||
})
|
||||
}
|
||||
|
||||
@Watch('browserPolicyContent.persistent_data')
|
||||
onPersistentDataUpdate(enabled: boolean) {
|
||||
const config = this.browserPolicyConfig
|
||||
if (!config) return
|
||||
|
||||
if (enabled) {
|
||||
// eslint-disable-next-line
|
||||
this.data.mounts = [ ...(this.data.mounts || []), { type: RoomMountTypeEnum.private, host_path: '/profile', container_path: config.profile }]
|
||||
} else {
|
||||
// eslint-disable-next-line
|
||||
this.data.mounts = (this.data.mounts || []).filter(({ type, container_path }) => type != RoomMountTypeEnum.private && container_path != config.profile)
|
||||
}
|
||||
}
|
||||
|
||||
addEnv() {
|
||||
Vue.set(this, 'envList', [ ...this.envList, { key: '', val: '' } ])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user