w-web-perm 1.0.48 → 1.0.49

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 (95) hide show
  1. package/.github/workflows/ci-test.yml +2 -2
  2. package/_gh-pages-deploy/.nojekyll +0 -0
  3. package/_gh-pages-deploy/WWebPerm.html +938 -0
  4. package/_gh-pages-deploy/WWebPerm.mjs.html +1228 -0
  5. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  6. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  7. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  8. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  9. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  10. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  11. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  12. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  13. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  14. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  15. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  16. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  17. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  18. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  19. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  20. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  21. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  22. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  23. package/_gh-pages-deploy/index.html +84 -0
  24. package/_gh-pages-deploy/scripts/collapse.js +39 -0
  25. package/_gh-pages-deploy/scripts/commonNav.js +28 -0
  26. package/_gh-pages-deploy/scripts/linenumber.js +25 -0
  27. package/_gh-pages-deploy/scripts/nav.js +12 -0
  28. package/_gh-pages-deploy/scripts/polyfill.js +4 -0
  29. package/_gh-pages-deploy/scripts/prettify/Apache-License-2.0.txt +202 -0
  30. package/_gh-pages-deploy/scripts/prettify/lang-css.js +2 -0
  31. package/_gh-pages-deploy/scripts/prettify/prettify.js +28 -0
  32. package/_gh-pages-deploy/scripts/search.js +99 -0
  33. package/_gh-pages-deploy/styles/jsdoc.css +776 -0
  34. package/_gh-pages-deploy/styles/prettify.css +80 -0
  35. package/dist/css/app.d8b16216.css +1 -0
  36. package/dist/css/{chunk-vendors.f149e124.css → chunk-vendors.2d3ef2ba.css} +1 -1
  37. package/dist/index.tmp +2 -2
  38. package/dist/js/app-legacy.fb48310a.js +1 -0
  39. package/dist/js/app.fb48310a.js +1 -0
  40. package/dist/js/chunk-vendors-legacy.8fdd4435.js +21 -0
  41. package/dist/js/chunk-vendors.8fdd4435.js +21 -0
  42. package/dist/w-web-perm.umd.js +2 -2
  43. package/dist/w-web-perm.umd.js.map +1 -1
  44. package/docs/WWebPerm.html +2 -2
  45. package/docs/WWebPerm.mjs.html +138 -199
  46. package/docs/index.html +1 -1
  47. package/package.json +15 -11
  48. package/public/index.html +2 -2
  49. package/server/WWebPerm.mjs +137 -198
  50. package/server/procCore.mjs +169 -0
  51. package/server/procLang.mjs +197 -0
  52. package/server/procStaInfor.mjs +118 -0
  53. package/server/provideTabs.mjs +1 -1
  54. package/server/srLog.mjs +30 -0
  55. package/server/staLogs/staEvent.callWorker.mjs +46 -0
  56. package/server/staLogs/staEvent.mjs +116 -0
  57. package/server/staLogs/staEvent.shellWorker.mjs +19 -0
  58. package/server/staLogs/staEventTable.mjs +100 -0
  59. package/server/staLogs/test_staEvent.mjs +22 -0
  60. package/settings.json +40 -0
  61. package/src/components/Common/CheckYes.vue +18 -1
  62. package/src/components/Layout.vue +1 -1
  63. package/src/components/LayoutContent.vue +13 -1
  64. package/src/components/LayoutContentGrups.vue +32 -23
  65. package/src/components/LayoutContentPemis.vue +32 -23
  66. package/src/components/LayoutContentStaInfor.vue +536 -0
  67. package/src/components/LayoutContentTargets.vue +32 -23
  68. package/src/components/LayoutContentUsers.vue +32 -23
  69. package/src/components/LayoutState.vue +5 -0
  70. package/src/components/VeCgrups.vue +12 -3
  71. package/src/components/VeCpemis.vue +12 -3
  72. package/src/components/VeCrules.vue +12 -3
  73. package/src/components/VeGrupBlngUsers.vue +18 -6
  74. package/src/components/VePemiBlngGrups.vue +18 -6
  75. package/src/getPerm.mjs +7 -17
  76. package/src/getPermUserInfor.mjs +8 -18
  77. package/src/main.js +1 -0
  78. package/src/plugins/mShare.mjs +8 -13
  79. package/src/plugins/mUI.mjs +11 -0
  80. package/srv.mjs +76 -101
  81. package/tableTags.json +1 -1
  82. package/db/wperm/grups/data.mdb +0 -0
  83. package/db/wperm/grups/lock.mdb +0 -0
  84. package/db/wperm/pemis/data.mdb +0 -0
  85. package/db/wperm/pemis/lock.mdb +0 -0
  86. package/db/wperm/targets/data.mdb +0 -0
  87. package/db/wperm/targets/lock.mdb +0 -0
  88. package/db/wperm/users/data.mdb +0 -0
  89. package/db/wperm/users/lock.mdb +0 -0
  90. package/dist/css/app.30e81bfe.css +0 -1
  91. package/dist/js/app-legacy.3324392e.js +0 -1
  92. package/dist/js/app.3324392e.js +0 -1
  93. package/dist/js/chunk-vendors-legacy.e8703728.js +0 -21
  94. package/dist/js/chunk-vendors.e8703728.js +0 -21
  95. package/test/getUserRules.test.mjs +0 -899
package/srv.mjs CHANGED
@@ -1,101 +1,76 @@
1
- import WOrm from 'w-orm-lmdb/src/WOrmLmdb.mjs'
2
- import WWebPerm from './server/WWebPerm.mjs'
3
- import getSettings from './g.getSettings.mjs'
4
-
5
-
6
- //st
7
- let st = getSettings()
8
-
9
- let url = st.dbUrl
10
- let db = st.dbName
11
- let opt = {
12
-
13
- useCheckUser: false,
14
- getUserById: null,
15
- useExcludeWhenNotAdmin: false,
16
-
17
- serverPort: 11006,
18
- subfolder: '', //mperm
19
- urlRedirect: 'https://www.google.com/', //本機測試時得先編譯, 再瀏覽: http://localhost:11006/
20
-
21
- showLanguage: 'y', //'n',
22
- language: 'eng', //'eng', 'cht'
23
-
24
- showModeEditTargets: 'y', //'n',
25
- showModeEditPemis: 'y',
26
- showModeEditGrups: 'y',
27
- showModeEditUsers: 'y',
28
- modeEditTargets: 'y', //'n',
29
- modeEditPemis: 'y',
30
- modeEditGrups: 'y',
31
- modeEditUsers: 'y',
32
-
33
- webName: {
34
- 'eng': 'Permission Service',
35
- 'cht': '權限管理系統',
36
- },
37
- webDescription: {
38
- 'eng': 'A web service package for user permissions and management targets.',
39
- 'cht': '基於簡易分層架構來給予與設定使用者所需之權限及群組管理功能',
40
- },
41
- webLogo: 'data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjQ4IiB3aWR0aD0iNDgiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTQ4IDBIMHY0OGg0OFYwWiIgZmlsbD0iI2ZmZiIgZmlsbC1vcGFjaXR5PSIuMDEiLz48cGF0aCBkPSJNMzcuODU2IDIwdjhNMjcuNDY0IDM4bDMuNDY0LTIgMy40NjQtMk0yMC41MzYgMzhsLTMuNDY1LTItMy40NjQtMk0xMC4xNDQgMjB2OE0xMy42MDcgMTRsMy40NjUtMiAzLjQ2NC0yTTI3LjQ2NCAxMGwzLjQ2NCAyIDMuNDY0IDIiIHN0cm9rZT0iI0ZGOTgwMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIiBzdHJva2Utd2lkdGg9IjIiLz48cGF0aCBkPSJNMjQgNDRhNCA0IDAgMSAwIDAtOCA0IDQgMCAwIDAgMCA4Wk0yNCAxMmE0IDQgMCAxIDAgMC04IDQgNCAwIDAgMCAwIDhaTTI0IDI4YTQgNCAwIDEgMCAwLTggNCA0IDAgMCAwIDAgOFpNMzggMjBhNCA0IDAgMSAwIDAtOCA0IDQgMCAwIDAgMCA4Wk0zOCAzNmE0IDQgMCAxIDAgMC04IDQgNCAwIDAgMCAwIDhaTTEwIDIwYTQgNCAwIDEgMCAwLTggNCA0IDAgMCAwIDAgOFpNMTAgMzZhNCA0IDAgMSAwIDAtOCA0IDQgMCAwIDAgMCA4WiIgZmlsbD0iI0ZGRTBCMiIgc3Ryb2tlPSIjRkY5ODAwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIvPjwvc3ZnPg==',
42
-
43
- // kpLangExt: {
44
- // mmTargets: {
45
- // eng: `Current features list`,
46
- // cht: `現有功能清單`,
47
- // },
48
- // mmTargetsMsg: {
49
- // eng: `Features generally refer to entities such as pages, data, etc., and can also include features or services.`,
50
- // cht: `現有功能泛指實體的頁面、數據等,亦可為的功能或服務。`,
51
- // },
52
- // },
53
-
54
- }
55
-
56
- let getUserByToken = async (token) => {
57
- // console.log('getUserByToken/token', token)
58
- // console.log('於生產環境時得加入SSO等驗證token機制')
59
- // return {} //測試無法登入
60
- if (token === '{token-for-application}') { //提供外部應用系統作為存取使用者
61
- return {
62
- id: 'id-for-application',
63
- name: 'application',
64
- email: 'application@example.com',
65
- isAdmin: 'y',
66
- }
67
- }
68
- if (token === 'sys') { //開發階段w-ui-loginout自動給予browser使用者(且位於localhost)的token為sys
69
- return {
70
- id: 'id-for-admin',
71
- name: 'admin',
72
- email: 'admin@example.com', //mappingBy為email, 開發階段時會使用email找到所建置之使用者資料
73
- isAdmin: 'y',
74
- }
75
- }
76
- console.log('invalid token', token)
77
- return {}
78
- }
79
-
80
- let verifyClientUser = (user, from) => {
81
- // console.log('verifyClientUser/user', user)
82
- // console.log('於生產環境時得加入限制瀏覽器使用者身份機制')
83
- // return false //測試無法登入
84
- return user.isAdmin === 'y' //測試僅系統管理者使用
85
- }
86
-
87
- let verifyAppUser = (user, from) => {
88
- // console.log('verifyAppUser/user', user)
89
- // console.log('於生產環境時得加入限制應用程式使用者身份機制')
90
- // return false //測試無法登入
91
- return user.isAdmin === 'y' //測試僅系統管理者使用
92
- }
93
-
94
- //WWebPerm
95
- let instWWebPerm = WWebPerm(WOrm, url, db, getUserByToken, verifyClientUser, verifyAppUser, opt)
96
-
97
- instWWebPerm.on('error', (err) => {
98
- console.log(err)
99
- })
100
-
101
- //node srv.mjs
1
+ import fs from 'fs'
2
+ import JSON5 from 'json5'
3
+ import WOrm from 'w-orm-lmdb/src/WOrmLmdb.mjs'
4
+ import WWebPerm from './server/WWebPerm.mjs'
5
+ import getSettings from './g.getSettings.mjs'
6
+
7
+
8
+ //st(DB 設定)
9
+ let st = getSettings()
10
+
11
+ let url = st.dbUrl
12
+ let db = st.dbName
13
+
14
+ //app 設定來源: argv[2] 指定之 settings 檔(供 e2e restartBackend 注入不同語系等), 預設 ./settings.json.(對齊 SSO srv.mjs)
15
+ //JSON5 格式(無引號鍵 / 單引號 / 註解 / 尾逗號); language / webName / modeEdit* / webLogo 等資料設定皆在此檔.
16
+ let pathSettings = process.argv[2] || './settings.json'
17
+ let appSt = JSON5.parse(fs.readFileSync(pathSettings, 'utf8'))
18
+
19
+ let opt = {
20
+
21
+ useCheckUser: false,
22
+ getUserById: null,
23
+ useExcludeWhenNotAdmin: false,
24
+
25
+ //serverPort / subfolder / urlRedirect / showLanguage / language / showModeEdit* / modeEdit* / webName / webDescription / webLogo / kpLangExt 皆由 settings.json 提供
26
+ ...appSt,
27
+
28
+ }
29
+
30
+ let getUserByToken = async (token) => {
31
+ // console.log('getUserByToken/token', token)
32
+ // console.log('於生產環境時得加入SSO等驗證token機制')
33
+ // return {} //測試無法登入
34
+ if (token === '{token-for-application}') { //提供外部應用系統作為存取使用者
35
+ return {
36
+ id: 'id-for-application',
37
+ name: 'application',
38
+ email: 'application@example.com',
39
+ isAdmin: 'y',
40
+ }
41
+ }
42
+ if (token === 'sys') { //開發階段w-ui-loginout自動給予browser使用者(且位於localhost)的token為sys
43
+ return {
44
+ id: 'id-for-admin',
45
+ name: 'admin',
46
+ email: 'admin@example.com', //mappingBy為email, 開發階段時會使用email找到所建置之使用者資料
47
+ isAdmin: 'y',
48
+ }
49
+ }
50
+ console.log('invalid token', token)
51
+ return {}
52
+ }
53
+
54
+ let verifyClientUser = (user, from) => {
55
+ // console.log('verifyClientUser/user', user)
56
+ // console.log('於生產環境時得加入限制瀏覽器使用者身份機制')
57
+ // return false //測試無法登入
58
+ return user.isAdmin === 'y' //測試僅系統管理者使用
59
+ }
60
+
61
+ let verifyAppUser = (user, from) => {
62
+ // console.log('verifyAppUser/user', user)
63
+ // console.log('於生產環境時得加入限制應用程式使用者身份機制')
64
+ // return false //測試無法登入
65
+ return user.isAdmin === 'y' //測試僅系統管理者使用
66
+ }
67
+
68
+ //WWebPerm
69
+ let instWWebPerm = WWebPerm(WOrm, url, db, getUserByToken, verifyClientUser, verifyAppUser, opt)
70
+
71
+ instWWebPerm.on('error', (err) => {
72
+ console.log(err)
73
+ })
74
+
75
+ //node srv.mjs
76
+ //node srv.mjs <pathSettings> //指定 settings 檔(e2e 注入語系用)
package/tableTags.json CHANGED
@@ -1 +1 @@
1
- {"grups":"2026-03-29T21:41:46+08:00|yI6vlG","pemis":"2026-03-29T21:41:46+08:00|eXQml3","targets":"2026-03-29T21:41:46+08:00|CdW12e","users":"2026-03-29T22:01:58+08:00|dDEKFJ"}
1
+ {"grups":"2026-06-22T14:53:50+08:00|dxIazx","pemis":"2026-06-22T14:53:50+08:00|kg4x7v","targets":"2026-06-22T14:53:50+08:00|jNJCZK","users":"2026-06-22T14:53:50+08:00|zponD1"}
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- body,html{font-family:微軟正黑體,Microsoft JhengHei,MicrosoftJhengHeiRegular,Avenir,Helvetica,Arial,sans-serif;overflow-y:hidden}a,button,div,input,p,pre,span,textarea{font-family:inherit}.fade-enter-active{-webkit-animation:go 1s;animation:go 1s}.fade-leave-active{-webkit-animation:back 1s;animation:back 1s}@-webkit-keyframes go{0%{opacity:0}to{opacity:1}}@keyframes go{0%{opacity:0}to{opacity:1}}@-webkit-keyframes back{0%{opacity:1}to{opacity:0}}@keyframes back{0%{opacity:1}to{opacity:0}}