BREAKING CHANGE(opsserver): Return structured configuration (IConfigData) from opsserver and update UI to render detailed config sections
This commit is contained in:
@@ -225,13 +225,17 @@ export class OpsViewApiTokens extends DeesElement {
|
||||
name: 'Create',
|
||||
iconName: 'lucide:key',
|
||||
action: async (modalArg: any) => {
|
||||
const form = modalArg.shadowRoot?.querySelector('.content')?.querySelector('dees-form');
|
||||
const contentEl = modalArg.shadowRoot?.querySelector('.content');
|
||||
const form = contentEl?.querySelector('dees-form');
|
||||
if (!form) return;
|
||||
const formData = await form.collectFormData();
|
||||
if (!formData.name) return;
|
||||
|
||||
// dees-input-tags returns string[] directly
|
||||
const scopes = (formData.scopes || [])
|
||||
// dees-input-tags is not in dees-form's FORM_INPUT_TYPES, so collectFormData() won't
|
||||
// include it. Query the tags input directly and call getValue().
|
||||
const tagsInput = form.querySelector('dees-input-tags') as any;
|
||||
const rawScopes: string[] = tagsInput?.getValue?.() || tagsInput?.value || formData.scopes || [];
|
||||
const scopes = rawScopes
|
||||
.filter((s: string) => allScopes.includes(s as any)) as TApiTokenScope[];
|
||||
|
||||
const expiresInDays = formData.expiresInDays
|
||||
|
||||
Reference in New Issue
Block a user