mount path on persistent data.

This commit is contained in:
Miroslav Šedivý
2021-08-15 14:12:26 +02:00
parent a419c8a23e
commit e781551103
+16 -1
View File
@@ -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: '' } ])
}