@7365admin1/layer-common 3.0.8 → 3.0.9
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/CHANGELOG.md +6 -0
- package/components/DashboardMain.vue +1894 -844
- package/components/EntryPassInformation.vue +60 -0
- package/components/HidAccessLogDashboard.vue +1691 -0
- package/components/HidEnabledGate.vue +51 -0
- package/components/HidIdentityMapping.vue +975 -0
- package/components/HidQrCodeConfiguration.vue +618 -0
- package/components/HidReaderForm.vue +246 -0
- package/components/HidReaderManagement.vue +1233 -0
- package/components/HidServiceSettingsPanel.vue +150 -0
- package/components/HidUserEnrollment.vue +1274 -0
- package/components/Layout/NavigationDrawer.vue +31 -1
- package/components/NavigationItem.vue +11 -4
- package/components/SiteSettings.vue +24 -1
- package/components/VisitorForm.vue +195 -4
- package/components/VisitorFormSelection.vue +12 -2
- package/composables/useDashboard.ts +29 -2
- package/composables/useHidAmico.ts +152 -0
- package/composables/useHidNavigation.ts +106 -0
- package/composables/useMember.ts +7 -1
- package/composables/useOptionalServices.ts +118 -0
- package/composables/useSiteSettings.ts +1 -1
- package/composables/useUser.ts +1 -2
- package/nuxt.config.ts +1 -1
- package/package.json +2 -1
- package/pages/[org]/[site]/access-mgmt/access-logs/index.vue +21 -0
- package/pages/[org]/[site]/access-mgmt/administrator/index.vue +21 -0
- package/pages/[org]/[site]/access-mgmt/hid-readers/index.vue +21 -0
- package/pages/[org]/[site]/access-mgmt/hid-users/index.vue +21 -0
- package/pages/[org]/[site]/access-mgmt/identity-mapping/index.vue +21 -0
- package/types/local.d.ts +2 -1
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-dialog v-model="dialogModel" max-width="430" persistent>
|
|
3
|
+
<v-card class="hid-reader-form" rounded="lg">
|
|
4
|
+
<v-card-title class="form-title">
|
|
5
|
+
{{ mode === "edit" ? "Edit Reader" : "Add Reader" }}
|
|
6
|
+
</v-card-title>
|
|
7
|
+
|
|
8
|
+
<v-card-text class="form-body">
|
|
9
|
+
<div class="field-label">HID Reader Name <span>*</span></div>
|
|
10
|
+
<v-text-field
|
|
11
|
+
v-model="draft.name"
|
|
12
|
+
aria-label="HID Reader Name"
|
|
13
|
+
placeholder="HID reader name"
|
|
14
|
+
variant="outlined"
|
|
15
|
+
density="compact"
|
|
16
|
+
hide-details="auto"
|
|
17
|
+
class="mb-3"
|
|
18
|
+
/>
|
|
19
|
+
|
|
20
|
+
<div class="field-label">Base URL / IP address <span>*</span></div>
|
|
21
|
+
<v-text-field
|
|
22
|
+
v-model="draft.baseUrl"
|
|
23
|
+
aria-label="Base URL / IP address"
|
|
24
|
+
placeholder="http://192.168.0.129"
|
|
25
|
+
variant="outlined"
|
|
26
|
+
density="compact"
|
|
27
|
+
hide-details="auto"
|
|
28
|
+
class="mb-3"
|
|
29
|
+
/>
|
|
30
|
+
|
|
31
|
+
<div class="field-label">Device ID <span>*</span></div>
|
|
32
|
+
<v-text-field
|
|
33
|
+
v-model="draft.deviceId"
|
|
34
|
+
aria-label="Device ID"
|
|
35
|
+
placeholder="Enter device id"
|
|
36
|
+
variant="outlined"
|
|
37
|
+
density="compact"
|
|
38
|
+
hide-details="auto"
|
|
39
|
+
class="mb-3"
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
<div class="field-label">Location <span>*</span></div>
|
|
43
|
+
<v-text-field
|
|
44
|
+
v-model="draft.location"
|
|
45
|
+
aria-label="Location"
|
|
46
|
+
placeholder="Enter location"
|
|
47
|
+
variant="outlined"
|
|
48
|
+
density="compact"
|
|
49
|
+
hide-details="auto"
|
|
50
|
+
class="mb-3"
|
|
51
|
+
/>
|
|
52
|
+
|
|
53
|
+
<div class="field-label">Monitor Path <span>*</span></div>
|
|
54
|
+
<v-btn-toggle v-model="monitorEnabled" mandatory divided class="monitor-toggle mb-3">
|
|
55
|
+
<v-btn :value="true" class="text-none">Enable</v-btn>
|
|
56
|
+
<v-btn :value="false" class="text-none">Disable</v-btn>
|
|
57
|
+
</v-btn-toggle>
|
|
58
|
+
|
|
59
|
+
<div class="field-label">Username <span>*</span></div>
|
|
60
|
+
<v-text-field
|
|
61
|
+
v-model="draft.username"
|
|
62
|
+
aria-label="Username"
|
|
63
|
+
placeholder="Enter username"
|
|
64
|
+
variant="outlined"
|
|
65
|
+
density="compact"
|
|
66
|
+
hide-details="auto"
|
|
67
|
+
class="mb-3"
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
<div class="field-label">Confirm Password <span>*</span></div>
|
|
71
|
+
<v-text-field
|
|
72
|
+
v-model="draft.password"
|
|
73
|
+
:type="showPassword ? 'text' : 'password'"
|
|
74
|
+
aria-label="Confirm Password"
|
|
75
|
+
placeholder="Enter password"
|
|
76
|
+
variant="outlined"
|
|
77
|
+
density="compact"
|
|
78
|
+
hide-details="auto"
|
|
79
|
+
:append-inner-icon="showPassword ? 'mdi-eye-off' : 'mdi-eye'"
|
|
80
|
+
@click:append-inner="showPassword = !showPassword"
|
|
81
|
+
/>
|
|
82
|
+
</v-card-text>
|
|
83
|
+
|
|
84
|
+
<v-card-actions class="form-actions pa-0">
|
|
85
|
+
<v-btn
|
|
86
|
+
class="text-none action-cancel"
|
|
87
|
+
variant="flat"
|
|
88
|
+
height="48"
|
|
89
|
+
@click="close"
|
|
90
|
+
>
|
|
91
|
+
Cancel
|
|
92
|
+
</v-btn>
|
|
93
|
+
<v-btn
|
|
94
|
+
class="text-none action-submit"
|
|
95
|
+
variant="flat"
|
|
96
|
+
height="48"
|
|
97
|
+
:loading="loading"
|
|
98
|
+
@click="submit"
|
|
99
|
+
>
|
|
100
|
+
Submit
|
|
101
|
+
</v-btn>
|
|
102
|
+
</v-card-actions>
|
|
103
|
+
</v-card>
|
|
104
|
+
</v-dialog>
|
|
105
|
+
</template>
|
|
106
|
+
|
|
107
|
+
<script setup lang="ts">
|
|
108
|
+
const props = defineProps({
|
|
109
|
+
modelValue: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: false,
|
|
112
|
+
},
|
|
113
|
+
mode: {
|
|
114
|
+
type: String as () => "add" | "edit",
|
|
115
|
+
default: "add",
|
|
116
|
+
},
|
|
117
|
+
reader: {
|
|
118
|
+
type: Object as () => Record<string, any> | null,
|
|
119
|
+
default: null,
|
|
120
|
+
},
|
|
121
|
+
loading: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
default: false,
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
const emit = defineEmits<{
|
|
128
|
+
"update:modelValue": [value: boolean];
|
|
129
|
+
submit: [payload: Record<string, any>];
|
|
130
|
+
}>();
|
|
131
|
+
|
|
132
|
+
const dialogModel = computed({
|
|
133
|
+
get: () => props.modelValue,
|
|
134
|
+
set: (value: boolean) => emit("update:modelValue", value),
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const showPassword = ref(false);
|
|
138
|
+
const monitorEnabled = ref(true);
|
|
139
|
+
const draft = reactive({
|
|
140
|
+
name: "",
|
|
141
|
+
baseUrl: "",
|
|
142
|
+
deviceId: "",
|
|
143
|
+
location: "",
|
|
144
|
+
username: "",
|
|
145
|
+
password: "",
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
watch(
|
|
149
|
+
() => [props.modelValue, props.reader],
|
|
150
|
+
() => {
|
|
151
|
+
if (!props.modelValue) return;
|
|
152
|
+
|
|
153
|
+
draft.name = props.reader?.name ?? "";
|
|
154
|
+
draft.baseUrl = props.reader?.baseUrl ?? "";
|
|
155
|
+
draft.deviceId = props.reader?.deviceId ?? "";
|
|
156
|
+
draft.location = props.reader?.location ?? "";
|
|
157
|
+
draft.username = props.reader?.username ?? "";
|
|
158
|
+
draft.password = props.reader?.password ?? "";
|
|
159
|
+
monitorEnabled.value = props.reader?.enabled ?? true;
|
|
160
|
+
},
|
|
161
|
+
{ immediate: true },
|
|
162
|
+
);
|
|
163
|
+
|
|
164
|
+
function close() {
|
|
165
|
+
emit("update:modelValue", false);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function submit() {
|
|
169
|
+
emit("submit", {
|
|
170
|
+
...draft,
|
|
171
|
+
monitorPath: monitorEnabled.value ? "api/notifications" : "",
|
|
172
|
+
enabled: monitorEnabled.value,
|
|
173
|
+
status: monitorEnabled.value ? "active" : "inactive",
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
</script>
|
|
177
|
+
|
|
178
|
+
<style scoped>
|
|
179
|
+
.hid-reader-form {
|
|
180
|
+
overflow: hidden;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.form-title {
|
|
184
|
+
font-size: 14px;
|
|
185
|
+
font-weight: 700;
|
|
186
|
+
padding: 12px 16px;
|
|
187
|
+
border-bottom: 1px solid #ececec;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.form-body {
|
|
191
|
+
padding: 18px 16px 20px;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.field-label {
|
|
195
|
+
color: #4f5a66;
|
|
196
|
+
font-size: 12px;
|
|
197
|
+
font-weight: 600;
|
|
198
|
+
margin-bottom: 6px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.field-label span {
|
|
202
|
+
color: #e53935;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.monitor-toggle {
|
|
206
|
+
display: grid;
|
|
207
|
+
grid-template-columns: 1fr 1fr;
|
|
208
|
+
width: 100%;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.monitor-toggle :deep(.v-btn) {
|
|
212
|
+
height: 36px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.form-actions {
|
|
216
|
+
display: grid;
|
|
217
|
+
grid-template-columns: 1fr 1fr;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.action-cancel {
|
|
221
|
+
background: #ffffff;
|
|
222
|
+
color: #111827;
|
|
223
|
+
border-radius: 0;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.action-submit {
|
|
227
|
+
background: #062d42;
|
|
228
|
+
color: #ffffff;
|
|
229
|
+
border-radius: 0;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@media (max-width: 600px) {
|
|
233
|
+
.form-body {
|
|
234
|
+
padding: 14px 12px 16px;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.form-actions {
|
|
238
|
+
grid-template-columns: 1fr;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
:global(.v-dialog > .v-overlay__content) {
|
|
242
|
+
max-width: calc(100vw - 24px) !important;
|
|
243
|
+
margin: 12px !important;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
</style>
|