w-web-perm 1.0.0

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 (101) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.js +55 -0
  4. package/.github/workflows/ci-test.yml +24 -0
  5. package/.jsdoc +25 -0
  6. package/.vscode/launch.json +21 -0
  7. package/LICENSE +21 -0
  8. package/README.md +24 -0
  9. package/SECURITY.md +5 -0
  10. package/babel.config.js +15 -0
  11. package/dist/css/app.79b4b59b.css +1 -0
  12. package/dist/css/chunk-vendors.65775501.css +5 -0
  13. package/dist/index.tmp +1 -0
  14. package/dist/js/app-legacy.954e168c.js +2 -0
  15. package/dist/js/app-legacy.954e168c.js.map +1 -0
  16. package/dist/js/app.954e168c.js +2 -0
  17. package/dist/js/app.954e168c.js.map +1 -0
  18. package/dist/js/chunk-vendors-legacy.f5f1a231.js +13 -0
  19. package/dist/js/chunk-vendors-legacy.f5f1a231.js.map +1 -0
  20. package/dist/js/chunk-vendors.f5f1a231.js +13 -0
  21. package/dist/js/chunk-vendors.f5f1a231.js.map +1 -0
  22. package/dist/w-web-perm.umd.js +7 -0
  23. package/dist/w-web-perm.umd.js.map +1 -0
  24. package/docs/WWebPerm.html +826 -0
  25. package/docs/WWebPerm.mjs.html +558 -0
  26. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  27. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  28. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  29. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  30. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  31. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  32. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  33. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  34. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  35. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  36. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  37. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  38. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  39. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  40. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  41. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  42. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  43. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  44. package/docs/index.html +84 -0
  45. package/docs/scripts/collapse.js +39 -0
  46. package/docs/scripts/commonNav.js +28 -0
  47. package/docs/scripts/linenumber.js +25 -0
  48. package/docs/scripts/nav.js +12 -0
  49. package/docs/scripts/polyfill.js +4 -0
  50. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  51. package/docs/scripts/prettify/lang-css.js +2 -0
  52. package/docs/scripts/prettify/prettify.js +28 -0
  53. package/docs/scripts/search.js +99 -0
  54. package/docs/styles/jsdoc.css +776 -0
  55. package/docs/styles/prettify.css +80 -0
  56. package/g.getSettings.mjs +17 -0
  57. package/g.mDb.mjs +10 -0
  58. package/g.mInitialTestData.mjs +20 -0
  59. package/g.mOrm.mjs +24 -0
  60. package/package.json +75 -0
  61. package/public/index.html +23 -0
  62. package/server/WWebPerm.mjs +486 -0
  63. package/src/App.vue +153 -0
  64. package/src/components/Common/CheckYes.vue +85 -0
  65. package/src/components/Common/CheckYesNo.vue +91 -0
  66. package/src/components/Common/LabelItem.vue +106 -0
  67. package/src/components/Common/LoadingWinBar.vue +87 -0
  68. package/src/components/Layout.vue +152 -0
  69. package/src/components/LayoutContent.vue +246 -0
  70. package/src/components/LayoutContentGroups.vue +664 -0
  71. package/src/components/LayoutContentTargets.vue +538 -0
  72. package/src/components/LayoutContentUsers.vue +493 -0
  73. package/src/components/LayoutState.vue +91 -0
  74. package/src/components/VeUser.vue +453 -0
  75. package/src/components/ruleGroup.vue +667 -0
  76. package/src/main.js +103 -0
  77. package/src/perm.mjs +61 -0
  78. package/src/plugins/mDataSelectorSchema.mjs +30 -0
  79. package/src/plugins/mDataSupport.mjs +66 -0
  80. package/src/plugins/mShare.mjs +366 -0
  81. package/src/plugins/mUI.mjs +229 -0
  82. package/src/plugins/mVuetify.mjs +12 -0
  83. package/src/schema/gi.mjs +8 -0
  84. package/src/schema/index.mjs +20 -0
  85. package/src/schema/tables/ruleGroups.mjs +100 -0
  86. package/src/schema/tables/targets.mjs +100 -0
  87. package/src/schema/tables/users.mjs +125 -0
  88. package/src/store/actions.mjs +1 -0
  89. package/src/store/getters.mjs +1 -0
  90. package/src/store/index.mjs +25 -0
  91. package/src/store/mutations.mjs +201 -0
  92. package/src/store/types.mjs +15 -0
  93. package/srv.mjs +52 -0
  94. package/tableTags-web-perm.json +1 -0
  95. package/test/all.test.mjs +10 -0
  96. package/toolg/addVersion.mjs +4 -0
  97. package/toolg/cleanFolder.mjs +4 -0
  98. package/toolg/gDistRollup.mjs +36 -0
  99. package/toolg/genEntry.mjs +23 -0
  100. package/toolg/modifyReadme.mjs +4 -0
  101. package/vue.config.js +15 -0
@@ -0,0 +1,80 @@
1
+ .pln {
2
+ color: #ddd;
3
+ }
4
+
5
+ /* string content */
6
+ .str {
7
+ color: #61ce3c;
8
+ }
9
+
10
+ /* a keyword */
11
+ .kwd {
12
+ color: #fbde2d;
13
+ }
14
+
15
+ /* a comment */
16
+ .com {
17
+ color: #aeaeae;
18
+ }
19
+
20
+ /* a type name */
21
+ .typ {
22
+ color: #8da6ce;
23
+ }
24
+
25
+ /* a literal value */
26
+ .lit {
27
+ color: #fbde2d;
28
+ }
29
+
30
+ /* punctuation */
31
+ .pun {
32
+ color: #ddd;
33
+ }
34
+
35
+ /* lisp open bracket */
36
+ .opn {
37
+ color: #000000;
38
+ }
39
+
40
+ /* lisp close bracket */
41
+ .clo {
42
+ color: #000000;
43
+ }
44
+
45
+ /* a markup tag name */
46
+ .tag {
47
+ color: #8da6ce;
48
+ }
49
+
50
+ /* a markup attribute name */
51
+ .atn {
52
+ color: #fbde2d;
53
+ }
54
+
55
+ /* a markup attribute value */
56
+ .atv {
57
+ color: #ddd;
58
+ }
59
+
60
+ /* a declaration */
61
+ .dec {
62
+ color: #EF5050;
63
+ }
64
+
65
+ /* a variable name */
66
+ .var {
67
+ color: #c82829;
68
+ }
69
+
70
+ /* a function name */
71
+ .fun {
72
+ color: #4271ae;
73
+ }
74
+
75
+ /* Specify class=linenums on a pre to get line numbering */
76
+ ol.linenums {
77
+ margin-top: 0;
78
+ margin-bottom: 0;
79
+ padding-bottom: 2px;
80
+ }
@@ -0,0 +1,17 @@
1
+ // import path from 'path'
2
+ // import fs from 'fs'
3
+ // import JSON5 from 'json5'
4
+
5
+
6
+ function getSettings() {
7
+ return {
8
+ 'dbUsername': 'username',
9
+ 'dbPassword': 'password',
10
+ 'dbName': 'wperm',
11
+ 'dbIP': '127.0.0.1',
12
+ 'dbPort': 27017,
13
+ }
14
+ }
15
+
16
+
17
+ export default getSettings
package/g.mDb.mjs ADDED
@@ -0,0 +1,10 @@
1
+ import { woItems } from './g.mOrm.mjs'
2
+ import getDb from 'w-serv-orm/src/getDb.mjs'
3
+
4
+
5
+ getDb.backup(woItems)
6
+ // getDb.recover(woItems, './ooo.json')
7
+
8
+
9
+ //備份資料重與由備份資料重建資料庫
10
+ //node --experimental-modules --es-module-specifier-resolution=node g.mDb.mjs
@@ -0,0 +1,20 @@
1
+ import ds from './src/schema/index.mjs'
2
+ import { woItems } from './g.mOrm.mjs'
3
+ import genTestData from 'w-serv-orm/src/genTestData.mjs'
4
+
5
+
6
+ async function initialTestData() {
7
+
8
+ //genTestData
9
+ await genTestData(ds, woItems)
10
+
11
+ }
12
+
13
+ initialTestData()
14
+ .catch((err) => {
15
+ console.log('initialTestData catch', err)
16
+ })
17
+
18
+
19
+ //刪除舊檔與重建測試資料庫
20
+ //node --experimental-modules --es-module-specifier-resolution=node g.mInitialTestData.mjs
package/g.mOrm.mjs ADDED
@@ -0,0 +1,24 @@
1
+ import WOrm from 'w-orm-mongodb/src/WOrmMongodb.mjs'
2
+ import WServOrm from 'w-serv-orm/src/WServOrm.mjs'
3
+ import ds from './src/schema/index.mjs'
4
+ import getSettings from './g.getSettings.mjs'
5
+
6
+
7
+ //getSettings
8
+ let st = getSettings()
9
+
10
+ //url, db
11
+ let url = `mongodb://${st.dbUsername}:${st.dbPassword}@${st.dbIP}:${st.dbPort}`
12
+ let db = st.dbName
13
+
14
+ //WServOrm
15
+ let opt = {
16
+ getUserById: null,
17
+ bCheckUser: false,
18
+ bExcludeWhenNotAdmin: false,
19
+ }
20
+ let r = WServOrm(ds, WOrm, url, db, opt)
21
+ let { woItems, procOrm } = r
22
+
23
+
24
+ export { woItems, procOrm }
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "w-web-perm",
3
+ "version": "1.0.0",
4
+ "main": "dist/w-web-perm.umd.js",
5
+ "dependencies": {
6
+ "@mdi/js": "^7.2.96",
7
+ "axios": "^1.3.4",
8
+ "lodash": "^4.17.21",
9
+ "showdown": "^2.1.0",
10
+ "w-component-vue": "^2.3.6",
11
+ "w-data-collector": "^1.0.19",
12
+ "w-serv-hapi": "^1.0.11",
13
+ "w-serv-orm": "^1.0.7",
14
+ "w-ui-loginout": "^1.0.4",
15
+ "wsemi": "^1.7.17"
16
+ },
17
+ "devDependencies": {
18
+ "@vue/cli-plugin-babel": "^5.0.8",
19
+ "@vue/cli-plugin-eslint": "^5.0.8",
20
+ "@vue/cli-service": "^5.0.8",
21
+ "eslint": "^8.37.0",
22
+ "eslint-config-standard": "^17.0.0",
23
+ "eslint-friendly-formatter": "^4.0.1",
24
+ "eslint-plugin-import": "^2.27.5",
25
+ "eslint-plugin-node": "^11.1.0",
26
+ "eslint-plugin-promise": "^6.1.1",
27
+ "eslint-plugin-standard": "^4.1.0",
28
+ "eslint-plugin-vue": "^9.10.0",
29
+ "sass": "^1.60.0",
30
+ "sass-loader": "^13.2.2",
31
+ "vue": "^2.6.14",
32
+ "vue-cli-plugin-vuetify": "^2.5.8",
33
+ "vuetify": "^2.6.14",
34
+ "vuetify-loader": "^1.9.2",
35
+ "vuex": "^3.6.2",
36
+ "w-orm-mongodb": "^1.1.29",
37
+ "w-package-tools": "^1.0.69"
38
+ },
39
+ "scripts": {
40
+ "serve": "vue-cli-service serve",
41
+ "build": "vue-cli-service build",
42
+ "test": "mocha --parallel --timeout 60000 --experimental-modules --es-module-specifier-resolution=node",
43
+ "lint": "vue-cli-service lint",
44
+ "deploy": "gh-pages -d docs"
45
+ },
46
+ "eslintConfig": {
47
+ "root": true,
48
+ "env": {
49
+ "node": true
50
+ },
51
+ "extends": [
52
+ "plugin:vue/essential",
53
+ "eslint:recommended"
54
+ ],
55
+ "rules": {},
56
+ "parserOptions": {
57
+ "parser": "babel-eslint"
58
+ }
59
+ },
60
+ "browserslist": [
61
+ "> 1%",
62
+ "last 2 versions"
63
+ ],
64
+ "repository": {
65
+ "type": "git",
66
+ "url": "https://github.com/yuda-lyu/w-web-perm"
67
+ },
68
+ "keywords": [
69
+ "web",
70
+ "service",
71
+ "permission"
72
+ ],
73
+ "author": "yuda-lyu(semisphere)",
74
+ "license": "MIT"
75
+ }
@@ -0,0 +1,23 @@
1
+ <!DOCTYPE html>
2
+ <html xmlns="http://www.w3.org/1999/xhtml" lang="zh-tw">
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, minimal-ui">
6
+ <meta http-equiv="X-UA-Compatible" content="ie=edge">
7
+ <title></title>
8
+
9
+ <!-- mdi font -->
10
+ <link href="https://cdn.jsdelivr.net/npm/@mdi/font/css/materialdesignicons.min.css" rel="stylesheet">
11
+
12
+ <!-- fontawesome -->
13
+ <link href="https://pro.fontawesome.com/releases/v5.15.4/css/all.css" rel="stylesheet">
14
+
15
+ </head>
16
+ <body style="font-family:'Microsoft JhengHei','Avenir','Helvetica', 'Arial', 'sans-serif'; padding:0px; margin:0px;">
17
+ <noscript>
18
+ <strong>We're sorry but w-component-vue doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
19
+ </noscript>
20
+ <div id="app"></div>
21
+ <!-- built files will be auto injected -->
22
+ </body>
23
+ </html>