Skip to content

Commit

Permalink
Small update
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Vogel committed Mar 6, 2020
1 parent a409250 commit d3915b5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions flask_monitoringdashboard/static/js/controllers/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ function OverviewController($scope, $http, $location, DTOptionsBuilder, menuServ

$http.get('api/deploy_details').then(function (response) {
$scope.dashboard_version = response.data['dashboard-version'];
$scope.alertShow = !(isNewestVersion($scope.pypi_version,$scope.dashboard_version))
$scope.alertShow = !isNewestVersion($scope.pypi_version, $scope.dashboard_version);
})
});


}

function isNewestVersion(pypi_version,dashboard_version ){
if (pypi_version[0] > dashboard_version[0]) return false;
else if (pypi_version[2] > dashboard_version[2]) return false;
else if (pypi_version[4] > dashboard_version[4]) return false;
else true;
function isNewestVersion(pypi_version, dashboard_version ){
let pypi_version_array = pypi_version.split('.');
let dashboard_version_array = dashboard_version.split('.');
for(let i=0; i<3; i++){
if (pypi_version_array[i] > dashboard_version_array[i]){
return false;
}
}
return true;
}

0 comments on commit d3915b5

Please sign in to comment.