Add option to serve a static frontend
This commit is contained in:
parent
b3804f3d58
commit
f6117d04ee
9 changed files with 64 additions and 33 deletions
|
@ -55,7 +55,7 @@ function createTokenRefreshInterceptor() {
|
|||
// Retry failed, clean up and reject the promise
|
||||
clearLoginState();
|
||||
axios.defaults.headers.common['Authorization'] = "";
|
||||
goto('/login?reauth')
|
||||
goto('#/login?reauth')
|
||||
return Promise.reject(retryError);
|
||||
})
|
||||
.finally(createTokenRefreshInterceptor); // Re-attach interceptor for future requests
|
||||
|
@ -101,7 +101,7 @@ export const logout = function() {
|
|||
.then(() => {
|
||||
clearLoginState();
|
||||
axios.defaults.headers.common['Authorization'] = "";
|
||||
goto('/login?logout')
|
||||
goto('#/login?logout')
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<a href="/chargepoint/{transaction.chargepoint.id}" class="btn btn-sm btn-primary">
|
||||
<a href="#/chargepoint/{transaction.chargepoint.id}" class="btn btn-sm btn-primary">
|
||||
<i class="bi bi-plug-fill text-lg"></i>
|
||||
{transaction.chargepoint.identity}
|
||||
</a>
|
||||
|
@ -71,7 +71,7 @@
|
|||
>{((transaction.meter_end - transaction.meter_start) * transaction.price).toFixed(2)} €</td
|
||||
>
|
||||
<th>
|
||||
<a href="/transaction/{transaction.id}" class="btn btn-sm btn-primary">
|
||||
<a href="#/transaction/{transaction.id}" class="btn btn-sm btn-primary">
|
||||
{$i18n.t('common:transactionTable.detailButton')}
|
||||
<i class="bi bi-arrow-right"></i>
|
||||
</a>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
let { children } = $props()
|
||||
|
||||
if (!$persistentSettings.loggedIn) {
|
||||
goto('/login')
|
||||
goto('#/login')
|
||||
}
|
||||
|
||||
let drawerOpen = $state(false)
|
||||
|
@ -44,7 +44,7 @@
|
|||
onclick={() => {
|
||||
drawerOpen = !drawerOpen
|
||||
}}
|
||||
href="/idtoken"
|
||||
href="#/idtoken"
|
||||
>
|
||||
<i class="bi bi-credit-card-fill text-xl"></i>
|
||||
<span>{$i18n.t('common:navbar.link.idtoken')}</span>
|
||||
|
@ -55,7 +55,7 @@
|
|||
onclick={() => {
|
||||
drawerOpen = !drawerOpen
|
||||
}}
|
||||
href="/transaction"
|
||||
href="#/transaction"
|
||||
>
|
||||
<i class="bi bi-battery-charging text-xl"></i>
|
||||
<span>{$i18n.t('common:navbar.link.transaction')}</span>
|
||||
|
@ -66,7 +66,7 @@
|
|||
onclick={() => {
|
||||
drawerOpen = !drawerOpen
|
||||
}}
|
||||
href="/chargepoint"
|
||||
href="#/chargepoint"
|
||||
>
|
||||
<i class="bi bi-plug-fill text-xl"></i>
|
||||
<span>{$i18n.t('common:navbar.link.chargepoint')}</span>
|
||||
|
@ -87,7 +87,7 @@
|
|||
tabindex="-1"
|
||||
class="menu menu-sm dropdown-content bg-base-100 rounded-box z-1 mt-3 w-52 p-2 shadow"
|
||||
>
|
||||
<li><a href="/profile">{$i18n.t('common:navbar.link.profile')}</a></li>
|
||||
<li><a href="#/profile">{$i18n.t('common:navbar.link.profile')}</a></li>
|
||||
<li><button onclick={logout}>{$i18n.t('common:navbar.link.logout')}</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
</td>
|
||||
<td>{chargepoint.price} €</td>
|
||||
<th>
|
||||
<a href="/chargepoint/{chargepoint.id}" class="btn btn-sm btn-primary">
|
||||
<a href="#/chargepoint/{chargepoint.id}" class="btn btn-sm btn-primary">
|
||||
{$i18n.t('common:transactionTable.detailButton')}
|
||||
<i class="bi bi-arrow-right"></i>
|
||||
</a>
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
export const ssr = false
|
|
@ -11,6 +11,7 @@ const config = {
|
|||
adapter: adapter({
|
||||
fallback: 'index.html',
|
||||
}),
|
||||
router: { type: 'hash' },
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue