Skip to content

Commit

Permalink
show versions and point to new liveview port
Browse files Browse the repository at this point in the history
  • Loading branch information
lurume84 committed Apr 23, 2020
1 parent 9853aee commit 2946a52
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 8 deletions.
29 changes: 25 additions & 4 deletions css/drawer.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<title>Blink Viewer</title>
</head>
<body>
<div id="upgrade"><i class="fas fa-flag"></i>Bling <span></span> has been installed. <a href="#">Reload</a></div>
<div id="upgrade"><i class="fas fa-flag"></i>Bling <span></span> has been installed, click <a href="#">Reload</a> You can <a href="https://github.com/lurume84/bling-viewer/releases" target="_blank">read more</a> about changes in this release.</div>
<div id="draggable-window"></div>
<div id="toolbar-window">
<div class="minimize">
Expand All @@ -45,7 +45,10 @@
<div class="layout">
<div class="drawer">
<nav class="navigation"></nav>
<img class="logo" src="img/logo.png"/>
<div id="version">
<div class="viewer"><div class="title">viewer</div><div class="number">0.1.16</div></div>
<div class="desktop"><div class="title">desktop</div><div class="number"></div></div>
</div>
</div>
<div class="content"></div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions js/camera/CameraInteractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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);
Expand Down
19 changes: 19 additions & 0 deletions js/login/LoginInteractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
});

Expand Down
17 changes: 17 additions & 0 deletions js/login/LoginPresenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
20 changes: 20 additions & 0 deletions js/login/LoginView.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
componentHandler.upgradeAllRegistered();

self.presenter.checkToken();
self.presenter.checkVersion();
});
},
enumerable: false
Expand All @@ -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)
Expand Down

0 comments on commit 2946a52

Please sign in to comment.