w-web-api 1.0.51 → 1.0.53

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 (86) hide show
  1. package/_gh-pages-deploy/.nojekyll +0 -0
  2. package/_gh-pages-deploy/WWebApi.html +898 -0
  3. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  4. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  5. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  6. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  7. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  8. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  9. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  10. package/_gh-pages-deploy/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  11. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  12. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  13. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  14. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  15. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  16. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  17. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  18. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  19. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  20. package/_gh-pages-deploy/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  21. package/_gh-pages-deploy/index.html +84 -0
  22. package/_gh-pages-deploy/scripts/collapse.js +39 -0
  23. package/_gh-pages-deploy/scripts/commonNav.js +28 -0
  24. package/_gh-pages-deploy/scripts/linenumber.js +25 -0
  25. package/_gh-pages-deploy/scripts/nav.js +12 -0
  26. package/_gh-pages-deploy/scripts/polyfill.js +4 -0
  27. package/_gh-pages-deploy/scripts/prettify/Apache-License-2.0.txt +202 -0
  28. package/_gh-pages-deploy/scripts/prettify/lang-css.js +2 -0
  29. package/_gh-pages-deploy/scripts/prettify/prettify.js +28 -0
  30. package/_gh-pages-deploy/scripts/search.js +99 -0
  31. package/{docs/WWebApi.mjs.html → _gh-pages-deploy/server_WWebApi.mjs.html} +118 -41
  32. package/_gh-pages-deploy/src_components_Common_CheckYesNo.vue.html +187 -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.fe69497a.css +1 -0
  36. package/dist/index.tmp +4 -2
  37. package/dist/js/app-legacy.15819aa7.js +1 -0
  38. package/dist/js/app.15819aa7.js +1 -0
  39. package/dist/js/chunk-vendors-legacy.c1a32dd1.js +15 -0
  40. package/dist/js/chunk-vendors.c1a32dd1.js +15 -0
  41. package/dist/w-web-api.umd.js +2 -2
  42. package/dist/w-web-api.umd.js.map +1 -1
  43. package/docs/WWebApi.html +2 -2
  44. package/docs/index.html +1 -1
  45. package/docs/server_WWebApi.mjs.html +1012 -0
  46. package/docs/src_components_Common_CheckYesNo.vue.html +187 -0
  47. package/g.getSettings.mjs +3 -0
  48. package/package.json +15 -11
  49. package/public/index.html +9 -2
  50. package/server/WWebApi.mjs +115 -38
  51. package/server/procApis.mjs +62 -0
  52. package/server/procLang.mjs +724 -0
  53. package/server/procProxy.mjs +120 -0
  54. package/server/srLog.mjs +30 -0
  55. package/server/staLogs/staEvent.mjs +129 -0
  56. package/server/staLogs/test_staEvent.mjs +132 -0
  57. package/settings.json +14 -0
  58. package/src/App.vue +11 -7
  59. package/src/assets/scalar-ui.css +113 -0
  60. package/src/components/Common/CheckYes.vue +102 -0
  61. package/src/components/Common/CheckYesNo.vue +115 -0
  62. package/src/components/Common/LoadingWinBar.vue +114 -0
  63. package/src/components/Layout.vue +33 -7
  64. package/src/components/LayoutContent.vue +308 -333
  65. package/src/components/LayoutContentEdit.vue +577 -0
  66. package/src/components/LayoutContentStats.vue +485 -0
  67. package/src/components/LayoutContentTest.vue +799 -0
  68. package/src/components/MdPanel.vue +80 -58
  69. package/src/main.js +8 -0
  70. package/src/plugins/mUI.mjs +58 -71
  71. package/src/schema/tables/apis.mjs +30 -0
  72. package/src/store/mutations.mjs +1 -1
  73. package/srv.mjs +47 -19
  74. package/tableTags.json +1 -1
  75. package/.github/workflows/ci-test.yml +0 -24
  76. package/.vscode/launch.json +0 -18
  77. package/db/wapis/apis/data.mdb +0 -0
  78. package/db/wapis/apis/lock.mdb +0 -0
  79. package/dist/css/app.b5cf2ef5.css +0 -1
  80. package/dist/js/app-legacy.fbfba810.js +0 -1
  81. package/dist/js/app.fbfba810.js +0 -1
  82. package/dist/js/chunk-vendors-legacy.735ec7d6.js +0 -13
  83. package/dist/js/chunk-vendors.735ec7d6.js +0 -13
  84. package/src/plugins/mLang.mjs +0 -250
  85. package/tableTags-web-api.json +0 -1
  86. package/test/all.test.mjs +0 -10
@@ -0,0 +1,102 @@
1
+ <template>
2
+ <WConfirm
3
+ :show.sync="bShow"
4
+ :title="$t('systemMessage')"
5
+ :content="content"
6
+ :contentIcon="contentIcon"
7
+ :contentIconColor="contentIconColor"
8
+ :_contentColor="'white'"
9
+ :_contentIconColor="'white'"
10
+ :_contentBackgroundColor="'orange lighten-5'"
11
+ :headerBackgroundColor="'grey lighten-3'"
12
+ :hasNoBtn="false"
13
+ :yesBtnText="$t('ok')"
14
+ @click-yes="clickUnit()"
15
+ ></WConfirm>
16
+ </template>
17
+
18
+ <script>
19
+ import Vue from 'vue'
20
+ import { mdiAlert, mdiCheckCircle } from '@mdi/js'
21
+ import genPm from 'wsemi/src/genPm.mjs'
22
+ import WConfirm from 'w-component-vue/src/components/WConfirm.vue'
23
+
24
+ export default {
25
+ components: {
26
+ WConfirm,
27
+ },
28
+ props: {
29
+ },
30
+ data: function() {
31
+ return {
32
+
33
+ bShow: false,
34
+ pm: null,
35
+
36
+ content: '',
37
+
38
+ //content icon(依 type 切換:success=綠勾,其餘=驚嘆號)
39
+ contentIcon: mdiAlert,
40
+ contentIconColor: '#D81B60',
41
+
42
+ }
43
+ },
44
+ mounted: function() {
45
+ //console.log('mounted')
46
+
47
+ let vo = this
48
+
49
+ //set
50
+ Vue.prototype.$dg.showCheckYes = vo.show
51
+
52
+ },
53
+ computed: {
54
+ },
55
+ methods: {
56
+
57
+ show: function (content, opt = {}) {
58
+ //console.log('methods show', content)
59
+
60
+ let vo = this
61
+
62
+ //pm
63
+ vo.pm = genPm()
64
+
65
+ //save
66
+ vo.content = content
67
+
68
+ //content icon:type='success' 顯示綠勾,其餘維持驚嘆號
69
+ if (opt && opt.type === 'success') {
70
+ vo.contentIcon = mdiCheckCircle
71
+ vo.contentIconColor = '#2E7D32'
72
+ }
73
+ else {
74
+ vo.contentIcon = mdiAlert
75
+ vo.contentIconColor = '#D81B60'
76
+ }
77
+
78
+ //show
79
+ vo.bShow = true
80
+
81
+ return vo.pm
82
+ },
83
+
84
+ clickUnit: function() {
85
+ //console.log('methods clickUnit')
86
+
87
+ let vo = this
88
+
89
+ //resolve
90
+ vo.pm.resolve()
91
+
92
+ //hide
93
+ vo.bShow = false
94
+
95
+ },
96
+
97
+ }
98
+ }
99
+ </script>
100
+
101
+ <style scoped>
102
+ </style>
@@ -0,0 +1,115 @@
1
+ <template>
2
+ <WConfirm
3
+ :show.sync="bShow"
4
+ :title="$t('systemMessage')"
5
+ :content="content"
6
+ :_contentColor="'white'"
7
+ :_contentIconColor="'white'"
8
+ :_contentBackgroundColor="'orange lighten-5'"
9
+ :_titleColor="'white'"
10
+ :headerBackgroundColor="'grey lighten-3'"
11
+ :noBtnText="$t('no')"
12
+ :yesBtnText="$t('yes')"
13
+ @click-no="clickBtn(false)"
14
+ @click-yes="clickBtn(true)"
15
+ ></WConfirm>
16
+ </template>
17
+
18
+ <script>
19
+ import Vue from 'vue'
20
+ import genPm from 'wsemi/src/genPm.mjs'
21
+ import WConfirm from 'w-component-vue/src/components/WConfirm.vue'
22
+
23
+ export default {
24
+ components: {
25
+ WConfirm,
26
+ },
27
+ props: {
28
+ },
29
+ data: function() {
30
+ return {
31
+
32
+ bShow: false,
33
+ pm: null,
34
+
35
+ content: '',
36
+
37
+ }
38
+ },
39
+ mounted: function() {
40
+ //console.log('mounted')
41
+
42
+ let vo = this
43
+
44
+ //set
45
+ Vue.prototype.$dg.showCheckYesNo = vo.show
46
+
47
+ },
48
+ computed: {
49
+ },
50
+ methods: {
51
+
52
+ /**
53
+ * 顯示 Yes/No 確認對話框並回傳 Promise。
54
+ *
55
+ * **Contract** (caller 須遵守):
56
+ * - 使用者點 **Yes** → Promise `resolve()` (無值, 進 `.then()`)
57
+ * - 使用者點 **No** → Promise `reject('close')` (進 `.catch(err => err === 'close')`)
58
+ *
59
+ * 正確 caller pattern:
60
+ *
61
+ * vo.$dg.showCheckYesNo('確定要 X?')
62
+ * .then(() => {
63
+ * //使用者點 Yes
64
+ * doX()
65
+ * })
66
+ * .catch((err) => {
67
+ * //使用者點 No (err === 'close') 為正常路徑, 靜默處理
68
+ * if (err === 'close') return
69
+ * //非預期錯誤 (CheckYesNo 本身故障等)
70
+ * console.log('showCheckYesNo unexpected error', err)
71
+ * })
72
+ *
73
+ * @param {string} content - 顯示在 modal 中的訊息文字
74
+ * @returns {Promise<void>} Yes → resolve(); No → reject('close')
75
+ */
76
+ show: function(content) {
77
+ //console.log('methods show', content)
78
+
79
+ let vo = this
80
+
81
+ //pm
82
+ vo.pm = genPm()
83
+
84
+ //save
85
+ vo.content = content
86
+
87
+ //show
88
+ vo.bShow = true
89
+
90
+ return vo.pm
91
+ },
92
+
93
+ clickBtn: function(mode) {
94
+ //console.log('methods clickBtn', mode)
95
+
96
+ let vo = this
97
+
98
+ if (mode) {
99
+ vo.pm.resolve()
100
+ }
101
+ else {
102
+ vo.pm.reject('close')
103
+ }
104
+
105
+ //hide
106
+ vo.bShow = false
107
+
108
+ },
109
+
110
+ }
111
+ }
112
+ </script>
113
+
114
+ <style scoped>
115
+ </style>
@@ -0,0 +1,114 @@
1
+ <template>
2
+ <WDialog
3
+ :show.sync="loading"
4
+ :maxWidth="dialogWidth"
5
+ @resize="resizeDialog"
6
+ >
7
+
8
+ <template v-slot:panel>
9
+
10
+ <div :style="`padding:${barPadding-5}px ${barPadding}px ${barPadding}px ${barPadding}px;`">
11
+
12
+ <div style="padding-bottom:3px; font-size:0.9rem; color:#666;">
13
+
14
+ <span v-if="msg!==''">{{msg}}</span>
15
+
16
+ <span v-else>{{$t('processing')}}</span>
17
+
18
+ </div>
19
+
20
+ <WProgressBar
21
+ :style="`width:${barWidth}px;`"
22
+ :height="3"
23
+ :enableContinuous="true"
24
+ :progColor="'deep-purple lighten-1'"
25
+ :progBackgroundColor="'deep-purple lighten-4'"
26
+ ></WProgressBar>
27
+
28
+ </div>
29
+
30
+ </template>
31
+
32
+ </WDialog>
33
+ </template>
34
+
35
+ <script>
36
+ import Vue from 'vue'
37
+ import get from 'lodash-es/get.js'
38
+ import WDialog from 'w-component-vue/src/components/WDialog.vue'
39
+ import WProgressBar from 'w-component-vue/src/components/WProgressBar.vue'
40
+
41
+
42
+ export default {
43
+ components: {
44
+ WDialog,
45
+ WProgressBar,
46
+ },
47
+ props: {
48
+ },
49
+ data: function() {
50
+ return {
51
+
52
+ dialogWidth: 0,
53
+ dialogWidthMax: 600,
54
+
55
+ barPadding: 20,
56
+ barWidth: 0,
57
+ msg: '',
58
+
59
+ }
60
+ },
61
+ mounted: function() {
62
+ //console.log('mounted')
63
+
64
+ let vo = this
65
+
66
+ //set
67
+ Vue.prototype.$dg.setLoadingWinBarMessage = vo.setMessage
68
+
69
+ },
70
+ computed: {
71
+
72
+ loading: function() {
73
+ let vo = this
74
+ let b = get(vo, `$store.state.loading`)
75
+ // console.log('loading', b)
76
+ return b
77
+ },
78
+
79
+ },
80
+ methods: {
81
+
82
+ setMessage: function(msg) {
83
+ this.msg = msg
84
+ },
85
+
86
+ resizeDialog: function(msg) {
87
+ // console.log('methods resizeDialog', msg)
88
+
89
+ let vo = this
90
+
91
+ let w = window.innerWidth
92
+ // console.log('window.innerWidth', window.innerWidth)
93
+
94
+ //dialogWidth
95
+ let dialogWidth = w - vo.barPadding * 2
96
+ dialogWidth = Math.max(dialogWidth, 0)
97
+ dialogWidth = Math.min(dialogWidth, vo.dialogWidthMax)
98
+ vo.dialogWidth = dialogWidth
99
+ // console.log('dialogWidth', dialogWidth)
100
+
101
+ //barWidth
102
+ let barWidth = dialogWidth - vo.barPadding * 2
103
+ barWidth = Math.max(barWidth, 0)
104
+ vo.barWidth = barWidth
105
+ // console.log('barWidth', barWidth)
106
+
107
+ },
108
+
109
+ }
110
+ }
111
+ </script>
112
+
113
+ <style scoped>
114
+ </style>
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <div style="height:100svh; background:#f5f5f5;">
2
+ <div style="height:100svh; background:var(--bg-2);">
3
3
 
4
4
  <!-- menu top, 因窄版導致名稱換行故須使用overflow-y:hidden -->
5
- <div :style="`height:${heightToolbar}px; overflow-y:hidden; padding:0px 10px; background:#fff; border-bottom:1px solid #ccc; display:flex; align-items:center;`">
5
+ <div :style="`height:${heightToolbar}px; box-sizing:border-box; overflow-y:hidden; padding:0px 10px; background:var(--bg-1); border-bottom:1px solid var(--border); display:flex; align-items:center;`">
6
6
 
7
7
  <WButtonCircle
8
8
  :icon="'mdi-menu'"
@@ -20,8 +20,8 @@
20
20
  </div>
21
21
 
22
22
  <div>
23
- <div style="font-size:1.2rem; color:#000;">{{webName}}</div>
24
- <div style="font-size:0.8rem; color:#666;">{{$t('webDescription')}}</div>
23
+ <div style="font-size:var(--fs-h3); color:var(--c-1); font-weight:600;">{{webName}}</div>
24
+ <div style="font-size:var(--fs-xs); color:var(--c-2);">{{$t('webDescription')}}</div>
25
25
  </div>
26
26
 
27
27
  </div>
@@ -106,9 +106,10 @@ export default {
106
106
  let showLanguage = get(vo, 'webInfor.showLanguage', '')
107
107
  // console.log('showLanguage', showLanguage)
108
108
  vo.showLangSelect = showLanguage === 'y'
109
- let language = get(vo, 'webInfor.language', '')
110
- // console.log('language', language)
111
- vo.$ui.setLang(language, 'layout mounted')
109
+ //setLang(null):改走 getLang 解析(URL ?lang= > store > window 注入之 server 語系),
110
+ //不再用 webInfor.language 明確覆蓋(否則會蓋掉 URL ?lang= 與使用者切換)。server 初始語系已由
111
+ //window.___pmwperm___.language(WWebApi 注入 index.html)提供,getLang 會取得。
112
+ vo.$ui.setLang(null, 'layout mounted')
112
113
  vo.firstSetting = false
113
114
  }
114
115
 
@@ -127,6 +128,21 @@ export default {
127
128
  return get(vo, `$store.state.heightToolbar`, 0)
128
129
  },
129
130
 
131
+ userToken: function() {
132
+ let vo = this
133
+ return get(vo, `$store.state.userToken`)
134
+ },
135
+
136
+ lang: function() {
137
+ let vo = this
138
+ return get(vo, `$store.state.lang`, '')
139
+ },
140
+
141
+ webInfor: function() {
142
+ let wi = get(this, `$store.state.webInfor`)
143
+ return wi
144
+ },
145
+
130
146
  webName: {
131
147
  get() {
132
148
  let vo = this
@@ -152,6 +168,16 @@ export default {
152
168
  return get(vo, `$store.state.webInfor.webLogo`, '')
153
169
  },
154
170
 
171
+ userSelf: function() {
172
+ let vo = this
173
+ return get(vo, `$store.state.userSelf`, '')
174
+ },
175
+
176
+ userName: function() {
177
+ let vo = this
178
+ return get(vo, `userSelf.name`, '')
179
+ },
180
+
155
181
  },
156
182
  methods: {
157
183