@edgedev/create-edge-app 1.0.64 → 1.1.2
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/{pages → layouts}/app.vue +18 -11
- package/package.json +1 -1
- package/pages/app/account.vue +29 -26
- package/pages/app/dashboard/[[collection]]/[[docId]].vue +90 -87
- package/pages/app/login.vue +11 -9
- package/pages/app/signup.vue +11 -9
|
@@ -69,12 +69,6 @@ watch (user, async () => {
|
|
|
69
69
|
const colorMode = useColorMode()
|
|
70
70
|
onMounted(() => {
|
|
71
71
|
colorMode.preference = 'system'
|
|
72
|
-
// if (edgeGlobal.isDarkMode()) {
|
|
73
|
-
// changeTheme('dark')
|
|
74
|
-
// }
|
|
75
|
-
// else {
|
|
76
|
-
// changeTheme('light')
|
|
77
|
-
// }
|
|
78
72
|
})
|
|
79
73
|
edgeFirebase.runFunction('edgeFirebase-initFirestore', {})
|
|
80
74
|
edgeGlobal.edgeState.userRoles = [
|
|
@@ -113,14 +107,24 @@ const menuItems = [
|
|
|
113
107
|
</script>
|
|
114
108
|
|
|
115
109
|
<template>
|
|
110
|
+
<Head>
|
|
111
|
+
<title>Edge App</title>
|
|
112
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover">
|
|
113
|
+
</Head>
|
|
116
114
|
<Toaster />
|
|
117
115
|
<div class="flex flex-col h-screen">
|
|
118
116
|
<div class="flex h-full w-full">
|
|
119
|
-
<
|
|
117
|
+
<edge-sidebar-provider
|
|
118
|
+
v-slot="sideBarProviderProps"
|
|
119
|
+
enable-nested-menu
|
|
120
|
+
collapsible="slack"
|
|
121
|
+
>
|
|
120
122
|
<div class="h-full">
|
|
121
|
-
<edge-side-
|
|
123
|
+
<edge-side-bar
|
|
122
124
|
v-if="edgeFirebase.user.loggedIn"
|
|
123
125
|
:menu-items="menuItems"
|
|
126
|
+
:collapsible="sideBarProviderProps.collapsible"
|
|
127
|
+
class="border-solid border-r"
|
|
124
128
|
>
|
|
125
129
|
<template #header>
|
|
126
130
|
<SidebarMenu>
|
|
@@ -147,7 +151,10 @@ const menuItems = [
|
|
|
147
151
|
</CardContent>
|
|
148
152
|
</Card>
|
|
149
153
|
</template>
|
|
150
|
-
|
|
154
|
+
<template #nested-menu>
|
|
155
|
+
<slot name="nested-menu" />
|
|
156
|
+
</template>
|
|
157
|
+
</edge-side-bar>
|
|
151
158
|
</div>
|
|
152
159
|
<div class="grow h-full flex flex-col h-screen">
|
|
153
160
|
<edge-menu
|
|
@@ -164,7 +171,7 @@ const menuItems = [
|
|
|
164
171
|
</h1>
|
|
165
172
|
</template>
|
|
166
173
|
</edge-menu>
|
|
167
|
-
<
|
|
174
|
+
<slot />
|
|
168
175
|
<edge-menu
|
|
169
176
|
v-if="edgeFirebase.user.loggedIn"
|
|
170
177
|
type="footer"
|
|
@@ -178,7 +185,7 @@ const menuItems = [
|
|
|
178
185
|
</template>
|
|
179
186
|
</edge-menu>
|
|
180
187
|
</div>
|
|
181
|
-
</
|
|
188
|
+
</edge-sidebar-provider>
|
|
182
189
|
</div>
|
|
183
190
|
</div>
|
|
184
191
|
</template>
|
package/package.json
CHANGED
package/pages/app/account.vue
CHANGED
|
@@ -40,33 +40,36 @@ const menuItems = [
|
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
42
|
<template>
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
43
|
+
<NuxtLayout name="app">
|
|
44
|
+
<div
|
|
45
|
+
v-if="edgeGlobal.edgeState.organizationDocPath"
|
|
46
|
+
class="flex-1 flex flex-col overflow-y-auto p-3 pt-0"
|
|
47
|
+
>
|
|
48
|
+
<div class="h-full p-0">
|
|
49
|
+
<SidebarProvider class="min-h-full">
|
|
50
|
+
<div class="h-full md:w-[180px]">
|
|
51
|
+
<edge-side-bar
|
|
52
|
+
:menu-items="menuItems"
|
|
53
|
+
:settings-menu-items="isAdmin ? adminMenuItems : []"
|
|
54
|
+
collapsible="submenu"
|
|
55
|
+
class="bg-background text-foreground border-none w-[180px] absolute shadow-none"
|
|
56
|
+
:show-settings-section="false"
|
|
57
|
+
title="My Settings"
|
|
58
|
+
settings-title="Organization Settings"
|
|
59
|
+
group-label-classes="text-foreground/70"
|
|
60
|
+
>
|
|
61
|
+
<template #header>
|
|
62
|
+
<h1 class="text-xl">
|
|
63
|
+
Settings
|
|
64
|
+
</h1>
|
|
65
|
+
</template>
|
|
66
|
+
</edge-side-bar>
|
|
67
|
+
</div>
|
|
68
|
+
<NuxtPage class="flex-1 flex flex-col overflow-y-auto p-3" />
|
|
69
|
+
</SidebarProvider>
|
|
70
|
+
</div>
|
|
68
71
|
</div>
|
|
69
|
-
</
|
|
72
|
+
</NuxtLayout>
|
|
70
73
|
</template>
|
|
71
74
|
|
|
72
75
|
<style lang="scss">
|
|
@@ -71,90 +71,69 @@ onMounted(() => {
|
|
|
71
71
|
</script>
|
|
72
72
|
|
|
73
73
|
<template>
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
<template #header-end="slotProps">
|
|
93
|
-
<edge-shad-button class="uppercase bg-slate-600" :to="`/app/dashboard/${collection}/new`">
|
|
94
|
-
Add {{ slotProps.title }}
|
|
95
|
-
</edge-shad-button>
|
|
96
|
-
</template>
|
|
97
|
-
<template #list-item="slotProps">
|
|
98
|
-
<edge-shad-button variant="text" class="cursor-pointer w-full flex justify-between slotProps.items-center py-2 gap-3" :to="`/app/dashboard/${collection}/${slotProps.item.docId}`">
|
|
99
|
-
<div>
|
|
100
|
-
<Avatar class="cursor-pointer p-0 h-8 w-8 mr-2">
|
|
101
|
-
<FilePenLine class="h-5 w-5" />
|
|
102
|
-
</Avatar>
|
|
74
|
+
<NuxtLayout name="app">
|
|
75
|
+
<div
|
|
76
|
+
v-if="edgeGlobal.edgeState.organizationDocPath"
|
|
77
|
+
class="flex-1 flex flex-col overflow-y-auto p-3 pt-0"
|
|
78
|
+
>
|
|
79
|
+
<edge-dashboard v-if="docId === ''" :filter="state.filter" :collection="collection" class="flex-1">
|
|
80
|
+
<template #header-start>
|
|
81
|
+
<LayoutDashboard class="mr-2" />
|
|
82
|
+
<span class="capitalize">{{ collection }}</span>
|
|
83
|
+
</template>
|
|
84
|
+
<template #header-center>
|
|
85
|
+
<div class="w-full px-6">
|
|
86
|
+
<edge-shad-input
|
|
87
|
+
v-model="state.filter"
|
|
88
|
+
label=""
|
|
89
|
+
name="filter"
|
|
90
|
+
placeholder="Filter..."
|
|
91
|
+
/>
|
|
103
92
|
</div>
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
93
|
+
</template>
|
|
94
|
+
<template #header-end="slotProps">
|
|
95
|
+
<edge-shad-button class="uppercase bg-slate-600" :to="`/app/dashboard/${collection}/new`">
|
|
96
|
+
Add {{ slotProps.title }}
|
|
97
|
+
</edge-shad-button>
|
|
98
|
+
</template>
|
|
99
|
+
<template #list-item="slotProps">
|
|
100
|
+
<edge-shad-button variant="text" class="cursor-pointer w-full flex justify-between slotProps.items-center py-2 gap-3" :to="`/app/dashboard/${collection}/${slotProps.item.docId}`">
|
|
101
|
+
<div>
|
|
102
|
+
<Avatar class="cursor-pointer p-0 h-8 w-8 mr-2">
|
|
103
|
+
<FilePenLine class="h-5 w-5" />
|
|
104
|
+
</Avatar>
|
|
107
105
|
</div>
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
>
|
|
140
|
-
Close
|
|
141
|
-
</edge-shad-button>
|
|
142
|
-
<edge-shad-button
|
|
143
|
-
v-else
|
|
144
|
-
:to="`/app/dashboard/${collection}`"
|
|
145
|
-
class="bg-red-700 uppercase h-8 hover:bg-slate-400 w-20"
|
|
146
|
-
>
|
|
147
|
-
Cancel
|
|
148
|
-
</edge-shad-button>
|
|
149
|
-
<edge-shad-button
|
|
150
|
-
type="submit"
|
|
151
|
-
class="bg-slate-500 uppercase h-8 hover:bg-slate-400 w-20"
|
|
152
|
-
>
|
|
153
|
-
Save
|
|
154
|
-
</edge-shad-button>
|
|
155
|
-
</template>
|
|
156
|
-
<template #footer="slotProps">
|
|
157
|
-
<div class="flex w-full gap-1 items-center justify-end">
|
|
106
|
+
<div class="grow text-left">
|
|
107
|
+
<div class="text-lg">
|
|
108
|
+
{{ slotProps.item.name }}
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
<div>
|
|
112
|
+
<edge-shad-button
|
|
113
|
+
size="icon"
|
|
114
|
+
class="bg-slate-600 h-7 w-7"
|
|
115
|
+
@click.stop="slotProps.deleteItem(slotProps.item.docId)"
|
|
116
|
+
>
|
|
117
|
+
<Trash class="h-5 w-5" />
|
|
118
|
+
</edge-shad-button>
|
|
119
|
+
</div>
|
|
120
|
+
</edge-shad-button>
|
|
121
|
+
<Separator class="dark:bg-slate-600" />
|
|
122
|
+
</template>
|
|
123
|
+
</edge-dashboard>
|
|
124
|
+
<edge-editor
|
|
125
|
+
v-else
|
|
126
|
+
:collection="collection"
|
|
127
|
+
:doc-id="docId"
|
|
128
|
+
:schema="schemas[collection]"
|
|
129
|
+
:new-doc-schema="state.newDocs[collection]"
|
|
130
|
+
class="w-full max-w-7xl mx-auto flex-1"
|
|
131
|
+
>
|
|
132
|
+
<template #header-start="slotProps">
|
|
133
|
+
<FilePenLine class="mr-2" />
|
|
134
|
+
{{ slotProps.title }}
|
|
135
|
+
</template>
|
|
136
|
+
<template #header-end="slotProps">
|
|
158
137
|
<edge-shad-button
|
|
159
138
|
v-if="!slotProps.unsavedChanges"
|
|
160
139
|
:to="`/app/dashboard/${collection}`"
|
|
@@ -169,15 +148,39 @@ onMounted(() => {
|
|
|
169
148
|
>
|
|
170
149
|
Cancel
|
|
171
150
|
</edge-shad-button>
|
|
172
|
-
|
|
173
151
|
<edge-shad-button
|
|
174
152
|
type="submit"
|
|
175
153
|
class="bg-slate-500 uppercase h-8 hover:bg-slate-400 w-20"
|
|
176
154
|
>
|
|
177
155
|
Save
|
|
178
156
|
</edge-shad-button>
|
|
179
|
-
</
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
157
|
+
</template>
|
|
158
|
+
<template #footer="slotProps">
|
|
159
|
+
<div class="flex w-full gap-1 items-center justify-end">
|
|
160
|
+
<edge-shad-button
|
|
161
|
+
v-if="!slotProps.unsavedChanges"
|
|
162
|
+
:to="`/app/dashboard/${collection}`"
|
|
163
|
+
class="bg-red-700 uppercase h-8 hover:bg-slate-400 w-20"
|
|
164
|
+
>
|
|
165
|
+
Close
|
|
166
|
+
</edge-shad-button>
|
|
167
|
+
<edge-shad-button
|
|
168
|
+
v-else
|
|
169
|
+
:to="`/app/dashboard/${collection}`"
|
|
170
|
+
class="bg-red-700 uppercase h-8 hover:bg-slate-400 w-20"
|
|
171
|
+
>
|
|
172
|
+
Cancel
|
|
173
|
+
</edge-shad-button>
|
|
174
|
+
|
|
175
|
+
<edge-shad-button
|
|
176
|
+
type="submit"
|
|
177
|
+
class="bg-slate-500 uppercase h-8 hover:bg-slate-400 w-20"
|
|
178
|
+
>
|
|
179
|
+
Save
|
|
180
|
+
</edge-shad-button>
|
|
181
|
+
</div>
|
|
182
|
+
</template>
|
|
183
|
+
</edge-editor>
|
|
184
|
+
</div>
|
|
185
|
+
</NuxtLayout>
|
|
183
186
|
</template>
|
package/pages/app/login.vue
CHANGED
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
4
|
<template>
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
<NuxtLayout name="app">
|
|
6
|
+
<div class="flex w-full h-full align-center items-center">
|
|
7
|
+
<edge-auth type="login" class="p-8 mx-auto max-w-lg w-full h-full max-h-[540px] overflow-y-auto">
|
|
8
|
+
<div class="grid gap-2 text-center">
|
|
9
|
+
<h1 class="text-2xl font-bold">
|
|
10
|
+
Login
|
|
11
|
+
</h1>
|
|
12
|
+
</div>
|
|
13
|
+
</edge-auth>
|
|
14
|
+
</div>
|
|
15
|
+
</NuxtLayout>
|
|
14
16
|
</template>
|
|
15
17
|
|
|
16
18
|
<style lang="scss" scoped>
|
package/pages/app/signup.vue
CHANGED
|
@@ -3,15 +3,17 @@ const config = useRuntimeConfig()
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<template>
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
<NuxtLayout name="app">
|
|
7
|
+
<div class="flex w-full h-full align-center items-center">
|
|
8
|
+
<edge-auth type="register" :registration-code="config.public.registrationCode" class="p-8 mx-auto max-w-lg w-full h-full max-h-[760px] overflow-y-auto">
|
|
9
|
+
<div class="grid gap-2 text-center">
|
|
10
|
+
<h1 class="text-2xl font-bold">
|
|
11
|
+
Sign Up
|
|
12
|
+
</h1>
|
|
13
|
+
</div>
|
|
14
|
+
</edge-auth>
|
|
15
|
+
</div>
|
|
16
|
+
</NuxtLayout>
|
|
15
17
|
</template>
|
|
16
18
|
|
|
17
19
|
<style lang="scss" scoped>
|