feat: add clean public routes for alpine ui

This commit is contained in:
a.tolmachev
2026-03-31 22:07:12 +03:00
parent 9cee29d110
commit f5a658b4f0
17 changed files with 198 additions and 115 deletions
+13 -18
View File
@@ -1,20 +1,15 @@
/**
* config.js — auto-detects base paths based on current page location.
* Must be loaded before workspace.js and other navigation-using scripts.
*/
(function() {
var p = window.location.pathname;
// html/wizard/ is two levels deep from root
if (/\/html\/wizard\//.test(p)) {
window.APP_BASE = '../../';
window.DATA_URL = '../../data/';
// html/*.html is one level deep from root
} else if (/\/html\//.test(p)) {
window.APP_BASE = '../';
window.DATA_URL = '../data/';
// root level (index.html)
} else {
window.APP_BASE = '';
window.DATA_URL = 'data/';
}
window.APP_BASE = '/';
window.DATA_URL = '/data/';
window.CrankRoutes = {
home: '/',
login: '/login',
agents: '/agents',
apiKeys: '/api-keys',
logs: '/logs',
usage: '/usage',
settings: '/settings',
workspaceSetup: '/workspace-setup',
wizard: '/wizard/'
};
}());