w-web-api 1.0.52 → 1.0.55

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 (78) hide show
  1. package/README.md +1 -1
  2. package/dist/css/app.cad4a1ca.css +1 -0
  3. package/dist/index.tmp +4 -2
  4. package/dist/js/app-legacy.7687b23b.js +1 -0
  5. package/dist/js/app.7687b23b.js +1 -0
  6. package/dist/js/chunk-vendors-legacy.4c27cf51.js +15 -0
  7. package/dist/js/chunk-vendors.4c27cf51.js +15 -0
  8. package/dist/w-web-api.umd.js +2 -2
  9. package/dist/w-web-api.umd.js.map +1 -1
  10. package/docs/WWebApi.html +2 -2
  11. package/docs/index.html +1 -1
  12. package/docs/{WWebApi.mjs.html → server_WWebApi.mjs.html} +113 -66
  13. package/docs/src_components_Common_CheckYesNo.vue.html +187 -0
  14. package/g.getSettings.mjs +3 -0
  15. package/logs/2026-06-19T16.log +6 -0
  16. package/logs/2026-06-20T11.log +4 -0
  17. package/logs/2026-06-20T14.log +2 -0
  18. package/logs/2026-06-21T20.log +1 -0
  19. package/logs/2026-06-21T21.log +4 -0
  20. package/logs/2026-06-22T07.log +12 -0
  21. package/logs/2026-06-22T08.log +808 -0
  22. package/logs/2026-06-22T09.log +104 -0
  23. package/logs/2026-06-22T10.log +26 -0
  24. package/logs/2026-06-22T11.log +860 -0
  25. package/logs/2026-06-22T12.log +430 -0
  26. package/logs/2026-06-22T23.log +1547 -0
  27. package/logs/2026-06-23T00.log +473 -0
  28. package/logs/2026-06-23T08.log +231 -0
  29. package/logs/2026-06-23T09.log +179 -0
  30. package/logs/2026-07-01T11.log +488 -0
  31. package/logs/2026-07-09T22.log +370 -0
  32. package/logs/2026-07-09T23.log +370 -0
  33. package/logs/2026-07-10T12.log +284 -0
  34. package/logs/2026-07-10T13.log +777 -0
  35. package/logs/2026-07-11T17.log +2 -0
  36. package/package.json +20 -15
  37. package/public/index.html +9 -2
  38. package/server/WWebApi.mjs +110 -63
  39. package/server/procApis.mjs +62 -0
  40. package/server/procLang.mjs +372 -66
  41. package/server/procProxy.mjs +120 -0
  42. package/server/srLog.mjs +30 -0
  43. package/server/staLogs/filterVpfsByWindow.mjs +27 -0
  44. package/server/staLogs/staEvent.mjs +131 -0
  45. package/server/staLogs/test_staEvent.mjs +198 -0
  46. package/settings.json +18 -0
  47. package/src/App.vue +11 -7
  48. package/src/assets/scalar-ui.css +113 -0
  49. package/src/components/Common/CheckYes.vue +102 -0
  50. package/src/components/Common/CheckYesNo.vue +115 -0
  51. package/src/components/Common/LoadingWinBar.vue +114 -0
  52. package/src/components/Layout.vue +8 -26
  53. package/src/components/LayoutContent.vue +299 -350
  54. package/src/components/LayoutContentEdit.vue +577 -0
  55. package/src/components/LayoutContentStats.vue +485 -0
  56. package/src/components/LayoutContentTest.vue +781 -0
  57. package/src/components/MdPanel.vue +80 -58
  58. package/src/main.js +11 -8
  59. package/src/plugins/mUI.mjs +19 -39
  60. package/src/schema/tables/apis.mjs +30 -0
  61. package/src/store/mutations.mjs +0 -14
  62. package/src/store/types.mjs +0 -3
  63. package/srv.mjs +50 -20
  64. package/tableTags.json +1 -1
  65. package/z/344/277/256/346/255/243/350/246/217/345/212/203/346/233/270.md +246 -0
  66. package/.github/workflows/ci-test.yml +0 -24
  67. package/.vscode/launch.json +0 -18
  68. package/db/wapis/apis/data.mdb +0 -0
  69. package/db/wapis/apis/lock.mdb +0 -0
  70. package/dist/css/app.b5cf2ef5.css +0 -1
  71. package/dist/js/app-legacy.927b5679.js +0 -1
  72. package/dist/js/app.927b5679.js +0 -1
  73. package/dist/js/chunk-vendors-legacy.ffb0c6c5.js +0 -13
  74. package/dist/js/chunk-vendors.ffb0c6c5.js +0 -13
  75. package/src/plugins/mDataSelectorSchema.mjs +0 -30
  76. package/src/plugins/mShare.mjs +0 -44
  77. package/tableTags-web-api.json +0 -1
  78. package/test/all.test.mjs +0 -10
@@ -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,19 +106,16 @@ 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= > window 注入之 server 語系 > store),
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
 
115
116
  },
116
117
  computed: {
117
118
 
118
- viewState: function() {
119
- return get(this, `$store.state.viewState`, '')
120
- },
121
-
122
119
  heightToolbar: function() {
123
120
  //console.log('computed heightToolbar')
124
121
 
@@ -127,11 +124,6 @@ export default {
127
124
  return get(vo, `$store.state.heightToolbar`, 0)
128
125
  },
129
126
 
130
- userToken: function() {
131
- let vo = this
132
- return get(vo, `$store.state.userToken`)
133
- },
134
-
135
127
  lang: function() {
136
128
  let vo = this
137
129
  return get(vo, `$store.state.lang`, '')
@@ -167,16 +159,6 @@ export default {
167
159
  return get(vo, `$store.state.webInfor.webLogo`, '')
168
160
  },
169
161
 
170
- userSelf: function() {
171
- let vo = this
172
- return get(vo, `$store.state.userSelf`, '')
173
- },
174
-
175
- userName: function() {
176
- let vo = this
177
- return get(vo, `userSelf.name`, '')
178
- },
179
-
180
162
  },
181
163
  methods: {
182
164