zet-lib 1.0.29 → 1.0.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.
@@ -12,6 +12,7 @@ const connection = require('./connection');
12
12
  const Util = require('./Util');
13
13
  const moduleLib = require('./moduleLib');
14
14
  const myCache = require('./cache');
15
+ const ejs = require('ejs');
15
16
 
16
17
  const nots = ['index','uploads','js','css','log','generator','zmenu','zgenerator','zfields','zrole','zfunction','zgrid','zgrid_default', 'zuser','zreport','zpage','zlayout','zerror','zuser_company','zconfig'];
17
18
  //const nots = [];
@@ -74,11 +75,11 @@ router.get('/', csrfProtection, async (req, res) => {
74
75
  lock: lock,
75
76
  routeName:res.locals.routeName,
76
77
  //endHTML : Util.readFile(`./views/generatorjs.ejs`)
77
- renderBody: "zgenerator/index.ejs",
78
+ //renderBody: "zgenerator/index.ejs",
78
79
  renderEnd: "zgenerator/indexjs.ejs"
79
80
  };
80
81
  let dataRender = zRoute.renderHTML(renderData);
81
-
82
+ dataRender.bodyHTML = ejs.render(body, dataRender);
82
83
  res.render('layouts/generator',dataRender);
83
84
  });
84
85
 
@@ -226,6 +227,7 @@ const generate = async (req, res) => {
226
227
  let datas;
227
228
  let results;
228
229
  let dummy = false;
230
+
229
231
  //save data into table zfields
230
232
  //console.log(JSON.stringify(body.others))
231
233
  const others = body.others;
@@ -266,7 +268,10 @@ const generate = async (req, res) => {
266
268
  id: datas.updateFields.id
267
269
  }
268
270
  });
269
-
271
+ let resultJSON = Object.prototype.hasOwnProperty.call(result,'json') ? result.json : {};
272
+ if(resultJSON && Object.prototype.hasOwnProperty.call(resultJSON,'dummy')){
273
+ dummy = resultJSON.dummy == 1 ? true : false;
274
+ }
270
275
  let properties = result.properties;
271
276
  //update if any chains
272
277
  for (let key in properties) {
@@ -436,7 +441,6 @@ const generate = async (req, res) => {
436
441
  newModel += `${Util.tab}};`;
437
442
 
438
443
  fs.writeFileSync(`${dirRoot}/models/${filesKey.filename}`, newModel);
439
- //console.log(JSON.stringify(objChains))
440
444
  }
441
445
  //check model if it has select relation in concat
442
446
  await scanning(MYMODEL);
@@ -448,23 +452,11 @@ const generate = async (req, res) => {
448
452
  fs.mkdirSync(DIR_VIEW);
449
453
  }
450
454
  let compilesJS = ['createjs.ejs', 'updatejs.ejs', 'importjs.ejs'];
451
-
452
- let resultJSON = Object.prototype.hasOwnProperty.call(result,'json') ? result.json : {};
453
- if(Object.prototype.hasOwnProperty.call(resultJSON,'dummy')){
454
- dummy = resultJSON.dummy;
455
- }
456
455
  if(!dummy) {
457
456
  for (const q in filesKey) {
458
457
  console.log(q);
459
458
  if (Util.in_array(q, compilesJS)) {
460
459
  fs.writeFileSync(`${DIR_VIEW}/${q}`, filesKey[q]);
461
- /* console.log(filesKey[q]);
462
- let myscript = filesKey[q];
463
- myscript = myscript.replaceAll(`<script>`,'').replaceAll(`</script>`,'');
464
- console.log(myscript);
465
- let script = uglifyJS.minify(myscript);
466
- if (script.error) throw script.error;
467
- fs.writeFileSync(`${DIR_VIEW}/${q}`, script.code);*/
468
460
  } else {
469
461
  fs.writeFileSync(`${DIR_VIEW}/${q}`, await minify(filesKey[q],
470
462
  {
@@ -478,11 +470,11 @@ const generate = async (req, res) => {
478
470
  }
479
471
  }
480
472
  }
481
- if (key == "route") {
482
- if(!dummy) {
473
+ if(!dummy) {
474
+ if (key == "route") {
483
475
  fs.writeFileSync(`${dirRoot}/routes/${filesKey.filename}`, filesKey.content);
476
+ console.log(`The files route of ${filesKey.filename} is saved!`);
484
477
  }
485
- //console.log(`The files route of ${filesKey.filename} is saved!`);
486
478
  }
487
479
  }
488
480
 
@@ -1095,9 +1087,8 @@ router.post("/import", async (req, res) => {
1095
1087
  Scanning relation id to name
1096
1088
  */
1097
1089
  const scanning = async (MYMODEL) => {
1098
- //let MYMODEL = require(`./../models/${table}`);
1090
+ //let MYMODEL = require(`${dirRoot}/models/${table}`);
1099
1091
  //console.log(JSON.stringify(MYMODEL))
1100
- const MYMODELS = zRoute.MYMODELS();
1101
1092
  let table = MYMODEL.table;
1102
1093
  const widgets = MYMODEL.widgets;
1103
1094
  const not_scanning = ['created_by', 'updated_by'];
@@ -1113,7 +1104,7 @@ const scanning = async (MYMODEL) => {
1113
1104
  if (arr.length) {
1114
1105
  let str = Util.replaceAll(arr[0], '"', '');
1115
1106
  let mysplits = str.indexOf(',') > -1 ? str.split(',') : [str];
1116
- let MYMODEL_TABLE = MYMODELS[widgets[key].table];
1107
+ let MYMODEL_TABLE = require(`${dirRoot}/models/${widgets[key].table}`);
1117
1108
  let widgetsRelations = MYMODEL_TABLE.widgets;
1118
1109
  let relationsKeys = [];
1119
1110
  let relationsKeysObject = {}
@@ -1247,4 +1238,532 @@ const viewsMini = async () => {
1247
1238
  return notifyObj;
1248
1239
  };
1249
1240
 
1241
+ const body = `<section class="mt-4">
1242
+ <!--Grid row-->
1243
+ <div class="row">
1244
+ <!--Grid column-->
1245
+ <div class="col-md-12 mb-2">
1246
+ <!--Generator-->
1247
+ <div class="card mb-3 wow fadeIn">
1248
+ <div class="card-header bg-success text-white font-weight-bold">Generator</div>
1249
+ <div class="card-body">
1250
+ <!-- Default form reply -->
1251
+ <form id="formgenerator" method="post" action="/crud">
1252
+ <div class="form-group">
1253
+ <label for="table">Module Name</label>
1254
+ <select name="table" id="table" class="form-control">
1255
+ <option value="">Please Select</option>
1256
+ <% for(var key in rows) {
1257
+ var row = rows[key];
1258
+ var selected = row.table == table ? " selected " : "";
1259
+ if(row.table != 'zrole') {
1260
+ %>
1261
+ <option value="<%= row.table %>" <%= selected %> ><%= row.table %></option>
1262
+ <% }} %>
1263
+ </select>
1264
+ </div>
1265
+
1266
+ <% if(table) {%>
1267
+ <div class="form-group">
1268
+ <label for="route">Title</label>
1269
+ <input type="text" class="form-control" id="title" name="title" value="<%- datas.name%>" />
1270
+ </div>
1271
+ <div class="form-group">
1272
+ <label for="route">Route</label>
1273
+ <input type="text" class="form-control" readonly id="route" name="route" value="<%- route%>" />
1274
+ </div>
1275
+
1276
+ <!-- Default checkbox -->
1277
+ <div class="form-group">
1278
+ <div class="form-check">
1279
+ <input class="form-check-input" type="checkbox" value="1" <%- checkDummy %> name="json[dummy]" id="dummy" />
1280
+ <label class="form-check-label" for="flexCheckDefault">As Dummy</label>
1281
+ </div>
1282
+ </div>
1283
+
1284
+ <div class="form-group">
1285
+ <label for="route">Tabs</label>
1286
+ <div class="input-group mb-3">
1287
+ <input type="text" class="form-control" id="tabname" placeholder="Enter tab name" aria-label="Enter tab name" aria-describedby="button-addon2">
1288
+ <div class="input-group-append">
1289
+ <button class="btn btn-md btn-secondary m-0 px-3" type="button" id="add"><i class="fa fa-plus"></i></button>
1290
+ </div>
1291
+ </div>
1292
+ </div>
1293
+ <div id="tabs"></div>
1294
+ <%} %>
1295
+
1296
+ <%if(lock==0) {%>
1297
+ <div class="text-center mt-4">
1298
+ <% if(table) {%>
1299
+ <button class="btn btn-danger text-white" id="delete_module" type="button"><i class="fa fa-trash"></i> Delete Module</button>
1300
+ <%}%>
1301
+ <button class="btn btn-success text-white" data-toggle="modal" data-target="#add_table" type="button"><i class="fa fa-plus"></i> Add Module</button>
1302
+ <% if(table) {%>
1303
+ <button class="btn btn-info" id="savetab" type="button"><i class="fa fa-paper-plane"></i> Save</button>
1304
+ <a class="btn btn-warning " href="/<%- table%>" target="__blank" type="button"><i class="fa fa-plane"></i> Go To <%- table%></a>
1305
+ <%}%>
1306
+ </div>
1307
+ <%} else {%>
1308
+ <button class="btn btn-danger text-white" type="button"><i class="fa fa-warning"></i> This table has been locked!!!</button>
1309
+
1310
+ <%} %>
1311
+ </form>
1312
+ <!-- Default form reply -->
1313
+ </div>
1314
+ </div>
1315
+ <!--Generator-->
1316
+ <div class="card mb-3 wow fadeIn" id="divfields" style="display: none">
1317
+ <div class="card-header secondary-color-dark text-white font-weight-bold">Fields</div>
1318
+ <div class="card-body">
1319
+
1320
+ <!-- Default form reply -->
1321
+ <form id="formfields" method="post" action="/generator/fields">
1322
+ <div id="divtablist" class="row"></div>
1323
+ <div id="contentfields"></div>
1324
+
1325
+
1326
+ <% if(lock == 0) {%>
1327
+ <div class="text-center mt-4">
1328
+ <button class="btn btn-danger btn-reset text-white mr-2" type="button"><i class="fas fa-drum"></i> Reset </button>
1329
+ <button class="btn btn-primary dropdown-toggle mr-2" type="button" data-toggle="dropdown"
1330
+ aria-haspopup="true" aria-expanded="false"><i class="fas fa-columns"></i> Layout <%- sorting%></button>
1331
+ <div class="dropdown-menu">
1332
+ <a class="dropdown-item layout21" href="#">2 : 1</a>
1333
+ <a class="dropdown-item layout12" href="#">1 : 2</a>
1334
+ </div>
1335
+ <!-- Basic dropdown -->
1336
+ <!--
1337
+ <button class="btn m-0 px-3 btn-test" type="button"><i class="fa fa-plus"></i> Test</button>
1338
+ -->
1339
+ <button class="btn m-0 px-3 waves-effect waves-light mr-2" data-toggle="modal" data-target="#modal_container" type="button"><i class="fa fa-plus"></i> Add Container</button>
1340
+ <button class="btn btn-success px-3 text-white mr-2" data-toggle="modal" data-target="#modal_add_field" type="button"><i class="fa fa-plus"></i> Add Field</button>
1341
+ <button class="btn secondary-color-dark px-3 text-white mr-2" id="save" type="button"><i class="fa fa-paper-plane"></i> Save & Generate</button>
1342
+ </div>
1343
+ <%}%>
1344
+ </form>
1345
+ <!-- Default form reply -->
1346
+ </div>
1347
+ </div>
1348
+ <!--/Generator-->
1349
+
1350
+
1351
+
1352
+
1353
+ <!-- Card -->
1354
+ <div class="card mb-4 wow fadeIn card-script" style="display: none">
1355
+ <div class="card-header font-weight-bold">
1356
+ <span> Files Content</span>
1357
+ </div>
1358
+ <div class="card-body">
1359
+ <h5 class="card-title">Files Generator <span class="badge badge-danger"><small>Using EJS template engine, Let it blank</small></span></h5>
1360
+
1361
+ <hr>
1362
+
1363
+ <ul class="nav nav-tabs" id="tabfiles" role="tablist">
1364
+ <li class="nav-item">
1365
+ <a class="nav-link active" data-toggle="tab" href="#tabrouter" role="tab" aria-controls="router"
1366
+ aria-selected="true">Router</a>
1367
+ </li>
1368
+ <li class="nav-item">
1369
+ <a class="nav-link " data-toggle="tab" href="#tabindex" role="tab" aria-controls="index"
1370
+ aria-selected="true">Index</a>
1371
+ </li>
1372
+ <li class="nav-item">
1373
+ <a class="nav-link" data-toggle="tab" href="#tabform" role="tab" aria-controls="form"
1374
+ aria-selected="false">Form</a>
1375
+ </li>
1376
+ <li class="nav-item">
1377
+ <a class="nav-link" data-toggle="tab" href="#tabview" role="tab" aria-controls="view"
1378
+ aria-selected="false">View</a>
1379
+ </li>
1380
+ </ul>
1381
+ <div class="tab-content" id="mytabfiles">
1382
+ <div class="tab-pane fade show active" id="tabrouter" role="tabpanel" aria-labelledby="tab-router">
1383
+ <br>
1384
+ <div class="row">
1385
+ <div class="col-md-9">
1386
+ <div class="form-group ">
1387
+ <label for="javascript">Router</label>
1388
+ <div class="ide_editor" id="router"><%- datas.router%></div>
1389
+ </div>
1390
+ </div>
1391
+
1392
+ </div>
1393
+ </div>
1394
+
1395
+ <div class="tab-pane fade" id="tabindex" role="tabpanel" aria-labelledby="index-tab">
1396
+ <br>
1397
+ <div class="row">
1398
+ <div class="col-md-6">
1399
+ <div class="form-group ">
1400
+ <label for="index.ejs">index.ejs</label>
1401
+ <div class="ide_editor" id="index_ejs"></div>
1402
+ </div>
1403
+ </div>
1404
+
1405
+ <div class="col-md-6">
1406
+ <div class="form-group ">
1407
+ <label for="indexcss_ejs">indexcss.ejs</label>
1408
+ <div class="ide_editor_200" id="indexcss_ejs"><%- datas.indexcss_ejs%></div>
1409
+ </div>
1410
+ <div class="form-group ">
1411
+ <label for="indexjs_ejs">indexjs.ejs</label>
1412
+ <div class="ide_editor_200" id="indexjs_ejs"></div>
1413
+ </div>
1414
+ </div>
1415
+ </div>
1416
+
1417
+ </div>
1418
+
1419
+ <div class="tab-pane fade" id="tabform" role="tabpanel" aria-labelledby="form-tab">
1420
+ <br>
1421
+
1422
+ <div class="row">
1423
+ <div class="col-md-6">
1424
+ <div class="form-group ">
1425
+ <label for="form.ejs">_form.ejs</label>
1426
+ <div class="ide_editor" id="form_ejs"></div>
1427
+ </div>
1428
+ </div>
1429
+ <div class="col-md-6">
1430
+ <div class="form-group ">
1431
+ <label for="create_ejs">create.ejs</label>
1432
+ <div class="ide_editor_200" id="create_ejs"></div>
1433
+ </div>
1434
+ <div class="form-group ">
1435
+ <label for="createjs_ejs">createjs.ejs</label>
1436
+ <div class="ide_editor_200" id="createjs_ejs"></div>
1437
+ </div>
1438
+ </div>
1439
+ </div>
1440
+
1441
+
1442
+ <div class="row">
1443
+ <div class="col-md-6">
1444
+ <div class="form-group ">
1445
+ <label for="update_ejs">update.ejs</label>
1446
+ <div class="ide_editor_200" id="update_ejs"></div>
1447
+ </div>
1448
+ <div class="form-group ">
1449
+ <label for="updatejs_ejs">updatejs.ejs</label>
1450
+ <div class="ide_editor_200" id="updatejs_ejs"></div>
1451
+ </div>
1452
+ </div>
1453
+
1454
+ <div class="col-md-6">
1455
+ <div class="form-group ">
1456
+ <label for="import_ejs">import.ejs</label>
1457
+ <div class="ide_editor_200" id="import_ejs"></div>
1458
+ </div>
1459
+ <div class="form-group ">
1460
+ <label for="importjs_ejs">importjs.ejs</label>
1461
+ <div class="ide_editor_200" id="importjs_ejs"></div>
1462
+ </div>
1463
+ </div>
1464
+ </div>
1465
+
1466
+ </div>
1467
+ <div class="tab-pane fade" id="tabview" role="tabpanel" aria-labelledby="view-tab">
1468
+ <br>
1469
+ <div class="row">
1470
+ <div class="col-md-9">
1471
+ <div class="form-group ">
1472
+ <label for="view_ejs">view.ejs</label>
1473
+ <div class="ide_editor" id="view_ejs"></div>
1474
+ </div>
1475
+ </div>
1476
+ <div class="col-md-6"></div>
1477
+ </div>
1478
+ </div>
1479
+ </div>
1480
+ </div>
1481
+ </div>
1482
+
1483
+
1484
+ <!--Card-->
1485
+ <div class="card mb-4 wow fadeIn card-script" style="display: none">
1486
+ <div class="card-header font-weight-bold">
1487
+ <span>Additional Settings</span>
1488
+ </div>
1489
+
1490
+ <div class="card-body">
1491
+ <h5 class="card-title">Hard Code</h5>
1492
+ <hr>
1493
+
1494
+ <div class="row">
1495
+ <div class="col-md-6">
1496
+ <div class="form-group">
1497
+ <div class="form-group">
1498
+ <label for="javascript">Grid / List <span class="badge badge-danger">Please do not remove this</span></label>
1499
+ <div class="ide_editor_200" id="hardcode_grid"><%= datas.hardcode_grid || ""%></div>
1500
+ </div>
1501
+ </div>
1502
+ </div>
1503
+
1504
+ <div class="col-md-6">
1505
+ <% if(zForms.obj.hasOwnProperty("is_approval")) {%>
1506
+ <label for="approval">Approval Systems</label>
1507
+ <!-- Default checked -->
1508
+ <%- zForms.build["is_approval"] %>
1509
+ <div class="divzapprovals" <%- approvalDatas.is_approval ? '' : 'style="display: none"' %> >
1510
+ <%- zForms.build["template"] %>
1511
+ <div class="row">
1512
+ <div class="col-md-6">
1513
+ <div class="form-group divTitle mb-3">
1514
+ <label>Title</label>
1515
+ <input type="text" class="form-control" id="approval_title" name="approval_title" value="<%- approvalDatas.title %>">
1516
+ </div>
1517
+ </div>
1518
+ <div class="col-md-6">
1519
+ <%- zForms.build["type"] %>
1520
+ </div>
1521
+ </div>
1522
+
1523
+ <div class="row">
1524
+ <div class="col-md-12">
1525
+ <%- zForms.build["approvers"] %>
1526
+ <%- zForms.build["knowings"] %>
1527
+ </div>
1528
+ </div>
1529
+ </div>
1530
+ <%}%>
1531
+ </div>
1532
+ </div>
1533
+ </div>
1534
+ </div>
1535
+ <!--/.Card-->
1536
+
1537
+ </div>
1538
+
1539
+ </div>
1540
+ <!--Grid row-->
1541
+ </section>
1542
+ <!--Section: Post-->
1543
+
1544
+
1545
+
1546
+
1547
+ <!-- Modal -->
1548
+ <div class="modal fade" id="add_table" tabindex="-1" aria-labelledby="add_table" aria-hidden="true">
1549
+ <div class="modal-dialog">
1550
+ <div class="modal-content">
1551
+ <div class="modal-header">
1552
+ <h5 class="modal-title" id="exampleModalLabel">Add Table</h5>
1553
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fa fa-times"></i> </button>
1554
+ </div>
1555
+ <div class="modal-body">
1556
+ <form id="modal-form" method="post" action="/generator">
1557
+ <div class="form-group">
1558
+ <label for="table">Module Name</label>
1559
+ <input type="text" class="form-control" id="modal-table" name="table"/>
1560
+ </div>
1561
+
1562
+ <div class="form-group">
1563
+ <label for="route">Route</label>
1564
+ <input type="text" class="form-control" id="modal-route" name="route"/>
1565
+ </div>
1566
+ </form>
1567
+ </div>
1568
+ <div class="modal-footer">
1569
+ <button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
1570
+ <button type="button" id="modal-save" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Save</button>
1571
+ </div>
1572
+ </div>
1573
+ </div>
1574
+ </div>
1575
+
1576
+
1577
+ <div class="modal fade" id="modal_add_field" tabindex="-1" aria-labelledby="add_table" aria-hidden="true">
1578
+ <div class="modal-dialog">
1579
+ <div class="modal-content">
1580
+ <div class="modal-header">
1581
+ <h5 class="modal-title" >Add Field</h5>
1582
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fa fa-times"></i> </button>
1583
+ </div>
1584
+ <div class="modal-body">
1585
+
1586
+ <form id="modal-form" method="post" action="/<%- routeName%>">
1587
+ <div class="form-group">
1588
+ <label for="table">Name</label>
1589
+ <div class="input-group">
1590
+ <div class="input-group-prepend">
1591
+ <select id="modal_position" class="form-control">
1592
+ <option value="LEFT">Left</option>
1593
+ <option value="RIGHT">Right</option>
1594
+ <option value="ONE_COLUMN">One Column</option>
1595
+ </select>
1596
+ </div>
1597
+ <input type="text" class="form-control" id="modal_name" placeholder="Field Name" name="name"/>
1598
+ </div>
1599
+ </div>
1600
+
1601
+ <div class="form-group">
1602
+ <label for="route">Type</label>
1603
+ <select class="form-control" id="modal_type">
1604
+ <% for(var key in selects){%>
1605
+ <option value="<%- key%>"><%- selects[key]%></option>
1606
+ <%}%>
1607
+ </select>
1608
+ </div>
1609
+
1610
+ <div class="row divrelation" style="display:none">
1611
+ <div class="col-md-6">
1612
+ <div class="form-group">
1613
+ <label for="route">Module Name</label>
1614
+ <select class="form-control" id="relationtable"></select>
1615
+ </div>
1616
+ </div>
1617
+
1618
+ <div class="col-md-6 divrelationfield">
1619
+ <div class="form-group ">
1620
+ <label for="route">Label</label>
1621
+ <select class="form-control" id="relationfield"></select>
1622
+ </div>
1623
+ </div>
1624
+
1625
+ <div class="col-md-12 divconcat">
1626
+ <div class="form-group ">
1627
+ <label for="route">Concat</label>
1628
+ <input type="text" class="form-control" id="relationconcat" placeholder='CONCAT(fullname, " (email) : ", email)' >
1629
+ </div>
1630
+ </div>
1631
+
1632
+ </div>
1633
+ </form>
1634
+
1635
+ </div>
1636
+ <div class="modal-footer">
1637
+ <button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
1638
+ <button type="button" id="modal-add" class="btn btn-primary"><i class="fa fa-plus"></i> Add</button>
1639
+ </div>
1640
+ </div>
1641
+ </div>
1642
+ </div>
1643
+
1644
+
1645
+ <div class="modal fade" id="modal_setting" tabindex="-1" aria-labelledby="modal_setting" aria-hidden="true">
1646
+ <div class="modal-dialog">
1647
+ <div class="modal-content">
1648
+ <div class="modal-header">
1649
+ <h5 class="modal-title" id="modal_setting_label">Setting</h5>
1650
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fa fa-times"></i> </button>
1651
+ </div>
1652
+ <div class="modal-body">
1653
+ <form id="modal-setting-form" method="post" action="/<%- routeName%>/save_setting">
1654
+ <div id="body_content"></div>
1655
+ </form>
1656
+ </div>
1657
+ <div class="modal-footer">
1658
+ <button class="btn btn-danger text-white" id="delete_field" type="button"><i class="fa fa-trash"></i> Delete</button>
1659
+ <button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
1660
+ <button type="button" id="modal-setting-save" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Save</button>
1661
+ </div>
1662
+ </div>
1663
+ </div>
1664
+ </div>
1665
+
1666
+
1667
+
1668
+ <div class="modal fade" id="modal_tab" tabindex="-1" aria-labelledby="modal_setting" aria-hidden="true">
1669
+ <div class="modal-dialog">
1670
+ <div class="modal-content">
1671
+ <div class="modal-header">
1672
+ <h5 class="modal-title" id="modal_setting_label">Tab</h5>
1673
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fa fa-times"></i> </button>
1674
+ </div>
1675
+ <div class="modal-body">
1676
+ <form>
1677
+ <input type="text" id="edittab" class="form-control">
1678
+ </form>
1679
+ </div>
1680
+ <div class="modal-footer">
1681
+ <button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
1682
+ <button type="button" id="modal-tab-save" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Save</button>
1683
+ </div>
1684
+ </div>
1685
+ </div>
1686
+ </div>
1687
+
1688
+ <div class="modal fade" id="modal-file" tabindex="-1" aria-labelledby="add_table" aria-hidden="true">
1689
+ <div class="modal-dialog">
1690
+ <div class="modal-content">
1691
+ <div class="modal-header">
1692
+ <h5 class="modal-title" id="exampleModalLabel">Import zfield File</h5>
1693
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fa fa-times"></i> </button>
1694
+ </div>
1695
+ <div class="modal-body">
1696
+ <form id="modal-form-file" method="post" action="/zgenerator/import">
1697
+ <input type="hidden" name="_csrf" value="<%= csrfToken %>">
1698
+ <div class="form-group">
1699
+ <label for="table">File</label>
1700
+ <input type="file" class="form-control" id="import-file" name="import-file" required/>
1701
+ </div>
1702
+ </form>
1703
+ </div>
1704
+ <div class="modal-footer">
1705
+ <button type="button" class="btn btn-secondary" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
1706
+ <button type="submit" id="submit-import" class="btn btn-primary"><i class="fa fa-paper-plane"></i> Submit</button>
1707
+ </div>
1708
+ </div>
1709
+ </div>
1710
+ </div>
1711
+
1712
+
1713
+ <div class="modal fade" id="modal_container" tabindex="-1" aria-labelledby="add_container" aria-hidden="true">
1714
+ <div class="modal-dialog">
1715
+ <div class="modal-content">
1716
+ <div class="modal-header">
1717
+ <h5 class="modal-title" id="exampleModalLabel">Add Container</h5>
1718
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fa fa-times"></i> </button>
1719
+ </div>
1720
+ <div class="modal-body">
1721
+ <form >
1722
+ <div class="form-group">
1723
+ <label for="route">Column</label>
1724
+ <select class="form-control form-select" id="column-count">
1725
+ <option value="1">1</option>
1726
+ <option value="2" selected>2</option>
1727
+ <option value="3">3</option>
1728
+ <option value="4">4</option>
1729
+ <option value="6">6</option>
1730
+ </select>
1731
+ </div>
1732
+ </form>
1733
+ </div>
1734
+ <div class="modal-footer">
1735
+ <button type="button" class="btn btn-secondary btn-modal-container-close" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
1736
+ <button type="button" id="modal-container-save" class="btn btn-primary"><i class="fa fa-plus-circle"></i> Add</button>
1737
+ </div>
1738
+ </div>
1739
+ </div>
1740
+ </div>
1741
+
1742
+
1743
+ <!-- Modal insert data into container --->
1744
+ <div class="modal fade" id="modal_container_into" tabindex="-1" aria-labelledby="modal_container_into" aria-hidden="true">
1745
+ <div class="modal-dialog">
1746
+ <div class="modal-content">
1747
+ <div class="modal-header">
1748
+ <h5 class="modal-title" id="exampleModalLabel">Move <span class="badge badge-danger">fields </span> into container</h5>
1749
+ <button type="button" class="close" data-dismiss="modal" aria-label="Close"><i class="fa fa-times"></i> </button>
1750
+ </div>
1751
+ <div class="modal-body">
1752
+ <form >
1753
+ <div class="form-group">
1754
+ <label for="route">Into Container</label>
1755
+ <select class="form-control form-select" id="container-select">
1756
+ </select>
1757
+ </div>
1758
+ </form>
1759
+ </div>
1760
+ <div class="modal-footer">
1761
+ <button type="button" class="btn btn-secondary btncontainer-close" data-dismiss="modal"><i class="fa fa-times"></i> Close</button>
1762
+ <button type="button" id="moveintocontainer" class="btn btn-primary"><i class="fa fa-plus-circle"></i> Move</button>
1763
+ </div>
1764
+ </div>
1765
+ </div>
1766
+ </div>
1767
+ `;
1768
+
1250
1769
  module.exports = router;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"