api refactor: force access control and handle subpaths

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-02-14 11:25:29 -05:00
parent 877c488fa8
commit dbf20d1388
19 changed files with 92 additions and 45 deletions
+7
View File
@@ -1,4 +1,6 @@
/* eslint-disable no-undef */
window.api = '/sdapi/v1';
window.subpath = '';
async function initStartup() {
log('initStartup');
@@ -23,6 +25,11 @@ async function initStartup() {
// make sure all of the ui is ready and options are loaded
while (Object.keys(window.opts).length === 0) await sleep(50);
log('mountURL', window.opts.subpath);
if (window.opts.subpath?.length > 0) {
window.subpath = window.opts.subpath;
window.api = `${window.subpath}/sdapi/v1`;
}
executeCallbacks(uiReadyCallbacks);
initLogMonitor();
setupExtraNetworks();