mirror of
https://github.com/hansjone/netxops.git
synced 2026-10-13 07:03:20 +08:00
Simplify settings copy and polish responsive form layout
This commit is contained in:
parent
0b9a3a82bc
commit
9271494b37
8 changed files with 590 additions and 690 deletions
|
|
@ -23,7 +23,15 @@ const scope = {
|
|||
async set(field: string, value: unknown) { user[field] = value; for (const fn of listeners) fn() },
|
||||
async unset(field: string) { delete user[field]; for (const fn of listeners) fn() },
|
||||
}
|
||||
const controller = new NetxopsCardController(scope, { get: () => undefined } as never)
|
||||
const previewCredentials = {
|
||||
async describe(refs: string[]) {
|
||||
return { ok: true, value: Object.fromEntries(refs.map(ref => [ref, { configured: true, writable: true }])) }
|
||||
},
|
||||
async set() { /* Preview only; no credentials are stored. */ },
|
||||
}
|
||||
const controller = new NetxopsCardController(scope, {
|
||||
get: key => key === 'remote.credentials' ? previewCredentials : undefined,
|
||||
} as never)
|
||||
controller.setAlarmPushRpc(async (_channel, endpoint) => {
|
||||
const value = scope.getSnapshot().value
|
||||
if (endpoint === 'presets.catalog') return { ok: true, value: { presets: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue