adminforth 1.2.87 → 1.2.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/modules/restApi.js +9 -0
- package/dist/spa/.vscode/extensions.json +6 -0
- package/dist/spa/index.html +4 -4
- package/dist/spa/package-lock.json +6 -421
- package/dist/spa/package.json +2 -10
- package/dist/spa/public/favicon.ico +0 -0
- package/dist/spa/spa/.eslintrc.cjs +14 -0
- package/dist/spa/spa/.vscode/extensions.json +6 -0
- package/dist/spa/spa/README.md +39 -0
- package/dist/spa/spa/env.d.ts +1 -0
- package/dist/spa/spa/index.html +23 -0
- package/dist/spa/spa/package-lock.json +4573 -0
- package/dist/spa/spa/package.json +49 -0
- package/dist/spa/spa/postcss.config.js +6 -0
- package/dist/spa/spa/public/favicon.ico +0 -0
- package/dist/spa/spa/src/App.vue +314 -0
- package/dist/spa/spa/src/assets/base.css +0 -0
- package/dist/spa/spa/src/assets/logo.svg +19 -0
- package/dist/spa/spa/src/components/AcceptModal.vue +45 -0
- package/dist/spa/spa/src/components/Breadcrumbs.vue +40 -0
- package/dist/spa/spa/src/components/BreadcrumbsWithButtons.vue +26 -0
- package/dist/spa/spa/src/components/CustomDatePicker.vue +174 -0
- package/dist/spa/spa/src/components/CustomDateRangePicker.vue +218 -0
- package/dist/spa/spa/src/components/Dropdown.vue +168 -0
- package/dist/spa/spa/src/components/Filters.vue +222 -0
- package/dist/spa/spa/src/components/HelloWorld.vue +17 -0
- package/dist/spa/spa/src/components/MenuLink.vue +24 -0
- package/dist/spa/spa/src/components/ResourceForm.vue +289 -0
- package/dist/spa/{src → spa/src}/components/ResourceListTable.vue +3 -6
- package/dist/spa/spa/src/components/SingleSkeletLoader.vue +13 -0
- package/dist/spa/{src → spa/src}/components/Toast.vue +3 -9
- package/dist/spa/spa/src/components/ValueRenderer.vue +66 -0
- package/dist/spa/spa/src/components/icons/IconCalendar.vue +5 -0
- package/dist/spa/spa/src/components/icons/IconCommunity.vue +7 -0
- package/dist/spa/spa/src/components/icons/IconDocumentation.vue +7 -0
- package/dist/spa/spa/src/components/icons/IconEcosystem.vue +7 -0
- package/dist/spa/spa/src/components/icons/IconSupport.vue +7 -0
- package/dist/spa/spa/src/components/icons/IconTime.vue +5 -0
- package/dist/spa/spa/src/components/icons/IconTooling.vue +19 -0
- package/dist/spa/spa/src/index.scss +27 -0
- package/dist/spa/spa/src/main.ts +18 -0
- package/dist/spa/spa/src/router/index.ts +63 -0
- package/dist/spa/spa/src/stores/core.ts +144 -0
- package/dist/spa/spa/src/stores/modal.ts +48 -0
- package/dist/spa/spa/src/utils.ts +103 -0
- package/dist/spa/spa/src/views/CreateView.vue +156 -0
- package/dist/spa/spa/src/views/EditView.vue +157 -0
- package/dist/spa/spa/src/views/HomeView.vue +8 -0
- package/dist/spa/spa/src/views/ListView.vue +258 -0
- package/dist/spa/spa/src/views/LoginView.vue +143 -0
- package/dist/spa/spa/src/views/ResourceParent.vue +17 -0
- package/dist/spa/spa/src/views/ShowView.vue +184 -0
- package/dist/spa/spa/tailwind.config.js +17 -0
- package/dist/spa/spa/tsconfig.app.json +14 -0
- package/dist/spa/spa/tsconfig.json +11 -0
- package/dist/spa/spa/tsconfig.node.json +19 -0
- package/dist/spa/spa/vite.config.ts +56 -0
- package/dist/spa/src/App.vue +94 -236
- package/dist/spa/src/assets/base.css +0 -2
- package/dist/spa/src/assets/logo.svg +1 -19
- package/dist/spa/src/components/AcceptModal.vue +10 -3
- package/dist/spa/src/components/Breadcrumbs.vue +2 -3
- package/dist/spa/src/components/BreadcrumbsWithButtons.vue +1 -1
- package/dist/spa/src/components/CustomDatePicker.vue +10 -25
- package/dist/spa/src/components/CustomDateRangePicker.vue +5 -14
- package/dist/spa/src/components/Dropdown.vue +5 -19
- package/dist/spa/src/components/Filters.vue +38 -103
- package/dist/spa/src/components/MenuLink.vue +3 -3
- package/dist/spa/src/components/ResourceForm.vue +116 -205
- package/dist/spa/src/components/ValueRenderer.vue +8 -30
- package/dist/spa/src/index.scss +1 -2
- package/dist/spa/src/main.ts +2 -2
- package/dist/spa/src/router/index.ts +19 -29
- package/dist/spa/src/stores/core.ts +59 -65
- package/dist/spa/src/stores/modal.ts +3 -13
- package/dist/spa/src/utils.ts +10 -69
- package/dist/spa/src/views/CreateView.vue +16 -69
- package/dist/spa/src/views/EditView.vue +14 -68
- package/dist/spa/src/views/HomeView.vue +8 -0
- package/dist/spa/src/views/ListView.vue +371 -100
- package/dist/spa/src/views/LoginView.vue +29 -67
- package/dist/spa/src/views/ResourceParent.vue +2 -1
- package/dist/spa/src/views/ShowView.vue +25 -116
- package/dist/spa/tailwind.config.js +3 -8
- package/dist/spa/vite.config.ts +0 -13
- package/dist/types.js +30 -0
- package/modules/restApi.ts +14 -1
- package/package.json +1 -1
- package/spa/src/components/MenuLink.vue +3 -0
- package/types/AdminForthConfig.ts +6 -0
- package/dist/spa/src/types/AdminForthConfig.ts +0 -1477
- package/dist/spa/src/types/FrontendAPI.ts +0 -121
- /package/dist/spa/{public → spa/public}/assets/favicon.png +0 -0
- /package/dist/spa/{src → spa/src}/components/CustomRangePicker.vue +0 -0
- /package/dist/spa/{src → spa/src}/components/SkeleteLoader.vue +0 -0
- /package/dist/spa/{src → spa/src}/composables/useFrontendApi.ts +0 -0
- /package/dist/spa/{src → spa/src}/composables/useStores.ts +0 -0
- /package/dist/spa/{src → spa/src}/spa_types/core.ts +0 -0
- /package/dist/spa/{src → spa/src}/stores/filters.ts +0 -0
- /package/dist/spa/{src → spa/src}/stores/toast.ts +0 -0
- /package/dist/spa/{src → spa/src}/stores/user.ts +0 -0
package/dist/spa/src/App.vue
CHANGED
|
@@ -1,253 +1,159 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<div class="
|
|
8
|
-
<div class="flex items-center justify-
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
2
|
+
<nav
|
|
3
|
+
v-if="loggedIn"
|
|
4
|
+
|
|
5
|
+
class="fixed h-14 top-0 z-50 w-full bg-white border-b border-gray-200 dark:bg-gray-800 dark:border-gray-700">
|
|
6
|
+
<div class="px-3 py-3 lg:px-5 lg:pl-3">
|
|
7
|
+
<div class="flex items-center justify-between">
|
|
8
|
+
<div class="flex items-center justify-start rtl:justify-end">
|
|
9
|
+
<button data-drawer-target="logo-sidebar" data-drawer-toggle="logo-sidebar" aria-controls="logo-sidebar" type="button" class="inline-flex items-center p-2 text-sm text-gray-500 rounded-lg sm:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600">
|
|
10
|
+
<span class="sr-only">Open sidebar</span>
|
|
11
|
+
<svg class="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
12
|
+
<path clip-rule="evenodd" fill-rule="evenodd" d="M2 4.75A.75.75 0 012.75 4h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 4.75zm0 10.5a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5a.75.75 0 01-.75-.75zM2 10a.75.75 0 01.75-.75h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 10z"></path>
|
|
13
|
+
</svg>
|
|
14
|
+
</button>
|
|
15
|
+
<div class="flex ms-2 md:me-24">
|
|
16
|
+
<img src="https://flowbite.com/docs/images/logo.svg" class="h-8 me-3" alt="FlowBite Logo" />
|
|
17
|
+
<span class="self-center text-xl font-semibold sm:text-2xl whitespace-nowrap dark:text-white">
|
|
18
|
+
{{ coreStore.config?.brandName }}
|
|
19
|
+
</span>
|
|
18
20
|
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
</div>
|
|
22
|
+
<div class="flex items-center">
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
<div class="flex items-center ms-3">
|
|
21
26
|
<div>
|
|
22
|
-
<button type="button" class="flex text-sm bg- rounded-full focus:ring-4 focus:ring-
|
|
27
|
+
<button type="button" class="flex text-sm bg-gray-100 rounded-full focus:ring-4 focus:ring-gray-300 dark:focus:ring-gray-600 dark:bg-gray-700" aria-expanded="false" data-dropdown-toggle="dropdown-user">
|
|
23
28
|
<span class="sr-only">Open user menu</span>
|
|
24
|
-
<svg class="w-8 h-8 text-
|
|
29
|
+
<svg class="w-8 h-8 text-gray-400 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
|
|
25
30
|
<path fill-rule="evenodd" d="M12 20a7.966 7.966 0 0 1-5.002-1.756l.002.001v-.683c0-1.794 1.492-3.25 3.333-3.25h3.334c1.84 0 3.333 1.456 3.333 3.25v.683A7.966 7.966 0 0 1 12 20ZM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10c0 5.5-4.44 9.963-9.932 10h-.138C6.438 21.962 2 17.5 2 12Zm10-5c-1.84 0-3.333 1.455-3.333 3.25S10.159 13.5 12 13.5c1.84 0 3.333-1.455 3.333-3.25S13.841 7 12 7Z" clip-rule="evenodd"/>
|
|
26
31
|
</svg>
|
|
32
|
+
|
|
27
33
|
</button>
|
|
28
34
|
</div>
|
|
29
|
-
<div class="z-50 hidden my-4 text-base list-none bg-white divide-y divide-gray-100 rounded shadow dark:
|
|
35
|
+
<div class="z-50 hidden my-4 text-base list-none bg-white divide-y divide-gray-100 rounded shadow dark:bg-gray-700 dark:divide-gray-600 dark:shadow-xl" id="dropdown-user">
|
|
30
36
|
<div class="px-4 py-3" role="none">
|
|
31
|
-
<p class="text-sm text-gray-900 dark:text-
|
|
37
|
+
<p class="text-sm text-gray-900 dark:text-white" role="none" v-if="coreStore.userFullname">
|
|
32
38
|
{{ coreStore.userFullname }}
|
|
33
39
|
</p>
|
|
34
|
-
<p class="text-sm font-medium text-gray-900 truncate dark:text-
|
|
40
|
+
<p class="text-sm font-medium text-gray-900 truncate dark:text-gray-300" role="none">
|
|
35
41
|
{{ coreStore.username }}
|
|
36
42
|
</p>
|
|
37
43
|
</div>
|
|
38
44
|
<ul class="py-1" role="none">
|
|
39
45
|
<li>
|
|
40
|
-
<
|
|
46
|
+
<a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-600 dark:hover:text-white" role="menuitem">Dashboard</a>
|
|
47
|
+
</li>
|
|
48
|
+
<li >
|
|
49
|
+
<span @click="toggleTheme" class=" cursor-pointer flex items-center gap-1 block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-600 dark:hover:text-white" role="menuitem">
|
|
41
50
|
{{ theme === 'dark' ? 'Light' : 'Dark' }}
|
|
42
|
-
<IconMoonSolid class="w-5 h-5 text-blue-300
|
|
43
|
-
|
|
51
|
+
<IconMoonSolid class="w-5 h-5 text-blue-300
|
|
52
|
+
" v-if="theme !== 'dark'"/>
|
|
53
|
+
<IconSunSolid class="w-5 h-5 text-yellow-300
|
|
54
|
+
" v-else/>
|
|
44
55
|
mode
|
|
45
56
|
</span>
|
|
46
57
|
</li>
|
|
58
|
+
|
|
47
59
|
<li>
|
|
48
|
-
<button @click="logout" class="
|
|
49
|
-
|
|
60
|
+
<button @click="logout" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-600 dark:hover:text-white" role="menuitem">Sign out</button>
|
|
61
|
+
</li>
|
|
50
62
|
</ul>
|
|
51
63
|
</div>
|
|
52
64
|
</div>
|
|
53
65
|
</div>
|
|
54
|
-
</div>
|
|
55
66
|
</div>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<aside
|
|
61
|
-
|
|
62
|
-
v-if="loggedIn && routerIsReady && loginRedirectCheckIsReady"
|
|
63
|
-
|
|
64
|
-
id="logo-lightSidebar" class="fixed bg-lightSidebar border-none top-0 left-0 z-20 w-64 h-screen transition-transform bg-lightSidebar dark:bg-darkSidebar border-r border-lightSidebarBorder sm:translate-x-0 dark:bg-darkSidebar dark:border-darkSidebarBorder"
|
|
65
|
-
:class="{ '-translate-x-full': !sideBarOpen, 'transform-none': sideBarOpen }"
|
|
66
|
-
aria-label="Sidebar"
|
|
67
|
-
>
|
|
68
|
-
<div class="h-full px-3 pb-4 overflow-y-auto bg-lightSidebar dark:bg-darkSidebar border-r border-lightSidebarBorder dark:border-darkSidebarBorder">
|
|
69
|
-
<div class="flex ms-2 md:me-24 m-4 ">
|
|
70
|
-
<img :src="loadFile(coreStore.config?.brandLogo || '@/assets/logo.svg')" :alt="`${ coreStore.config?.brandName } Logo`" class="h-8 me-3" />
|
|
71
|
-
<span class="self-center text-lightNavbarText-size font-semibold sm:text-lightNavbarText-size whitespace-nowrap dark:text-darkSidebarText text-lightSidebarText">
|
|
72
|
-
{{ coreStore.config?.brandName }}
|
|
73
|
-
</span>
|
|
74
|
-
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</nav>
|
|
75
69
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
<div v-if="item.type === 'divider'" class="border-t border-lightSidebarDevider dark:border-darkSidebarDevider"></div>
|
|
79
|
-
<div v-else-if="item.type === 'gap'" class="flex items-center justify-center h-8"></div>
|
|
80
|
-
<div v-else-if="item.type === 'heading'" class="flex items-center justify-left pl-2 h-8 text-lightSidebarHeading dark:text-darkSidebarHeading
|
|
81
|
-
">{{ item.label }}</div>
|
|
82
|
-
<li v-else-if="item.children" class=" ">
|
|
83
|
-
<button @click="clickOnMenuItem(i)" type="button" class="flex items-center w-full p-2 text-base text-lightSidebarText rounded-default transition duration-75 group hover:bg-lightSidebarItemHover hover:text-lightSidebarTextHover dark:text-darkSidebarText dark:hover:bg-darkSidebarHover dark:hover:text-darkSidebarTextHover"
|
|
84
|
-
:aria-controls="`dropdown-example${i}`"
|
|
85
|
-
:data-collapse-toggle="`dropdown-example${i}`"
|
|
86
|
-
>
|
|
87
|
-
<component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-lightSidebarIcons group-hover:text-lightSidebarIconsHover transition duration-75 dark:group-hover:text-darkSidebarIconsHover dark:text-darkSidebarIcons" ></component>
|
|
70
|
+
<aside
|
|
71
|
+
v-if="loggedIn"
|
|
88
72
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
73
|
+
id="logo-sidebar" class="fixed top-0 left-0 z-10 w-64 h-screen pt-20 transition-transform -translate-x-full bg-white border-r border-gray-200 sm:translate-x-0 dark:bg-gray-800 dark:border-gray-700" aria-label="Sidebar">
|
|
74
|
+
<div class="h-full px-3 pb-4 overflow-y-auto bg-white dark:bg-gray-800">
|
|
75
|
+
<ul class="space-y-2 font-medium">
|
|
76
|
+
<template v-for="(item, i) in coreStore.menu" :key="`menu-${i}`">
|
|
77
|
+
<div v-if="item.type === 'divider'" class="border-t border-gray-200 dark:border-gray-700"></div>
|
|
78
|
+
<div v-else-if="item.type === 'gap'" class="flex items-center justify-center h-8"></div>
|
|
79
|
+
|
|
80
|
+
<li v-else-if="item.children">
|
|
81
|
+
<button type="button" class="flex items-center w-full p-2 text-base text-gray-900 transition duration-75 rounded-lg group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700"
|
|
82
|
+
:aria-controls="`dropdown-example${i}`"
|
|
83
|
+
:data-collapse-toggle="`dropdown-example${i}`"
|
|
84
|
+
>
|
|
85
|
+
<component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" ></component>
|
|
86
|
+
|
|
87
|
+
<span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap">{{ item.label }}</span>
|
|
88
|
+
<svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
|
|
89
|
+
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 4 4 4-4"/>
|
|
90
|
+
</svg>
|
|
91
|
+
</button>
|
|
94
92
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
93
|
+
<ul :id="`dropdown-example${i}`" role="none" class="py-2 space-y-2" :class="{ 'hidden': !item.open }">
|
|
94
|
+
<template v-for="(child, j) in item.children" :key="`menu-${i}-${j}`">
|
|
95
|
+
<li>
|
|
96
|
+
<MenuLink :item="child" isChild="true" />
|
|
97
|
+
</li>
|
|
98
|
+
</template>
|
|
99
|
+
</ul>
|
|
100
|
+
</li>
|
|
101
|
+
<li v-else>
|
|
102
|
+
<MenuLink :item="item" />
|
|
103
|
+
</li>
|
|
104
|
+
</template>
|
|
105
|
+
</ul>
|
|
106
|
+
</div>
|
|
107
|
+
</aside>
|
|
110
108
|
|
|
111
|
-
|
|
112
|
-
<div class="
|
|
113
|
-
<div class="p-0 dark:border-gray-700 mt-14">
|
|
109
|
+
<div class="p-4 sm:ml-64 dark:bg-gray-800" v-if="loggedIn">
|
|
110
|
+
<div class="p-0 dark:border-gray-700 mt-14">
|
|
114
111
|
<RouterView/>
|
|
115
|
-
</div>
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<div v-else-if="routerIsReady && loginRedirectCheckIsReady">
|
|
119
|
-
<RouterView/>
|
|
120
112
|
</div>
|
|
121
|
-
|
|
122
|
-
<div class="text-3xl text-gray-400 animate-bounce">
|
|
123
|
-
<svg aria-hidden="true" class="w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/><path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/></svg>
|
|
124
|
-
<span class="sr-only">Loading...</span>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
<AcceptModal />
|
|
128
|
-
<div v-if="toastStore.toasts.length>0" class="fixed bottom-5 right-5 flex gap-1 flex-col-reverse">
|
|
129
|
-
<transition-group
|
|
130
|
-
name="fade"
|
|
131
|
-
tag="div"
|
|
132
|
-
class="flex flex-col-reverse gap-1"
|
|
133
|
-
>
|
|
134
|
-
<Toast :toast="t" @close="toastStore.removeToast(t)" v-for="(t,i) in toastStore.toasts" :key="`t-${t.id}`" ></Toast>
|
|
135
|
-
</transition-group>
|
|
136
|
-
</div>
|
|
137
|
-
|
|
138
|
-
<div v-if="sideBarOpen"
|
|
139
|
-
@click="sideBarOpen = false"
|
|
140
|
-
|
|
141
|
-
drawer-backdrop="" class="bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-5"></div>
|
|
142
|
-
|
|
113
|
+
</div>
|
|
143
114
|
|
|
144
|
-
</div>
|
|
145
115
|
<div v-else>
|
|
146
|
-
<
|
|
147
|
-
<RouterView/>
|
|
148
|
-
</div>
|
|
149
|
-
<AcceptModal />
|
|
150
|
-
<div v-if="toastStore.toasts.length>0" class="fixed bottom-5 right-5 flex gap-1 flex-col-reverse">
|
|
151
|
-
<transition-group
|
|
152
|
-
name="fade"
|
|
153
|
-
tag="div"
|
|
154
|
-
class="flex flex-col-reverse gap-1"
|
|
155
|
-
>
|
|
156
|
-
<Toast :toast="t" @close="toastStore.removeToast(t)" v-for="(t,i) in toastStore.toasts" :key="`t-${t.id}`" ></Toast>
|
|
157
|
-
</transition-group>
|
|
158
|
-
</div>
|
|
116
|
+
<RouterView/>
|
|
159
117
|
</div>
|
|
118
|
+
<AcceptModal />
|
|
160
119
|
</template>
|
|
161
120
|
|
|
162
|
-
<style
|
|
163
|
-
|
|
164
|
-
.fade-leave-active {
|
|
165
|
-
@apply transition-opacity duration-500;
|
|
166
|
-
}
|
|
167
|
-
.fade-leave-to {
|
|
168
|
-
@apply opacity-0;
|
|
169
|
-
}
|
|
170
|
-
.fade-enter-active {
|
|
171
|
-
@apply transition-opacity duration-500;
|
|
172
|
-
}
|
|
173
|
-
.fade-enter-from {
|
|
174
|
-
@apply opacity-0;
|
|
175
|
-
}
|
|
176
|
-
.fade-enter-to {
|
|
177
|
-
@apply opacity-100;
|
|
178
|
-
}
|
|
179
|
-
|
|
121
|
+
<style scoped>
|
|
180
122
|
</style>
|
|
181
123
|
|
|
182
124
|
<script setup lang="ts">
|
|
183
|
-
import { computed, onMounted, ref, watch, defineComponent
|
|
125
|
+
import { computed, onMounted, ref, watch, defineComponent } from 'vue';
|
|
184
126
|
import { RouterLink, RouterView } from 'vue-router';
|
|
185
127
|
import { initFlowbite } from 'flowbite'
|
|
186
128
|
import './index.scss'
|
|
187
129
|
import { useCoreStore } from '@/stores/core';
|
|
188
|
-
import { useUserStore } from '@/stores/user';
|
|
189
|
-
import {useModalStore} from '@/stores/modal';
|
|
190
130
|
import { IconMoonSolid, IconSunSolid } from '@iconify-prerendered/vue-flowbite';
|
|
191
131
|
import AcceptModal from './components/AcceptModal.vue';
|
|
192
132
|
import MenuLink from './components/MenuLink.vue';
|
|
193
133
|
import { useRoute, useRouter } from 'vue-router';
|
|
194
134
|
import { getIcon } from '@/utils';
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
import { loadFile } from '@/utils';
|
|
198
|
-
import Toast from './components/Toast.vue';
|
|
199
|
-
import {useToastStore} from '@/stores/toast';
|
|
200
|
-
import { FrontendAPI } from '@/composables/useStores'
|
|
201
|
-
// import { link } from 'fs';
|
|
202
|
-
const coreStore = useCoreStore();
|
|
203
|
-
const modalStore = useModalStore();
|
|
204
|
-
const toastStore = useToastStore();
|
|
205
|
-
const userStore = useUserStore();
|
|
206
|
-
const frontendApi = new FrontendAPI();
|
|
207
|
-
frontendApi.init();
|
|
208
|
-
const splitAtLast = (str: string, separator: string) => {
|
|
209
|
-
const index = str.lastIndexOf(separator);
|
|
210
|
-
return [str.slice(0, index), str.slice(index + 1)];
|
|
211
|
-
}
|
|
212
|
-
createHead()
|
|
213
|
-
const sideBarOpen = ref(false);
|
|
214
|
-
const defaultLayout = ref(true);
|
|
135
|
+
|
|
136
|
+
|
|
215
137
|
const route = useRoute();
|
|
216
138
|
const router = useRouter();
|
|
217
|
-
const title = ref('');
|
|
218
|
-
//create a ref to store the opened menu items with ts type;
|
|
219
|
-
const opened = ref<string[]>([]);
|
|
220
|
-
|
|
221
139
|
|
|
222
140
|
const routerIsReady = ref(false);
|
|
223
|
-
const loginRedirectCheckIsReady = ref(false);
|
|
224
141
|
|
|
225
|
-
const loggedIn = computed(() => route.name !== 'login');
|
|
142
|
+
const loggedIn = computed(() => route.name !== 'login' && routerIsReady.value);
|
|
226
143
|
|
|
227
144
|
const theme = ref('light');
|
|
228
145
|
|
|
229
146
|
function toggleTheme() {
|
|
230
147
|
theme.value = theme.value === 'light' ? 'dark' : 'light';
|
|
231
148
|
document.documentElement.classList.toggle('dark');
|
|
232
|
-
window.localStorage.setItem('theme', theme.value);
|
|
233
|
-
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
function clickOnMenuItem (label: string) {
|
|
237
|
-
if (opened.value.includes(label)) {
|
|
238
|
-
opened.value = opened.value.filter((item) => item !== label);
|
|
239
|
-
} else {
|
|
240
|
-
opened.value.push(label);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
149
|
}
|
|
244
150
|
|
|
245
151
|
async function logout() {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
router.push({ name: 'login' })
|
|
152
|
+
await coreStore.logout();
|
|
153
|
+
router.push({ name: 'login' });
|
|
249
154
|
}
|
|
250
155
|
|
|
156
|
+
const coreStore = useCoreStore();
|
|
251
157
|
|
|
252
158
|
|
|
253
159
|
|
|
@@ -256,59 +162,11 @@ async function initRouter() {
|
|
|
256
162
|
routerIsReady.value = true;
|
|
257
163
|
}
|
|
258
164
|
|
|
259
|
-
async function loadMenu() {
|
|
260
|
-
await coreStore.fetchMenuAndResource();
|
|
261
|
-
loginRedirectCheckIsReady.value = true;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function handleCustomLayout() {
|
|
265
|
-
if (route.meta?.customLayout) {
|
|
266
|
-
defaultLayout.value = false;
|
|
267
|
-
} else {
|
|
268
|
-
defaultLayout.value = true;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
watch(route, () => {
|
|
275
|
-
handleCustomLayout()
|
|
276
|
-
title.value = `${coreStore.config?.title || coreStore.config?.brandName || 'Adminforth'} | ${ Object.values(route.params)[0] || route.meta.title || ' '}`;
|
|
277
|
-
useHead({
|
|
278
|
-
title: title.value,
|
|
279
|
-
})
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
watch (()=>coreStore.menu, () => {
|
|
285
|
-
coreStore.menu.forEach((item, i) => {
|
|
286
|
-
if (item.open) {
|
|
287
|
-
opened.value.push(i);
|
|
288
|
-
};
|
|
289
|
-
});
|
|
290
|
-
})
|
|
291
|
-
|
|
292
|
-
watch([loggedIn, routerIsReady, loginRedirectCheckIsReady], ([l,r,lr]) => {
|
|
293
|
-
if (l && r && lr) {
|
|
294
|
-
setTimeout(() => {
|
|
295
|
-
initFlowbite();
|
|
296
|
-
});
|
|
297
|
-
}
|
|
298
|
-
})
|
|
299
|
-
|
|
300
165
|
// initialize components based on data attribute selectors
|
|
301
166
|
onMounted(async () => {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
await
|
|
305
|
-
handleCustomLayout()
|
|
306
|
-
|
|
307
|
-
})
|
|
308
|
-
|
|
309
|
-
onBeforeMount(()=>{
|
|
310
|
-
theme.value = window.localStorage.getItem('theme') || 'light';
|
|
311
|
-
document.documentElement.classList.toggle('dark', theme.value === 'dark');
|
|
167
|
+
initRouter();
|
|
168
|
+
initFlowbite();
|
|
169
|
+
await coreStore.fetchMenuAndResource();
|
|
312
170
|
})
|
|
313
171
|
|
|
314
172
|
</script>
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
<svg
|
|
2
|
-
<g clip-path="url(#clip0_1_8)">
|
|
3
|
-
<path d="M8.034 6.006V13H6.097V12.194C5.59433 12.8007 4.86633 13.104 3.913 13.104C3.25433 13.104 2.65633 12.9567 2.119 12.662C1.59033 12.3673 1.17433 11.947 0.871 11.401C0.567667 10.855 0.416 10.2223 0.416 9.503C0.416 8.78367 0.567667 8.151 0.871 7.605C1.17433 7.059 1.59033 6.63867 2.119 6.344C2.65633 6.04933 3.25433 5.902 3.913 5.902C4.80567 5.902 5.50333 6.18367 6.006 6.747V6.006H8.034ZM4.264 11.44C4.77533 11.44 5.2 11.2667 5.538 10.92C5.876 10.5647 6.045 10.0923 6.045 9.503C6.045 8.91367 5.876 8.44567 5.538 8.099C5.2 7.74367 4.77533 7.566 4.264 7.566C3.744 7.566 3.315 7.74367 2.977 8.099C2.639 8.44567 2.47 8.91367 2.47 9.503C2.47 10.0923 2.639 10.5647 2.977 10.92C3.315 11.2667 3.744 11.44 4.264 11.44Z" fill="url(#paint0_linear_1_8)"/>
|
|
4
|
-
<path d="M13.317 5.538C12.589 5.538 12.0387 5.69833 11.666 6.019C11.2933 6.331 11.107 6.80333 11.107 7.436V7.995H14.851V9.685H11.107V13H9.001V7.449C9.001 6.279 9.365 5.369 10.093 4.719C10.8297 4.069 11.8567 3.744 13.174 3.744C13.694 3.744 14.1837 3.80033 14.643 3.913C15.1023 4.017 15.501 4.173 15.839 4.381L15.189 6.045C14.669 5.707 14.045 5.538 13.317 5.538Z" fill="url(#paint1_linear_1_8)"/>
|
|
5
|
-
</g>
|
|
6
|
-
<defs>
|
|
7
|
-
<linearGradient id="paint0_linear_1_8" x1="1.5" y1="6.93333" x2="7.31883" y2="11.8926" gradientUnits="userSpaceOnUse">
|
|
8
|
-
<stop stop-color="#656E7A"/>
|
|
9
|
-
<stop offset="1" stop-color="#99A6B8"/>
|
|
10
|
-
</linearGradient>
|
|
11
|
-
<linearGradient id="paint1_linear_1_8" x1="12.5" y1="3.73333" x2="9.68642" y2="12.7016" gradientUnits="userSpaceOnUse">
|
|
12
|
-
<stop stop-color="#48C5FF"/>
|
|
13
|
-
<stop offset="1" stop-color="#A1E1FF"/>
|
|
14
|
-
</linearGradient>
|
|
15
|
-
<clipPath id="clip0_1_8">
|
|
16
|
-
<rect width="16" height="16" fill="white"/>
|
|
17
|
-
</clipPath>
|
|
18
|
-
</defs>
|
|
19
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>
|
|
@@ -3,13 +3,20 @@ import { ref,onMounted } from 'vue'
|
|
|
3
3
|
import { useModalStore } from '@/stores/modal';
|
|
4
4
|
|
|
5
5
|
const modalStore = useModalStore();
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
6
13
|
</script>
|
|
7
14
|
|
|
8
15
|
<template>
|
|
9
16
|
<Teleport to="body">
|
|
10
17
|
<div v-if="modalStore.isOpened" class="bg-gray-900/50 dark:bg-gray-900/80 overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
|
11
18
|
<div class="relative p-4 w-full max-w-md max-h-full top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 " >
|
|
12
|
-
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700
|
|
19
|
+
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
|
|
13
20
|
<button type="button"@click="modalStore.togleModal" class="absolute top-3 end-2.5 text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white" >
|
|
14
21
|
<svg class="w-3 h-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
|
|
15
22
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
|
|
@@ -21,10 +28,10 @@ const modalStore = useModalStore();
|
|
|
21
28
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 11V6m0 8h.01M19 10a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"/>
|
|
22
29
|
</svg>
|
|
23
30
|
<h3 class="mb-5 text-lg font-normal text-gray-500 dark:text-gray-400">{{ modalStore?.modalContent?.content }}</h3>
|
|
24
|
-
<button @click="()=>{
|
|
31
|
+
<button @click="()=>{modalStore.onAcceptFunction();modalStore.togleModal()}" type="button" class="text-white bg-red-600 hover:bg-red-800 focus:ring-4 focus:outline-none focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg text-sm inline-flex items-center px-5 py-2.5 text-center">
|
|
25
32
|
{{ modalStore?.modalContent?.acceptText }}
|
|
26
33
|
</button>
|
|
27
|
-
<button @click="
|
|
34
|
+
<button @click="modalStore.togleModal" type="button" class="py-2.5 px-5 ms-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700">{{ modalStore?.modalContent?.cancelText }}</button>
|
|
28
35
|
</div>
|
|
29
36
|
</div>
|
|
30
37
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<nav class="flex" aria-label="Breadcrumb">
|
|
3
|
-
<ol class="inline-flex items-center space-x-1 md:space-x-2 rtl:space-x-reverse
|
|
3
|
+
<ol class="inline-flex items-center space-x-1 md:space-x-2 rtl:space-x-reverse">
|
|
4
4
|
<li class="inline-flex items-center">
|
|
5
5
|
<RouterLink :to="{name: 'home'}" class="inline-flex items-center text-sm font-medium text-gray-700 hover:text-blue-600 dark:text-gray-400 dark:hover:text-white">
|
|
6
6
|
<svg class="w-3 h-3 me-2.5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
<svg class="rtl:rotate-180 w-3 h-3 text-gray-400 mx-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10">
|
|
24
24
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 9 4-4-4-4"/>
|
|
25
25
|
</svg>
|
|
26
|
-
<span class="ms-1 text-sm font-medium text-gray-500 md:ms-2 dark:text-gray-400
|
|
27
|
-
max-w-80 truncate">
|
|
26
|
+
<span class="ms-1 text-sm font-medium text-gray-500 md:ms-2 dark:text-gray-400">
|
|
28
27
|
{{ $route.name === 'resource-edit' ? 'Edit' : 'Show' }} {{ coreStore.record?._label }}</span>
|
|
29
28
|
</div>
|
|
30
29
|
</li>
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
-
<div class="grid
|
|
3
|
+
<div class="mx-auto grid grid-cols-2 gap-4 mb-2">
|
|
4
4
|
<div>
|
|
5
5
|
<label for="start-time" class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">{{ label }}</label>
|
|
6
6
|
|
|
7
7
|
<div class="relative">
|
|
8
|
-
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5
|
|
8
|
+
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5">
|
|
9
9
|
<IconCalendar class="w-4 h-4 text-gray-500 dark:text-gray-400"/>
|
|
10
10
|
</div>
|
|
11
11
|
|
|
12
12
|
<input ref="datepickerStartEl" type="text"
|
|
13
13
|
class="bg-gray-50 border leading-none border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500"
|
|
14
|
-
placeholder="
|
|
14
|
+
placeholder="Start date">
|
|
15
15
|
</div>
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
19
|
<div>
|
|
20
|
-
<div class="grid
|
|
20
|
+
<div class="mx-auto grid grid-cols-2 gap-4 mb-2" :class="{hidden: !showTimeInputs}">
|
|
21
21
|
<div>
|
|
22
22
|
<div class="relative">
|
|
23
23
|
<div class="absolute inset-y-0 end-0 top-0 flex items-center pe-3.5 pointer-events-none">
|
|
@@ -67,9 +67,6 @@ const props = defineProps({
|
|
|
67
67
|
},
|
|
68
68
|
label: {
|
|
69
69
|
type: String,
|
|
70
|
-
},
|
|
71
|
-
autoHide: {
|
|
72
|
-
type: Boolean,
|
|
73
70
|
}
|
|
74
71
|
});
|
|
75
72
|
|
|
@@ -99,13 +96,12 @@ const start = computed(() => {
|
|
|
99
96
|
return date.utc().toISOString();
|
|
100
97
|
})
|
|
101
98
|
|
|
102
|
-
|
|
103
|
-
if (
|
|
99
|
+
function updateFromProps() {
|
|
100
|
+
if (props.valueStart === undefined) {
|
|
104
101
|
datepickerStartEl.value.value = '';
|
|
105
102
|
startTime.value = '';
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
await (new Promise(resolve => setTimeout(resolve, 0)));
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
109
105
|
datepickerObject.value.setDate(dayjs(props.valueStart).format('DD MMM YYYY'));
|
|
110
106
|
startTime.value = dayjs(props.valueStart).format('HH:mm:ss')
|
|
111
107
|
}
|
|
@@ -125,13 +121,7 @@ watch(start, () => {
|
|
|
125
121
|
})
|
|
126
122
|
|
|
127
123
|
function initDatepickers() {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if (props.autoHide) {
|
|
131
|
-
options.autohide = true;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
datepickerObject.value = new Datepicker(datepickerStartEl.value, options);
|
|
124
|
+
datepickerObject.value = new Datepicker(datepickerStartEl.value, { format: 'dd M yyyy' });
|
|
135
125
|
|
|
136
126
|
addChangeDateListener();
|
|
137
127
|
}
|
|
@@ -144,10 +134,6 @@ function removeChangeDateListener() {
|
|
|
144
134
|
datepickerStartEl.value.removeEventListener('changeDate', setStartDate);
|
|
145
135
|
}
|
|
146
136
|
|
|
147
|
-
function destroyDatepickerElement() {
|
|
148
|
-
datepickerObject.value.destroy();
|
|
149
|
-
}
|
|
150
|
-
|
|
151
137
|
function setStartDate(event) {
|
|
152
138
|
startDate.value = event.detail.date
|
|
153
139
|
}
|
|
@@ -171,6 +157,5 @@ onMounted(() => {
|
|
|
171
157
|
|
|
172
158
|
onBeforeUnmount(() => {
|
|
173
159
|
removeChangeDateListener();
|
|
174
|
-
|
|
175
|
-
});
|
|
160
|
+
})
|
|
176
161
|
</script>
|