adminforth 1.1.79 → 1.1.80
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/codeInjector.js +51 -23
- package/dist/plugins/AuditLog/index.js +13 -0
- package/dist/plugins/AuditLog/types.js +1 -0
- package/dist/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
- package/dist/spa/index.html +1 -1
- package/dist/spa/package-lock.json +0 -111
- package/dist/spa/package.json +0 -1
- package/dist/spa/spa/src/App.vue +1 -1
- package/dist/spa/spa/src/components/MenuLink.vue +1 -1
- package/dist/spa/src/App.vue +133 -178
- package/dist/spa/src/components/MenuLink.vue +3 -3
- package/dist/spa/src/components/ResourceForm.vue +96 -96
- package/dist/spa/src/components/ResourceListTable.vue +84 -69
- package/dist/spa/src/components/ValueRenderer.vue +3 -2
- package/dist/spa/src/composables/useStores.ts +11 -24
- package/dist/spa/src/main.ts +1 -1
- package/dist/spa/src/router/index.ts +1 -0
- package/dist/spa/src/utils.ts +1 -1
- package/dist/spa/src/views/CreateView.vue +9 -1
- package/dist/spa/src/views/EditView.vue +9 -1
- package/dist/spa/src/views/ListView.vue +3 -12
- package/dist/spa/src/views/LoginView.vue +1 -6
- package/dist/spa/src/views/ResourceParent.vue +2 -1
- package/dist/spa/src/views/ShowView.vue +14 -6
- package/dist/spa/tailwind.config.js +1 -3
- package/modules/codeInjector.ts +56 -26
- package/package.json +1 -1
- package/plugins/S3UploadPlugin/custom/s3uploader.vue +4 -1
- package/spa/src/App.vue +1 -1
- package/spa/src/components/MenuLink.vue +1 -1
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
- package/dist/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
- package/dist/spa/src/components/SkeleteLoader.vue +0 -23
- package/plugins/TwoFactorsAuthPlugin/node_modules/.package-lock.json +0 -61
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/LICENSE +0 -21
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/README.md +0 -15
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert/strict.d.ts +0 -8
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/assert.d.ts +0 -1040
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/async_hooks.d.ts +0 -541
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/buffer.d.ts +0 -2363
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/child_process.d.ts +0 -1544
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/cluster.d.ts +0 -578
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/console.d.ts +0 -452
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/constants.d.ts +0 -19
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/crypto.d.ts +0 -4523
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dgram.d.ts +0 -596
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/diagnostics_channel.d.ts +0 -554
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns/promises.d.ts +0 -476
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dns.d.ts +0 -864
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/dom-events.d.ts +0 -124
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/domain.d.ts +0 -170
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/events.d.ts +0 -931
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs/promises.d.ts +0 -1245
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/fs.d.ts +0 -4317
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.d.ts +0 -412
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/globals.global.d.ts +0 -1
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http.d.ts +0 -1908
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/http2.d.ts +0 -2418
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/https.d.ts +0 -550
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/index.d.ts +0 -89
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/inspector.d.ts +0 -2746
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/module.d.ts +0 -315
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/net.d.ts +0 -999
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/os.d.ts +0 -495
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/package.json +0 -217
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/path.d.ts +0 -191
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/perf_hooks.d.ts +0 -905
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/process.d.ts +0 -1754
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/punycode.d.ts +0 -117
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/querystring.d.ts +0 -153
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline/promises.d.ts +0 -150
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/readline.d.ts +0 -540
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/repl.d.ts +0 -430
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/sea.d.ts +0 -153
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/consumers.d.ts +0 -12
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/promises.d.ts +0 -83
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream/web.d.ts +0 -367
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/stream.d.ts +0 -1707
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/string_decoder.d.ts +0 -67
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/test.d.ts +0 -1718
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers/promises.d.ts +0 -97
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/timers.d.ts +0 -240
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tls.d.ts +0 -1217
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/trace_events.d.ts +0 -197
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/tty.d.ts +0 -208
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/url.d.ts +0 -952
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/util.d.ts +0 -2292
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/v8.d.ts +0 -808
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/vm.d.ts +0 -924
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/wasi.d.ts +0 -181
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/worker_threads.d.ts +0 -694
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/node/zlib.d.ts +0 -530
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/LICENSE +0 -21
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/README.md +0 -15
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/index.d.ts +0 -127
- package/plugins/TwoFactorsAuthPlugin/node_modules/@types/notp/package.json +0 -21
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/LICENSE +0 -201
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/README.md +0 -68
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.d.ts +0 -11
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/index.js +0 -51
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.d.ts +0 -4
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/dist/interfaces.js +0 -2
- package/plugins/TwoFactorsAuthPlugin/node_modules/node-2fa/package.json +0 -58
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/.travis.yml +0 -6
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/LICENSE +0 -22
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/Readme.md +0 -135
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP-verify.js +0 -33
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/examples/TOTP.js +0 -15
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/index.js +0 -221
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/package.json +0 -22
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/mocha.opts +0 -1
- package/plugins/TwoFactorsAuthPlugin/node_modules/notp/test/notp.js +0 -217
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/LICENSE.txt +0 -19
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/Makefile +0 -24
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/README.md +0 -15
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/index.js +0 -23
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/index.js +0 -26
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/lib/thirty-two/thirty-two.js +0 -128
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/package.json +0 -15
- package/plugins/TwoFactorsAuthPlugin/node_modules/thirty-two/spec/thirty-two_spec.js +0 -63
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/CopyrightNotice.txt +0 -15
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/LICENSE.txt +0 -12
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/README.md +0 -164
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/SECURITY.md +0 -41
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.d.ts +0 -37
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/index.js +0 -68
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/modules/package.json +0 -3
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/package.json +0 -47
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.d.ts +0 -453
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.html +0 -1
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.js +0 -374
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.es6.mjs +0 -373
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.html +0 -1
- package/plugins/TwoFactorsAuthPlugin/node_modules/tslib/tslib.js +0 -424
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/README.md +0 -6
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/agent.d.ts +0 -31
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/api.d.ts +0 -43
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/balanced-pool.d.ts +0 -18
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cache.d.ts +0 -36
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/client.d.ts +0 -97
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/connector.d.ts +0 -34
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/content-type.d.ts +0 -21
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/cookies.d.ts +0 -28
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/diagnostics-channel.d.ts +0 -67
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/dispatcher.d.ts +0 -241
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/errors.d.ts +0 -128
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/fetch.d.ts +0 -209
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/file.d.ts +0 -39
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/filereader.d.ts +0 -54
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/formdata.d.ts +0 -108
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-dispatcher.d.ts +0 -9
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/global-origin.d.ts +0 -7
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/handlers.d.ts +0 -9
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/header.d.ts +0 -4
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/index.d.ts +0 -63
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/interceptors.d.ts +0 -5
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-agent.d.ts +0 -50
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-client.d.ts +0 -25
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-errors.d.ts +0 -12
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-interceptor.d.ts +0 -93
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/mock-pool.d.ts +0 -25
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/package.json +0 -55
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/patch.d.ts +0 -71
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool-stats.d.ts +0 -19
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/pool.d.ts +0 -28
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/proxy-agent.d.ts +0 -30
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/readable.d.ts +0 -61
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/webidl.d.ts +0 -220
- package/plugins/TwoFactorsAuthPlugin/node_modules/undici-types/websocket.d.ts +0 -131
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
<div class="rounded-default">
|
|
3
3
|
|
|
4
4
|
<div
|
|
5
|
-
class="relative shadow-
|
|
5
|
+
class="relative shadow-resourse-form-shadow sm:rounded-lg dark:shadow-2xl dark:shadow-black rounded-default"
|
|
6
6
|
>
|
|
7
7
|
<form autocomplete="off" @submit.prevent>
|
|
8
8
|
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 ">
|
|
9
|
-
<thead class="text-xs text-gray-700 uppercase bg-
|
|
9
|
+
<thead class="text-xs text-gray-700 uppercase bg-form-view-heading dark:bg-gray-700 dark:text-gray-400">
|
|
10
10
|
<tr>
|
|
11
11
|
<th scope="col" class="px-6 py-3">
|
|
12
12
|
Field
|
|
@@ -18,8 +18,18 @@
|
|
|
18
18
|
</thead>
|
|
19
19
|
<tbody>
|
|
20
20
|
<tr v-for="column, i in editableColumns" :key="column.name"
|
|
21
|
-
class="bg-
|
|
21
|
+
class="bg-form-view-bg dark:bg-gray-800 border-b dark:border-gray-700"
|
|
22
22
|
>
|
|
23
|
+
<!-- if column is in customComponentsPerColumn, use this component. If not, use this code -->
|
|
24
|
+
<template v-if="customComponentsPerColumn[column.name]">
|
|
25
|
+
<component
|
|
26
|
+
:is="customComponentsPerColumn[column.name]"
|
|
27
|
+
:column="column"
|
|
28
|
+
:value="currentValues[column.name]"
|
|
29
|
+
@update:value="setCurrentValue(column.name, $event)"
|
|
30
|
+
/>
|
|
31
|
+
</template>
|
|
32
|
+
<template v-else>
|
|
23
33
|
<td class="px-6 py-4 whitespace-nowrap "> <!--align-top-->
|
|
24
34
|
{{ column.label }}
|
|
25
35
|
<span :data-tooltip-target="`tooltip-show-${i}`" class="relative inline-block">
|
|
@@ -34,99 +44,88 @@
|
|
|
34
44
|
</div>
|
|
35
45
|
</td>
|
|
36
46
|
<td class="px-6 py-4 whitespace-nowrap whitespace-pre-wrap relative">
|
|
47
|
+
<Dropdown
|
|
48
|
+
single
|
|
49
|
+
v-if="column.foreignResource"
|
|
50
|
+
:options="columnOptions[column.name] || []"
|
|
51
|
+
:placeholder = "columnOptions[column.name]?.length || 'There are no options available'"
|
|
52
|
+
:modelValue="currentValues[column.name]"
|
|
53
|
+
@update:modelValue="setCurrentValue(column.name, $event)"
|
|
54
|
+
></Dropdown>
|
|
55
|
+
<Dropdown
|
|
56
|
+
single
|
|
57
|
+
v-else-if="column.enum"
|
|
58
|
+
:options="column.enum"
|
|
59
|
+
:modelValue="currentValues[column.name]"
|
|
60
|
+
@update:modelValue="setCurrentValue(column.name, $event)"
|
|
61
|
+
/>
|
|
62
|
+
<Dropdown
|
|
63
|
+
single
|
|
64
|
+
v-else-if="column.type === 'boolean'"
|
|
65
|
+
:options="[{ label: 'Yes', value: true }, { label: 'No', value: false }, { label: 'Unset', value: null }]"
|
|
66
|
+
:modelValue="currentValues[column.name]"
|
|
67
|
+
@update:modelValue="setCurrentValue(column.name, $event)"
|
|
68
|
+
/>
|
|
69
|
+
<input
|
|
70
|
+
v-else-if="['integer'].includes(column.type)"
|
|
71
|
+
type="number"
|
|
72
|
+
step="1"
|
|
73
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-40 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"
|
|
74
|
+
placeholder="0"
|
|
75
|
+
:value="currentValues[column.name]"
|
|
76
|
+
@input="setCurrentValue(column.name, $event.target.value)"
|
|
77
|
+
>
|
|
78
|
+
<CustomDatePicker
|
|
79
|
+
v-else-if="['datetime'].includes(column.type)"
|
|
80
|
+
:column="column"
|
|
81
|
+
:valueStart="currentValues[column.name]"
|
|
82
|
+
auto-hide
|
|
83
|
+
@update:valueStart="setCurrentValue(column.name, $event)"
|
|
84
|
+
/>
|
|
85
|
+
<input
|
|
86
|
+
v-else-if="['decimal', 'float'].includes(column.type)"
|
|
87
|
+
type="number"
|
|
88
|
+
step="0.1"
|
|
89
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-40 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"
|
|
90
|
+
placeholder="0.0"
|
|
91
|
+
:value="currentValues[column.name]"
|
|
92
|
+
@input="setCurrentValue(column.name, $event.target.value)"
|
|
93
|
+
/>
|
|
94
|
+
<textarea
|
|
95
|
+
v-else-if="['text'].includes(column.type)"
|
|
96
|
+
class="bg-gray-50 border 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"
|
|
97
|
+
placeholder="Text"
|
|
98
|
+
:value="currentValues[column.name]"
|
|
99
|
+
@input="setCurrentValue(column.name, $event.target.value)"
|
|
100
|
+
>
|
|
101
|
+
</textarea>
|
|
102
|
+
<input
|
|
103
|
+
v-else
|
|
104
|
+
:type="!column.masked || unmasked[column.name] ? 'text' : 'password'"
|
|
105
|
+
class="bg-gray-50 border 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"
|
|
106
|
+
placeholder="Text"
|
|
107
|
+
:value="currentValues[column.name]"
|
|
108
|
+
@input="setCurrentValue(column.name, $event.target.value)"
|
|
109
|
+
autocomplete="false"
|
|
110
|
+
data-lpignore="true"
|
|
111
|
+
readonly
|
|
112
|
+
onfocus="this.removeAttribute('readonly');"
|
|
113
|
+
>
|
|
37
114
|
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/>
|
|
46
|
-
</
|
|
47
|
-
<
|
|
48
|
-
<Dropdown
|
|
49
|
-
single
|
|
50
|
-
v-if="column.foreignResource"
|
|
51
|
-
:options="columnOptions[column.name] || []"
|
|
52
|
-
:placeholder = "columnOptions[column.name]?.length ?'Select...': 'There are no options available'"
|
|
53
|
-
:modelValue="currentValues[column.name]"
|
|
54
|
-
@update:modelValue="setCurrentValue(column.name, $event)"
|
|
55
|
-
></Dropdown>
|
|
56
|
-
<Dropdown
|
|
57
|
-
single
|
|
58
|
-
v-else-if="column.enum"
|
|
59
|
-
:options="column.enum"
|
|
60
|
-
:modelValue="currentValues[column.name]"
|
|
61
|
-
@update:modelValue="setCurrentValue(column.name, $event)"
|
|
62
|
-
/>
|
|
63
|
-
<Dropdown
|
|
64
|
-
single
|
|
65
|
-
v-else-if="column.type === 'boolean'"
|
|
66
|
-
:options="[{ label: 'Yes', value: true }, { label: 'No', value: false }, { label: 'Unset', value: null }]"
|
|
67
|
-
:modelValue="currentValues[column.name]"
|
|
68
|
-
@update:modelValue="setCurrentValue(column.name, $event)"
|
|
69
|
-
/>
|
|
70
|
-
<input
|
|
71
|
-
v-else-if="['integer'].includes(column.type)"
|
|
72
|
-
type="number"
|
|
73
|
-
step="1"
|
|
74
|
-
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-40 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"
|
|
75
|
-
placeholder="0"
|
|
76
|
-
:value="currentValues[column.name]"
|
|
77
|
-
@input="setCurrentValue(column.name, $event.target.value)"
|
|
78
|
-
>
|
|
79
|
-
<CustomDatePicker
|
|
80
|
-
v-else-if="['datetime'].includes(column.type)"
|
|
81
|
-
:column="column"
|
|
82
|
-
:valueStart="currentValues[column.name]"
|
|
83
|
-
auto-hide
|
|
84
|
-
@update:valueStart="setCurrentValue(column.name, $event)"
|
|
85
|
-
/>
|
|
86
|
-
<input
|
|
87
|
-
v-else-if="['decimal', 'float'].includes(column.type)"
|
|
88
|
-
type="number"
|
|
89
|
-
step="0.1"
|
|
90
|
-
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-40 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"
|
|
91
|
-
placeholder="0.0"
|
|
92
|
-
:value="currentValues[column.name]"
|
|
93
|
-
@input="setCurrentValue(column.name, $event.target.value)"
|
|
94
|
-
/>
|
|
95
|
-
<textarea
|
|
96
|
-
v-else-if="['text'].includes(column.type)"
|
|
97
|
-
class="bg-gray-50 border 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"
|
|
98
|
-
placeholder="Text"
|
|
99
|
-
:value="currentValues[column.name]"
|
|
100
|
-
@input="setCurrentValue(column.name, $event.target.value)"
|
|
101
|
-
>
|
|
102
|
-
</textarea>
|
|
103
|
-
<input
|
|
104
|
-
v-else
|
|
105
|
-
:type="!column.masked || unmasked[column.name] ? 'text' : 'password'"
|
|
106
|
-
class="bg-gray-50 border 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"
|
|
107
|
-
placeholder="Text"
|
|
108
|
-
:value="currentValues[column.name]"
|
|
109
|
-
@input="setCurrentValue(column.name, $event.target.value)"
|
|
110
|
-
autocomplete="false"
|
|
111
|
-
data-lpignore="true"
|
|
112
|
-
readonly
|
|
113
|
-
onfocus="this.removeAttribute('readonly');"
|
|
114
|
-
>
|
|
115
|
+
<button
|
|
116
|
+
v-if="column.masked"
|
|
117
|
+
type="button"
|
|
118
|
+
@click="unmasked[column.name] = !unmasked[column.name]"
|
|
119
|
+
class="h-6 absolute inset-y-2 top-6 right-6 flex items-center pr-2 z-index-100 focus:outline-none"
|
|
120
|
+
>
|
|
121
|
+
<IconEyeSolid class="w-6 h-6 text-gray-400" v-if="!unmasked[column.name]" />
|
|
122
|
+
<IconEyeSlashSolid class="w-6 h-6 text-gray-400" v-else />
|
|
123
|
+
</button>
|
|
124
|
+
<div v-if="columnError(column) && validating" class="mt-1 text-xs text-red-500 dark:text-red-400">{{ columnError(column) }}</div>
|
|
115
125
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
@click="unmasked[column.name] = !unmasked[column.name]"
|
|
120
|
-
class="h-6 absolute inset-y-2 top-6 right-6 flex items-center pr-2 z-index-100 focus:outline-none"
|
|
121
|
-
>
|
|
122
|
-
<IconEyeSolid class="w-6 h-6 text-gray-400" v-if="!unmasked[column.name]" />
|
|
123
|
-
<IconEyeSlashSolid class="w-6 h-6 text-gray-400" v-else />
|
|
124
|
-
</button>
|
|
125
|
-
<div v-if="columnError(column) && validating" class="mt-1 text-xs text-red-500 dark:text-red-400">{{ columnError(column) }}</div>
|
|
126
|
-
|
|
127
|
-
<div v-if="column.editingNote && column.editingNote[mode]" class="mt-1 text-xs text-gray-400 dark:text-gray-500">{{ column.editingNote[mode] }}</div>
|
|
128
|
-
</template>
|
|
129
|
-
</td>
|
|
126
|
+
<div v-if="column.editingNote && column.editingNote[mode]" class="mt-1 text-xs text-gray-400 dark:text-gray-500">{{ column.editingNote[mode] }}</div>
|
|
127
|
+
</td>
|
|
128
|
+
</template>
|
|
130
129
|
</tr>
|
|
131
130
|
|
|
132
131
|
</tbody>
|
|
@@ -142,7 +141,7 @@
|
|
|
142
141
|
import CustomDatePicker from "@/components/CustomDatePicker.vue";
|
|
143
142
|
import Dropdown from '@/components/Dropdown.vue';
|
|
144
143
|
import { useCoreStore } from '@/stores/core';
|
|
145
|
-
import { callAdminForthApi
|
|
144
|
+
import { callAdminForthApi } from '@/utils';
|
|
146
145
|
import { IconExclamationCircleSolid, IconEyeSlashSolid, IconEyeSolid } from '@iconify-prerendered/vue-flowbite';
|
|
147
146
|
import { computedAsync } from '@vueuse/core';
|
|
148
147
|
import { initFlowbite } from 'flowbite';
|
|
@@ -156,9 +155,10 @@ const props = defineProps({
|
|
|
156
155
|
resource: Object,
|
|
157
156
|
record: Object,
|
|
158
157
|
validating: Boolean,
|
|
159
|
-
|
|
158
|
+
customComponentsPerColumn: Object,
|
|
160
159
|
});
|
|
161
160
|
|
|
161
|
+
|
|
162
162
|
const unmasked = ref({});
|
|
163
163
|
|
|
164
164
|
const mode = computed(() => props.record && Object.keys(props.record).length ? 'edit' : 'create');
|
|
@@ -1,29 +1,42 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- table -->
|
|
3
|
-
<div class="relative overflow-x-auto shadow-
|
|
3
|
+
<div class="relative overflow-x-auto shadow-list-table-shadow dark:shadow-black overflow-y-hidden rounded-default">
|
|
4
4
|
|
|
5
5
|
<!-- skelet loader -->
|
|
6
6
|
<div role="status" v-if="!resource || !resource.columns"
|
|
7
7
|
class="max-w p-4 space-y-4 divide-y divide-gray-200 rounded shadow animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700">
|
|
8
|
-
|
|
8
|
+
<div class="flex items-center justify-between h-16">
|
|
9
|
+
<div>
|
|
10
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
|
|
11
|
+
<div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div class="flex items-center justify-between h-16 pt-4" v-for="i in new Array(10)">
|
|
17
|
+
<div>
|
|
18
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
|
|
19
|
+
<div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
|
|
22
|
+
</div>
|
|
23
|
+
<span class="sr-only">Loading...</span>
|
|
9
24
|
</div>
|
|
10
25
|
|
|
11
26
|
<table v-else class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 rounded-default">
|
|
12
|
-
<thead class="text-xs text-view-table-heading-text bg-
|
|
27
|
+
<thead class="text-xs text-view-table-heading-text bg-list-view-table-heading dark:bg-gray-700 dark:text-gray-400">
|
|
13
28
|
<tr>
|
|
14
29
|
<th scope="col" class="p-4">
|
|
15
30
|
<div v-if="rows && rows.length" class="flex items-center">
|
|
16
|
-
<input id="checkbox-all-search" type="checkbox" :checked="allFromThisPageChecked" @change="selectAll()"
|
|
17
|
-
class="w-4 h-4
|
|
31
|
+
<input id="checkbox-all-search" type="checkbox" :checked="allFromThisPageChecked" @change="selectAll()"
|
|
32
|
+
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
|
|
18
33
|
<label for="checkbox-all-search" class="sr-only">checkbox</label>
|
|
19
34
|
</div>
|
|
20
35
|
</th>
|
|
21
36
|
|
|
22
37
|
<th v-for="c in columnsListed" scope="col" class="px-6 py-3">
|
|
23
|
-
|
|
24
38
|
<div @click="() => c.sortable && onSortButtonClick(c.name)" class="flex items-center " :class="{'cursor-pointer':c.sortable}">
|
|
25
39
|
{{ c.label }}
|
|
26
|
-
|
|
27
40
|
|
|
28
41
|
<div v-if="c.sortable"
|
|
29
42
|
:style="{ 'color':ascArr.includes(c.name)?'green':descArr.includes(c.name)?'red':'currentColor'}">
|
|
@@ -39,12 +52,6 @@
|
|
|
39
52
|
d="M8.574 11.024h6.852a2.075 2.075 0 0 0 1.847-1.086 1.9 1.9 0 0 0-.11-1.986L13.736 2.9a2.122 2.122 0 0 0-3.472 0L6.837 7.952a1.9 1.9 0 0 0-.11 1.986 2.074 2.074 0 0 0 1.847 1.086Zm6.852 1.952H8.574a2.072 2.072 0 0 0-1.847 1.087 1.9 1.9 0 0 0 .11 1.985l3.426 5.05a2.123 2.123 0 0 0 3.472 0l3.427-5.05a1.9 1.9 0 0 0 .11-1.985 2.074 2.074 0 0 0-1.846-1.087Z"/>
|
|
40
53
|
</svg>
|
|
41
54
|
</div>
|
|
42
|
-
<span
|
|
43
|
-
class="bg-red-100 text-red-800 text-xs font-medium me-1 px-1 py-0.5 rounded dark:bg-gray-700 dark:text-red-400 border border-red-400"
|
|
44
|
-
v-if="sort.findIndex((s) => s.field === c.name) !== -1">
|
|
45
|
-
{{ sort.findIndex((s) => s.field === c.name) + 1 }}
|
|
46
|
-
</span>
|
|
47
|
-
|
|
48
55
|
</div>
|
|
49
56
|
</th>
|
|
50
57
|
|
|
@@ -54,8 +61,51 @@
|
|
|
54
61
|
</tr>
|
|
55
62
|
</thead>
|
|
56
63
|
<tbody>
|
|
57
|
-
|
|
58
|
-
|
|
64
|
+
<tr v-if="!rows" class="bg-list-view-table-bg border-b dark:bg-gray-800 dark:border-gray-700">
|
|
65
|
+
<td :colspan="resource?.columns.length + 2">
|
|
66
|
+
|
|
67
|
+
<div role="status"
|
|
68
|
+
class="max-w p-4 space-y-4 divide-y divide-gray-200 rounded animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700">
|
|
69
|
+
<div class="flex items-center justify-between">
|
|
70
|
+
<div>
|
|
71
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
|
|
72
|
+
<div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
|
|
73
|
+
</div>
|
|
74
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="flex items-center justify-between pt-4">
|
|
77
|
+
<div>
|
|
78
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
|
|
79
|
+
<div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
|
|
82
|
+
</div>
|
|
83
|
+
<div class="flex items-center justify-between pt-4">
|
|
84
|
+
<div>
|
|
85
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
|
|
86
|
+
<div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
|
|
87
|
+
</div>
|
|
88
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
|
|
89
|
+
</div>
|
|
90
|
+
<div class="flex items-center justify-between pt-4">
|
|
91
|
+
<div>
|
|
92
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
|
|
93
|
+
<div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
|
|
96
|
+
</div>
|
|
97
|
+
<div class="flex items-center justify-between pt-4">
|
|
98
|
+
<div>
|
|
99
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
|
|
100
|
+
<div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
|
|
101
|
+
</div>
|
|
102
|
+
<div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
|
|
103
|
+
</div>
|
|
104
|
+
<span class="sr-only">Loading...</span>
|
|
105
|
+
</div>
|
|
106
|
+
</td>
|
|
107
|
+
</tr>
|
|
108
|
+
<tr v-else-if="rows.length === 0" class="bg-list-view-table-bg border-b dark:bg-gray-800 dark:border-gray-700">
|
|
59
109
|
<td :colspan="resource?.columns.length + 2">
|
|
60
110
|
|
|
61
111
|
<div id="toast-simple"
|
|
@@ -68,17 +118,16 @@
|
|
|
68
118
|
</td>
|
|
69
119
|
</tr>
|
|
70
120
|
|
|
71
|
-
<tr
|
|
72
|
-
class="bg-
|
|
73
|
-
<td class="w-4 p-4
|
|
74
|
-
<div class="flex items center
|
|
121
|
+
<tr v-else v-for="(row, rowI) in rows" :key="row.id"
|
|
122
|
+
class="bg-list-view-table-bg border-b dark:bg-gray-800 border-list-view-border-color dark:border-gray-700 hover:bg-list-view-table-row-hover dark:hover:bg-gray-600">
|
|
123
|
+
<td class="w-4 p-4">
|
|
124
|
+
<div class="flex items center">
|
|
75
125
|
<input
|
|
76
|
-
@click="(e)=>{e.stopPropagation()}"
|
|
77
126
|
id="checkbox-table-search-1"
|
|
78
127
|
type="checkbox"
|
|
79
128
|
:checked="checkboxesInternal.includes(row.id)"
|
|
80
129
|
@change="(e)=>{addToCheckedValues(row.id)}"
|
|
81
|
-
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600
|
|
130
|
+
class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 dark:focus:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
|
|
82
131
|
<label for="checkbox-table-search-1" class="sr-only">checkbox</label>
|
|
83
132
|
</div>
|
|
84
133
|
</td>
|
|
@@ -86,14 +135,14 @@
|
|
|
86
135
|
<!-- if c.name in listComponentsPerColumn, render it. If not, render ValueRenderer -->
|
|
87
136
|
<component
|
|
88
137
|
:is="c?.components?.list ? getCustomComponent(c.components.list) : ValueRenderer"
|
|
89
|
-
:meta="c?.components?.list
|
|
138
|
+
:meta="c?.components?.list.meta"
|
|
90
139
|
:column="c"
|
|
91
140
|
:record="row"
|
|
92
141
|
:adminUser="coreStore.adminUser"
|
|
93
142
|
:resource="resource"
|
|
94
143
|
/>
|
|
95
144
|
</td>
|
|
96
|
-
<td class=" items-center px-6 py-4
|
|
145
|
+
<td class=" items-center px-6 py-4">
|
|
97
146
|
<div class="flex">
|
|
98
147
|
<RouterLink
|
|
99
148
|
v-if="resource.options?.allowedActions.show"
|
|
@@ -229,7 +278,6 @@ import ValueRenderer from '@/components/ValueRenderer.vue';
|
|
|
229
278
|
import { getCustomComponent } from '@/utils';
|
|
230
279
|
import { useCoreStore } from '@/stores/core';
|
|
231
280
|
import { showSuccesTost } from '@/composables/useFrontendApi';
|
|
232
|
-
import SkeleteLoader from '@/components/SkeleteLoader.vue';
|
|
233
281
|
|
|
234
282
|
import {
|
|
235
283
|
IconInboxOutline,
|
|
@@ -243,7 +291,6 @@ IconFilterOutline,
|
|
|
243
291
|
IconPenSolid,
|
|
244
292
|
IconTrashBinSolid
|
|
245
293
|
} from '@iconify-prerendered/vue-flowbite';
|
|
246
|
-
import router from '@/router';
|
|
247
294
|
|
|
248
295
|
const coreStore = useCoreStore();
|
|
249
296
|
|
|
@@ -252,8 +299,7 @@ const props = defineProps([
|
|
|
252
299
|
'rows',
|
|
253
300
|
'totalRows',
|
|
254
301
|
'pageSize',
|
|
255
|
-
'checkboxes'
|
|
256
|
-
'sort'
|
|
302
|
+
'checkboxes'
|
|
257
303
|
])
|
|
258
304
|
|
|
259
305
|
// emits, update page
|
|
@@ -289,10 +335,6 @@ watch(() => props.checkboxes, (newCheckboxes) => {
|
|
|
289
335
|
checkboxesInternal.value = newCheckboxes;
|
|
290
336
|
});
|
|
291
337
|
|
|
292
|
-
watch(() => props.sort, (newSort) => {
|
|
293
|
-
sort.value = newSort;
|
|
294
|
-
});
|
|
295
|
-
|
|
296
338
|
function addToCheckedValues(id) {
|
|
297
339
|
if (checkboxesInternal.value.includes(id)) {
|
|
298
340
|
checkboxesInternal.value = checkboxesInternal.value.filter((item) => item !== id);
|
|
@@ -305,18 +347,15 @@ function addToCheckedValues(id) {
|
|
|
305
347
|
const columnsListed = computed(() => props.resource?.columns?.filter(c => c.showIn.includes('list')));
|
|
306
348
|
|
|
307
349
|
async function selectAll(value) {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
checkboxesInternal.value = checkboxesInternal.value.filter((item) => item !== r.id);
|
|
318
|
-
});
|
|
319
|
-
}
|
|
350
|
+
props.rows.forEach((r) => {
|
|
351
|
+
if (!checkboxesInternal.value.includes(r.id)) {
|
|
352
|
+
checkboxesInternal.value.push(r.id)
|
|
353
|
+
} else {
|
|
354
|
+
checkboxesInternal.value = checkboxesInternal.value.filter((item) => item !== r.id)
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
checkboxesInternal.value = [ ...checkboxesInternal.value ]
|
|
358
|
+
// checkboxes.value = rows.value.map((v) => v.id);
|
|
320
359
|
}
|
|
321
360
|
|
|
322
361
|
const totalPages = computed(() => Math.ceil(props.totalRows / props.pageSize));
|
|
@@ -326,7 +365,7 @@ const totalPages = computed(() => Math.ceil(props.totalRows / props.pageSize));
|
|
|
326
365
|
|
|
327
366
|
const allFromThisPageChecked = computed(() => {
|
|
328
367
|
if (!props.rows) return false;
|
|
329
|
-
return props.rows.every((r) =>
|
|
368
|
+
return props.rows.every((r) => props.checkboxes.includes(r.id));
|
|
330
369
|
});
|
|
331
370
|
const ascArr = computed(() => sort.value.filter((s) => s.direction === 'asc').map((s) => s.field));
|
|
332
371
|
const descArr = computed(() => sort.value.filter((s) => s.direction === 'desc').map((s) => s.field));
|
|
@@ -335,7 +374,7 @@ const descArr = computed(() => sort.value.filter((s) => s.direction === 'desc').
|
|
|
335
374
|
function onSortButtonClick(field) {
|
|
336
375
|
const sortIndex = sort.value.findIndex((s) => s.field === field);
|
|
337
376
|
if (sortIndex === -1) {
|
|
338
|
-
sort.value = [
|
|
377
|
+
sort.value = [{field, direction: 'asc'}, ...sort.value];
|
|
339
378
|
} else {
|
|
340
379
|
const sortField = sort.value[sortIndex];
|
|
341
380
|
if (sortField.direction === 'asc') {
|
|
@@ -346,30 +385,6 @@ function onSortButtonClick(field) {
|
|
|
346
385
|
}
|
|
347
386
|
}
|
|
348
387
|
|
|
349
|
-
|
|
350
|
-
const clickTarget = ref(null);
|
|
351
|
-
async function onClick(e,row) {
|
|
352
|
-
if(clickTarget.value === e.target) return;
|
|
353
|
-
clickTarget.value = e.target;
|
|
354
|
-
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
355
|
-
if (window.getSelection().toString()) return;
|
|
356
|
-
else {router.push({
|
|
357
|
-
name: 'resource-show',
|
|
358
|
-
params: {
|
|
359
|
-
resourceId: props.resource.resourceId,
|
|
360
|
-
primaryKey: row._primaryKeyValue,
|
|
361
|
-
},
|
|
362
|
-
})}
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
388
|
async function deleteRecord(row) {
|
|
374
389
|
const data = await window.adminforth.confirm({
|
|
375
390
|
message: 'Are you sure you want to delete this item?',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
3
|
|
|
4
|
-
<span
|
|
4
|
+
<span v-if="column.foreignResource">
|
|
5
5
|
<RouterLink v-if="record[column.name]" class="font-medium text-blue-600 dark:text-blue-500 hover:brightness-110"
|
|
6
6
|
:to="{ name: 'resource-show', params: { resourceId: column.foreignResource.resourceId, primaryKey: record[column.name].pk } }">
|
|
7
7
|
{{ record[column.name].label }}
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
<span v-else-if="column.enum">
|
|
19
19
|
{{ checkEmptyValues(column.enum.find(e => e.value === record[column.name])?.label,route.meta.type) }}
|
|
20
20
|
</span>
|
|
21
|
-
<span v-else-if="column.type === 'datetime'"
|
|
21
|
+
<span v-else-if="column.type === 'datetime'">
|
|
22
22
|
{{ checkEmptyValues(formatDate(record[column.name]),route.meta.type) }}
|
|
23
|
+
|
|
23
24
|
</span>
|
|
24
25
|
<span v-else>
|
|
25
26
|
{{ checkEmptyValues(record[column.name],route.meta.type) }}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { FrontendAPIInterface, ConfirmParams, AlertParams, } from '../types/FrontendAPI';
|
|
2
|
-
import type { AdminForthFilterOperators } from '@/types/AdminForthConfig';
|
|
1
|
+
import type { FrontendAPIInterface, ConfirmParams, AlertParams, FilterParams,Operator } from '../types/FrontendAPI';
|
|
3
2
|
import { useToastStore } from '../stores/toast';
|
|
4
3
|
import { useModalStore } from '../stores/modal';
|
|
5
4
|
import { useCoreStore } from '@/stores/core';
|
|
@@ -7,20 +6,9 @@ import { useFiltersStore } from '@/stores/filters';
|
|
|
7
6
|
import router from '@/router'
|
|
8
7
|
import type { AdminForthResourceColumn } from '@/types/AdminForthConfig';
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
field: string;
|
|
15
|
-
/**
|
|
16
|
-
* Operator of filter
|
|
17
|
-
*/
|
|
18
|
-
operator: AdminForthFilterOperators;
|
|
19
|
-
/**
|
|
20
|
-
* Value of filter
|
|
21
|
-
*/
|
|
22
|
-
value: string | number | boolean ;
|
|
23
|
-
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
24
12
|
|
|
25
13
|
declare global {
|
|
26
14
|
interface Window {
|
|
@@ -35,6 +23,7 @@ declare global {
|
|
|
35
23
|
}
|
|
36
24
|
|
|
37
25
|
export class FrontendAPI implements FrontendAPIInterface {
|
|
26
|
+
private validOperators: Operator[] = ['lte', 'gte', 'in','ilike'];
|
|
38
27
|
private toastStore:any
|
|
39
28
|
private modalStore:any
|
|
40
29
|
private filtersStore:any
|
|
@@ -81,8 +70,12 @@ export class FrontendAPI implements FrontendAPIInterface {
|
|
|
81
70
|
const filterField = this.coreStore.resourceColumnsWithFilters.find((col: AdminForthResourceColumn) => col.name === filter.field)
|
|
82
71
|
if(!filterField){
|
|
83
72
|
throw new Error(`Field ${filter.field} is not available for filtering`)
|
|
73
|
+
}
|
|
74
|
+
if(filterField) {
|
|
75
|
+
if(!this.validOperators.includes(filter.operator)){
|
|
76
|
+
throw new Error(`Operator ${filter.operator} is not valid`)
|
|
77
|
+
}
|
|
84
78
|
}
|
|
85
|
-
|
|
86
79
|
}
|
|
87
80
|
return true
|
|
88
81
|
}
|
|
@@ -110,13 +103,7 @@ export class FrontendAPI implements FrontendAPIInterface {
|
|
|
110
103
|
if(index === -1) {
|
|
111
104
|
this.filtersStore.setFilter(filter)
|
|
112
105
|
} else {
|
|
113
|
-
|
|
114
|
-
if (filter.value === undefined) {
|
|
115
|
-
filters.splice(index, 1);
|
|
116
|
-
} else {
|
|
117
|
-
filters[index] = filter;
|
|
118
|
-
}
|
|
119
|
-
this.filtersStore.setFilters(filters);
|
|
106
|
+
this.filtersStore.setFilters([...this.filtersStore.filters.slice(0, index), filter, ...this.filtersStore.filters.slice(index + 1)])
|
|
120
107
|
}
|
|
121
108
|
}
|
|
122
109
|
}
|
package/dist/spa/src/main.ts
CHANGED
|
@@ -12,6 +12,7 @@ const router = createRouter({
|
|
|
12
12
|
component: () => import('@/views/LoginView.vue'),
|
|
13
13
|
meta: { title: 'login' },
|
|
14
14
|
beforeEnter: async (to, from, next) => {
|
|
15
|
+
const userStore = useUserStore()
|
|
15
16
|
if(localStorage.getItem('isAuthorized') === 'true'){
|
|
16
17
|
next({name: 'home'})
|
|
17
18
|
} else {
|
package/dist/spa/src/utils.ts
CHANGED
|
@@ -16,7 +16,7 @@ export async function callApi({path, method, body=undefined} ) {
|
|
|
16
16
|
};
|
|
17
17
|
const fullPath = `${import.meta.env.VITE_ADMINFORTH_PUBLIC_PATH || ''}${path}`;
|
|
18
18
|
const r = await fetch(fullPath, options);
|
|
19
|
-
if (r.status == 401
|
|
19
|
+
if (r.status == 401) {
|
|
20
20
|
useUserStore().unauthorize();
|
|
21
21
|
router.push({ name: 'login' });
|
|
22
22
|
return null;
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
@update:record="onUpdateRecord"
|
|
51
51
|
@update:isValid="isValid = $event"
|
|
52
52
|
:validating="validating"
|
|
53
|
-
:
|
|
53
|
+
:customComponentsPerColumn="createComponentsPerColumn"
|
|
54
54
|
>
|
|
55
55
|
</ResourceForm>
|
|
56
56
|
|
|
@@ -91,6 +91,7 @@ const route = useRoute();
|
|
|
91
91
|
const router = useRouter();
|
|
92
92
|
|
|
93
93
|
const record = ref({});
|
|
94
|
+
let createComponentsPerColumn = {};
|
|
94
95
|
|
|
95
96
|
const coreStore = useCoreStore();
|
|
96
97
|
|
|
@@ -114,6 +115,12 @@ onMounted(async () => {
|
|
|
114
115
|
await coreStore.fetchResourceFull({
|
|
115
116
|
resourceId: route.params.resourceId
|
|
116
117
|
});
|
|
118
|
+
createComponentsPerColumn = coreStore.resource.columns.reduce((acc, column) => {
|
|
119
|
+
if (column.components?.create) {
|
|
120
|
+
acc[column.name] = getCustomComponent(column.components.create);
|
|
121
|
+
}
|
|
122
|
+
return acc;
|
|
123
|
+
}, {});
|
|
117
124
|
loading.value = false;
|
|
118
125
|
checkAcessByAllowedActions(coreStore.resourceOptions.allowedActions,'create');
|
|
119
126
|
});
|
|
@@ -136,6 +143,7 @@ async function saveRecord() {
|
|
|
136
143
|
});
|
|
137
144
|
if (response.error) {
|
|
138
145
|
showErrorTost(response.error);
|
|
146
|
+
|
|
139
147
|
}
|
|
140
148
|
saving.value = false;
|
|
141
149
|
if (route.query.returnTo) {
|