@agung_dhewe/webapps 1.1.2 → 1.2.4
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.
- package/lib/fgta5js-dist/fgta5js-v1.8.5.min.js +11 -0
- package/lib/fgta5js-dist/fgta5js-v1.8.5.min.js.map +1 -0
- package/{libs → lib}/webmodule/module-edit.css +73 -18
- package/{libs → lib}/webmodule/module-list.css +13 -0
- package/lib/webmodule/module-print.css +28 -0
- package/{libs → lib}/webmodule/module.css +13 -6
- package/{libs → lib}/webmodule/module.js +14 -4
- package/lib/webmodule/pagehelper.mjs +129 -0
- package/modules/generator/appgen-io.mjs +153 -76
- package/modules/generator/appgen-ui.mjs +234 -167
- package/modules/generator/generator-designtemplate-def.html +38 -0
- package/modules/generator/generator-designtemplate.html +11 -1492
- package/modules/generator/generator.css +103 -65
- package/modules/generator/generator.mjs +1 -1
- package/modules/generator/generator.svg +98 -0
- package/modules/generator/generatorEdit.mjs +43 -35
- package/modules/generator/generatorList.mjs +27 -0
- package/modules/generator/tpl-designerinfo.html +100 -0
- package/modules/generator/tpl-field-checkbox.html +200 -0
- package/modules/generator/tpl-field-combobox.html +228 -0
- package/modules/generator/tpl-field-datepicker.html +192 -0
- package/modules/generator/tpl-field-filebox.html +189 -0
- package/modules/generator/tpl-field-numberbox.html +218 -0
- package/modules/generator/tpl-field-textbox.html +255 -0
- package/modules/generator/tpl-field-timepicker.html +192 -0
- package/modules/generator/tpl-searchdesign.html +32 -0
- package/modules/generator/tpl-uniquedesign.html +25 -0
- package/modules/login/login.css +10 -2
- package/package.json +5 -3
- package/percobaan/coba-sequencer.js +16 -0
- package/src/api.js +12 -9
- package/src/apis/generator.api.js +35 -23
- package/src/apis/login.api.js +1 -0
- package/src/context.js +12 -2
- package/src/db.js +58 -32
- package/src/generator/createApiModule.js +4 -1
- package/src/generator/createIcon.js +24 -2
- package/src/generator/createLayoutCss.js +107 -0
- package/src/generator/createModuleDetilEditHtml.js +12 -1
- package/src/generator/createModuleDetilEditMjs.js +32 -28
- package/src/generator/createModuleDetilListHtml.js +14 -7
- package/src/generator/createModuleDetilListMjs.js +13 -1
- package/src/generator/createModuleHeaderEditHtml.js +13 -1
- package/src/generator/createModuleHeaderEditMjs.js +23 -2
- package/src/generator/createProgramData.js +3 -2
- package/src/generator/createTable.js +42 -38
- package/src/generator/helper.js +45 -27
- package/src/generator/templates/__rollup-module copy.ejs +90 -0
- package/src/generator/templates/__rollup-module.ejs +102 -31
- package/src/generator/templates/api-module.js.ejs +171 -32
- package/src/generator/templates/layout.css.ejs +24 -0
- package/src/generator/templates/module-ext.html.ejs +1 -1
- package/src/generator/templates/module-ext.mjs.ejs +19 -1
- package/src/generator/templates/module.ejs.ejs +8 -0
- package/src/generator/templates/module.mjs.ejs +42 -5
- package/src/generator/templates/moduleDetilEdit.html.ejs +11 -0
- package/src/generator/templates/moduleDetilEdit.mjs.ejs +135 -30
- package/src/generator/templates/moduleDetilList.html.ejs +2 -1
- package/src/generator/templates/moduleDetilList.mjs.ejs +86 -11
- package/src/generator/templates/moduleHeaderEdit.html.ejs +8 -1
- package/src/generator/templates/moduleHeaderEdit.mjs.ejs +123 -36
- package/src/generator/templates/moduleHeaderList.html.ejs +5 -1
- package/src/generator/templates/moduleHeaderList.mjs.ejs +47 -15
- package/src/generator/trygenerate.js +18 -2
- package/src/generator/worker.js +83 -72
- package/src/helper.js +12 -13
- package/src/logger.js +12 -12
- package/src/notifier.js +29 -0
- package/src/routers/generatorApi.js +9 -3
- package/src/routers/generatorPage.js +3 -1
- package/src/routers/moduleApi.js +1 -1
- package/src/routers/modulePage.js +42 -7
- package/src/sequencerdoc.js +22 -46
- package/src/sequencerline.js +16 -4
- package/src/session.js +69 -33
- package/src/startup.js +47 -10
- package/src/webapps.js +62 -18
- package/templates/_lib_debug.ejs +8 -8
- package/templates/_lib_production.ejs +2 -2
- package/templates/application.page.ejs +43 -8
- package/templates/generator.page.ejs +4 -3
- package/templates/index.page.ejs +2 -2
- package/templates/login.page.ejs +3 -3
- package/libs/fgta5js-dist/fgta5js-v1.8.3.min.js +0 -11
- package/libs/fgta5js-dist/fgta5js-v1.8.3.min.js.map +0 -1
- package/libs/webmodule/pagehelper.mjs +0 -45
- package/modules/generator/generator.png +0 -0
- /package/{libs/fgta5js-dist/fgta5js-v1.8.3.min.css → lib/fgta5js-dist/fgta5js-v1.8.5.min.css} +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla-italic-latin-ext.woff2 +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla-italic-latin.woff2 +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla-normal-latin-ext.woff2 +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla-normal-latin.woff2 +0 -0
- /package/{libs → lib}/fgta5js-dist/fonts/karla.css +0 -0
- /package/{libs → lib}/webmodule/module-footer.css +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
.module-form {
|
|
2
|
-
display: flex;
|
|
3
|
-
column-gap: 10px;
|
|
4
|
-
row-gap: 5px;
|
|
5
|
-
flex-wrap: wrap;
|
|
2
|
+
display: flex;
|
|
3
|
+
column-gap: 10px;
|
|
4
|
+
row-gap: 5px;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
6
|
margin-bottom: 20px;
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -15,42 +15,87 @@
|
|
|
15
15
|
/* background-color: aliceblue; */
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.input-field
|
|
18
|
+
.input-field>label {
|
|
19
19
|
margin-top: 4px;
|
|
20
20
|
font-size: 0.8rem;
|
|
21
21
|
font-weight: bold;
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
@media screen and (max-width: 500px) {
|
|
26
26
|
.input-field {
|
|
27
27
|
flex-direction: column;
|
|
28
|
+
flex-basis: 100%;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
|
-
.input-field
|
|
31
|
-
.input-field
|
|
31
|
+
.input-field>div[label],
|
|
32
|
+
.input-field>label {
|
|
32
33
|
text-align: left;
|
|
33
34
|
margin-bottom: 5px;
|
|
34
35
|
width: fit-content;
|
|
35
36
|
min-width: unset;
|
|
36
37
|
}
|
|
38
|
+
|
|
39
|
+
.fgta5-entry-container[fgta5-component=Combobox] {
|
|
40
|
+
width: 100%
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
43
|
|
|
39
44
|
|
|
40
45
|
@media screen and (min-width: 501px) {
|
|
41
|
-
.input-field
|
|
46
|
+
.input-field>label {
|
|
42
47
|
text-align: right;
|
|
43
48
|
width: 80px;
|
|
44
49
|
min-width: 80px;
|
|
50
|
+
white-space: nowrap;
|
|
51
|
+
overflow: hidden;
|
|
52
|
+
text-overflow: ellipsis;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
/* ACTION */
|
|
59
|
+
.panel-action {
|
|
60
|
+
display: flex;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media screen and (max-width: 500px) {
|
|
64
|
+
.panel-action {
|
|
65
|
+
padding-top: 30px;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
column-gap: 8px;
|
|
45
68
|
}
|
|
69
|
+
|
|
46
70
|
}
|
|
47
71
|
|
|
48
72
|
|
|
49
73
|
|
|
50
74
|
|
|
75
|
+
@media screen and (min-width: 501px) {
|
|
76
|
+
.panel-action {
|
|
77
|
+
/* padding-top: 20px; */
|
|
78
|
+
/* padding-left: 100px; */
|
|
79
|
+
column-gap: 10px;
|
|
80
|
+
margin: 20px 20px 20px 20px;
|
|
81
|
+
padding: 20px;
|
|
82
|
+
border: 1px solid #c8cbf4;
|
|
83
|
+
border-radius: 10px;
|
|
84
|
+
background: #d9d9d9;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@media screen and (min-width: 501px) and (max-width: 900px) {
|
|
89
|
+
.panel-action {
|
|
90
|
+
width: 787px
|
|
91
|
+
/* 827 dikurangi padding kiri kanan total 40px */
|
|
92
|
+
}
|
|
93
|
+
}
|
|
51
94
|
|
|
95
|
+
/* DETIL */
|
|
52
96
|
|
|
53
97
|
@media screen and (max-width: 500px) {
|
|
98
|
+
|
|
54
99
|
/* Box information detil */
|
|
55
100
|
.panel-detil {
|
|
56
101
|
margin: 50px 0 0 0;
|
|
@@ -58,12 +103,20 @@
|
|
|
58
103
|
}
|
|
59
104
|
|
|
60
105
|
@media screen and (min-width: 501px) {
|
|
106
|
+
|
|
61
107
|
/* Box information detil */
|
|
62
108
|
.panel-detil {
|
|
63
109
|
margin: 50px 20px 20px 20px;
|
|
64
110
|
}
|
|
65
111
|
}
|
|
66
112
|
|
|
113
|
+
@media screen and (min-width: 501px) and (max-width: 900px) {
|
|
114
|
+
.panel-detil {
|
|
115
|
+
width: 827px
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
67
120
|
|
|
68
121
|
.panel-detil [panel-title] {
|
|
69
122
|
font-weight: bold;
|
|
@@ -78,14 +131,17 @@
|
|
|
78
131
|
background-color: #ececec;
|
|
79
132
|
padding: 5px 0 10px 0;
|
|
80
133
|
border-radius: 0 0 10px 10px;
|
|
81
|
-
|
|
134
|
+
|
|
82
135
|
}
|
|
83
136
|
|
|
84
137
|
.panel-detil-row {
|
|
85
138
|
display: grid;
|
|
86
|
-
grid-template-columns: 1fr 1fr;
|
|
87
|
-
|
|
88
|
-
|
|
139
|
+
grid-template-columns: 1fr 1fr;
|
|
140
|
+
/* 2 kolom */
|
|
141
|
+
grid-template-rows: auto auto;
|
|
142
|
+
/* 2 baris */
|
|
143
|
+
column-gap: 10px;
|
|
144
|
+
/* jarak antar item */
|
|
89
145
|
padding: 10px 15px 10px 15px;
|
|
90
146
|
color: rgb(80, 80, 80);
|
|
91
147
|
|
|
@@ -143,13 +199,13 @@
|
|
|
143
199
|
}
|
|
144
200
|
|
|
145
201
|
|
|
146
|
-
.panel-recordbar
|
|
202
|
+
.panel-recordbar>div {
|
|
147
203
|
padding: 2px 10px 2px 10px;
|
|
148
204
|
border-left: 1px solid #bebebe;
|
|
149
|
-
|
|
205
|
+
|
|
150
206
|
}
|
|
151
207
|
|
|
152
|
-
.panel-recordbar
|
|
208
|
+
.panel-recordbar>div:first-child {
|
|
153
209
|
border-left: 0
|
|
154
210
|
}
|
|
155
211
|
|
|
@@ -159,5 +215,4 @@
|
|
|
159
215
|
|
|
160
216
|
.panel-recordbar a:hover {
|
|
161
217
|
color: #000
|
|
162
|
-
|
|
163
|
-
}
|
|
218
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@media screen {
|
|
2
|
+
#print-media-container {
|
|
3
|
+
background-color: #fff;
|
|
4
|
+
border: 2px solid #666;
|
|
5
|
+
visibility: hidden;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@media print {
|
|
10
|
+
body * {
|
|
11
|
+
visibility: hidden;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/* 2. Tampilkan kembali (visibility: visible) hanya div yang ingin dicetak */
|
|
15
|
+
#print-media-container,
|
|
16
|
+
#print-media-container * {
|
|
17
|
+
visibility: visible;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* 3. Posisikan div cetak agar menempati seluruh halaman cetak */
|
|
21
|
+
#print-media-container {
|
|
22
|
+
border: 0px;
|
|
23
|
+
position: absolute;
|
|
24
|
+
left: 0;
|
|
25
|
+
top: 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
@import url('./module-list.css');
|
|
2
2
|
@import url('./module-edit.css');
|
|
3
3
|
@import url('./module-footer.css');
|
|
4
|
+
@import url('./module-print.css');
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
--max-mobile-width: 500px;
|
|
8
|
+
--min-desktop-width: 501px;
|
|
9
|
+
}
|
|
10
|
+
|
|
4
11
|
|
|
5
12
|
|
|
6
13
|
body {
|
|
@@ -8,10 +15,14 @@ body {
|
|
|
8
15
|
|
|
9
16
|
}
|
|
10
17
|
|
|
18
|
+
#fRecord-section [name="value"] {
|
|
19
|
+
user-select: text;
|
|
20
|
+
}
|
|
11
21
|
|
|
12
22
|
|
|
13
|
-
#fRecord-section
|
|
23
|
+
#fRecord-section [name="panel"] {
|
|
14
24
|
display: flex;
|
|
25
|
+
margin-bottom: 15px;
|
|
15
26
|
}
|
|
16
27
|
|
|
17
28
|
|
|
@@ -45,8 +56,4 @@ body {
|
|
|
45
56
|
border-bottom: 1px solid #8d8d8d;
|
|
46
57
|
font-size: 0.8rem;
|
|
47
58
|
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
59
|
+
}
|
|
@@ -118,7 +118,7 @@ class Module {
|
|
|
118
118
|
const result = await api.execute(args, formData)
|
|
119
119
|
return result
|
|
120
120
|
} catch (err) {
|
|
121
|
-
this.processError(err)
|
|
121
|
+
await this.processError(err)
|
|
122
122
|
throw err
|
|
123
123
|
}
|
|
124
124
|
}
|
|
@@ -129,8 +129,10 @@ class Module {
|
|
|
129
129
|
const currentUrl = window.location.href;
|
|
130
130
|
if (err.status==401) {
|
|
131
131
|
console.error(err)
|
|
132
|
-
|
|
132
|
+
window.onbeforeunload = null
|
|
133
|
+
|
|
133
134
|
if (inFrane) {
|
|
135
|
+
await $fgta5.MessageBox.error(`${err.message}!`) // perlu tambah tanda seru !, agar gak diproses reload di messagebox
|
|
134
136
|
window.parent.postMessage({
|
|
135
137
|
action:'REDIRECT_TO_LOGIN',
|
|
136
138
|
href: '/login',
|
|
@@ -138,9 +140,13 @@ class Module {
|
|
|
138
140
|
|
|
139
141
|
}, '*')
|
|
140
142
|
} else {
|
|
141
|
-
|
|
143
|
+
|
|
144
|
+
document.body.innerHTML = `<div style="font-size: 18px; padding: 30px;">Your session was expired.<br>You need to <a href="/login?nexturl=${currentUrl}">relogin</a></div>`
|
|
145
|
+
setTimeout(()=>{
|
|
146
|
+
location.href = `/login?nexturl=${currentUrl}`
|
|
147
|
+
}, 100000)
|
|
142
148
|
}
|
|
143
|
-
await this.sleep(10000)
|
|
149
|
+
// await this.sleep(10000)
|
|
144
150
|
throw err
|
|
145
151
|
} else {
|
|
146
152
|
throw err
|
|
@@ -187,6 +193,10 @@ class Module {
|
|
|
187
193
|
input.setSelectionRange(start, start);
|
|
188
194
|
}
|
|
189
195
|
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
190
200
|
}
|
|
191
201
|
|
|
192
202
|
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
|
|
2
|
+
export async function openSection(self, sectionName, params, fnOpened) {
|
|
3
|
+
const context = params.Context
|
|
4
|
+
const Crsl = context.Crsl
|
|
5
|
+
const section = Crsl.Items[sectionName]
|
|
6
|
+
section.setSectionReturn(params.sectionReturn)
|
|
7
|
+
section.show({}, fnOpened)
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export function renderLog(tbody, data) {
|
|
12
|
+
tbody.innerHTML = ''
|
|
13
|
+
|
|
14
|
+
for (var row of data) {
|
|
15
|
+
const tr = document.createElement('tr')
|
|
16
|
+
|
|
17
|
+
const tdTime = document.createElement('td')
|
|
18
|
+
tdTime.innerHTML = row.log_time
|
|
19
|
+
tdTime.classList.add('logcell')
|
|
20
|
+
|
|
21
|
+
const tdUser = document.createElement('td')
|
|
22
|
+
tdUser.innerHTML = row.log_user_name
|
|
23
|
+
tdUser.classList.add('logcell')
|
|
24
|
+
|
|
25
|
+
const tdAction = document.createElement('td')
|
|
26
|
+
tdAction.innerHTML = row.log_action
|
|
27
|
+
tdAction.classList.add('logcell')
|
|
28
|
+
|
|
29
|
+
const tdIP = document.createElement('td')
|
|
30
|
+
tdIP.innerHTML = row.log_ipaddress
|
|
31
|
+
tdIP.classList.add('logcell')
|
|
32
|
+
|
|
33
|
+
const tdRemark = document.createElement('td')
|
|
34
|
+
tdRemark.innerHTML = row.log_remark
|
|
35
|
+
tdRemark.classList.add('logcell')
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
tr.appendChild(tdTime)
|
|
39
|
+
tr.appendChild(tdUser)
|
|
40
|
+
tr.appendChild(tdAction)
|
|
41
|
+
tr.appendChild(tdIP)
|
|
42
|
+
tr.appendChild(tdRemark)
|
|
43
|
+
tbody.appendChild(tr)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
export async function sleep(ms) {
|
|
49
|
+
return new Promise((resolve) => {
|
|
50
|
+
setTimeout(() => {
|
|
51
|
+
resolve()
|
|
52
|
+
}, ms)
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
export function setCssRule(selector, properties) {
|
|
58
|
+
let found = false;
|
|
59
|
+
|
|
60
|
+
for (const sheet of document.styleSheets) {
|
|
61
|
+
for (let i = 0; i < sheet.cssRules.length; i++) {
|
|
62
|
+
const rule = sheet.cssRules[i];
|
|
63
|
+
|
|
64
|
+
if (rule.selectorText === selector) {
|
|
65
|
+
for (const [prop, val] of Object.entries(properties)) {
|
|
66
|
+
rule.style[prop] = val;
|
|
67
|
+
}
|
|
68
|
+
found = true;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// jika rule belum ada, tambahkan
|
|
74
|
+
if (!found) {
|
|
75
|
+
const firstSheet = document.styleSheets[0];
|
|
76
|
+
const props = Object.entries(properties)
|
|
77
|
+
.map(([p, v]) => `${p}: ${v}`)
|
|
78
|
+
.join('; ');
|
|
79
|
+
firstSheet.insertRule(`${selector} { ${props} }`, firstSheet.cssRules.length);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
export function formatDecimal(num, prec) {
|
|
85
|
+
return new Intl.NumberFormat("en-EN", {
|
|
86
|
+
minimumFractionDigits: prec,
|
|
87
|
+
maximumFractionDigits: prec
|
|
88
|
+
}).format(num);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function formatISODate(isoString, format) {
|
|
92
|
+
const date = new Date(isoString);
|
|
93
|
+
|
|
94
|
+
// Mengambil komponen waktu dalam UTC
|
|
95
|
+
const day = String(date.getUTCDate()).padStart(2, '0');
|
|
96
|
+
const month = String(date.getUTCMonth() + 1).padStart(2, '0');
|
|
97
|
+
const year = String(date.getUTCFullYear());
|
|
98
|
+
|
|
99
|
+
// Mapping pola format ke nilai asli
|
|
100
|
+
const map = {
|
|
101
|
+
'dd': day,
|
|
102
|
+
'mm': month,
|
|
103
|
+
'yyyy': year,
|
|
104
|
+
'yy': year.slice(-2) // Mengambil 2 angka terakhir tahun
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// Mengganti pola dalam string format berdasarkan map di atas
|
|
108
|
+
return format.replace(/dd|mm|yyyy|yy/gi, matched => map[matched.toLowerCase()]);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export function formatNumber(num, decimalPrecision = 0) {
|
|
112
|
+
return new Intl.NumberFormat("en-EN", {
|
|
113
|
+
minimumFractionDigits: decimalPrecision,
|
|
114
|
+
maximumFractionDigits: decimalPrecision
|
|
115
|
+
}).format(num);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function setVisibility(el_name, visible) {
|
|
119
|
+
const el = document.getElementById(el_name)
|
|
120
|
+
if (el == null) {
|
|
121
|
+
return
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (visible == true) {
|
|
125
|
+
el.classList.remove('hidden')
|
|
126
|
+
} else {
|
|
127
|
+
el.classList.add('hidden')
|
|
128
|
+
}
|
|
129
|
+
}
|