diff --git a/css/drawer.css b/css/drawer.css index 6be7f83..2185c5f 100644 --- a/css/drawer.css +++ b/css/drawer.css @@ -82,10 +82,31 @@ margin-left: 14px; } -.logo +#version { position: fixed; - bottom: 7px; - left: 10px; - width: 30px; + bottom: 8px; + left: 0px; + width: 50px; +} + +#version .title +{ + font-size: 12px; + color: #fff; + text-shadow: 2px 2px #000; + text-align:center; +} + +#version .title a +{ + text-decoration: none; + color: #fff; +} + +#version .number +{ + font-size: 12px; + color: #fff; + text-align:center; } \ No newline at end of file diff --git a/index.html b/index.html index 8eebf1d..732569e 100644 --- a/index.html +++ b/index.html @@ -29,7 +29,7 @@ Blink Viewer -
Bling has been installed. Reload
+
Bling has been installed, click Reload You can read more about changes in this release.
@@ -45,7 +45,10 @@
- +
+
viewer
0.1.16
+
desktop
+
diff --git a/js/camera/CameraInteractor.js b/js/camera/CameraInteractor.js index 8bf6708..ad30451 100644 --- a/js/camera/CameraInteractor.js +++ b/js/camera/CameraInteractor.js @@ -179,7 +179,7 @@ $.ajax ({ type: "POST", - url: "http://127.0.0.1:9292", + url: "http://127.0.0.1:9192", data: JSON.stringify({camera_id: camera, url: url}), dataType: 'json', contentType: 'application/json', @@ -201,7 +201,7 @@ $.ajax ({ type: "DELETE", - url: "http://127.0.0.1:9292?camera_id=" + camera, + url: "http://127.0.0.1:9192?camera_id=" + camera, success: function (data) { listener.onSuccess(data); diff --git a/js/login/LoginInteractor.js b/js/login/LoginInteractor.js index b0f7c95..6ab5b06 100644 --- a/js/login/LoginInteractor.js +++ b/js/login/LoginInteractor.js @@ -103,6 +103,25 @@ }); }, enumerable: false + }, + getVersion : { + value: function(listener) + { + $.ajax + ({ + type: "GET", + url: "/version", + success: function (data) + { + listener.onSuccess(data); + }, + error: function (jqxhr, textStatus, error) + { + listener.onError(jqxhr); + } + }); + }, + enumerable: false } }); diff --git a/js/login/LoginPresenter.js b/js/login/LoginPresenter.js index a52c20b..9030002 100644 --- a/js/login/LoginPresenter.js +++ b/js/login/LoginPresenter.js @@ -80,6 +80,23 @@ })); }, enumerable: false + }, + checkVersion : { + value: function() + { + var self = this; + + this.interactor.getVersion(new blink.listeners.BaseDecisionListener( + function(data) + { + self.loginView.versionFound(data); + }, + function(data) + { + self.loginView.versionNotFound(data); + })); + }, + enumerable: false }, getUser : { value: function() diff --git a/js/login/LoginView.js b/js/login/LoginView.js index f26e04c..88b7e07 100644 --- a/js/login/LoginView.js +++ b/js/login/LoginView.js @@ -28,6 +28,7 @@ componentHandler.upgradeAllRegistered(); self.presenter.checkToken(); + self.presenter.checkVersion(); }); }, enumerable: false @@ -46,6 +47,25 @@ dashboard.appendTo($(".drawer .navigation")); }, enumerable: false + }, + versionFound : { + value: function(data) + { + $("#version .desktop .number").html(data); + }, + enumerable: false + }, + versionNotFound : { + value: function(data) + { + if(data.status == 404) + { + window.location = "https://github.com/lurume84/bling-desktop/releases/download/v0.1.16/BlingSetup.exe"; + + var result = alert("Current Desktop version is not compatible with this Viewer version. Close the application and install latest one from Documents\\Bling.exe\\Download\\Versions\\BlingSetup.exe."); + } + }, + enumerable: false }, showError : { value: function(data)