w-web-perm 1.0.45 → 1.0.47

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/.github/workflows/ci-test.yml +1 -1
  2. package/db/wperm/grups/data.mdb +0 -0
  3. package/db/wperm/grups/lock.mdb +0 -0
  4. package/db/wperm/pemis/data.mdb +0 -0
  5. package/db/wperm/pemis/lock.mdb +0 -0
  6. package/db/wperm/targets/data.mdb +0 -0
  7. package/db/wperm/targets/lock.mdb +0 -0
  8. package/db/wperm/users/data.mdb +0 -0
  9. package/db/wperm/users/lock.mdb +0 -0
  10. package/dist/css/app.30e81bfe.css +1 -0
  11. package/dist/css/chunk-vendors.f149e124.css +1 -0
  12. package/dist/index.tmp +1 -1
  13. package/dist/js/app-legacy.f1277a07.js +1 -0
  14. package/dist/js/app.f1277a07.js +1 -0
  15. package/dist/js/chunk-vendors-legacy.e8703728.js +21 -0
  16. package/dist/js/chunk-vendors.e8703728.js +21 -0
  17. package/dist/w-web-perm.umd.js +2 -2
  18. package/dist/w-web-perm.umd.js.map +1 -1
  19. package/docs/WWebPerm.html +2 -2
  20. package/docs/WWebPerm.mjs.html +9 -5
  21. package/docs/index.html +1 -1
  22. package/g.initialData.mjs +3 -3
  23. package/g.provideUsers.mjs +3 -3
  24. package/package.json +7 -6
  25. package/server/WWebPerm.mjs +8 -4
  26. package/{src/plugins/mLang.mjs → server/procLang.mjs} +837 -754
  27. package/src/components/LayoutContentGrups.vue +26 -62
  28. package/src/components/LayoutContentPemis.vue +26 -62
  29. package/src/components/LayoutContentTargets.vue +16 -45
  30. package/src/components/LayoutContentUsers.vue +30 -90
  31. package/src/components/VeCgrups.vue +15 -46
  32. package/src/components/VeCpemis.vue +15 -46
  33. package/src/components/VeCrules.vue +11 -26
  34. package/src/components/VeGrupBlngUsers.vue +26 -72
  35. package/src/components/VePemiBlngGrups.vue +26 -72
  36. package/src/plugins/mUI.mjs +35 -60
  37. package/src/schema/tables/users.mjs +3 -3
  38. package/tableTags.json +1 -1
  39. package/test/getUserRules.test.mjs +899 -0
  40. package/dist/css/app.5eabcb89.css +0 -1
  41. package/dist/js/app-legacy.d506ca61.js +0 -1
  42. package/dist/js/app.d506ca61.js +0 -1
  43. package/dist/js/chunk-vendors-legacy.18b85e4c.js +0 -14
  44. package/dist/js/chunk-vendors.18b85e4c.js +0 -14
  45. package/test/all.test.mjs +0 -10
@@ -22,7 +22,6 @@ import delay from 'wsemi/src/delay.mjs'
22
22
  import isarr from 'wsemi/src/isarr.mjs'
23
23
  import isestr from 'wsemi/src/isestr.mjs'
24
24
  import isfun from 'wsemi/src/isfun.mjs'
25
- import iseobj from 'wsemi/src/iseobj.mjs'
26
25
  import isearr from 'wsemi/src/isearr.mjs'
27
26
  import isEle from 'wsemi/src/isEle.mjs'
28
27
  import strleft from 'wsemi/src/strleft.mjs'
@@ -42,12 +41,36 @@ import replace from 'wsemi/src/replace.mjs'
42
41
  import timemsTZ2past from 'wsemi/src/timemsTZ2past.mjs'
43
42
  import convertToTree from 'wsemi/src/convertToTree.mjs'
44
43
  // import WUiDwload from 'w-ui-dwload/src/WUiDwload.mjs'
45
- import kpLang from './mLang.mjs'
46
44
 
47
45
 
48
46
  let vo = Vue.prototype
49
47
 
50
48
 
49
+ //連線建立前的 fallback 專用, 僅含連線狀態字串, 其餘語系皆由後端提供
50
+ let kpFallback = {
51
+ csIng: {
52
+ eng: 'Connecting...',
53
+ cht: '連線中...',
54
+ },
55
+ csLogin: {
56
+ eng: 'Logged in',
57
+ cht: '已登入',
58
+ },
59
+ csLogout: {
60
+ eng: 'Logged out',
61
+ cht: '已登出',
62
+ },
63
+ csErrConn: {
64
+ eng: 'Unable to connect',
65
+ cht: '無法連線',
66
+ },
67
+ csErrLogin: {
68
+ eng: 'Login denied',
69
+ cht: '拒絕登入',
70
+ },
71
+ }
72
+
73
+
51
74
  function setVo(vObj) {
52
75
  vo = vObj
53
76
  }
@@ -156,73 +179,20 @@ function setLang(lang = null, from = '') {
156
179
  }
157
180
  }
158
181
 
159
- //genKpText, 切換lang得調用getKpLang重算kpText
160
- genKpText(lang)
161
-
162
- //forceUpdate
163
- forceUpdate()
164
-
165
- }
166
-
167
-
168
- function genKpText(lang) {
169
- // console.log('genKpText', lang)
170
-
171
- //kp
172
- let kp = {}
173
-
174
182
  //kpLang
175
- kp = {
176
- ...kp,
177
- ...kpLang,
178
- }
179
-
180
- //kpLangExt
181
- let kpLangExt = get(vo, '$store.state.webInfor.kpLangExt', {})
182
- // console.log('kpLangExt', kpLangExt)
183
- if (iseobj(kpLangExt)) {
184
- kp = {
185
- ...kp,
186
- ...kpLangExt,
187
- }
188
- }
189
-
190
- //webName
191
- let webName = get(vo, '$store.state.webInfor.webName', {})
192
- // console.log('webName', webName)
193
- if (iseobj(webName)) {
194
- kp = {
195
- ...kp,
196
- webName: {
197
- ...webName,
198
- },
199
- }
200
- }
201
-
202
- //webDescription
203
- let webDescription = get(vo, '$store.state.webInfor.webDescription', {})
204
- // console.log('webDescription', webDescription)
205
- if (iseobj(webDescription)) {
206
- kp = {
207
- ...kp,
208
- webDescription: {
209
- ...webDescription,
210
- },
211
- }
212
- }
183
+ let kpLang = get(vo, '$store.state.webInfor.kpLang', {})
213
184
 
214
185
  //kpText
215
- let kpText = {}
216
- each(kp, (v, k) => {
217
- kpText[k] = v[lang]
218
- })
219
- // console.log('kp', kp)
186
+ let kpText = get(kpLang, lang, {})
220
187
  // console.log('kpText', kpText)
221
188
 
222
189
  //commit
223
190
  vo.$store.commit(vo.$store.types.UpdateKpText, kpText)
224
191
  // console.log('commit kpText', kpText)
225
192
 
193
+ //forceUpdate
194
+ forceUpdate()
195
+
226
196
  }
227
197
 
228
198
 
@@ -235,6 +205,11 @@ function getKpText(key) {
235
205
 
236
206
  //t
237
207
  let t = get(kpText, key, '')
208
+ if (!isestr(t)) {
209
+ // fallback: 後端語系尚未載入時使用預設值
210
+ let lang = getLang()
211
+ t = get(kpFallback, `${key}.${lang}`, '')
212
+ }
238
213
  if (!isestr(t)) {
239
214
  t = key
240
215
  }
@@ -127,9 +127,9 @@ let funTest = () => {
127
127
  isAdmin,
128
128
  })
129
129
  v.id = `id-for-${name}`
130
- if (name === 'john') {
131
- v.email = `${v.email};john@test.com`
132
- }
130
+ // if (name === 'john') {
131
+ // v.email = `${v.email};john@test.com`
132
+ // }
133
133
  v.isAdmin = isAdmin
134
134
  v = dtpick(v, keys(settings))
135
135
  return v
package/tableTags.json CHANGED
@@ -1 +1 @@
1
- {"grups":"2025-07-24T23:53:43+08:00|kqQUfj","pemis":"2025-07-24T23:53:43+08:00|JIx6QG","targets":"2025-07-24T23:53:43+08:00|DLziCS","users":"2025-07-24T23:53:43+08:00|qBeZwW"}
1
+ {"grups":"2026-03-26T16:16:47+08:00|OgUEFl","pemis":"2026-03-26T16:16:47+08:00|ZQqITs","targets":"2026-03-26T16:16:47+08:00|c3veRF","users":"2026-03-26T16:16:47+08:00|pCsk2f"}