zet-lib 1.5.29 → 1.5.30
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/views/generatorjs.ejs +855 -852
- package/lib/zGeneratorRouter.js +131 -131
- package/package.json +1 -1
package/lib/zGeneratorRouter.js
CHANGED
|
@@ -44,16 +44,16 @@ const nots = [
|
|
|
44
44
|
const generatorUrl = "https://generator.cmsqu.com";
|
|
45
45
|
|
|
46
46
|
const bodyView = Util.readFile(
|
|
47
|
-
|
|
47
|
+
require.resolve(__dirname + "/views/generator.ejs")
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
router.get("/", csrfProtection, async (req, res) => {
|
|
51
51
|
let table = req.query.table || "",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
route = "",
|
|
53
|
+
jsonData = {},
|
|
54
|
+
zForms = {},
|
|
55
|
+
relations = {},
|
|
56
|
+
approvalDatas = { is_approval: false };
|
|
57
57
|
const MYMODELS = myCache.get("MYMODELS");
|
|
58
58
|
let datas = await axios.post(`${generatorUrl}/api/generator/index`);
|
|
59
59
|
jsonData = datas.data;
|
|
@@ -66,9 +66,9 @@ router.get("/", csrfProtection, async (req, res) => {
|
|
|
66
66
|
let sorting = "";
|
|
67
67
|
if (table) {
|
|
68
68
|
let contentScript = `var ZFIELDS = ${JSON.stringify(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
jsonData.rows,
|
|
70
|
+
null,
|
|
71
|
+
2
|
|
72
72
|
)};`;
|
|
73
73
|
moduleLib.addScript(req, res, contentScript);
|
|
74
74
|
moduleLib.editor(req, res);
|
|
@@ -87,15 +87,15 @@ router.get("/", csrfProtection, async (req, res) => {
|
|
|
87
87
|
approvalDatas.title = approvalJSON.title || "";
|
|
88
88
|
approvalDatas.type = approvalJSON.type || 1;
|
|
89
89
|
approvalDatas.approvers = approvalJSON.approvers
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
? approvalJSON.approvers
|
|
91
|
+
: [];
|
|
92
92
|
approvalDatas.knowings = approvalJSON.knowings || [];
|
|
93
93
|
approvalDatas.template = approvalJSON.content || "";
|
|
94
94
|
zForms = await zRoute.formsFieldSync(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
req,
|
|
96
|
+
res,
|
|
97
|
+
MYMODEL_APPROVERS,
|
|
98
|
+
approvalDatas
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -103,12 +103,12 @@ router.get("/", csrfProtection, async (req, res) => {
|
|
|
103
103
|
const jsonDatas = jsonData.datas;
|
|
104
104
|
const lock = nots.includes(table) ? 1 : 0;
|
|
105
105
|
const jsonDatasJson =
|
|
106
|
-
|
|
106
|
+
jsonDatas.hasOwnProperty("json") && jsonDatas.json ? jsonDatas.json : {};
|
|
107
107
|
const checkDummy =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
Object.prototype.hasOwnProperty.call(jsonDatasJson, "dummy") &&
|
|
109
|
+
jsonDatasJson.dummy
|
|
110
|
+
? "checked"
|
|
111
|
+
: "";
|
|
112
112
|
const renderData = {
|
|
113
113
|
datas: jsonDatas,
|
|
114
114
|
table: table,
|
|
@@ -127,15 +127,15 @@ router.get("/", csrfProtection, async (req, res) => {
|
|
|
127
127
|
|
|
128
128
|
const bodyHTML = ejs.render(bodyView, renderData);
|
|
129
129
|
const endHTML = ejs.render(
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
Util.readFile(require.resolve(__dirname + "/views/generatorjs.ejs")),
|
|
131
|
+
renderData
|
|
132
132
|
);
|
|
133
133
|
let dataRender = renderData;
|
|
134
134
|
dataRender.bodyHTML = bodyHTML;
|
|
135
135
|
dataRender.endHTML = endHTML;
|
|
136
136
|
res.render(
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
require.resolve(__dirname + "/views/generator_layout.ejs"),
|
|
138
|
+
dataRender
|
|
139
139
|
);
|
|
140
140
|
});
|
|
141
141
|
|
|
@@ -144,8 +144,8 @@ router.post("/fields", async (req, res) => {
|
|
|
144
144
|
let body = req.body;
|
|
145
145
|
let table = body.table || "";
|
|
146
146
|
let result = {},
|
|
147
|
-
|
|
148
|
-
|
|
147
|
+
fields = {},
|
|
148
|
+
rowsFields = [];
|
|
149
149
|
if (table) {
|
|
150
150
|
result = await connection.result({
|
|
151
151
|
table: "zfields",
|
|
@@ -161,8 +161,8 @@ router.post("/fields", async (req, res) => {
|
|
|
161
161
|
table: table,
|
|
162
162
|
};
|
|
163
163
|
let datas = await axios.post(
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
`${generatorUrl}/api/generator/modal`,
|
|
165
|
+
objData
|
|
166
166
|
);
|
|
167
167
|
res.json(datas.data);
|
|
168
168
|
} catch (e) {
|
|
@@ -177,8 +177,8 @@ Create new Module/Table
|
|
|
177
177
|
router.post("/", csrfProtection, async (req, res) => {
|
|
178
178
|
try {
|
|
179
179
|
let results = await axios.post(
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
`${generatorUrl}/api/generator/create`,
|
|
181
|
+
req.body
|
|
182
182
|
);
|
|
183
183
|
let datas = results.data;
|
|
184
184
|
if (datas.status == 0) {
|
|
@@ -208,8 +208,8 @@ router.post("/reset", async (req, res) => {
|
|
|
208
208
|
}
|
|
209
209
|
if (table) {
|
|
210
210
|
let results = await axios.post(
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
`${generatorUrl}/api/generator/reset`,
|
|
212
|
+
req.body
|
|
213
213
|
);
|
|
214
214
|
let datas = results.data;
|
|
215
215
|
await connection.update({
|
|
@@ -284,9 +284,9 @@ router.post("/tabs", async (req, res) => {
|
|
|
284
284
|
let details = {};
|
|
285
285
|
//remove Object in array
|
|
286
286
|
let left = leftOri.filter((item) => typeof item !== "object") || [],
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
287
|
+
right = rightOri.filter((item) => typeof item !== "object") || [],
|
|
288
|
+
oneColumn =
|
|
289
|
+
oneColumnOri.filter((item) => typeof item !== "object") || [];
|
|
290
290
|
|
|
291
291
|
details.notabs = detailOri.notabs;
|
|
292
292
|
tabs.map((item, index) => {
|
|
@@ -296,24 +296,24 @@ router.post("/tabs", async (req, res) => {
|
|
|
296
296
|
details[key] = detailOri[objOri[item]] || [];
|
|
297
297
|
//left
|
|
298
298
|
let objLeft =
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
299
|
+
leftOri[valueIndex] &&
|
|
300
|
+
leftOri[valueIndex].hasOwnProperty(`arr${arrayOri[item]}`)
|
|
301
|
+
? leftOri[valueIndex][`arr${arrayOri[item]}`]
|
|
302
|
+
: [];
|
|
303
303
|
left.push({ [key]: objLeft });
|
|
304
304
|
//right
|
|
305
305
|
let objRight =
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
306
|
+
rightOri[valueIndex] &&
|
|
307
|
+
rightOri[valueIndex].hasOwnProperty(`arr${arrayOri[item]}`)
|
|
308
|
+
? rightOri[valueIndex][`arr${arrayOri[item]}`]
|
|
309
|
+
: [];
|
|
310
310
|
right.push({ [key]: objRight });
|
|
311
311
|
//one column
|
|
312
312
|
let objOneColumn =
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
313
|
+
oneColumnOri[valueIndex] &&
|
|
314
|
+
oneColumnOri[valueIndex].hasOwnProperty(`arr${arrayOri[item]}`)
|
|
315
|
+
? oneColumnOri[valueIndex][`arr${arrayOri[item]}`]
|
|
316
|
+
: [];
|
|
317
317
|
oneColumn.push({ [key]: objOneColumn });
|
|
318
318
|
});
|
|
319
319
|
post.details = JSON.stringify(details);
|
|
@@ -410,8 +410,8 @@ const generate = async (req, res) => {
|
|
|
410
410
|
},
|
|
411
411
|
});
|
|
412
412
|
let resultJSON = Object.prototype.hasOwnProperty.call(result, "json")
|
|
413
|
-
|
|
414
|
-
|
|
413
|
+
? result.json
|
|
414
|
+
: {};
|
|
415
415
|
if (resultJSON && Object.prototype.hasOwnProperty.call(resultJSON, "dummy")) {
|
|
416
416
|
dummy = resultJSON.dummy == 1 ? true : false;
|
|
417
417
|
}
|
|
@@ -420,11 +420,11 @@ const generate = async (req, res) => {
|
|
|
420
420
|
for (let key in properties) {
|
|
421
421
|
//override
|
|
422
422
|
properties[key].values.required = properties[key].values.required
|
|
423
|
-
|
|
424
|
-
|
|
423
|
+
? true
|
|
424
|
+
: false;
|
|
425
425
|
properties[key].values.unique = properties[key].values.unique
|
|
426
|
-
|
|
427
|
-
|
|
426
|
+
? true
|
|
427
|
+
: false;
|
|
428
428
|
var isChain = properties[key].values.isChain ? true : false;
|
|
429
429
|
properties[key].values.isChain = isChain;
|
|
430
430
|
if (isChain) {
|
|
@@ -460,7 +460,7 @@ const generate = async (req, res) => {
|
|
|
460
460
|
//generate file models routes views
|
|
461
461
|
body.columns = await connection.query(connection.describeTable(table));
|
|
462
462
|
body.constraintList = await connection.query(
|
|
463
|
-
|
|
463
|
+
connection.constraintList(table)
|
|
464
464
|
);
|
|
465
465
|
body.result = result;
|
|
466
466
|
results = await axios.post(`${generatorUrl}/api/generator/generate`, body);
|
|
@@ -508,7 +508,7 @@ const generate = async (req, res) => {
|
|
|
508
508
|
//check if has chains here
|
|
509
509
|
MYMODEL = filesKey.modelObj;
|
|
510
510
|
//delete/clean zgrid after changes
|
|
511
|
-
|
|
511
|
+
await connection.delete({
|
|
512
512
|
table: 'zgrid',
|
|
513
513
|
where: {
|
|
514
514
|
route_name: table,
|
|
@@ -541,8 +541,8 @@ const generate = async (req, res) => {
|
|
|
541
541
|
});
|
|
542
542
|
|
|
543
543
|
fs.writeFileSync(
|
|
544
|
-
|
|
545
|
-
|
|
544
|
+
`${dirRoot}/models/${filesKey.filename}`,
|
|
545
|
+
filesKey.content
|
|
546
546
|
);
|
|
547
547
|
console.log(`The file model of ${filesKey.filename} is saved!`);
|
|
548
548
|
|
|
@@ -552,8 +552,8 @@ const generate = async (req, res) => {
|
|
|
552
552
|
let isChain = false;
|
|
553
553
|
for (let key in widgets) {
|
|
554
554
|
let hasChains = widgets[key].hasOwnProperty("isChain")
|
|
555
|
-
|
|
556
|
-
|
|
555
|
+
? widgets[key].isChain
|
|
556
|
+
: false;
|
|
557
557
|
if (hasChains) {
|
|
558
558
|
isChain = true;
|
|
559
559
|
if (widgets[key].hasOwnProperty("table")) {
|
|
@@ -580,7 +580,7 @@ const generate = async (req, res) => {
|
|
|
580
580
|
name: widgets[objChains[key].key].fields[1],
|
|
581
581
|
};
|
|
582
582
|
objChains[model_table.widgets[q].table].changes.push(
|
|
583
|
-
|
|
583
|
+
objChanges
|
|
584
584
|
);
|
|
585
585
|
}
|
|
586
586
|
}
|
|
@@ -617,12 +617,12 @@ const generate = async (req, res) => {
|
|
|
617
617
|
fs.writeFileSync(`${DIR_VIEW}/${q}`, filesKey[q]);
|
|
618
618
|
} else {
|
|
619
619
|
fs.writeFileSync(
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
620
|
+
`${DIR_VIEW}/${q}`,
|
|
621
|
+
await minify(filesKey[q], {
|
|
622
|
+
minifyJS: true,
|
|
623
|
+
minifyCSS: true,
|
|
624
|
+
collapseWhitespace: true,
|
|
625
|
+
})
|
|
626
626
|
);
|
|
627
627
|
}
|
|
628
628
|
console.log(`The files views of ${q} is saved!`);
|
|
@@ -632,8 +632,8 @@ const generate = async (req, res) => {
|
|
|
632
632
|
if (!dummy) {
|
|
633
633
|
if (key == "route") {
|
|
634
634
|
fs.writeFileSync(
|
|
635
|
-
|
|
636
|
-
|
|
635
|
+
`${dirRoot}/routes/${filesKey.filename}`,
|
|
636
|
+
filesKey.content
|
|
637
637
|
);
|
|
638
638
|
console.log(`The files route of ${filesKey.filename} is saved!`);
|
|
639
639
|
}
|
|
@@ -687,9 +687,9 @@ router.post("/savetabs", async (req, res) => {
|
|
|
687
687
|
let table = body.table;
|
|
688
688
|
let details = body.details;
|
|
689
689
|
let left = [],
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
690
|
+
right = [],
|
|
691
|
+
tabLeft = {},
|
|
692
|
+
tabRight = {};
|
|
693
693
|
let json = { status: 0, title: "error", message: "error", url: "" };
|
|
694
694
|
let obj = {};
|
|
695
695
|
obj.notabs = [];
|
|
@@ -811,8 +811,8 @@ const buildJoin = async (MYMODEL, result) => {
|
|
|
811
811
|
rows.map((row) => {
|
|
812
812
|
foreignTables.push(row.foreign_table_name);
|
|
813
813
|
foreign_table_name[
|
|
814
|
-
|
|
815
|
-
|
|
814
|
+
row.foreign_table_name
|
|
815
|
+
] = ` LEFT JOIN ${row.foreign_table_name} ON ${row.foreign_table_name}.id = ${table}.${row.column_name} `;
|
|
816
816
|
});
|
|
817
817
|
|
|
818
818
|
//step by step
|
|
@@ -827,15 +827,15 @@ const buildJoin = async (MYMODEL, result) => {
|
|
|
827
827
|
if (table_steps.length > 0) {
|
|
828
828
|
for (let table_steps_item of table_steps) {
|
|
829
829
|
let rows = await connection.query(
|
|
830
|
-
|
|
830
|
+
connection.foreignKeyList(table_steps_item)
|
|
831
831
|
);
|
|
832
832
|
let foreign_table_name = {};
|
|
833
833
|
let foreignTables = [];
|
|
834
834
|
rows.map((row) => {
|
|
835
835
|
foreignTables.push(row.foreign_table_name);
|
|
836
836
|
foreign_table_name[
|
|
837
|
-
|
|
838
|
-
|
|
837
|
+
row.foreign_table_name
|
|
838
|
+
] = ` LEFT JOIN ${row.foreign_table_name} ON ${row.foreign_table_name}.id = ${table_steps_item}.${row.column_name} `;
|
|
839
839
|
});
|
|
840
840
|
console.log(foreignTables);
|
|
841
841
|
table_joins.map((item) => {
|
|
@@ -852,15 +852,15 @@ const buildJoin = async (MYMODEL, result) => {
|
|
|
852
852
|
if (table_steps.length > 0) {
|
|
853
853
|
for (let table_steps_item of table_steps) {
|
|
854
854
|
let rows = await connection.query(
|
|
855
|
-
|
|
855
|
+
connection.foreignKeyList(table_steps_item)
|
|
856
856
|
);
|
|
857
857
|
let foreign_table_name = {};
|
|
858
858
|
let foreignTables = [];
|
|
859
859
|
rows.map((row) => {
|
|
860
860
|
foreignTables.push(row.foreign_table_name);
|
|
861
861
|
foreign_table_name[
|
|
862
|
-
|
|
863
|
-
|
|
862
|
+
row.foreign_table_name
|
|
863
|
+
] = ` LEFT JOIN ${row.foreign_table_name} ON ${row.foreign_table_name}.id = ${table_steps_item}.${row.column_name} `;
|
|
864
864
|
});
|
|
865
865
|
//console.log(foreignTables)
|
|
866
866
|
table_joins.map((item) => {
|
|
@@ -955,45 +955,45 @@ router.delete("/delete-table", csrfProtection, async (req, res) => {
|
|
|
955
955
|
|
|
956
956
|
let runtimeFile = dirRoot + "/public/runtime/script/" + table;
|
|
957
957
|
fs.rm(
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
958
|
+
runtimeFile,
|
|
959
|
+
{
|
|
960
|
+
recursive: true,
|
|
961
|
+
},
|
|
962
|
+
(error) => {
|
|
963
|
+
if (error) {
|
|
964
|
+
console.log(error);
|
|
965
|
+
} else {
|
|
966
|
+
console.log("Recursive: Directories Deleted!");
|
|
967
|
+
}
|
|
967
968
|
}
|
|
968
|
-
}
|
|
969
969
|
);
|
|
970
970
|
let runtimeFileHead = dirRoot + "/public/runtime/head/" + table;
|
|
971
971
|
fs.rm(
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
972
|
+
runtimeFileHead,
|
|
973
|
+
{
|
|
974
|
+
recursive: true,
|
|
975
|
+
},
|
|
976
|
+
(error) => {
|
|
977
|
+
if (error) {
|
|
978
|
+
console.log(error);
|
|
979
|
+
} else {
|
|
980
|
+
console.log("Recursive: Directories Deleted!");
|
|
981
|
+
}
|
|
981
982
|
}
|
|
982
|
-
}
|
|
983
983
|
);
|
|
984
984
|
let runtimeFileEnd = dirRoot + "/public/runtime/end/" + table;
|
|
985
985
|
fs.rm(
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
986
|
+
runtimeFileEnd,
|
|
987
|
+
{
|
|
988
|
+
recursive: true,
|
|
989
|
+
},
|
|
990
|
+
(error) => {
|
|
991
|
+
if (error) {
|
|
992
|
+
console.log(error);
|
|
993
|
+
} else {
|
|
994
|
+
console.log("Recursive: Directories Deleted!");
|
|
995
|
+
}
|
|
995
996
|
}
|
|
996
|
-
}
|
|
997
997
|
);
|
|
998
998
|
|
|
999
999
|
await connection.delete({
|
|
@@ -1003,17 +1003,17 @@ router.delete("/delete-table", csrfProtection, async (req, res) => {
|
|
|
1003
1003
|
if (table) {
|
|
1004
1004
|
const viewsFile = dirRoot + "/views/" + table;
|
|
1005
1005
|
fs.rm(
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1006
|
+
viewsFile,
|
|
1007
|
+
{
|
|
1008
|
+
recursive: true,
|
|
1009
|
+
},
|
|
1010
|
+
(error) => {
|
|
1011
|
+
if (error) {
|
|
1012
|
+
console.log(error);
|
|
1013
|
+
} else {
|
|
1014
|
+
console.log("Recursive: Directories Deleted!");
|
|
1015
|
+
}
|
|
1015
1016
|
}
|
|
1016
|
-
}
|
|
1017
1017
|
);
|
|
1018
1018
|
}
|
|
1019
1019
|
await connection.delete({
|
|
@@ -1040,8 +1040,8 @@ router.post("/add_field", csrfProtection, async (req, res) => {
|
|
|
1040
1040
|
where: { table: table },
|
|
1041
1041
|
});
|
|
1042
1042
|
const results = await axios.post(
|
|
1043
|
-
|
|
1044
|
-
|
|
1043
|
+
`${generatorUrl}/api/generator/create_field`,
|
|
1044
|
+
body
|
|
1045
1045
|
);
|
|
1046
1046
|
const datas = results.data;
|
|
1047
1047
|
if (datas.status == 1) {
|
|
@@ -1092,8 +1092,8 @@ router.post("/setting_field", csrfProtection, async (req, res) => {
|
|
|
1092
1092
|
where: { table: table },
|
|
1093
1093
|
});
|
|
1094
1094
|
const results = await axios.post(
|
|
1095
|
-
|
|
1096
|
-
|
|
1095
|
+
`${generatorUrl}/api/generator/modal_settings`,
|
|
1096
|
+
body
|
|
1097
1097
|
);
|
|
1098
1098
|
const datas = results.data;
|
|
1099
1099
|
res.json(datas.html);
|
|
@@ -1101,7 +1101,7 @@ router.post("/setting_field", csrfProtection, async (req, res) => {
|
|
|
1101
1101
|
|
|
1102
1102
|
router.post("/save_setting", async (req, res) => {
|
|
1103
1103
|
const html = "",
|
|
1104
|
-
|
|
1104
|
+
table = req.query.table || "";
|
|
1105
1105
|
let json = Util.jsonSuccess("Success to update");
|
|
1106
1106
|
try {
|
|
1107
1107
|
if (nots.includes(req.body.table)) {
|
|
@@ -1141,7 +1141,7 @@ router.delete("/delete_field", csrfProtection, async (req, res) => {
|
|
|
1141
1141
|
return res.json(Util.flashError("Table is locked"));
|
|
1142
1142
|
}
|
|
1143
1143
|
const table = req.body.table,
|
|
1144
|
-
|
|
1144
|
+
name = req.body.name;
|
|
1145
1145
|
let data = await connection.result({
|
|
1146
1146
|
table: "zfields",
|
|
1147
1147
|
where: { table: table },
|
|
@@ -1178,7 +1178,7 @@ router.delete("/delete_field", csrfProtection, async (req, res) => {
|
|
|
1178
1178
|
//DROP COULUMN
|
|
1179
1179
|
//ALTER TABLE table_name DROP COLUMN IF EXISTS column_name;
|
|
1180
1180
|
await connection.query(
|
|
1181
|
-
|
|
1181
|
+
`ALTER TABLE "${table}" DROP COLUMN IF EXISTS "${name}";`
|
|
1182
1182
|
);
|
|
1183
1183
|
} catch (err) {
|
|
1184
1184
|
json = Util.flashError(err.toString());
|
|
@@ -1190,9 +1190,9 @@ router.delete("/delete_field", csrfProtection, async (req, res) => {
|
|
|
1190
1190
|
|
|
1191
1191
|
router.post("/tab_rename", csrfProtection, async (req, res) => {
|
|
1192
1192
|
const html = "",
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1193
|
+
table = req.body.table || "",
|
|
1194
|
+
name = req.body.name || "",
|
|
1195
|
+
id = req.body.id || 0;
|
|
1196
1196
|
let json = Util.jsonSuccess("Success to rename");
|
|
1197
1197
|
try {
|
|
1198
1198
|
if (table == "") {
|
|
@@ -1452,7 +1452,7 @@ router.post("/import", async (req, res) => {
|
|
|
1452
1452
|
});
|
|
1453
1453
|
}
|
|
1454
1454
|
json = Util.jsonSuccess(
|
|
1455
|
-
|
|
1455
|
+
"Success to add module, please generate tax to make a file"
|
|
1456
1456
|
);
|
|
1457
1457
|
}
|
|
1458
1458
|
}
|
|
@@ -1624,7 +1624,7 @@ const viewsMini = async () => {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
} catch (e) {
|
|
1626
1626
|
notifyObj = Util.flashError(
|
|
1627
|
-
|
|
1627
|
+
`error in item : ${item} , error str :${e.toString()}`
|
|
1628
1628
|
);
|
|
1629
1629
|
}
|
|
1630
1630
|
return notifyObj;
|