storage enabled in rooms config.

This commit is contained in:
Miroslav Šedivý
2021-08-15 14:27:36 +02:00
parent a1a68889cb
commit 845a79e718
5 changed files with 38 additions and 7 deletions
+3
View File
@@ -234,6 +234,9 @@ components:
items:
type: string
example: m1k1o/neko:latest
storage_enabled:
type: boolean
example: true
RoomEntry:
type: object
+6
View File
@@ -374,6 +374,12 @@ export interface RoomsConfig {
* @memberof RoomsConfig
*/
neko_images?: Array<string>;
/**
*
* @type {boolean}
* @memberof RoomsConfig
*/
storage_enabled?: boolean;
}
/**
+23 -3
View File
@@ -210,8 +210,16 @@
</v-row>
<v-row align="center" no-gutters class="my-3">
<h2> Mounts </h2>
<v-btn @click="data.mounts = [ ...data.mounts, { type: 'private', host_path: '', container_path: '' }]" icon color="green"><v-icon>mdi-plus</v-icon></v-btn>
<v-btn :disabled="!storageEnabled" @click="data.mounts = [ ...data.mounts, { type: 'private', host_path: '', container_path: '' }]" icon color="green"><v-icon>mdi-plus</v-icon></v-btn>
</v-row>
<v-alert
border="left"
type="warning"
v-if="!storageEnabled"
>
<p><strong>Not available!</strong></p>
<p class="mb-0">Mounts are not available, because storage is not enabled.</p>
</v-alert>
<v-row align="center" class="mb-2" v-for="({ type, host_path, container_path }, index) in data.mounts" :key="index">
<v-col class="py-0" cols="2">
<v-select
@@ -261,13 +269,21 @@
</h2>
<v-checkbox
v-model="browserPolicyEnabled"
:disabled="!browserPolicyConfig"
:disabled="!browserPolicyConfig || !storageEnabled"
hide-details
class="shrink ml-2 mt-0"
></v-checkbox>
</v-row>
<template v-if="browserPolicyConfig">
<v-alert
border="left"
type="warning"
v-if="!storageEnabled"
>
<p><strong>Not available!</strong></p>
<p class="mb-0">Browser policy is not available, because storage is not enabled.</p>
</v-alert>
<template v-else-if="browserPolicyConfig">
<v-row align="center" no-gutters class="mt-0">
<v-col>
<v-select
@@ -403,6 +419,10 @@ export default class RoomsCreate extends Vue {
return this.$store.state.roomsConfig.neko_images
}
get storageEnabled() {
return this.$store.state.roomsConfig.storage_enabled
}
get videoCodecs() {
return this.$store.state.videoCodecs
}
+3 -2
View File
@@ -59,8 +59,9 @@ type RoomManagerCtx struct {
func (manager *RoomManagerCtx) Config() types.RoomsConfig {
return types.RoomsConfig{
Connections: manager.config.EprMax - manager.config.EprMin + 1,
NekoImages: manager.config.NekoImages,
Connections: manager.config.EprMax - manager.config.EprMin + 1,
NekoImages: manager.config.NekoImages,
StorageEnabled: manager.config.StorageEnabled,
}
}
+3 -2
View File
@@ -24,8 +24,9 @@ var blacklistedEnvs = []string{
}
type RoomsConfig struct {
Connections uint16 `json:"connections"`
NekoImages []string `json:"neko_images"`
Connections uint16 `json:"connections"`
NekoImages []string `json:"neko_images"`
StorageEnabled bool `json:"storage_enabled"`
}
type RoomEntry struct {