Skip to content

Commit

Permalink
Merge pull request #342 from KelvinTegelaar/dev
Browse files Browse the repository at this point in the history
Version 1.5.1
  • Loading branch information
KelvinTegelaar authored Dec 6, 2021
2 parents 8c502f9 + 3c663e9 commit 323743a
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 45 deletions.
89 changes: 45 additions & 44 deletions js/version-checker.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,54 @@
$(document).ready(function () {
function GetVersion() {
return new Promise((resolve, reject) => {
let ajaxsettings = {
async: false,
type: 'GET',
url: '/version_latest.txt',
success: function (data) {
data;
resolve(data);
}
}
$.ajax(ajaxsettings);
})
}


let searchParams = new URLSearchParams(window.location.search)
if (searchParams.has('page')) {

GetVersion().then((LocalVersionCIPP) => {
var json = null;
$.ajax({
'async': false,
'global': false,
'url': '/api/GetVersion?localversion=' + LocalVersionCIPP,
'dataType': "json",
'success': function (data) {
var VersionResults = null
VersionResults = data;
document.getElementById('dashversionlocalcipp').innerHTML = VersionResults.LocalCIPPVersion;
document.getElementById('dashversionremotecipp').innerHTML = VersionResults.RemoteCIPPVersion;
document.getElementById('dashversionlocalcippapi').innerHTML = VersionResults.LocalCIPPAPIVersion;
document.getElementById('dashversionremotecippapi').innerHTML = VersionResults.RemoteCIPPAPIVersion;

if (VersionResults.OutOfDateCIPP == true) {
console.log("CIPP Remote and Local Versions are Different")
document.getElementById('versionalertcipp').innerHTML = '<div><strong>WARNING:&nbsp;&nbsp;</strong> The version of CIPP you are running is out of date. Your version is ' + VersionResults.LocalCIPPVersion + ' and the latest version is ' + VersionResults.RemoteCIPPVersion + '. Please Update your CIPP Repository.</div>';
document.getElementById('versionalertcipp').classList.remove("d-none");
} else {
function GetVersion() {
return new Promise((resolve, reject) => {
let ajaxsettings = {
async: false,
type: 'GET',
url: '/version_latest.txt',
success: function (data) {
data;
resolve(data);
}
}
$.ajax(ajaxsettings);
})
}
GetVersion().then((LocalVersionCIPP) => {
var json = null;
$.ajax({
'async': false,
'global': false,
'url': '/api/GetVersion?localversion=' + LocalVersionCIPP,
'dataType': "json",
'success': function (data) {
var VersionResults = null
VersionResults = data;
document.getElementById('dashversionlocalcipp').innerHTML = VersionResults.LocalCIPPVersion;
document.getElementById('dashversionremotecipp').innerHTML = VersionResults.RemoteCIPPVersion;
document.getElementById('dashversionlocalcippapi').innerHTML = VersionResults.LocalCIPPAPIVersion;
document.getElementById('dashversionremotecippapi').innerHTML = VersionResults.RemoteCIPPAPIVersion;

if (VersionResults.OutOfDateCIPPAPI == true) {
console.log("CIPPAPI Remote and Local Versions are Different")
document.getElementById('versionalertcippapi').innerHTML = '<div><strong>WARNING:&nbsp;&nbsp;</strong> The version of CIPP-API you are running is out of date. Your version is ' + VersionResults.LocalCIPPAPIVersion + ' and the latest version is ' + VersionResults.RemoteCIPPAPIVersion + '. Please Update your CIPP-API Repository.</div>';
document.getElementById('versionalertcippapi').classList.remove("d-none");
}
}
});
return json;
})();
if (VersionResults.OutOfDateCIPP == true) {
console.log("CIPP Remote and Local Versions are Different")
document.getElementById('versionalertcipp').innerHTML = '<div><strong>WARNING:&nbsp;&nbsp;</strong> The version of CIPP you are running is out of date. Your version is ' + VersionResults.LocalCIPPVersion + ' and the latest version is ' + VersionResults.RemoteCIPPVersion + '. Please Update your CIPP Repository.</div>';
document.getElementById('versionalertcipp').classList.remove("d-none");
}

if (VersionResults.OutOfDateCIPPAPI == true) {
console.log("CIPPAPI Remote and Local Versions are Different")
document.getElementById('versionalertcippapi').innerHTML = '<div><strong>WARNING:&nbsp;&nbsp;</strong> The version of CIPP-API you are running is out of date. Your version is ' + VersionResults.LocalCIPPAPIVersion + ' and the latest version is ' + VersionResults.RemoteCIPPAPIVersion + '. Please Update your CIPP-API Repository.</div>';
document.getElementById('versionalertcippapi').classList.remove("d-none");
}
}
});
return json;
})

}


//scratch this after 1.5
Expand Down
2 changes: 1 addition & 1 deletion version_latest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
1.5.1

0 comments on commit 323743a

Please sign in to comment.