zet-lib 3.0.2 → 3.0.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/generatorApi.js +1328 -1328
- package/lib/moduleLib.js +1 -2
- package/lib/views/zgenerator/routerApp.ejs +359 -359
- package/lib/zAppRouter.js +1 -1
- package/lib/zapp.js +20 -3
- package/package.json +1 -1
package/lib/zAppRouter.js
CHANGED
|
@@ -622,7 +622,7 @@ router.get("/layout_changes/:layout", access, async (req, res) => {
|
|
|
622
622
|
req.session.user.layout = selectedLayout;
|
|
623
623
|
}
|
|
624
624
|
res.locals.layout = selectedLayout;
|
|
625
|
-
global.layout = selectedLayout;
|
|
625
|
+
///global.layout = selectedLayout;
|
|
626
626
|
} catch (err) {
|
|
627
627
|
debug(req, res, err);
|
|
628
628
|
}
|
package/lib/zapp.js
CHANGED
|
@@ -33,7 +33,6 @@ module.exports = (req,res,next) => {
|
|
|
33
33
|
res.locals.backend_layouts = [];
|
|
34
34
|
res.locals.isLogin = false;
|
|
35
35
|
res.locals.objectStores = {};
|
|
36
|
-
global.layout = "backend";
|
|
37
36
|
if (req.session) {
|
|
38
37
|
let reqSession = req.session;
|
|
39
38
|
if (reqSession.hasOwnProperty('user')) {
|
|
@@ -69,6 +68,24 @@ module.exports = (req,res,next) => {
|
|
|
69
68
|
global.USER_ID = res.locals.userId;
|
|
70
69
|
res.locals.LANGUAGE = global.LANGUAGE;
|
|
71
70
|
|
|
72
|
-
|
|
71
|
+
const path = req.route && req.route.path ? req.route.path : req.path;
|
|
72
|
+
|
|
73
|
+
const MYMODELS = myCache.get("MYMODELS");
|
|
74
|
+
// Mapping manual per route
|
|
75
|
+
let map = {
|
|
76
|
+
'/dashboard': { title: 'Dashboard', subtitle: 'Systems' },
|
|
77
|
+
};
|
|
78
|
+
for(let key in MYMODELS) {
|
|
79
|
+
map[`/${key}`] = {title : MYMODELS[key].name, subtitle:'List'}
|
|
80
|
+
map[`/${key}/create`] = {title : MYMODELS[key].name, subtitle:'Create'}
|
|
81
|
+
map[`/${key}/update`] = {title : MYMODELS[key].name, subtitle:'Update'}
|
|
82
|
+
map[`/${key}/view`] = {title : MYMODELS[key].name, subtitle:'View'}
|
|
83
|
+
map[`/${key}/import`] = {title : MYMODELS[key].name, subtitle:'Import'}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const info = map[path] || {};
|
|
87
|
+
res.locals.pagetitle = info.title || 'Dashboard';
|
|
88
|
+
res.locals.pagesubtitle = info.subtitle || '';
|
|
73
89
|
|
|
74
|
-
|
|
90
|
+
next();
|
|
91
|
+
}
|