zet-lib 1.2.1 → 1.2.2

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.
@@ -1,195 +1,211 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
- <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no" />
7
- <meta name="usertoken" content="<%- token %>" />
8
- <meta name="socketUrl" content="<%- socketUrl %>" />
9
- <meta name="csrf-token" content="<%- csrfToken %>" />
10
- <title><%- titleApp || 'CRUD GENERATOR' %></title>
11
- <%- moduleHead %>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no" />
7
+ <meta name="usertoken" content="<%- token %>" />
8
+ <meta name="socketUrl" content="<%- socketUrl %>" />
9
+ <meta name="csrf-token" content="<%- csrfToken %>" />
10
+ <title><%- titleApp || 'CRUD GENERATOR' %></title>
11
+ <%- moduleHead %>
12
12
  <link rel="stylesheet" href="/css/app.css" />
13
13
  <%- renderHead ? include("./../" + renderHead) : headHTML %>
14
- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" />
15
- <link href="/mdb/css/bootstrap.min.css" rel="stylesheet" />
16
- <link rel="stylesheet" href="/css/toastr.min.css" />
17
- <link rel="stylesheet" href="/js/sortable.css" />
18
- <link href="/mdb/css/mdb.min.css" rel="stylesheet" />
19
- <link href="/mdb/css/style.css" rel="stylesheet" />
20
- <style type="text/css">
21
- .ide_editor {
22
- width: 100%;
23
- height: 400px;
24
- }
25
-
26
- .ide_editor_200 {
27
- width: 100%;
28
- height: 200px;
29
- }
30
-
31
- #modalpopup {
32
- display: none;
33
- position: fixed;
34
- z-index: 1000;
35
- top: 0;
36
- left: 0;
37
- height: 100%;
38
- width: 100%;
39
- opacity: 0.8;
40
- }
41
-
42
- .divbox {
43
- border: 1px solid green;
44
- min-height: 100px;
45
- margin: 30px 1px 30px 1px;
46
- padding-top: 10px;
47
- padding-bottom: 5px;
48
- }
49
-
50
- .tab-content {
51
- width: 100%;
52
- }
53
-
54
- .tab-pane {
55
- width: 100%;
56
- }
57
-
58
- .divboxlittle {
59
- border: 1px solid green;
60
- min-height: 50px;
61
- width: 100%;
62
- padding-top: 10px;
63
- padding-bottom: 5px;
64
- }
65
-
66
- ol.mydragable li {
67
- cursor: grabbing;
68
- }
69
-
70
- body.dragging,
71
- body.dragging * {
72
- cursor: move !important;
73
- }
74
-
75
- .dragged {
76
- position: absolute;
77
- opacity: 0.5;
78
- z-index: 2000;
79
- }
80
-
81
- ol.mydragable li.placeholder {
82
- position: relative;
83
- }
84
-
85
- ol.mydragable li.placeholder:before {
86
- position: absolute;
87
- }
88
-
89
- .icon-floats {
90
- position: absolute;
91
- }
92
-
93
- .box-border {
94
- border: 1px solid green;
95
- }
96
-
97
- .icon-floating {
98
- position: relative;
99
- top: 40px;
100
- left: -30px;
101
- }
102
-
103
- .spinner {
104
- display: flex;
105
- align-items: center;
106
- width: 40px;
107
- height: 40px;
108
- position: fixed;
109
- top: 140px;
110
- left: 140px;
111
- z-index: 10;
112
- }
113
- .sortable-list .item {
114
- list-style: none;
115
- display: flex;
116
- cursor: move;
117
- background: #fff;
118
- align-items: center;
119
- border-radius: 5px;
120
- padding: 10px 13px;
121
- margin-bottom: 11px;
122
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
123
- border: 1px solid #ccc;
124
- justify-content: space-between;
125
- }
126
- .divtabs {
127
- display: flex;
128
- }
129
- </style>
130
- </head>
131
- <body class="grey lighten-3">
132
- <header>
133
- <nav class="navbar fixed-top navbar-expand-lg navbar-light white scrolling-navbar">
134
- <div class="container">
135
- <a class="navbar-brand waves-effect" href="/dashboard"><strong class="blue-text"><%- menuApp %> </strong></a>
136
- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
137
- <div class="collapse navbar-collapse" id="navbarSupportedContent">
138
- <ul id="main-navbar" class="nav navbar-nav nav-flex-icons ml-auto ms-auto flex-row" data-loaded="dpl">
139
- <div id="navbarNotification" class="d-none">
140
- <div id="navbarNotificationCounter"></div>
141
- <div id="navbarNotificationContent"></div>
142
- </div>
143
- <li class="nav-item me-3 me-lg-0 d-none d-sm-inline-block dropdown">
144
- <a class="nav-link dropdown-toggle" id="new-mdb-technologies-dropdown" role="button" data-toggle="dropdown" aria-expanded="true"><i class="fa fa-cog"></i> Admin</a>
145
- <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="new-mdb-technologies-dropdown">
146
- <li><h5 class="dropdown-header">Admin Menu</h5></li>
147
- <li>
148
- <hr class="dropdown-divider" />
149
- </li>
150
- <li>
151
- <a class="dropdown-item" href="/zgenerator"><span>Generator</span></a>
152
- </li>
153
- <li>
154
- <a class="dropdown-item" href="/zmenu"><span>Menu Generator</span></a>
155
- </li>
156
- <li>
157
- <a class="dropdown-item" href="/zreport"><span>Report Generator</span></a>
158
- </li>
159
- </ul>
160
- </li>
161
- <li class="nav-item d-none d-sm-inline-block">
162
- <a href="#" class="nav-link waves-effect export-file"><i class="fas fa-sign-out-alt"></i> Export</a>
163
- </li>
164
- <li class="nav-item d-none d-sm-inline-block">
165
- <a href="#" data-toggle="modal" data-target="#modal-file" class="nav-link waves-effect"><i class="fas fa-syringe"></i> Import</a>
166
- </li>
167
- <li><a href="/dashboard" target="_blank" class="auth-modal-toggle btn btn-sm btn-primary ripple-surface ms-2 me-1" data-auth-modal-tab="sign-in">Dashboard</a></li>
168
- </ul>
169
- </div>
14
+ <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css" />
15
+ <link href="/mdb/css/bootstrap.min.css" rel="stylesheet" />
16
+ <link rel="stylesheet" href="/css/toastr.min.css" />
17
+ <link rel="stylesheet" href="/js/sortable.css" />
18
+ <link href="/mdb/css/mdb.min.css" rel="stylesheet" />
19
+ <link href="/mdb/css/style.css" rel="stylesheet" />
20
+ <style type="text/css">
21
+ .ide_editor {
22
+ width: 100%;
23
+ height: 400px;
24
+ }
25
+
26
+ .ide_editor_200 {
27
+ width: 100%;
28
+ height: 200px;
29
+ }
30
+
31
+ #modalpopup {
32
+ display: none;
33
+ position: fixed;
34
+ z-index: 1000;
35
+ top: 0;
36
+ left: 0;
37
+ height: 100%;
38
+ width: 100%;
39
+ opacity: 0.8;
40
+ }
41
+
42
+ .divbox {
43
+ border: 1px solid green;
44
+ min-height: 100px;
45
+ margin: 30px 1px 30px 1px;
46
+ padding-top: 10px;
47
+ padding-bottom: 5px;
48
+ }
49
+
50
+ .tab-content {
51
+ width: 100%;
52
+ }
53
+
54
+ .tab-pane {
55
+ width: 100%;
56
+ }
57
+
58
+ .divboxlittle {
59
+ border: 1px solid green;
60
+ min-height: 50px;
61
+ width: 100%;
62
+ padding-top: 10px;
63
+ padding-bottom: 5px;
64
+ }
65
+
66
+ ol.mydragable li {
67
+ cursor: grabbing;
68
+ }
69
+
70
+ body.dragging,
71
+ body.dragging * {
72
+ cursor: move !important;
73
+ }
74
+
75
+ .dragged {
76
+ position: absolute;
77
+ opacity: 0.5;
78
+ z-index: 2000;
79
+ }
80
+
81
+ ol.mydragable li.placeholder {
82
+ position: relative;
83
+ }
84
+
85
+ ol.mydragable li.placeholder:before {
86
+ position: absolute;
87
+ }
88
+
89
+ .icon-floats {
90
+ position: absolute;
91
+ }
92
+
93
+ .box-border {
94
+ border: 1px solid green;
95
+ }
96
+
97
+ .icon-floating {
98
+ position: relative;
99
+ top: 40px;
100
+ left: -30px;
101
+ }
102
+
103
+ .spinner {
104
+ display: flex;
105
+ align-items: center;
106
+ width: 40px;
107
+ height: 40px;
108
+ position: fixed;
109
+ top: 140px;
110
+ left: 140px;
111
+ z-index: 10;
112
+ }
113
+
114
+ .sortable-list .item {
115
+ list-style: none;
116
+ display: flex;
117
+ cursor: move;
118
+ background: #fff;
119
+ align-items: center;
120
+ border-radius: 5px;
121
+ padding: 10px 13px;
122
+ margin-bottom: 11px;
123
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
124
+ border: 1px solid #ccc;
125
+ justify-content: space-between;
126
+ }
127
+
128
+ .divtabs {
129
+ display: flex;
130
+ }
131
+ </style>
132
+ </head>
133
+ <body class="grey lighten-3">
134
+ <header>
135
+ <nav class="navbar fixed-top navbar-expand-lg navbar-light white scrolling-navbar">
136
+ <div class="container">
137
+ <a class="navbar-brand waves-effect" href="/dashboard"><strong class="blue-text"><%- menuApp %> </strong></a>
138
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
139
+ aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"><span
140
+ class="navbar-toggler-icon"></span></button>
141
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
142
+ <ul id="main-navbar" class="nav navbar-nav nav-flex-icons ml-auto ms-auto flex-row" data-loaded="dpl">
143
+ <div id="navbarNotification" class="d-none">
144
+ <div id="navbarNotificationCounter"></div>
145
+ <div id="navbarNotificationContent"></div>
146
+ </div>
147
+ <li class="nav-item me-3 me-lg-0 d-none d-sm-inline-block dropdown">
148
+ <a class="nav-link dropdown-toggle" id="new-mdb-technologies-dropdown" role="button"
149
+ data-toggle="dropdown" aria-expanded="true"><i class="fa fa-cog"></i> Admin</a>
150
+ <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="new-mdb-technologies-dropdown">
151
+ <li>
152
+ <h5 class="dropdown-header">Admin Menu</h5>
153
+ </li>
154
+ <li>
155
+ <hr class="dropdown-divider" />
156
+ </li>
157
+ <li>
158
+ <a class="dropdown-item" href="/zgenerator"><span>Generator</span></a>
159
+ </li>
160
+ <li>
161
+ <a class="dropdown-item" href="/zmenu"><span>Menu Generator</span></a>
162
+ </li>
163
+ <li>
164
+ <a class="dropdown-item" href="/zreport"><span>Report Generator</span></a>
165
+ </li>
166
+ </ul>
167
+ </li>
168
+ <li class="nav-item d-none d-sm-inline-block">
169
+ <a href="#" class="nav-link waves-effect export-file"><i class="fas fa-sign-out-alt"></i> Export</a>
170
+ </li>
171
+ <li class="nav-item d-none d-sm-inline-block">
172
+ <a href="#" data-toggle="modal" data-target="#modal-file" class="nav-link waves-effect"><i
173
+ class="fas fa-syringe"></i> Import</a>
174
+ </li>
175
+ <li><a href="/dashboard" target="_blank"
176
+ class="auth-modal-toggle btn btn-sm btn-primary ripple-surface ms-2 me-1"
177
+ data-auth-modal-tab="sign-in">Dashboard</a></li>
178
+ </ul>
170
179
  </div>
171
- </nav>
172
- </header>
173
- <main class="mt-5 pt-5">
174
- <div class="container-fluid"><%- renderBody ? include("./../" + renderBody) : bodyHTML %></div>
175
- </main>
176
- <footer class="page-footer text-center font-small mdb-color darken-2 mt-4 wow fadeIn">
177
- <hr class="my-4" />
178
- <div class="pb-4">
179
- <a href="https://www.facebook.com/sintret" target="_blank"><i class="fab fa-facebook-f mr-3"></i> </a><a href="https://twitter.com/sintret" target="_blank"><i class="fab fa-twitter mr-3"></i> </a><a href="https://www.youtube.com/watch?v=sintret" target="_blank"><i class="fab fa-youtube mr-3"></i> </a
180
- ><a href="https://plus.google.com/u/0/b/sintret" target="_blank"><i class="fab fa-google-plus-g mr-3"></i> </a><a href="https://dribbble.com/sintret" target="_blank"><i class="fab fa-dribbble mr-3"></i> </a><a href="https://pinterest.com/sintret" target="_blank"><i class="fab fa-pinterest mr-3"></i> </a
181
- ><a href="https://github.com/sintret" target="_blank"><i class="fab fa-github mr-3"></i> </a><a href="http://codepen.io/sintret/" target="_blank"><i class="fab fa-codepen mr-3"></i></a>
182
180
  </div>
183
- <div class="footer-copyright py-3">© 2022 - <%- new Date().getFullYear() %> Copyright: <a href="https://sintret.com" target="_blank">App Maker</a></div>
184
- </footer>
185
- <div class="spinner" style="display: none"><img src="/assets/tiny/reload.svg" width="62" /></div>
186
- <script src="/js/jquery-3.7.0.min.js"></script>
187
- <script type="text/javascript" src="/mdb/js/popper.min.js"></script>
188
- <script type="text/javascript" src="/mdb/js/bootstrap.min.js"></script>
189
- <script type="text/javascript" src="/mdb/js/mdb.min.js"></script>
190
- <script src="/js/toastr.min.js"></script>
191
- <script src="/js/jquery-sortable.js"></script>
192
- <script src="/js/formv4.min.js"></script>
193
- <%- moduleEnd %> <%- renderEnd ? include("./../" + renderEnd) : endHTML %>
194
- </body>
195
- </html>
181
+ </nav>
182
+ </header>
183
+ <main class="mt-5 pt-5">
184
+ <div class="container-fluid"><%- renderBody ? include("./../" + renderBody) : bodyHTML %></div>
185
+ </main>
186
+ <footer class="page-footer text-center font-small mdb-color darken-2 mt-4 wow fadeIn">
187
+ <hr class="my-4" />
188
+ <div class="pb-4">
189
+ <a href="https://www.facebook.com/sintret" target="_blank"><i class="fab fa-facebook-f mr-3"></i> </a><a
190
+ href="https://twitter.com/sintret" target="_blank"><i class="fab fa-twitter mr-3"></i> </a><a
191
+ href="https://www.youtube.com/watch?v=sintret" target="_blank"><i class="fab fa-youtube mr-3"></i> </a><a
192
+ href="https://plus.google.com/u/0/b/sintret" target="_blank"><i class="fab fa-google-plus-g mr-3"></i> </a><a
193
+ href="https://dribbble.com/sintret" target="_blank"><i class="fab fa-dribbble mr-3"></i> </a><a
194
+ href="https://pinterest.com/sintret" target="_blank"><i class="fab fa-pinterest mr-3"></i> </a><a
195
+ href="https://github.com/sintret" target="_blank"><i class="fab fa-github mr-3"></i> </a><a
196
+ href="http://codepen.io/sintret/" target="_blank"><i class="fab fa-codepen mr-3"></i></a>
197
+ </div>
198
+ <div class="footer-copyright py-3">©2023 - <%- new Date().getFullYear() %> Copyright: <a href="https://sintret.com"
199
+ target="_blank">App Maker</a></div>
200
+ </footer>
201
+ <div class="spinner" style="display: none"><img src="/assets/tiny/reload.svg" width="62" /></div>
202
+ <script src="/js/jquery-3.7.0.min.js"></script>
203
+ <script type="text/javascript" src="/mdb/js/popper.min.js"></script>
204
+ <script type="text/javascript" src="/mdb/js/bootstrap.min.js"></script>
205
+ <script type="text/javascript" src="/mdb/js/mdb.min.js"></script>
206
+ <script src="/js/toastr.min.js"></script>
207
+ <script src="/js/jquery-sortable.js"></script>
208
+ <script src="/js/formv4.min.js"></script>
209
+ <%- moduleEnd %> <%- renderEnd ? include("./../" + renderEnd) : endHTML %>
210
+ </body>
211
+ </html>
@@ -1,6 +1,6 @@
1
1
  <!-- set to localStorage -->
2
2
  <script>
3
- var datas = <%- JSON.stringify(JSON.stringify(datas,null,2)) %>;
3
+ var datas = <% - JSON.stringify(JSON.stringify(datas, null, 2)) %>;
4
4
  var is_approval = "<%- approvalDatas.is_approval %>";
5
5
  var sorting = "<%- sorting%>";
6
6
  </script>
@@ -9,8 +9,6 @@
9
9
  var others = {}
10
10
  var container_time = ''
11
11
  //end container
12
- var editor_hardcode_grid = ace.edit('hardcode_grid')
13
- editor_hardcode_grid.getSession().setMode('ace/mode/javascript')
14
12
  var editor_router = ace.edit('router')
15
13
  editor_router.getSession().setMode('ace/mode/javascript')
16
14
 
@@ -386,7 +384,7 @@
386
384
  {
387
385
  details: $('#formfields').serializeArray(),
388
386
  table: $('#table').val(),
389
- hardcode_grid: editor_hardcode_grid.getValue(),
387
+ hardcode_grid: null,
390
388
  router: editor_router.getValue(),
391
389
  index_ejs: editor_index_ejs.getValue(),
392
390
  indexcss_ejs: editor_indexcss_ejs.getValue(),
@@ -873,11 +871,11 @@
873
871
  table: $('#table').val(),
874
872
  others: JSON.stringify(others),
875
873
  },
876
- function (dt) {}
874
+ function (dt) { }
877
875
  )
878
876
  }
879
877
  </script>
880
878
  <script>
881
879
  //tab draggable
882
- $(function () {})
883
- </script>
880
+ $(function () { })
881
+ </script>
@@ -724,30 +724,68 @@ router.delete('/delete-table', csrfProtection, async (req, res) => {
724
724
  }
725
725
  })
726
726
 
727
- let runtimeFile = dirRoot + '/runtime/scripts/' + table + '.js'
728
- fs.stat(runtimeFile, function (err, stats) {
729
- if (err) {
730
- return console.error(err)
731
- } else {
732
- fs.unlink(runtimeFile, function (err) {
733
- if (err) return console.log(err)
734
- console.log('file deleted successfully')
735
- })
727
+ let runtimeFile = dirRoot + '/public/runtime/script/' + table
728
+ fs.rm(
729
+ runtimeFile,
730
+ {
731
+ recursive: true,
732
+ },
733
+ (error) => {
734
+ if (error) {
735
+ console.log(error)
736
+ } else {
737
+ console.log('Recursive: Directories Deleted!')
738
+ }
736
739
  }
737
- })
740
+ )
741
+ let runtimeFileHead = dirRoot + '/public/runtime/head/' + table
742
+ fs.rm(
743
+ runtimeFileHead,
744
+ {
745
+ recursive: true,
746
+ },
747
+ (error) => {
748
+ if (error) {
749
+ console.log(error)
750
+ } else {
751
+ console.log('Recursive: Directories Deleted!')
752
+ }
753
+ }
754
+ )
755
+ let runtimeFileEnd = dirRoot + '/public/runtime/end/' + table
756
+ fs.rm(
757
+ runtimeFileEnd,
758
+ {
759
+ recursive: true,
760
+ },
761
+ (error) => {
762
+ if (error) {
763
+ console.log(error)
764
+ } else {
765
+ console.log('Recursive: Directories Deleted!')
766
+ }
767
+ }
768
+ )
769
+
738
770
  await connection.delete({
739
771
  table: 'zgrid',
740
772
  where: { route_name: table },
741
773
  })
742
774
  if (table) {
743
775
  const viewsFile = dirRoot + '/views/' + table
744
- fs.stat(viewsFile, function (err, stats) {
745
- if (err) {
746
- return console.error(err)
747
- } else {
748
- fs.rmdirSync(viewsFile, { recursive: true })
776
+ fs.rm(
777
+ viewsFile,
778
+ {
779
+ recursive: true,
780
+ },
781
+ (error) => {
782
+ if (error) {
783
+ console.log(error)
784
+ } else {
785
+ console.log('Recursive: Directories Deleted!')
786
+ }
749
787
  }
750
- })
788
+ )
751
789
  }
752
790
  await connection.delete({
753
791
  table: 'zgrid_default',
@@ -947,7 +985,7 @@ router.post('/tab_rename', csrfProtection, async (req, res) => {
947
985
 
948
986
  const zfields = async () => {
949
987
  return await connection.results({
950
- select: `id, "table", "name", "route",tabs,labels, details, "left","right",one_column, sorting, properties,hardcode_grid,others,json`,
988
+ select: `id, "table", "name", "route",tabs,labels, details, "left","right",one_column, sorting, properties,others,json`,
951
989
  table: 'zfields',
952
990
  orderBy: ['table', 'asc'],
953
991
  })
@@ -1548,20 +1586,9 @@ const body = `<section class="mt-4">
1548
1586
  </div>
1549
1587
 
1550
1588
  <div class="card-body">
1551
- <h5 class="card-title">Hard Code</h5>
1552
1589
  <hr>
1553
1590
 
1554
- <div class="row">
1555
- <div class="col-md-6">
1556
- <div class="form-group">
1557
- <div class="form-group">
1558
- <label for="javascript">Grid / List <span class="badge badge-danger">Please do not remove this</span></label>
1559
- <div class="ide_editor_200" id="hardcode_grid"><%= datas.hardcode_grid || ""%></div>
1560
- </div>
1561
- </div>
1562
- </div>
1563
-
1564
- <div class="col-md-6">
1591
+ <div class="col-md-12">
1565
1592
  <% if(zForms.obj.hasOwnProperty("is_approval")) {%>
1566
1593
  <label for="approval">Approval Systems</label>
1567
1594
  <!-- Default checked -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zet-lib",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "zet is a library that part of zet generator.",
5
5
  "engines": {
6
6
  "node": ">=18"