add Shared memory to settings, fixes #82.

This commit is contained in:
Miroslav Šedivý
2023-01-09 22:26:00 +01:00
parent c325d4fc59
commit ac07cb5c74
3 changed files with 31 additions and 7 deletions
+1 -1
View File
@@ -172,7 +172,7 @@
<tr><th style="width:50%;"> CPUs </th><td :title="settings.resources.nano_cpus"><span v-if="settings.resources.nano_cpus">{{ settings.resources.nano_cpus | nanocpus }}</span><i v-else>--undefined--</i></td></tr> <tr><th style="width:50%;"> CPUs </th><td :title="settings.resources.nano_cpus"><span v-if="settings.resources.nano_cpus">{{ settings.resources.nano_cpus | nanocpus }}</span><i v-else>--undefined--</i></td></tr>
<tr><th> Memory </th><td :title="settings.resources.memory"><span v-if="settings.resources.memory">{{ settings.resources.memory | memory }}</span><i v-else>--undefined--</i></td></tr> <tr><th> Memory </th><td :title="settings.resources.memory"><span v-if="settings.resources.memory">{{ settings.resources.memory | memory }}</span><i v-else>--undefined--</i></td></tr>
<tr><th> CPU Shares </th><td :title="settings.resources.cpu_shares"><span v-if="settings.resources.cpu_shares">{{ settings.resources.cpu_shares }}</span><i v-else>--undefined--</i></td></tr> <tr><th> CPU Shares </th><td :title="settings.resources.cpu_shares"><span v-if="settings.resources.cpu_shares">{{ settings.resources.cpu_shares }}</span><i v-else>--undefined--</i></td></tr>
<tr><th> Shm Size </th><td :title="settings.resources.shm_size">{{ settings.resources.shm_size | memory }}</td></tr> <tr><th> Shared memory </th><td :title="settings.resources.shm_size">{{ settings.resources.shm_size | memory }}</td></tr>
</tbody> </tbody>
</template> </template>
</v-simple-table> </v-simple-table>
+21 -5
View File
@@ -313,6 +313,7 @@
:max="8*1e9" :max="8*1e9"
:step="0.2*1e9" :step="0.2*1e9"
color="blue" color="blue"
hide-details
> >
<template v-slot:thumb-label="{ value }"> <template v-slot:thumb-label="{ value }">
<span v-if="value">{{ value | memory }}</span> <span v-if="value">{{ value | memory }}</span>
@@ -330,6 +331,7 @@
:max="8*1e9" :max="8*1e9"
:step="0.2*1e9" :step="0.2*1e9"
color="blue" color="blue"
hide-details
> >
<template v-slot:thumb-label="{ value }"> <template v-slot:thumb-label="{ value }">
<span v-if="value">{{ value | nanocpus }}</span> <span v-if="value">{{ value | nanocpus }}</span>
@@ -338,6 +340,25 @@
</v-slider> </v-slider>
</v-col> </v-col>
</v-row> </v-row>
<v-row align="center">
<v-col>
<v-slider
v-model="data.resources.shm_size"
label="Shared memory"
thumb-label="always"
:thumb-size="30"
:min="0"
:max="20*1e9"
:step="0.2*1e9"
color="blue"
>
<template v-slot:thumb-label="{ value }">
<span v-if="value">{{ value | memory }}</span>
<span v-else>N/A</span>
</template>
</v-slider>
</v-col>
</v-row>
</template> </template>
<hr /> <hr />
@@ -653,11 +674,6 @@ export default class RoomsCreate extends Vue {
...this.$store.state.defaultRoomSettings, ...this.$store.state.defaultRoomSettings,
// eslint-disable-next-line // eslint-disable-next-line
neko_image: this.nekoImages[0], neko_image: this.nekoImages[0],
resources: {
// eslint-disable-next-line
nano_cpus: 0,
memory: 0,
},
} }
this.browserPolicyContent = { ...this.$store.state.defaultBrowserPolicyContent } this.browserPolicyContent = { ...this.$store.state.defaultBrowserPolicyContent }
this.envList = Object.entries({...this.data.envs}).map(([ key, val ]) => ({ key, val, })) this.envList = Object.entries({...this.data.envs}).map(([ key, val ]) => ({ key, val, }))
+9 -1
View File
@@ -67,7 +67,15 @@ export const state = {
// eslint-disable-next-line // eslint-disable-next-line
envs: {}, envs: {},
// eslint-disable-next-line // eslint-disable-next-line
mounts: [], mounts: [],
// eslint-disable-next-line
resources: {
// eslint-disable-next-line
nano_cpus: 0,
memory: 0,
// eslint-disable-next-line
shm_size: 2000000000,
},
} as RoomSettings, } as RoomSettings,
videoCodecs: [ videoCodecs: [
"VP8", "VP8",