summaryrefslogtreecommitdiff
path: root/www/js/DataModel.js
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@gmail.com>2018-11-23 10:52:53 -0500
committerPliable Pixels <pliablepixels@gmail.com>2018-11-23 10:52:53 -0500
commit0a4df85f5838cd32927d47d75c50899f6a7a5b4c (patch)
treecce4f543f7a2f032c67e693410d12385dfd1dbc2 /www/js/DataModel.js
parented485b7a29ceb8b59e36ed09f8373dcb88f79461 (diff)
switch between snapshot and support for older versions
Diffstat (limited to 'www/js/DataModel.js')
-rw-r--r--www/js/DataModel.js21
1 files changed, 19 insertions, 2 deletions
diff --git a/www/js/DataModel.js b/www/js/DataModel.js
index 25a42c86..86c9415a 100644
--- a/www/js/DataModel.js
+++ b/www/js/DataModel.js
@@ -25,6 +25,10 @@ angular.module('zmApp.controllers')
var justResumed = false;
var timeSinceResumed = -1;
var monitorsLoaded = 0;
+ var snapshotFrame = 1; // will be 'snapshot'
+ // if ZM >= 1.31
+
+
var monitors = [];
var multiservers = [];
@@ -1780,10 +1784,19 @@ angular.module('zmApp.controllers')
$http.get(apiurl)
.then(function (success) {
if (success.data.version) {
- // console.log ("API VERSION RETURNED: " + JSON.stringify(success));
+ console.log ("API VERSION RETURNED: " + JSON.stringify(success));
$rootScope.apiValid = true;
+
+ if (versionCompare(success.data.version, '1.31.0') != -1 ) {
+ debug ("snapshot supported in image.php");
+ snapshotFrame = 'snapshot';
+ }
+ else {
+ debug ("snapshot NOT supported in image.php");
+ snapshotFrame = 1;
+ }
setCurrentServerVersion(success.data.version);
- debug("getAPI version succeded with " + success.data.version);
+ debug("getAPI version succeeded with " + success.data.version);
d.resolve(success.data.version);
} else {
debug("Setting APIValid to false as API version was not retrieved");
@@ -1952,6 +1965,10 @@ angular.module('zmApp.controllers')
return getBandwidth();
},
+ getSnapshotFrame: function () {
+ return snapshotFrame;
+ },
+
//-----------------------------------------------------------------------------
// This function returns a list of monitors
// if forceReload == 1 then it will force an HTTP API request to get a list of monitors