mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-03 15:56:17 +00:00
Up
This commit is contained in:
@@ -1462,7 +1462,7 @@ DashboardPlugin: DashboardPlugins = DashboardPlugins(app, WireguardConfiguration
|
|||||||
|
|
||||||
InitWireguardConfigurationsList(startup=True)
|
InitWireguardConfigurationsList(startup=True)
|
||||||
|
|
||||||
|
app.static_url_path = f'{APP_PREFIX}/static'
|
||||||
with app.app_context():
|
with app.app_context():
|
||||||
DashboardClients: DashboardClients = DashboardClients(WireguardConfigurations)
|
DashboardClients: DashboardClients = DashboardClients(WireguardConfigurations)
|
||||||
app.register_blueprint(createClientBlueprint(WireguardConfigurations, DashboardConfig, DashboardClients))
|
app.register_blueprint(createClientBlueprint(WireguardConfigurations, DashboardConfig, DashboardClients))
|
||||||
|
@@ -10,31 +10,6 @@
|
|||||||
<link rel="icon" href="/img/Logo-2-512x512.png">
|
<link rel="icon" href="/img/Logo-2-512x512.png">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>WGDashboard</title>
|
<title>WGDashboard</title>
|
||||||
<script type="javascript">
|
|
||||||
// Runtime base path detection
|
|
||||||
function getBasePath() {
|
|
||||||
const path = window.location.pathname
|
|
||||||
const segments = path.split('/')
|
|
||||||
const staticIndex = segments.indexOf('static')
|
|
||||||
|
|
||||||
if (staticIndex > 0) {
|
|
||||||
return segments.slice(0, staticIndex + 1).join('/') + '/app/dist/'
|
|
||||||
}
|
|
||||||
return '/static/app/dist/'
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update document base if needed
|
|
||||||
const currentBase = document.querySelector('base')?.href || window.location.origin + '/'
|
|
||||||
const detectedBase = window.location.origin + getBasePath()
|
|
||||||
console.log(detectedBase)
|
|
||||||
if (currentBase !== detectedBase) {
|
|
||||||
const baseTag = document.querySelector('base') || document.createElement('base')
|
|
||||||
baseTag.href = detectedBase
|
|
||||||
if (!document.querySelector('base')) {
|
|
||||||
document.head.appendChild(baseTag)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
@@ -32,10 +32,7 @@ export default defineConfig(({mode}) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
base: "/",
|
base: "/static/app/dist",
|
||||||
define: {
|
|
||||||
__RUNTIME_BASE_DETECTION__: true
|
|
||||||
},
|
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
],
|
],
|
||||||
|
Reference in New Issue
Block a user