adminforth 1.2.38 → 1.2.40

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.
Files changed (49) hide show
  1. package/basePlugin.ts +4 -5
  2. package/dataConnectors/mongo.ts +7 -5
  3. package/dist/basePlugin.js +2 -4
  4. package/dist/dataConnectors/mongo.js +4 -1
  5. package/dist/modules/configValidator.js +2 -3
  6. package/dist/spa/index.html +4 -4
  7. package/dist/spa/package-lock.json +5 -206
  8. package/dist/spa/package.json +2 -8
  9. package/dist/spa/public/favicon.ico +0 -0
  10. package/dist/spa/spa/public/favicon.ico +0 -0
  11. package/dist/spa/spa/src/views/HomeView.vue +8 -0
  12. package/dist/spa/src/App.vue +72 -171
  13. package/dist/spa/src/assets/logo.svg +1 -19
  14. package/dist/spa/src/components/AcceptModal.vue +10 -3
  15. package/dist/spa/src/components/BreadcrumbsWithButtons.vue +1 -1
  16. package/dist/spa/src/components/CustomDatePicker.vue +6 -19
  17. package/dist/spa/src/components/CustomDateRangePicker.vue +5 -14
  18. package/dist/spa/src/components/Dropdown.vue +5 -19
  19. package/dist/spa/src/components/Filters.vue +37 -91
  20. package/dist/spa/src/components/MenuLink.vue +2 -2
  21. package/dist/spa/src/components/ResourceForm.vue +103 -163
  22. package/dist/spa/src/components/ValueRenderer.vue +6 -22
  23. package/dist/spa/src/main.ts +1 -1
  24. package/dist/spa/src/router/index.ts +19 -30
  25. package/dist/spa/src/stores/core.ts +59 -65
  26. package/dist/spa/src/stores/modal.ts +3 -13
  27. package/dist/spa/src/utils.ts +8 -65
  28. package/dist/spa/src/views/CreateView.vue +16 -76
  29. package/dist/spa/src/views/EditView.vue +14 -76
  30. package/dist/spa/src/views/HomeView.vue +8 -0
  31. package/dist/spa/src/views/ListView.vue +360 -88
  32. package/dist/spa/src/views/LoginView.vue +5 -17
  33. package/dist/spa/src/views/ResourceParent.vue +1 -1
  34. package/dist/spa/src/views/ShowView.vue +19 -114
  35. package/dist/spa/tailwind.config.js +2 -5
  36. package/dist/spa/vite.config.ts +0 -6
  37. package/dist/types.js +30 -0
  38. package/modules/configValidator.ts +4 -3
  39. package/package.json +1 -3
  40. package/dist/spa/public/assets/favicon.png +0 -0
  41. package/dist/spa/src/components/CustomRangePicker.vue +0 -148
  42. package/dist/spa/src/components/ResourceListTable.vue +0 -419
  43. package/dist/spa/src/components/Toast.vue +0 -66
  44. package/dist/spa/src/composables/useFrontendApi.ts +0 -26
  45. package/dist/spa/src/composables/useStores.ts +0 -113
  46. package/dist/spa/src/spa_types/core.ts +0 -51
  47. package/dist/spa/src/stores/filters.ts +0 -22
  48. package/dist/spa/src/stores/toast.ts +0 -15
  49. package/dist/spa/src/stores/user.ts +0 -54
@@ -1,22 +0,0 @@
1
- import { ref } from 'vue'
2
- import { defineStore } from 'pinia'
3
- import { callAdminForthApi } from '@/utils';
4
-
5
- export const useFiltersStore = defineStore('filters', () => {
6
- const filters = ref([]);
7
- const setFilter = (filter: any) => {
8
- filters.value = [...filters.value, filter];
9
- }
10
- const setFilters = (f: any) => {
11
- filters.value = [...f];
12
- }
13
- const getFilters = () => {
14
- return filters.value;
15
- }
16
- const clearFilters = () => {
17
- filters.value = [];
18
- }
19
- return {setFilter, getFilters,clearFilters, filters,setFilters}
20
- })
21
-
22
-
@@ -1,15 +0,0 @@
1
- import { ref, computed } from 'vue'
2
- import { defineStore } from 'pinia'
3
- import { callAdminForthApi } from '@/utils';
4
- import { v1 as uuid } from 'uuid';
5
-
6
- export const useToastStore = defineStore('toast', () => {
7
- const toasts = ref([]);
8
- const addToast = (toast) => {
9
- toasts.value.push({...toast, id: uuid()});
10
- };
11
- const removeToast = (toast) => {
12
- toasts.value = toasts.value.filter((t) => t.id !== toast.id);
13
- };
14
- return { toasts, addToast, removeToast };
15
- });
@@ -1,54 +0,0 @@
1
- import {ref} from 'vue';
2
- import {defineStore} from 'pinia';
3
- import { callAdminForthApi } from '@/utils';
4
-
5
- export const useUserStore = defineStore('user', () => {
6
- const isAuthorized = ref(false);
7
-
8
- function authorize() {
9
- isAuthorized.value = true;
10
- localStorage.setItem('isAuthorized', 'true');
11
- }
12
-
13
- function unauthorize() {
14
- isAuthorized.value = false;
15
- localStorage.setItem('isAuthorized', 'false');
16
- }
17
-
18
- async function logout() {
19
- await callAdminForthApi({
20
- path: '/logout',
21
- method: 'POST',
22
- });
23
- unauthorize();
24
- }
25
-
26
- // async function checkAuth( skipApiCall = false){
27
- // console.log('checkAuth', isAuthorized.value, skipApiCall)
28
- // if(isAuthorized.value) {
29
- // return true}
30
- // else {
31
- // if(skipApiCall) return false;
32
- // const resp = await callAdminForthApi({
33
- // path: '/check_auth',
34
- // method: 'POST',
35
- // });
36
- // if (resp.status !== 401) {
37
- // authorize();
38
- // return true;
39
- // }
40
- // else {
41
- // unauthorize();
42
- // return false;}
43
- // }
44
-
45
- // }
46
-
47
- return {
48
- isAuthorized,
49
- authorize,
50
- unauthorize,
51
- logout
52
- }
53
-
54
- });