enhance: enable pwa install

This commit is contained in:
Julian Krauser 2025-01-11 14:45:48 +01:00
parent 260478af69
commit 3f3aa040d9
14 changed files with 48 additions and 10 deletions

View file

@ -2,7 +2,7 @@
<header class="flex flex-row h-16 min-h-16 justify-between p-3 md:px-5 bg-white shadow-sm">
<RouterLink to="/" class="flex flex-row gap-2 align-bottom w-fit h-full">
<img src="/Logo.png" alt="LOGO" class="h-full w-auto" />
<h1 v-if="false" class="font-bold text-3xl w-fit whitespace-nowrap">{{config.app_name_overwrite ?? "FF Admin"}}</h1>
<h1 v-if="false" class="font-bold text-3xl w-fit whitespace-nowrap">{{config.app_name_overwrite || "FF Admin"}}</h1>
</RouterLink>
<div class="flex flex-row gap-2 items-center">
<div v-if="authCheck" class="hidden md:flex flex-row gap-2 h-full align-middle">

View file

@ -24,7 +24,7 @@ export default defineComponent({
default: "LINK",
},
link: {
type: Object as PropType<string | { name: string }>,
type: Object as PropType<string | { name: string, params?:{[key:string]:string} }>,
default: "/",
},
active: {

View file

@ -9,6 +9,7 @@ import type { PermissionType, PermissionSection, PermissionModule } from "@/type
import { resetMemberStores, setMemberId } from "./memberGuard";
import { resetProtocolStores, setProtocolId } from "./protocolGuard";
import { resetNewsletterStores, setNewsletterId } from "./newsletterGuard";
import { config } from "../config";
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
@ -683,6 +684,10 @@ const router = createRouter({
],
});
router.afterEach((to, from) => {
document.title = config.app_name_overwrite || "FF Admin";
});
export default router;
declare module "vue-router" {

View file

@ -28,6 +28,15 @@ http.interceptors.request.use(
}
}
const isPWA =
window.matchMedia("(display-mode: standalone)").matches ||
window.matchMedia("(display-mode: fullscreen)").matches;
if (isPWA) {
if (config.headers) {
config.headers["X-PWA-Client"] = isPWA ? "true" : "false";
}
}
return config;
},
(error) => {

View file

@ -3,7 +3,7 @@
<div class="max-w-md w-full space-y-8 pb-20">
<div class="flex flex-col items-center gap-4">
<img src="/Logo.png" alt="LOGO" class="h-36" />
<h2 class="text-center text-4xl font-extrabold text-gray-900">{{config.app_name_overwrite ?? "FF Admin"}}</h2>
<h2 class="text-center text-4xl font-extrabold text-gray-900">{{config.app_name_overwrite || "FF Admin"}}</h2>
</div>
<form class="flex flex-col gap-2" @submit.prevent="login">

View file

@ -1,7 +1,7 @@
<template>
<SidebarLayout>
<template #sidebar>
<SidebarTemplate mainTitle="Mein Account" :topTitle="config.app_name_overwrite ?? 'FF Admin'" :showTopList="isOwner">
<SidebarTemplate mainTitle="Mein Account" :topTitle="config.app_name_overwrite || 'FF Admin'" :showTopList="isOwner">
<template v-if="isOwner" #topList>
<RoutingLink
title="Administration"