From 1bf44dd917aa9e7fd4778dd5f9763e939b87ac31 Mon Sep 17 00:00:00 2001 From: Dominik9906 Date: Wed, 26 Aug 2026 23:41:00 +0200 Subject: [PATCH] ENH - configure radio job permissions --- .../src/components/AdminConfigValueEditor.vue | 32 ++++++- frontend/src/components/AdminPanel.vue | 2 + .../src/radioConfigurator.contract.test.ts | 85 +++++++++++++++++++ frontend/src/stores/phone.ts | 2 + .../utils/adminConfiguratorDefaults.test.ts | 32 +++++++ sky_phone/config/config.lua | 3 +- sky_phone/config/locales/de.lua | 2 + sky_phone/config/locales/en.lua | 2 + sky_phone/config/locales/es.lua | 2 + .../source/server/phone_configurator.lua | 32 ++++++- sky_phone/source/server/radio.lua | 6 ++ sky_phone/source/shared/config_default.lua | 3 +- 12 files changed, 196 insertions(+), 7 deletions(-) create mode 100644 frontend/src/radioConfigurator.contract.test.ts diff --git a/frontend/src/components/AdminConfigValueEditor.vue b/frontend/src/components/AdminConfigValueEditor.vue index 5af001a..4a6d6f4 100644 --- a/frontend/src/components/AdminConfigValueEditor.vue +++ b/frontend/src/components/AdminConfigValueEditor.vue @@ -18,6 +18,7 @@ import type { AdminConfiguratorDescribe } from '@/utils/adminConfiguratorDescrip export type AdminConfigEditorLabels = { addField: string + addJob: string addRow: string configuredSecret: string convertToList: string @@ -27,6 +28,7 @@ export type AdminConfigEditorLabels = { emptyTable: string entry: string general: string + jobPlaceholder: string keyPlaceholder: string list: string remove: string @@ -149,6 +151,11 @@ const canExtendTable = computed( !vectorType.value && (!tableStructure.value || tableStructure.value.mutableKeys === true), ) +const isJobTable = computed( + () => + props.path === 'Radio.DisplayName.AllowedJobs' || + /^Radio\.LockedChannels\[\d+\]\.jobs$/.test(props.path), +) const usesFixedTableLayout = computed( () => Boolean(tableStructure.value) && tableStructure.value?.mutableKeys !== true, @@ -371,6 +378,19 @@ function updateOptionalString(event: Event): void { } } +function updateNewObjectKey(event: Event): void { + const target = event.target + if (!(target instanceof HTMLInputElement)) return + const value = isJobTable.value + ? target.value + .toLowerCase() + .replace(/[^a-z0-9_-]/g, '') + .slice(0, 64) + : target.value + newObjectKey.value = value + target.value = value +} + function toggleOptionalString(event: Event): void { const target = event.target if (!(target instanceof HTMLInputElement)) return @@ -1015,11 +1035,15 @@ function mapEntryStructure( @submit.prevent="addTableField" >