@simitgroup/simpleapp-generator 1.1.1 → 1.1.3

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 (76) hide show
  1. package/dist/framework.js +2 -2
  2. package/dist/framework.js.map +1 -1
  3. package/dist/generate.d.ts.map +1 -1
  4. package/dist/generate.js +22 -46
  5. package/dist/generate.js.map +1 -1
  6. package/dist/processors/jsonschemabuilder.js +9 -0
  7. package/dist/processors/jsonschemabuilder.js.map +1 -1
  8. package/dist/storage.d.ts +1 -0
  9. package/dist/storage.d.ts.map +1 -1
  10. package/dist/storage.js +2 -1
  11. package/dist/storage.js.map +1 -1
  12. package/package.json +1 -1
  13. package/src/framework.ts +2 -2
  14. package/src/generate.ts +29 -51
  15. package/src/processors/jsonschemabuilder.ts +12 -2
  16. package/src/storage.ts +2 -1
  17. package/templates/basic/nuxt/pages.[id].vue.eta +3 -2
  18. package/templates/basic/nuxt/pages.form.vue.eta +226 -0
  19. package/templates/basic/nuxt/pages.landing.vue.eta +19 -43
  20. package/templates/basic/nuxt/pages.new.vue.eta +7 -210
  21. package/templates/basic/nuxt/pages.viewer.vue.eta +21 -0
  22. package/templates/basic/nuxt/simpleapp.generate.client.ts.eta +2 -1
  23. package/templates/nest/src/simpleapp/services/docno.service.ts.eta +1 -1
  24. package/templates/nuxt/app.vue.eta +5 -1
  25. package/templates/nuxt/assets/css/style.css._eta +33 -15
  26. package/templates/nuxt/assets/primevue/passthrough.ts._eta +14 -7
  27. package/templates/nuxt/components/debug/DebugDocumentData.vue.eta +23 -22
  28. package/templates/nuxt/components/docPage/DocPageList.vue.eta +117 -0
  29. package/templates/nuxt/components/event/EventDocumentViewer.vue.eta +72 -0
  30. package/templates/nuxt/components/header/HeaderBar.vue.eta +12 -10
  31. package/templates/nuxt/components/header/HeaderBreadcrumb.vue.eta +76 -0
  32. package/templates/nuxt/components/header/button/HeaderButtonMenuPicker.vue.eta +5 -7
  33. package/templates/nuxt/components/header/button/HeaderButtonProfile.vue.eta +39 -8
  34. package/templates/nuxt/components/list/ListView.vue.eta +4 -2
  35. package/templates/nuxt/components/renderer/RendererForeignKey.vue.eta +22 -3
  36. package/templates/nuxt/components/simpleApp/SimpleAppAutocomplete.vue.eta +163 -0
  37. package/templates/nuxt/components/simpleApp/SimpleAppDocumentNo.vue.eta +8 -8
  38. package/templates/nuxt/components/simpleApp/SimpleAppFieldContainer.vue.eta +21 -7
  39. package/templates/nuxt/components/simpleApp/SimpleAppInput.vue.eta +24 -63
  40. package/templates/nuxt/components/table/TableDocuments.vue.eta +15 -9
  41. package/templates/nuxt/components/user/UserButtonCreateTenant.vue.eta +25 -3
  42. package/templates/nuxt/components/user/UserProfileListItem.vue.eta +41 -41
  43. package/templates/nuxt/components/user/UserTenantPicker.vue.eta +26 -14
  44. package/templates/nuxt/composables/getDocument.generate.ts.eta +1 -1
  45. package/templates/nuxt/composables/getUserStore.generate.ts.eta +4 -1
  46. package/templates/nuxt/composables/stringHelper.generate.ts.eta +5 -1
  47. package/templates/nuxt/composables/themes.generate.ts.eta +1 -0
  48. package/templates/nuxt/i18n.config.ts.eta +5 -0
  49. package/templates/nuxt/lang/cn.ts._eta +9 -0
  50. package/templates/nuxt/lang/df.ts.eta +22 -0
  51. package/templates/nuxt/lang/en.ts._eta +6 -0
  52. package/templates/nuxt/layouts/{documentlist.vue.eta → documentlist.vue.eta.disabled} +1 -1
  53. package/templates/nuxt/nuxt.config.ts.eta +49 -16
  54. package/templates/nuxt/pages/[xorg]/docnoformat.vue.eta +11 -81
  55. package/templates/nuxt/pages/[xorg]/organization/[id]/branches/new.vue +1 -1
  56. package/templates/nuxt/pages/[xorg]/organization.vue.eta +10 -0
  57. package/templates/nuxt/pages/[xorg]/profile.vue.eta +3 -0
  58. package/templates/nuxt/pages/[xorg]/user.vue.eta +5 -0
  59. package/templates/nuxt/pages/index.vue._eta +19 -56
  60. package/templates/nuxt/pages/profile.vue.eta +12 -12
  61. package/templates/nuxt/plugins/10.simpleapp-event.ts.eta +3 -0
  62. package/templates/nuxt/plugins/20.simpleapp-userstore.ts.eta +1 -1
  63. package/templates/nuxt/simpleapp/generate/clients/SimpleAppClient.ts.eta +5 -4
  64. package/templates/nuxt/simpleapp/generate/commons/documents.ts.eta +4 -1
  65. package/templates/nuxt/tailwind.config.ts._eta +18 -17
  66. package/templates/nuxt/types/events.ts.eta +12 -0
  67. package/templates/nuxt/types/index.ts.eta +2 -1
  68. package/templates/nuxt/types/others.ts.eta +4 -1
  69. package/templates/nuxt/types/schema.ts.eta +183 -0
  70. package/templates/nuxt/types/simpleappinput.ts.eta +1 -0
  71. package/templates/project/jsonschemas/invoice.json._eta +3 -3
  72. package/templates/project/jsonschemas/product.json._eta +2 -2
  73. package/templates/project/sharelibs/money.ts.eta +2 -3
  74. package/tsconfig.tsbuildinfo +1 -1
  75. /package/templates/nuxt/layouts/{sidelist.vue.eta → sidelist.vue.eta.disabled} +0 -0
  76. /package/templates/nuxt/layouts/{sidelistcrud.vue.eta → sidelistcrud.vue.eta.disabled} +0 -0
@@ -1,16 +1,18 @@
1
1
  <template>
2
- <card>
2
+ <div v-if="alltenants" v-for="tenant in alltenants">
3
+ <card :pt="{ header:{class:'text-xl text-gray-600'}}">
4
+
3
5
  <template #header>
4
- <h1 class="font font-bold text text-gray-700">{{ tenant.tenantName }}</h1>
6
+ {{tenant.tenantName }}
5
7
  </template>
6
8
  <template #content>
7
9
 
8
10
  <ul >
9
- <li v-for="o in orglist">
10
- <h1>{{ o.orgName }}</h1>
11
+ <li v-for="o in getOrglist(tenant)">
12
+ <h1 class="subtitle-text">{{ o.orgName }}</h1>
11
13
  <ul role="list" class="divide-y divide-gray-100 rounded-md border border-gray-200">
12
- <li v-for="b in branchlist" class="flex items-center justify-between py-4 pl-4 pr-5 text-sm leading-6">
13
- <NuxtLink :href="`/${b.xOrg }`" v-if="o.orgId==b.orgId" :external="true" class="hover:bg-primary-100">
14
+ <li v-for="b in getBranchlist(tenant)" class="w-full items-center justify-between py-4 pl-4 pr-4 text-sm route-link-list">
15
+ <NuxtLink :href="`/${b.xOrg }`" v-if="o.orgId==b.orgId" :external="true" >
14
16
  <div class="flex w-full flex-1 items-center ">
15
17
  <!-- <i class="pi pi-sitemap"></i> -->
16
18
  <p class="flex-1 flex-shrink-0 font-bold text-primary-600 ">
@@ -53,23 +55,33 @@
53
55
  </ul> -->
54
56
  </template>
55
57
  </card>
58
+ </div>
56
59
  </template>
57
60
 
58
61
  <script setup lang="ts">
59
62
  import _ from 'lodash'
60
- const props = defineProps<{
61
- tenant:any
62
- }>()
63
- const branchlist = computed(()=>props.tenant.permissions)
63
+ const profileapi = getAllApi().PROFILEApi;
64
+ const alltenants = ref()
64
65
 
65
66
 
66
- const orglist = computed(()=>_.uniqBy(branchlist.value,'orgId')
67
- .map((item:any)=>({ orgId:item.orgId,orgCode:item.orgCode,orgName:item.orgName}) ) )
68
67
 
69
68
 
69
+ const loadAllTenants = async () =>{
70
+ const api = new profileapi(undefined,useRuntimeConfig().public.API_URL,)
71
+ alltenants.value = (await api.getAllTenants()).data
72
+ }
70
73
 
71
- onMounted(()=>{
74
+ // const props = defineProps<{
75
+ // tenant:any
76
+ // }>()
77
+ const getBranchlist = (tenant:any)=>tenant.permissions
72
78
 
73
- })
74
79
 
80
+ const getOrglist = (tenant:any) => _.uniqBy(getBranchlist(tenant),'orgId')
81
+ .map((item:any)=>({ orgId:item.orgId,orgCode:item.orgCode,orgName:item.orgName}) )
82
+
83
+
84
+ onNuxtReady(()=>{
85
+ loadAllTenants()
86
+ })
75
87
  </script>
@@ -1,4 +1,4 @@
1
1
  import {getAllDocuments} from '~/simpleapp/generate/commons/documents'
2
2
  export const getDocument = (docname:string) =>{
3
- return getAllDocuments().find((item)=>item.docName==docname)?.docClass
3
+ return getAllDocuments().find((item)=>item.docName==docname) //?.docClass
4
4
  }
@@ -24,4 +24,7 @@ export const getPageBaseUrl = (resourcename:string) =>{
24
24
  */
25
25
  export const canPerform = (resource:string,action:string):boolean =>{
26
26
  return getUserStore().canPerform(resource,action)
27
- }
27
+ }
28
+
29
+ export const getProfileEmail = () => getUserProfile().email
30
+ export const getProfileFullName = () => getUserProfile().fullName
@@ -1,4 +1,6 @@
1
+ import plugin from 'primevue/config';
1
2
  import {Md5} from 'ts-md5'
3
+
2
4
  export const camelCaseToWords = (s: string) =>{
3
5
  const result = s.replace(/([A-Z])/g, ' $1');
4
6
  return result.charAt(0).toUpperCase() + result.slice(1);
@@ -13,4 +15,6 @@ export const getAvatarLink = (email:string, size:number):string=>{
13
15
  }
14
16
 
15
17
  export const toLocalDate = (dateiso8601:string)=> new Date(String(dateiso8601)).toLocaleDateString()
16
- export const t = (txt:string):string=> camelCaseToWords(txt)
18
+ export const t = (txt:string,options?:any):string => useNuxtApp().$i18n.t(txt,options)
19
+
20
+
@@ -0,0 +1 @@
1
+ export const getAvatarColor = computed(()=>useColorMode().preference == 'dark' ? '#ffffff' : '#000000')
@@ -0,0 +1,5 @@
1
+ export default defineI18nConfig(() => ({
2
+ legacy: false,
3
+ locale: 'df',
4
+
5
+ }))
@@ -0,0 +1,9 @@
1
+ export default {
2
+ welcome:'欢迎',
3
+ welcomeSimpleApp: '你好,欢迎来到 SimpleApp',
4
+ changeHomePageMsg: '改了这面',
5
+ category: '类别',
6
+ /*manually fix from df.ts.eta*/
7
+ }
8
+
9
+ // or
@@ -0,0 +1,22 @@
1
+ export default {
2
+ welcome: 'Welcome',
3
+ create: 'Create',
4
+ profile: 'Profile',
5
+ logout: 'logout',
6
+ language: 'Language',
7
+ theme: 'Theme',
8
+ welcomeSimpleApp: 'Welcome To SimpleApp',
9
+ changeHomePageMsg: '{fullName}, it is product front page and by right you shall replace it with something else.',
10
+ realman:'Real man code with simpleapp',
11
+ new:'New',
12
+ keyword: 'Keyword',
13
+ empty: 'Empty',
14
+ noDataFound:'No Data Found',
15
+
16
+ //auto generate from schema
17
+ <% for(let i=0; i< it.allfields.length; i++){ %>
18
+ <% let f = it.allfields[i] %>
19
+ <%=f%> : '<%= camelCaseToWords(f) %>',
20
+ <%}%>
21
+
22
+ }
@@ -0,0 +1,6 @@
1
+ export default {
2
+ welcome: 'Welcome',
3
+ welcomeSimpleApp: 'Welcome To SimpleApp',
4
+ changeHomePageMsg: 'It is product front page and by right you shall replace it with something else.',
5
+ category: 'Category'
6
+ }
@@ -149,7 +149,7 @@ watch(()=> useRoute().meta ,(newvalue,oldvalue)=>{
149
149
 
150
150
  <HeaderBar />
151
151
  <UserInvitation/>
152
- <TableDocuments :value="recordlist" :columns="tablecolumns" :title="String(useRoute().meta.name)">
152
+ <TableDocuments :value="recordlist" :columns="tablecolumns" :title="t(useRoute().meta.name as string)">
153
153
  <template #toolbar>
154
154
  <div class="w-full text-left">
155
155
  <slot>
@@ -7,11 +7,11 @@
7
7
  import path from 'path'
8
8
  export default defineNuxtConfig({
9
9
  // colorMode: {} ,
10
- runtimeConfig:{
10
+ runtimeConfig:{
11
11
  public:{
12
12
  APP_URL: process.env.APP_URL,
13
13
  API_URL: process.env.API_URL,
14
- DEBUGDATA: process.env.DEBUGDATA,
14
+ DEBUGDATA: process.env.DEBUGDATA,
15
15
  }
16
16
  },
17
17
  vite: {
@@ -26,14 +26,51 @@ tailwindcss: {
26
26
  // Options
27
27
  },
28
28
  modules: [
29
+ // "@hebilicious/authjs-nuxt",
30
+ '@nuxtjs/i18n',
29
31
  '@sidebase/nuxt-auth',
30
32
  'nuxt-primevue',
31
33
  // "nuxt-security", //temporary avoid nuxt-security cause cors
32
34
  '@vueuse/nuxt',
33
35
  '@nuxt/ui',
34
36
  '@nuxtjs/tailwindcss',
35
- '@pinia/nuxt'
37
+ ['@pinia/nuxt',{
38
+ autoImports: [
39
+ // automatically imports `defineStore`
40
+ 'defineStore', // import { defineStore } from 'pinia'
41
+ ['defineStore', 'definePiniaStore'], // import { defineStore as definePiniaStore } from 'pinia'
42
+ ],
43
+ }],
44
+ '@nuxtjs/color-mode',
45
+
46
+
36
47
  ],
48
+ i18n: {
49
+ lazy: true,
50
+ langDir: "lang/",
51
+ strategy: "no_prefix",
52
+ locales: [
53
+ {
54
+ code: "df",
55
+ iso: "df",
56
+ name: "Default",
57
+ file: "df.ts",
58
+ },
59
+ {
60
+ code: "en",
61
+ iso: "en",
62
+ name: "English",
63
+ file: "en.ts",
64
+ },
65
+ {
66
+ code: "cn",
67
+ iso: "cn",
68
+ name: "Chinese",
69
+ file: "cn.ts",
70
+ },
71
+ ],
72
+ defaultLocale: "df",
73
+ },
37
74
  primevue: {
38
75
  options: {
39
76
  unstyled: true,
@@ -52,13 +89,9 @@ tailwindcss: {
52
89
 
53
90
 
54
91
  },
55
- pinia: {
56
- autoImports: [
57
- // automatically imports `defineStore`
58
- 'defineStore', // import { defineStore } from 'pinia'
59
- ['defineStore', 'definePiniaStore'], // import { defineStore as definePiniaStore } from 'pinia'
60
- ],
61
- },
92
+ // pinia: {
93
+
94
+ // },
62
95
  auth: {
63
96
  globalAppMiddleware: true
64
97
  },
@@ -81,12 +114,12 @@ tailwindcss: {
81
114
  // },
82
115
  //csrf: true, // been force to off csrf cash it crash with nuxt-auth
83
116
  // },
84
- ssr: false,
85
- content: [
86
- "./index.html",
87
- "./src/**/*.{vue,js,ts,jsx,tsx}",
88
- "./node_modules/primevue/**/*.{vue,js,ts,jsx,tsx}"
89
- ],
117
+ // ssr: false,
118
+ // content: [
119
+ // "./index.html",
120
+ // "./src/**/*.{vue,js,ts,jsx,tsx}",
121
+ // "./node_modules/primevue/**/*.{vue,js,ts,jsx,tsx}"
122
+ // ],
90
123
  css: [
91
124
  'primeicons/primeicons.css',
92
125
  path.resolve(__dirname,'./assets/css/style.css')
@@ -1,24 +1,19 @@
1
1
  <template>
2
2
  <div class="grid grid-cols-5 p-4">
3
- <ListView :list="getAllDocFormats()"
4
- idField="docType"
5
- titleField="docName"
3
+ <ListView
4
+ :list="getAllDocFormats()"
5
+ idField="docType"
6
+ titleField="docName"
6
7
  subTitleField="docType"
7
8
  :withFilter="true"
8
- :url="getDocumentUrl('docnoformat')"></ListView>
9
+ :url="getDocumentUrl('docnoformat')"
10
+ ></ListView>
9
11
  <div class="col-span-4">
10
12
  <NuxtPage></NuxtPage>
11
13
  </div>
12
14
  </div>
13
-
14
15
  </template>
15
- <script setup lang="ts">
16
-
17
-
18
-
19
- </script>
20
-
21
- <!-- <script setup lang="ts">
16
+ <script setup lang="ts">
22
17
  /**
23
18
  * This file was automatically generated by simpleapp everytime regenerate code.
24
19
  * delete file "delete-me-for-avoid-override" if you want to modify this file and
@@ -27,74 +22,9 @@
27
22
  * author: Ks Tan
28
23
  */
29
24
 
30
- import { CellSetting } from "~/types";
31
- const { $DocnoformatDoc } = useNuxtApp();
32
- const doc = $DocnoformatDoc();
33
- const data = doc.getReactiveData();
34
- const visible = ref(false);
35
-
36
- definePageMeta({
37
- name: "Docnoformat",
38
- layout: "documentlist",
39
- documentName: "docnoformat",
40
- columns: [
41
- {
42
- title: t("branch"),
43
- field: "branch",
44
- rendererName: "RendererForeignKey",
45
- rendererSetting: { collection: "branch" },
46
- },
47
- "docNoFormatNo",
48
- "docNoFormatName",
49
- "docNoType",
50
- "docNoPattern",
51
- "nextNumber",
52
- ] as CellSetting[],
53
- sorts: [["docNoFormatNo", "asc"]],
54
- });
55
-
56
- const newData = () => {
57
- doc.setNew();
58
- goTo(doc.getDocName(), "new");
59
- visible.value = true;
60
- };
61
-
62
- const exitRecord = () => {
63
- goTo(doc.getDocName());
64
- console.log("exitRecord");
65
- };
66
-
67
- watch(
68
- () => useRoute().fullPath,
69
- (newvalue, oldvalue) => {
70
- visible.value = useRoute().params.id ? true : false;
71
- },
72
- );
73
-
74
- onNuxtReady(() => {
75
- visible.value = useRoute().params.id ? true : false;
25
+ definePageMeta({
26
+ name: "docnoformat",
27
+ title: "docnoformat",
76
28
  });
77
29
  </script>
78
- <template>
79
- <div>
80
- <Button
81
- class="bg-primary-600 hover:bg-primary-400 text-white"
82
- v-if="canPerform(String(useRoute().meta.name), 'create')"
83
- @click="newData"
84
- >New</Button
85
- >
86
- <Dialog
87
- v-model:visible="visible"
88
- :pt="{
89
- root: { class: 'w-full h-full bg-white' },
90
- headertitle: { class: 'm-2 ml-6 text-2xl font-bold' },
91
- }"
92
- modal
93
- :header="t(doc.getDocName())"
94
- :autoZIndex="false"
95
- @update:visible="exitRecord"
96
- >
97
- <NuxtPage />
98
- </Dialog>
99
- </div>
100
- </template> -->
30
+
@@ -144,6 +144,6 @@ if (bid.value) {
144
144
  :setting="o.getField('#/properties/description')"
145
145
  />
146
146
  </SimpleAppForm>
147
- <DebugDocumentData v-model="data" label="branch" />
147
+ <DebugDocumentData v-model="data" :label="doc.getDocName()"/>
148
148
  </div>
149
149
  </template>
@@ -44,6 +44,13 @@ const refresh = () => {
44
44
  $event("RefreshDocumentList", { documentName: doc.getDocName() });
45
45
  };
46
46
 
47
+
48
+ definePageMeta({
49
+ name: 'organization',
50
+ title: 'organization'
51
+ })
52
+
53
+
47
54
  //branch record update then reload
48
55
  $listen("RefreshDocumentList", (data) => {
49
56
  console.log("refresh from branch", data.documentName, "==", doc.getDocName());
@@ -56,6 +63,9 @@ if (id) {
56
63
  fetchRecord(id.value);
57
64
  }
58
65
 
66
+
67
+
68
+
59
69
  getCurrentOrg();
60
70
  </script>
61
71
  <template>
@@ -3,4 +3,7 @@
3
3
  </template>
4
4
  <script setup lang="ts">
5
5
  import profile from '../profile.vue'
6
+ definePageMeta({
7
+ title: 'profile'
8
+ })
6
9
  </script>
@@ -129,6 +129,11 @@ $listen("RefreshUser", () => {
129
129
  onMounted(() => {
130
130
  refreshList();
131
131
  });
132
+
133
+ definePageMeta({
134
+ name: 'user',
135
+ title: 'user'
136
+ })
132
137
  </script>
133
138
  <template>
134
139
  <div class="grid grid-cols-4">
@@ -1,67 +1,30 @@
1
1
  <script lang="ts" setup>
2
2
  /**
3
- * This file was automatically generated by simpleapp generator. Every
4
- * MODIFICATION OVERRIDE BY GENERATEOR
5
- * last change 2023-10-28
3
+ * This file was automatically generated by simpleapp generator
4
+ * CHANGE IT!!
5
+ * last change 2023-11-12
6
6
  * Author: Ks Tan
7
7
  */
8
-
9
- import _ from "lodash";
10
- // import InputText from "primevue/inputtext";
11
- // import Dialog from "primevue/dialog";
12
- import { ref, Ref } from "vue";
13
- // import { EventType } from "~/types";
14
- // import { TenantDoc } from "../simpleapp/docs/TenantDoc";
15
- // import ProgressSpinner from "primevue/progressspinner";
16
- // import Panel from "primevue/panel";
17
- // import Card from "primevue/card";
18
- // import { AxiosResponse } from "axios";
19
- import {computed} from 'vue'
20
- const { $event, $listen, $userstore } = useNuxtApp();
21
- const branches = ref([]);
22
- const userprofile = ref();
23
- const orgList = ref();
24
- const alltenants = ref()
25
-
26
- const loadTenants = async () => {
27
- const profileapi = getAllApi().PROFILEApi;
28
- const axiosreturn = await new profileapi(
29
- undefined,
30
- useRuntimeConfig().public.API_URL,
31
- ).getAllTenants();
32
- alltenants.value = axiosreturn.data
33
- };
34
-
35
- // $listen("InvitationAccepted", async () => {
36
- // loadProfile();
37
- // });
38
-
39
- onMounted(() => {
40
- loadTenants();
41
-
42
- // const profileapi = getApi().PROFILEApi;
43
- });
44
8
  </script>
45
9
  <template>
46
- <div
47
- class="mx-4 md:mx-12 py-8 md:py-12 grid place-content-center px-4 md:px-0"
48
- >
49
- <div class="lg:flex justify-start lg:gap-28">
50
- <div class="">
51
- <h1 class="font-bold text-5xl text-gray-800 dark:text-white">
52
- Welcome To SimpleApp
10
+ <div class="grid place-content-center">
11
+ <ClientOnly><div class="flex flex-row">
12
+ <div class="block">
13
+ <h1
14
+ class="font-bold text-3xl md:text-5xl text-gray-800 dark:text-white"
15
+ >
16
+ {{ t("welcomeSimpleApp") }}
53
17
  </h1>
54
- <p class="pt-8 md:pt-4 text-gray-600 dark:text-gray-200">
55
- It is product front page and by right you shall replace it with
56
- something else.
18
+ <p class="text-gray-600 dark:text-gray-200">
19
+ {{ t("changeHomePageMsg",{fullName:getProfileFullName()}) }}
57
20
  </p>
58
- <div class="mt-8 md:flex justify-start md:gap-4">
21
+ <div class="">
59
22
  <UserButtonCreateTenant></UserButtonCreateTenant>
60
23
  </div>
61
24
  </div>
62
- <div class="pt-8 lg:pt-0">
25
+ <div class="hidden lg:block">
63
26
  <svg
64
- fill="#000000"
27
+ :fill="getAvatarColor"
65
28
  viewBox="0 0 512 512"
66
29
  xmlns="http://www.w3.org/2000/svg"
67
30
  >
@@ -91,11 +54,11 @@ onMounted(() => {
91
54
  </g>
92
55
  </g>
93
56
  </svg>
94
- <p class="text-gray-500">Real man code with simpleapp</p>
57
+ <p class="text-gray-500 dark:text-gray-200">{{ t('realman') }}</p>
95
58
  </div>
96
- </div>
97
- <div class="grid grid-cols-2">
98
- <UserTenantPicker v-for="tenant in alltenants" :tenant="tenant" class="col col-span-1"></UserTenantPicker>
59
+ </div></ClientOnly>
60
+ <div class="grid grid-cols-1 lg:grid-cols-2 2xl:grid-cols-3">
61
+ <UserTenantPicker></UserTenantPicker>
99
62
  </div>
100
63
  </div>
101
64
  </template>
@@ -1,41 +1,41 @@
1
1
  <template>
2
2
  <div class="p-4">
3
3
  <div class="px-4 sm:px-0">
4
- <h3 class="text-base font-semibold leading-7 text-gray-900">
4
+ <h3 class="text-base font-semibold leading-7 text-gray-900 dark:text-gray-400">
5
5
  User Information
6
6
  </h3>
7
7
  </div>
8
8
  <div class="mt-6 border-t border-gray-100">
9
9
  <dl class="divide-y divide-gray-100">
10
10
  <div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
11
- <dt class="text-sm font-medium leading-6 text-gray-900">Full name</dt>
11
+ <dt class="text-sm font-medium leading-6 text-gray-900 dark:text-gray-400">Full name</dt>
12
12
  <dd
13
- class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"
13
+ class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0 dark:text-gray-300"
14
14
  >
15
15
  {{ getUserProfile().fullName }}
16
16
  </dd>
17
17
  </div>
18
18
  <div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
19
- <dt class="text-sm font-medium leading-6 text-gray-900">Group</dt>
19
+ <dt class="text-sm font-medium leading-6 text-gray-900 dark:text-gray-400">Group</dt>
20
20
  <dd
21
- class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"
21
+ class="mt-1 text-sm leading-6 text-gray-700 dark:text-gray-300 sm:col-span-2 sm:mt-0"
22
22
  >
23
23
  {{ getUserProfile().group }}
24
24
  </dd>
25
25
  </div>
26
26
  <div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
27
- <dt class="text-sm font-medium leading-6 text-gray-900">
27
+ <dt class="text-sm font-medium leading-6 text-gray-900 dark:text-gray-400">
28
28
  Email address
29
29
  </dt>
30
30
  <dd
31
- class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"
31
+ class="mt-1 text-sm leading-6 text-gray-700 dark:text-gray-300 sm:col-span-2 sm:mt-0"
32
32
  >
33
- {{ getUserProfile().email }}
33
+ {{ getProfileEmail() }}
34
34
  </dd>
35
35
  </div>
36
36
 
37
37
  <div class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0">
38
- <dt class="text-sm font-medium leading-6 text-gray-900">
38
+ <dt class="text-sm font-medium leading-6 text-gray-900 dark:text-gray-400">
39
39
  Branch Access
40
40
  </dt>
41
41
  <dd class="mt-2 text-sm text-gray-900 sm:col-span-2 sm:mt-0">
@@ -75,15 +75,15 @@
75
75
 
76
76
  <div
77
77
  v-if="useRuntimeConfig().public.DEBUGDATA == '1'"
78
- class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 bg-warning-100"
78
+ class="px-4 py-6 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-0 "
79
79
  >
80
- <dt class="text-sm font-medium leading-6 text-gray-900">
80
+ <dt class="text-sm font-medium leading-6 text-gray-900 dark:text-gray-400">
81
81
  Current Branch Access Rights
82
82
  <p class="text-danger-600">only appear in debug mode</p>
83
83
  <p class="text-danger-600">{{ getUserProfile().sessionId }}</p>
84
84
  </dt>
85
85
  <dd
86
- class="mt-1 text-sm leading-6 text-gray-700 sm:col-span-2 sm:mt-0"
86
+ class="mt-1 text-sm leading-6 text-gray-700 dark:text-gray-300 sm:col-span-2 sm:mt-0"
87
87
  >
88
88
  {{ getUserProfile().roles }}
89
89
  </dd>
@@ -4,6 +4,7 @@
4
4
  * last change 2023-10-28
5
5
  * Author: Ks Tan
6
6
  */
7
+ import DialogService from 'primevue/dialogservice';
7
8
  import { defineNuxtPlugin } from "#app";
8
9
  import axios, { Axios, AxiosResponse } from 'axios'
9
10
  import {Notification,EventType} from '~/types'
@@ -18,6 +19,7 @@ export default defineNuxtPlugin( async(nuxtApp) => {
18
19
  onNuxtReady(()=>{
19
20
  window.__NUXT__ = undefined;
20
21
  })
22
+ // useNuxtApp().vueApp.use(DialogService)
21
23
  //const { csrf } = useCsrf()
22
24
  //axios.defaults.headers.common = {"CSRF-TOKEN": csrf};
23
25
  const myaxios = axios.create({timeout:5000})
@@ -54,6 +56,7 @@ export default defineNuxtPlugin( async(nuxtApp) => {
54
56
 
55
57
  return {
56
58
  provide: {
59
+
57
60
  event: emitter.emit, // Will emit an event
58
61
  listen: emitter.on, // Will register a listener for an event
59
62
  axios: myaxios,
@@ -50,7 +50,7 @@ export default defineNuxtPlugin( async(nuxtApp) => {
50
50
  }else{
51
51
  apiurl = `${useRuntimeConfig().public.APP_URL}/api/${xorg}`
52
52
  }
53
- console.log(apiurl)
53
+
54
54
  return await new PROFILEApi(undefined,apiurl,$axios).getProfile().then((res:AxiosResponse)=>{
55
55
  if(!res){
56
56
  return
@@ -10,7 +10,8 @@ import addErrors from 'ajv-errors';
10
10
  import { ref } from 'vue';
11
11
  import type { Ref } from 'vue';
12
12
  import type { AxiosResponse } from 'axios';
13
- import {SearchBody,Notification,NotificationStatus} from '~/types'
13
+ import {SearchBody,Notification,NotificationStatus,SchemaType} from '~/types'
14
+
14
15
  // import { useToast, } from 'primevue/usetoast';
15
16
  // import type { ToastMessageOptions } from 'primevue/toast';
16
17
  // const toast = useToast();
@@ -31,7 +32,7 @@ export class SimpleAppClient<
31
32
  public event:Function|null=null;
32
33
  public listen:Function|null=null;
33
34
  protected data = <Ref<TData>>ref({} as TData);
34
- public schema = {}; //cant define data type, cause it make autocomplete gone.
35
+ public schema = {} as SchemaType; //cant define data type, cause it make autocomplete gone.
35
36
  protected doctype = '';
36
37
  protected docname = '';
37
38
  protected errorlist = ref({});
@@ -46,8 +47,8 @@ export class SimpleAppClient<
46
47
  getDocName = () => this.docname;
47
48
  setNew = ()=>{}
48
49
  isNew = () => this.data.value['created']==''
49
- setSchema = (schema: any) => (this.schema = schema);
50
- getSchema = () => this.schema;
50
+ setSchema = (schema: SchemaType) => (this.schema = schema);
51
+ getSchema = ():SchemaType=> this.schema;
51
52
  getErrors = () => this.errorlist;
52
53
  getData = () => this.data.value;
53
54
  getApi = () =>this.docapi;