From e783c4dbad748f6597d8f15e93a22ad8fa1b5082 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 18 Oct 2018 12:50:20 -0400 Subject: other cleanup --- www/js/DataModel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 6dbd5958..96f90a48 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -1364,7 +1364,7 @@ angular.module('zmApp.controllers') loginData.enableSlowLoading = false; } - log("SlowDelay is: " + loginData.enableSlowLoading); + if (typeof loginData.enableStrictSSL == 'undefined') { @@ -2347,7 +2347,7 @@ angular.module('zmApp.controllers') var succ; try { - console.log(textsucc); + //console.log(textsucc); succ = JSON.parse(textsucc.data); if (succ.data) succ = succ.data; if (succ.config) { -- cgit v1.2.3 From b243bd03d3a8508d718227e6f0d9dee2d145d8f9 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Fri, 19 Oct 2018 11:21:58 -0400 Subject: take out disabling simul by force for iOS --- www/js/DataModel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 96f90a48..2322fbdf 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -1148,7 +1148,7 @@ angular.module('zmApp.controllers') if (typeof loginData.disableSimulStreaming == 'undefined') { - loginData.disableSimulStreaming = ($rootScope.platformOS == 'ios') ? true : false; + loginData.disableSimulStreaming = false; //console.log("INIT DISABLING SIMUL:" + loginData.disableSimulStreaming); } -- cgit v1.2.3 From 89211bbbd526bbc587361085b119a19d296f6a7f Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sat, 20 Oct 2018 19:17:21 -0400 Subject: #724 cleanup and making sure we take recordingURL for playback --- www/js/DataModel.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 2322fbdf..f1ea3689 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -2156,7 +2156,7 @@ angular.module('zmApp.controllers') var streamingurl = ""; - st += (s.scheme ? s.scheme : p.scheme) + "://"; // server scheme overrides + st += (s.scheme ? s.scheme : p.scheme) + "://"; // server scheme overrides @@ -2246,13 +2246,7 @@ angular.module('zmApp.controllers') monitors[i].Monitor.baseURL = loginData.url; monitors[i].Monitor.imageMode = (versionCompare($rootScope.apiVersion, "1.30") == -1) ? "path" : "fid"; - // but now check if forced path - if (loginData.forceImageModePath) { - debug("Overriding, setting image mode to true as you have requested force enable"); - monitors[i].Monitor.imageMode = 'path'; - } - - // debug("API " + $rootScope.apiVersion + ": Monitor " + monitors[i].Monitor.Id + " will use " + monitors[i].Monitor.imageMode + " for direct image access"); + } } // now get packery hide if applicable @@ -2849,6 +2843,20 @@ angular.module('zmApp.controllers') }, + + getRecordingURL: function (id) { + var idnum = parseInt(id); + for (var i = 0; i < monitors.length; i++) { + if (parseInt(monitors[i].Monitor.Id) == idnum) { + // console.log ("Matched, exiting getMonitorname"); + //console.log ("!!!"+monitors[i].Monitor.controlURL); + return monitors[i].Monitor.controlURL; + } + + } + return "(Unknown)"; + }, + getBaseURL: function (id) { var idnum = parseInt(id); for (var i = 0; i < monitors.length; i++) { -- cgit v1.2.3 From 3f549f3d6ea3dac1fbf862e236549ce0dd7fd570 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sun, 21 Oct 2018 10:33:47 -0400 Subject: #724 more cleanup --- www/js/DataModel.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index f1ea3689..71062b57 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -703,13 +703,7 @@ angular.module('zmApp.controllers') // the ZM authors fix this and streamline the access of images // from APIs, I don't have an option - zmStateGo: function (state, p1, p2) { - if ($rootScope.platformOS == 'desktop') - $state.go(state, p1, p2); - else - $state.go(state, p1, p2); - // $ionicNativeTransitions.stateGo(state, p1, p2); - }, + // used when an empty server profile is created getDefaultLoginObject: function () { -- cgit v1.2.3 From e3076881b748fff53690373f02211706b60fab79 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sun, 21 Oct 2018 18:49:32 -0400 Subject: #725 moved evaluate tapped notification to service,trapped handler in all controllers --- www/js/DataModel.js | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 71062b57..168c29f1 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -675,6 +675,67 @@ angular.module('zmApp.controllers') debug(val); }, + evaluateTappedNotification: function() { + + var state = ""; + var stateParams1 = {}; + var stateParams2 = {}; + + debug ("Inside evaluateNotifications"); + + if ($rootScope.tappedNotification == 2) { // url launch + debug("Came via app url launch with mid=" + $rootScope.tappedMid); + debug("Came via app url launch with eid=" + $rootScope.tappedEid); + + + if (parseInt($rootScope.tappedMid) > 0) { + debug("Going to live view "); + state = "app.monitors"; + + } else if (parseInt($rootScope.tappedEid) > 0) { + debug("Going to events with EID=" + $rootScope.tappedEid); + state = "app.events"; + stateParams1 = { + "id": 0, + "playEvent": true + }; + stateParams2 = { + reload: true + }; + + } + + + } // 2 + else if ($rootScope.tappedNotification == 1) // push + { + + + debug("Came via push tap. onTapScreen=" + loginData.onTapScreen); + if (loginData.onTapScreen == $translate.instant('kTapMontage')) { + debug("Going to montage"); + state = "app.montage"; + + + } else if (loginData.onTapScreen == $translate.instant('kTapEvents')) { + debug("Going to events"); + state = "app.events"; + stateParams1 = { + "id": 0, + "playEvent": true + }; + + } else // we go to live + { + debug("Going to live view "); + state = "app.monitors"; + + } + } + $rootScope.tappedNotification = 0; + return [state, stateParams1, stateParams2]; + }, + setLastUpdateCheck: function (val) { lastUpdateCheck = val; localforage.setItem("lastUpdateCheck", lastUpdateCheck); -- cgit v1.2.3 From e3ee3eeeb220cfce88ddfdb2189ec6e49432565f Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 22 Oct 2018 09:38:27 -0400 Subject: other cleanup --- www/js/DataModel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 168c29f1..a2eac7ea 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -1885,7 +1885,7 @@ angular.module('zmApp.controllers') if (forceReload == 1 || configParams.ZM_EVENT_IMAGE_DIGITS == '-1') { var apiurl = loginData.apiurl; var myurl = apiurl + '/configs/viewByName/ZM_EVENT_IMAGE_DIGITS.json'; - debug("Config URL for digits is:" + myurl); + //debug("Config URL for digits is:" + myurl); $http.get(myurl) .then(function (data) { data = data.data; @@ -1903,8 +1903,8 @@ angular.module('zmApp.controllers') return (d.promise); }); } else { - log("ZM_EVENT_IMAGE_DIGITS is already configured for " + - configParams.ZM_EVENT_IMAGE_DIGITS); + // log("ZM_EVENT_IMAGE_DIGITS is already configured for " + + // configParams.ZM_EVENT_IMAGE_DIGITS); d.resolve(configParams.ZM_EVENT_IMAGE_DIGITS); return (d.promise); } @@ -2939,7 +2939,7 @@ angular.module('zmApp.controllers') $rootScope.authSession = "undefined"; - console.log("CURRENT SERVER: " + loginData.currentServerVersion); + // console.log("CURRENT SERVER: " + loginData.currentServerVersion); if (loginData.currentServerVersion && (versionCompare(loginData.currentServerVersion, zm.versionWithLoginAPI) != -1 || loginData.loginAPISupported)) { -- cgit v1.2.3 From 022cd0c6c49d8b163207d790496a1516d289a849 Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Tue, 23 Oct 2018 13:39:06 -0400 Subject: #724 copy paths from portal to recording and multi-server port too --- www/js/DataModel.js | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index a2eac7ea..d3a48fcd 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -20,7 +20,7 @@ angular.module('zmApp.controllers') DO NOT TOUCH zmAppVersion It is changed by sync_version.sh */ - var zmAppVersion = "1.3.026"; + var zmAppVersion = "1.3.028"; var isBackground = false; var justResumed = false; var timeSinceResumed = -1; @@ -2178,15 +2178,16 @@ angular.module('zmApp.controllers') multiservers[j].Server.Hostname = multiserver_scheme + multiservers[j].Server.Hostname; } - debug("Monitor " + monitors[i].Monitor.Id + " has a recording server hostname of " + multiservers[j].Server.Hostname); + // debug("Monitor " + monitors[i].Monitor.Id + " has a recording server hostname of " + multiservers[j].Server.Hostname); // Now here is the logic, I need to retrieve serverhostname, // and slap on the host protocol and path. Meh. - var p = URI.parse(loginData.streamingurl); - var s = URI.parse(multiservers[j].Server.Hostname); + var s = URI.parse(loginData.streamingurl); + var m = URI.parse(multiservers[j].Server.Hostname); + var p = URI.parse(loginData.url); /* if (!p.port && !isNaN(p.path)) { debug ("Portal: port path reversed?"); @@ -2203,31 +2204,33 @@ angular.module('zmApp.controllers') } */ - debug("recording server parsed is " + JSON.stringify(s)); + debug("recording server reported is " + JSON.stringify(m)); debug("portal parsed is " + JSON.stringify(p)); + debug("streaming url parsed is " + JSON.stringify(s)); + debug ("multi-port is:"+zmsPort); var st = ""; var baseurl = ""; var streamingurl = ""; - st += (s.scheme ? s.scheme : p.scheme) + "://"; // server scheme overrides + st += (m.scheme ? m.scheme : p.scheme) + "://"; // server scheme overrides // if server doesn't have a protocol, what we want is in path - if (!s.host) { - s.host = s.path; - s.path = undefined; + if (!m.host) { + m.host = m.path; + m.path = undefined; } - st += s.host; + st += m.host; //console.log ("STEP 1: ST="+st); if (zmsPort <= 0 || loginData.disableSimulStreaming) { - if (p.port || s.port) { - st += (s.port ? ":" + s.port : ":" + p.port); + if (p.port || m.port) { + st += (m.port ? ":" + m.port : ":" + p.port); streamingurl = st; //console.log ("STEP 2 no ZMS: ST="+st); @@ -2235,17 +2238,19 @@ angular.module('zmApp.controllers') } else { var sport = parseInt(zmsPort) + parseInt(monitors[i].Monitor.Id); - streamingurl = st + ':' + sport; + st = st + ':' + sport; - if (p.port || s.port) - st += (s.port ? ":" + s.port : ":" + p.port); + if (p.port || m.port) + st += (m.port ? ":" + m.port : ":" + p.port); //console.log ("STEP 2: ST="+st); } baseurl = st; + controlURL = st; + controlURL += (p.path ? p.path:''); st += (s.path ? s.path : p.path); streamingurl += (s.path ? s.path : p.path); @@ -2258,6 +2263,9 @@ angular.module('zmApp.controllers') monitors[i].Monitor.streamingURL = st; monitors[i].Monitor.baseURL = baseurl; monitors[i].Monitor.controlURL = controlURL; + + + debug ("Storing baseurl="+baseurl+" streamingURL="+st+" recordingURL="+controlURL); //console.log ("** Streaming="+st+" **base="+baseurl); // starting 1.30 we have fid=xxx mode to return images monitors[i].Monitor.imageMode = (versionCompare($rootScope.apiVersion, "1.30") == -1) ? "path" : "fid"; -- cgit v1.2.3 From f1dbbabd0447bddfc6de3c4791951d2332d91def Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Sat, 27 Oct 2018 17:52:31 -0400 Subject: removed logs --- www/js/DataModel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index d3a48fcd..17e2a688 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -967,8 +967,8 @@ angular.module('zmApp.controllers') if (exists) { log("A cloud configuration has been found"); window.cordova.plugin.cloudsettings.load(function (cloudData) { - console.log("CLOUD DATA FOUND" + JSON.stringify(cloudData)); - debug("Cloud data retrieved is:" + JSON.stringify(cloudData)); + //console.log("CLOUD DATA FOUND" + JSON.stringify(cloudData)); + // debug("Cloud data retrieved is:" + JSON.stringify(cloudData)); if (cloudData && cloudData.defaultServerName && cloudData.serverGroupList) { log("retrieved a valid cloud config with a defaultServerName of:" + cloudData.defaultServerName); log("replacing local DB with cloud..."); -- cgit v1.2.3 From d5e7a99c63213ad3b62a9e8e95cb57f0bb0c7e6a Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 29 Oct 2018 10:45:16 -0400 Subject: desktop logs rework --- www/js/DataModel.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 17e2a688..cb33411d 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -20,7 +20,7 @@ angular.module('zmApp.controllers') DO NOT TOUCH zmAppVersion It is changed by sync_version.sh */ - var zmAppVersion = "1.3.028"; + var zmAppVersion = "1.3.029"; var isBackground = false; var justResumed = false; var timeSinceResumed = -1; -- cgit v1.2.3 From 87c98d7dae141e359e92058a7696e0d15d4b658e Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Mon, 29 Oct 2018 13:47:22 -0400 Subject: nits --- www/js/DataModel.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index cb33411d..17305f22 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -1980,11 +1980,11 @@ angular.module('zmApp.controllers') return $http.get(req + "&command=1") .then( function (s) { - debug("pause success for ck:" + ck + " with:" + JSON.stringify(s)); + // debug("pause success for ck:" + ck ); }, function (e) { - debug("pause success for ck:" + ck + " with:" + JSON.stringify(e)); + // debug("pause error for ck:" + ck + " with:" + JSON.stringify(e)); } ); @@ -2004,11 +2004,11 @@ angular.module('zmApp.controllers') return $http.get(req + "&command=2") .then( function (s) { - debug("play success for ck:" + ck + " with:" + JSON.stringify(s)); + // debug("play success for ck:" + ck + " with:" + JSON.stringify(s)); }, function (e) { - debug("play success for ck:" + ck + " with:" + JSON.stringify(e)); + // debug("play error for ck:" + ck + " with:" + JSON.stringify(e)); } ); -- cgit v1.2.3 From 38aecc45c37dbaf35a0523f3e8a880570b64f47a Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Wed, 31 Oct 2018 14:51:39 -0400 Subject: #733 use new Monitor_Status if available --- www/js/DataModel.js | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index 17305f22..c558d884 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -2081,6 +2081,29 @@ angular.module('zmApp.controllers') },*/ + getMultiServersCached: function () { + return multiservers; + }, + + // use non cached for daemon status + getMultiServers: function () { + return $http.get (loginData.apiurl+'/servers.json'); + + }, + + getMultiServer: function (id) { + + var ndx = -1; + for (var i=0; i < multiservers.length; i++) { + if (multiservers[i].Server.Id == id) { + ndx = i; + break; + } + } + return ndx == -1 ? {}:multiservers[ndx]; + + }, + regenConnKeys: function () { debug("DataModel: Regenerating connkeys..."); @@ -2144,7 +2167,7 @@ angular.module('zmApp.controllers') data = data.data; // We found a server list API, so lets make sure // we get the hostname as it will be needed for playback - log("multi server list loaded" + JSON.stringify(data)); + log("multi server list loaded:" + JSON.stringify(data)); multiservers = data.servers; var multiserver_scheme = "http://"; @@ -2158,6 +2181,8 @@ angular.module('zmApp.controllers') for (var i = 0; i < monitors.length; i++) { // make them all show for now + + monitors[i].Monitor.listDisplay = 'show'; monitors[i].Monitor.isAlarmed = false; monitors[i].Monitor.connKey = (Math.floor((Math.random() * 999999) + 1)).toString(); @@ -2276,11 +2301,13 @@ angular.module('zmApp.controllers') } else { //monitors[i].Monitor.listDisplay = 'show'; + debug ("No servers matched, filling defaults..."); monitors[i].Monitor.isAlarmed = false; monitors[i].Monitor.connKey = (Math.floor((Math.random() * 999999) + 1)).toString(); monitors[i].Monitor.rndKey = (Math.floor((Math.random() * 999999) + 1)).toString(); var st2 = loginData.streamingurl; + controlURL = loginData.url; if (zmsPort > 0 && !loginData.disableSimulStreaming) { // we need to insert minport @@ -2302,6 +2329,8 @@ angular.module('zmApp.controllers') if (p3.path) controlURL += p3.path; } + debug ("Storing streaming="+st2+" recording="+controlURL); + monitors[i].Monitor.streamingURL = st2; monitors[i].Monitor.controlURL = controlURL; //debug ("Streaming URL for Monitor " + monitors[i].Monitor.Id + " is " + monitors[i].Monitor.streamingURL ); -- cgit v1.2.3 From a8f91b80946aecd460543c551dd30dc9db401e5f Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Fri, 2 Nov 2018 14:32:31 -0400 Subject: odd case? --- www/js/DataModel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'www/js/DataModel.js') diff --git a/www/js/DataModel.js b/www/js/DataModel.js index c558d884..3e5f41c1 100644 --- a/www/js/DataModel.js +++ b/www/js/DataModel.js @@ -408,7 +408,7 @@ angular.module('zmApp.controllers') var as = 'undefined'; - if (!mid && monitors.length > 0) { + if (!mid && monitors && monitors.length > 0) { mid = monitors[0].Monitor.Id; } @@ -2145,7 +2145,7 @@ angular.module('zmApp.controllers') .then(function (data) { // console.log("HTTP success got " + JSON.stringify(data.monitors)); data = data.data; - monitors = data.monitors; + if (data.monitors) monitors = data.monitors; if ($rootScope.authSession == 'undefined') { -- cgit v1.2.3