add logout, cleanup, make carousel change on detector event 0.1
parent
4f5b255d63
commit
df8bbd8f6b
|
|
@ -806,6 +806,12 @@ $(document).ready(function(){
|
|||
$(this).show();
|
||||
});
|
||||
})
|
||||
.on('click','.logout',function(e){
|
||||
$.get(getApiPrefix() + '/logout/'+user.ke+'/'+user.uid,function(data){
|
||||
localStorage.removeItem('ShinobiLogin_'+location.host);
|
||||
location.href = location.href;
|
||||
})
|
||||
})
|
||||
// only binded on load
|
||||
$('.form-section-header:not(.no-toggle-header)').click(function(e){
|
||||
var parent = $(this).parent('.form-group-group')
|
||||
|
|
|
|||
|
|
@ -294,6 +294,7 @@ function drawVideoCardToMiniList(monitorId,video,skipLimitCheck){
|
|||
}
|
||||
function loadVideoMiniList(monitorId){
|
||||
getVideos({
|
||||
monitorId: monitorId,
|
||||
limit: 10,
|
||||
},function(data){
|
||||
var videos = data.videos
|
||||
|
|
@ -1079,18 +1080,14 @@ $(document).ready(function(e){
|
|||
setTimeout(() => {
|
||||
resetMonitorCanvas(d.mid,true,d.channel)
|
||||
},3000)
|
||||
console.log(d)
|
||||
console.log('substream_start',d.mid,d)
|
||||
break;
|
||||
case'substream_end':
|
||||
loadedMonitors[d.mid].subStreamChannel = null
|
||||
resetMonitorCanvas(d.mid,true,null)
|
||||
console.log('substream_end',d.mid,d)
|
||||
break;
|
||||
case'monitor_watch_on':
|
||||
var monitorId = d.mid || d.id
|
||||
var subStreamChannel = d.subStreamChannel
|
||||
console.log('subStreamChannel',subStreamChannel,d)
|
||||
drawLiveGridBlock(loadedMonitors[monitorId],subStreamChannel)
|
||||
saveLiveGridBlockOpenState(monitorId,$user.ke,1)
|
||||
break;
|
||||
|
|
@ -1147,14 +1144,14 @@ $(document).ready(function(e){
|
|||
if($user.details.event_mon_pop === '1' && (!monitorPop || monitorPop.closed === true)){
|
||||
popOutMonitor(monitorId)
|
||||
}
|
||||
console.log({
|
||||
ke: d.ke,
|
||||
mid: monitorId,
|
||||
log: {
|
||||
type: lang['Event Occurred'],
|
||||
msg: d.details,
|
||||
}
|
||||
})
|
||||
// console.log({
|
||||
// ke: d.ke,
|
||||
// mid: monitorId,
|
||||
// log: {
|
||||
// type: lang['Event Occurred'],
|
||||
// msg: d.details,
|
||||
// }
|
||||
// })
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ $(document).ready(function(){
|
|||
})
|
||||
}
|
||||
function loadMonitorInCarousel(monitorId){
|
||||
console.log(`loadMonitorInCarousel`,monitorId)
|
||||
currentCarouselMonitorId = `${monitorId}`
|
||||
streamCarouselBlock
|
||||
.find(`.carousel-block[data-mid="${monitorId}"]`)
|
||||
|
|
@ -55,7 +54,6 @@ $(document).ready(function(){
|
|||
function initCarousel(){
|
||||
drawCarouselSet()
|
||||
if(loadedCarouselBlocks[0]){
|
||||
console.log(loadedCarouselBlocks[0])
|
||||
loadMonitorInCarousel(currentCarouselMonitorId || loadedCarouselBlocks[0])
|
||||
setAutoChangerInterval()
|
||||
}
|
||||
|
|
@ -70,6 +68,17 @@ $(document).ready(function(){
|
|||
onDashboardReady(function(){
|
||||
initCarousel()
|
||||
})
|
||||
onWebSocketEvent(function(d){
|
||||
switch(d.f){
|
||||
case'detector_trigger':
|
||||
var monitorId = d.id
|
||||
if(tabTree.name === 'initial' && currentCarouselMonitorId !== monitorId){
|
||||
loadMonitorInCarousel(monitorId)
|
||||
setAutoChangerInterval()
|
||||
}
|
||||
break;
|
||||
}
|
||||
})
|
||||
$(window).focus(function(){
|
||||
if(canBackgroundCarousel()){
|
||||
initCarousel()
|
||||
|
|
|
|||
|
|
@ -58,6 +58,12 @@
|
|||
<span class="badge bg-light text-dark rounded-pill align-text-bottom cameraCount"><i class="fa fa-spinner fa-pulse"></i></span>`,
|
||||
pageOpen: 'monitorsList',
|
||||
},
|
||||
{
|
||||
icon: 'wrench',
|
||||
label: `${lang['Monitor Settings']}`,
|
||||
pageOpen: 'monitorSettings',
|
||||
addUl: true,
|
||||
},
|
||||
{
|
||||
icon: 'gears',
|
||||
label: `${lang['Account Settings']}`,
|
||||
|
|
@ -70,12 +76,6 @@
|
|||
pageOpen: 'subAccountManager',
|
||||
addUl: true,
|
||||
},
|
||||
{
|
||||
icon: 'wrench',
|
||||
label: `${lang['Monitor Settings']}`,
|
||||
pageOpen: 'monitorSettings',
|
||||
addUl: true,
|
||||
},
|
||||
{
|
||||
icon: 'compass',
|
||||
label: `${lang['ShinobiHub']}`,
|
||||
|
|
@ -135,5 +135,10 @@
|
|||
label: `${lang['Events']}`,
|
||||
pageOpen: 'eventListWithPics',
|
||||
},
|
||||
{
|
||||
icon: 'sign-out',
|
||||
label: `${lang['Logout']}`,
|
||||
class: 'logout',
|
||||
},
|
||||
]
|
||||
%>
|
||||
|
|
|
|||
Loading…
Reference in New Issue