zet-lib 1.0.8 → 1.0.9
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/zMenuRouter.js +2 -15
- package/package.json +1 -1
package/lib/zMenuRouter.js
CHANGED
|
@@ -10,6 +10,7 @@ const zRole = require('./zRole');
|
|
|
10
10
|
const zCache = require('./zCache');
|
|
11
11
|
const moduleLib = require('./moduleLib');
|
|
12
12
|
const config = require('dotenv').config();
|
|
13
|
+
const ejs = require('ejs');
|
|
13
14
|
|
|
14
15
|
/*
|
|
15
16
|
icons list for tabler and set to /public/js
|
|
@@ -20,16 +21,6 @@ const iconList = () => {
|
|
|
20
21
|
return icons;
|
|
21
22
|
};
|
|
22
23
|
|
|
23
|
-
const writeCss = () => {
|
|
24
|
-
const icons = iconList();
|
|
25
|
-
let text = '';
|
|
26
|
-
icons.forEach(function (icon) {
|
|
27
|
-
let item = icon.replace('.svg','');
|
|
28
|
-
text += `.tabler-${item}{background-image:url(/assets/icons/${item}.svg);display: inline-block;height: 24px;width: 24px;line-height : 1;filter: invert(100%) sepia(100%) saturate(2%) hue-rotate(94deg) brightness(102%) contrast(100%);}${Util.newLine}`;
|
|
29
|
-
});
|
|
30
|
-
fs.writeFileSync(`${dirRoot}/public/css/tabler.css`, text);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
24
|
router.get('/', async function (req, res, next) {
|
|
34
25
|
const levels = zRole.myLevel(req, res, 'zmenu');
|
|
35
26
|
if(Object.prototype.hasOwnProperty.call(levels,'index')) {
|
|
@@ -37,7 +28,6 @@ router.get('/', async function (req, res, next) {
|
|
|
37
28
|
return res.redirect(process.env.APP_AFTER_LOGIN);
|
|
38
29
|
}
|
|
39
30
|
}
|
|
40
|
-
//writeCss();
|
|
41
31
|
let name = "Standart";
|
|
42
32
|
let arr = [{"text":"Home","href":"zdashboard","icon":"fas fa-home","target":"_self","title":""}];
|
|
43
33
|
let hasAccessMenu = false;
|
|
@@ -106,13 +96,10 @@ router.get('/', async function (req, res, next) {
|
|
|
106
96
|
id: id,
|
|
107
97
|
refresh: refresh,
|
|
108
98
|
menuApp: "Menu Generator",
|
|
109
|
-
/*renderHead: "zmenu/indexcss.ejs",
|
|
110
|
-
renderBody: "zmenu/index.ejs",
|
|
111
|
-
renderEnd: "zmenu/indexjs.ejs"*/
|
|
112
99
|
}
|
|
113
100
|
const bodyHTML = ejs.render(body,datas);
|
|
114
101
|
const endBody = ejs.render(js, datas);
|
|
115
|
-
const headBody = ejs.render(css
|
|
102
|
+
const headBody = ejs.render(css);
|
|
116
103
|
datas.bodyHTML = bodyHTML;
|
|
117
104
|
moduleLib.addModule(req,res,headBody,true);
|
|
118
105
|
moduleLib.addModule(req,res,endBody);
|