mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Fixed warning if ahead of reference version
This commit is contained in:
parent
f064dd602e
commit
e6b282a1f2
@ -12,14 +12,24 @@
|
|||||||
<script>
|
<script>
|
||||||
neo.xhttprequest("https://maloja.krateng.ch/api/serverinfo",{},"GET",json=true).then((response)=>{
|
neo.xhttprequest("https://maloja.krateng.ch/api/serverinfo",{},"GET",json=true).then((response)=>{
|
||||||
result = JSON.parse(response.responseText);
|
result = JSON.parse(response.responseText);
|
||||||
document.getElementById("latestversion").innerHTML = result.version.join(".");
|
latestvers = result.version;
|
||||||
if (document.getElementById("latestversion").innerHTML.trim() == document.getElementById("currentversion").innerHTML.trim()) {
|
|
||||||
document.getElementById("currentversion").style.color = "green";
|
neo.xhttprequest("/api/serverinfo",{},"GET",json=true).then((response)=>{
|
||||||
}
|
|
||||||
else {
|
result = JSON.parse(response.responseText);
|
||||||
document.getElementById("currentversion").style.color = "red";
|
thisvers = result.version;
|
||||||
document.getElementById("updatestatus").innerHTML = "Consider updating to take advantage of new features";
|
|
||||||
}
|
document.getElementById("latestversion").innerHTML = latestvers.join(".");
|
||||||
|
document.getElementById("currentversion").innerHTML = thisvers.join(".");
|
||||||
|
|
||||||
|
if (latestvers <= thisvers) {
|
||||||
|
document.getElementById("currentversion").style.color = "green";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
document.getElementById("currentversion").style.color = "red";
|
||||||
|
document.getElementById("updatestatus").innerHTML = "Consider updating to take advantage of new features";
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
@ -44,8 +54,8 @@
|
|||||||
|
|
||||||
<h2>Update</h2>
|
<h2>Update</h2>
|
||||||
|
|
||||||
Currently installed Maloja version: <span id="currentversion"><pyhp echo="'.'.join(str(n) for n in info.version)" /></span><br/>
|
Currently installed Maloja version: <span id="currentversion">Loading...</span><br/>
|
||||||
Latest Maloja version: <span id="latestversion">Loading...</span><br/>
|
Latest recommended Maloja version: <span id="latestversion">Loading...</span><br/>
|
||||||
<span id="updatestatus"></span>
|
<span id="updatestatus"></span>
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user