disable old admin page
parent
94a51ad17b
commit
1ac929fb82
|
@ -171,9 +171,9 @@ module.exports = function(s,config,lang,app,io){
|
|||
return false
|
||||
}
|
||||
switch(true){
|
||||
case search(config.webPaths.admin):
|
||||
return 'admin'
|
||||
break;
|
||||
// case search(config.webPaths.admin):
|
||||
// return 'admin'
|
||||
// break;
|
||||
case search(config.webPaths.super):
|
||||
return 'super'
|
||||
break;
|
||||
|
@ -321,53 +321,6 @@ module.exports = function(s,config,lang,app,io){
|
|||
})
|
||||
break;
|
||||
case'admin':
|
||||
if(!r.details.sub){
|
||||
s.knexQuery({
|
||||
action: "select",
|
||||
columns: "uid,mail,details",
|
||||
table: "Users",
|
||||
where: [
|
||||
['ke','=',r.ke],
|
||||
['details','LIKE','%"sub"%'],
|
||||
]
|
||||
},(err,rr) => {
|
||||
s.knexQuery({
|
||||
action: "select",
|
||||
columns: "*",
|
||||
table: "Monitors",
|
||||
where: [
|
||||
['ke','=',r.ke],
|
||||
]
|
||||
},(err,rrr) => {
|
||||
renderPage(config.renderPaths.admin,{
|
||||
config: s.getConfigWithBranding(req.hostname),
|
||||
$user: response,
|
||||
$subs: rr,
|
||||
$mons: rrr,
|
||||
lang: r.lang,
|
||||
define: s.getDefinitonFile(r.details.lang),
|
||||
customAutoLoad: s.customAutoLoadTree
|
||||
})
|
||||
})
|
||||
})
|
||||
}else{
|
||||
//not admin user
|
||||
var chosenRender = 'home'
|
||||
if(r.details.landing_page && r.details.landing_page !== '' && config.renderPaths[r.details.landing_page]){
|
||||
chosenRender = r.details.landing_page
|
||||
}
|
||||
renderPage(config.renderPaths[chosenRender],{
|
||||
$user:response,
|
||||
config: s.getConfigWithBranding(req.hostname),
|
||||
lang:r.lang,
|
||||
define:s.getDefinitonFile(r.details.lang),
|
||||
addStorage:s.dir.addStorage,
|
||||
fs:fs,
|
||||
__dirname:s.mainDirectory,
|
||||
customAutoLoad: s.customAutoLoadTree
|
||||
});
|
||||
}
|
||||
break;
|
||||
default:
|
||||
var chosenRender = 'home'
|
||||
if(r.details.sub && r.details.landing_page && r.details.landing_page !== '' && config.renderPaths[r.details.landing_page]){
|
||||
|
|
|
@ -239,3 +239,14 @@
|
|||
<% } %>
|
||||
|
||||
<% include blocks/onvifDeviceManager.ejs %>
|
||||
<%
|
||||
if(!details.sub){ %>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
if(`${location.pathname}/` === `<%=config.webPaths.adminApiPrefix%>`){
|
||||
$('#subAccountManager').modal('show')
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<% }
|
||||
%>
|
||||
|
|
Loading…
Reference in New Issue