From 965a2b426fae8b0119ea7f65dd3d8398bf3fb7ff Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Tue, 24 Dec 2024 22:02:28 +0100 Subject: [PATCH] webadmin: when loading page with webserver routes, internal services would always be shown with "admin" as internal services, and saving the handler would overwrite the correct setting fix this by properly loading the correct internal service. for issue #264 reported by kiekerjan, thanks! --- webadmin/admin.js | 2 +- webadmin/admin.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webadmin/admin.js b/webadmin/admin.js index fb9e5a4..82d8556 100644 --- a/webadmin/admin.js +++ b/webadmin/admin.js @@ -3841,7 +3841,7 @@ const webserver = async () => { }; const root = dom.table(dom.tr(dom.td('Type'), dom.td('Base path', attr.title('Path to use as root of internal service, e.g. /webmail/.')), dom.td('Service')), dom.tr(dom.td(dom.select(attr.required(''), dom.option('Static'), dom.option('Redirect'), dom.option('Forward'), dom.option('Internal', attr.selected('')), function change(e) { makeType(e.target.value); - })), dom.td(basePath = dom.input(attr.value(wi.BasePath), attr.required(''), attr.placeholder('/.../'))), dom.td(service = dom.select(dom.option('Admin', attr.value('admin')), dom.option('Account', attr.value('account')), dom.option('Webmail', attr.value('webmail')), dom.option('Webapi', attr.value('webapi')), attr.value(wi.Service))))); + })), dom.td(basePath = dom.input(attr.value(wi.BasePath), attr.required(''), attr.placeholder('/.../'))), dom.td(service = dom.select(dom.option('Admin', attr.value('admin')), dom.option('Account', attr.value('account')), dom.option('Webmail', attr.value('webmail')), dom.option('Webapi', attr.value('webapi')), prop({ value: wi.Service }))))); view = { root: root, get: get }; return view; }; diff --git a/webadmin/admin.ts b/webadmin/admin.ts index b7133e5..52cd6d3 100644 --- a/webadmin/admin.ts +++ b/webadmin/admin.ts @@ -4847,7 +4847,7 @@ const webserver = async () => { dom.option('Account', attr.value('account')), dom.option('Webmail', attr.value('webmail')), dom.option('Webapi', attr.value('webapi')), - attr.value(wi.Service), + prop({value: wi.Service}), ), ), ),