adminforth 1.2.39 → 1.2.41

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 (45) hide show
  1. package/dataConnectors/mongo.ts +8 -5
  2. package/dist/dataConnectors/mongo.js +5 -1
  3. package/dist/spa/index.html +4 -4
  4. package/dist/spa/package-lock.json +5 -206
  5. package/dist/spa/package.json +2 -8
  6. package/dist/spa/public/favicon.ico +0 -0
  7. package/dist/spa/spa/public/favicon.ico +0 -0
  8. package/dist/spa/spa/src/views/HomeView.vue +8 -0
  9. package/dist/spa/src/App.vue +72 -171
  10. package/dist/spa/src/assets/logo.svg +1 -19
  11. package/dist/spa/src/components/AcceptModal.vue +10 -3
  12. package/dist/spa/src/components/BreadcrumbsWithButtons.vue +1 -1
  13. package/dist/spa/src/components/CustomDatePicker.vue +6 -19
  14. package/dist/spa/src/components/CustomDateRangePicker.vue +5 -14
  15. package/dist/spa/src/components/Dropdown.vue +5 -19
  16. package/dist/spa/src/components/Filters.vue +37 -91
  17. package/dist/spa/src/components/MenuLink.vue +2 -2
  18. package/dist/spa/src/components/ResourceForm.vue +103 -163
  19. package/dist/spa/src/components/ValueRenderer.vue +6 -22
  20. package/dist/spa/src/main.ts +1 -1
  21. package/dist/spa/src/router/index.ts +19 -30
  22. package/dist/spa/src/stores/core.ts +59 -65
  23. package/dist/spa/src/stores/modal.ts +3 -13
  24. package/dist/spa/src/utils.ts +8 -65
  25. package/dist/spa/src/views/CreateView.vue +16 -76
  26. package/dist/spa/src/views/EditView.vue +14 -76
  27. package/dist/spa/src/views/HomeView.vue +8 -0
  28. package/dist/spa/src/views/ListView.vue +360 -88
  29. package/dist/spa/src/views/LoginView.vue +5 -17
  30. package/dist/spa/src/views/ResourceParent.vue +1 -1
  31. package/dist/spa/src/views/ShowView.vue +19 -114
  32. package/dist/spa/tailwind.config.js +2 -5
  33. package/dist/spa/vite.config.ts +0 -6
  34. package/dist/types.js +30 -0
  35. package/package.json +1 -1
  36. package/dist/spa/public/assets/favicon.png +0 -0
  37. package/dist/spa/src/components/CustomRangePicker.vue +0 -148
  38. package/dist/spa/src/components/ResourceListTable.vue +0 -419
  39. package/dist/spa/src/components/Toast.vue +0 -66
  40. package/dist/spa/src/composables/useFrontendApi.ts +0 -26
  41. package/dist/spa/src/composables/useStores.ts +0 -113
  42. package/dist/spa/src/spa_types/core.ts +0 -51
  43. package/dist/spa/src/stores/filters.ts +0 -22
  44. package/dist/spa/src/stores/toast.ts +0 -15
  45. 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
- });