disable old admin page

merge-requests/289/head
Moe Alam 2021-02-07 13:46:23 -08:00
parent 94a51ad17b
commit 1ac929fb82
2 changed files with 14 additions and 50 deletions

View File

@ -171,9 +171,9 @@ module.exports = function(s,config,lang,app,io){
return false return false
} }
switch(true){ switch(true){
case search(config.webPaths.admin): // case search(config.webPaths.admin):
return 'admin' // return 'admin'
break; // break;
case search(config.webPaths.super): case search(config.webPaths.super):
return 'super' return 'super'
break; break;
@ -321,53 +321,6 @@ module.exports = function(s,config,lang,app,io){
}) })
break; break;
case'admin': 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: default:
var chosenRender = 'home' var chosenRender = 'home'
if(r.details.sub && r.details.landing_page && r.details.landing_page !== '' && config.renderPaths[r.details.landing_page]){ if(r.details.sub && r.details.landing_page && r.details.landing_page !== '' && config.renderPaths[r.details.landing_page]){

View File

@ -239,3 +239,14 @@
<% } %> <% } %>
<% include blocks/onvifDeviceManager.ejs %> <% include blocks/onvifDeviceManager.ejs %>
<%
if(!details.sub){ %>
<script>
$(document).ready(function(){
if(`${location.pathname}/` === `<%=config.webPaths.adminApiPrefix%>`){
$('#subAccountManager').modal('show')
}
})
</script>
<% }
%>