mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 06:16:08 +01:00
Color change
This commit is contained in:
0
baseTemplate/static/baseTemplate/custom-js/system-status.js
Executable file → Normal file
0
baseTemplate/static/baseTemplate/custom-js/system-status.js
Executable file → Normal file
@@ -200,17 +200,17 @@
|
|||||||
<div ng-controller="loadAvg" id="header-nav-right">
|
<div ng-controller="loadAvg" id="header-nav-right">
|
||||||
<a class="hide-on-phone hdr-btn" style="background-color: unset;width: 33px" href="#"
|
<a class="hide-on-phone hdr-btn" style="background-color: unset;width: 33px" href="#"
|
||||||
title="{% trans 'CPU Load Average' %}" data-placement="bottom">
|
title="{% trans 'CPU Load Average' %}" data-placement="bottom">
|
||||||
<span class="badge bg-yellow" id="load1">{$ one $}</span>
|
<span class="badge bg-red" id="load1">{$ one $}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="hide-on-phone hdr-btn" style="background-color: unset;width: 33px" href="#"
|
<a class="hide-on-phone hdr-btn" style="background-color: unset;width: 33px" href="#"
|
||||||
title="{% trans 'CPU Load Average' %}" data-placement="bottom">
|
title="{% trans 'CPU Load Average' %}" data-placement="bottom">
|
||||||
<span class="badge bg-yellow" id="load2">{$ two $}</span>
|
<span class="badge bg-red" id="load2">{$ two $}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="hide-on-phone hdr-btn" style="background-color: unset;width: 33px" href="#"
|
<a class="hide-on-phone hdr-btn" style="background-color: unset;width: 33px" href="#"
|
||||||
title="{% trans 'CPU Load Average' %}" data-placement="bottom">
|
title="{% trans 'CPU Load Average' %}" data-placement="bottom">
|
||||||
<span class="badge bg-yellow" id="load3">{$ three $}</span>
|
<span class="badge bg-red" id="load3">{$ three $}</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="dropdown" id="dashnav-btn">
|
<div class="dropdown" id="dashnav-btn">
|
||||||
|
|||||||
@@ -365,18 +365,17 @@ app.controller('adminController', function ($scope, $http, $timeout) {
|
|||||||
|
|
||||||
app.controller('loadAvg', function ($scope, $http, $timeout) {
|
app.controller('loadAvg', function ($scope, $http, $timeout) {
|
||||||
|
|
||||||
//getStuff();
|
getLoadAvg();
|
||||||
|
|
||||||
function getStuff() {
|
function getLoadAvg() {
|
||||||
|
|
||||||
|
|
||||||
url = "/base/getLoadAverage";
|
url = "/base/getLoadAverage";
|
||||||
|
|
||||||
$http.get(url).then(ListInitialData, cantLoadInitialData);
|
$http.get(url).then(ListLoadAvgData, cantGetLoadAvgData);
|
||||||
|
|
||||||
|
|
||||||
function ListInitialData(response) {
|
function ListLoadAvgData(response) {
|
||||||
|
|
||||||
|
|
||||||
$scope.one = response.data.one;
|
$scope.one = response.data.one;
|
||||||
$scope.two = response.data.two;
|
$scope.two = response.data.two;
|
||||||
@@ -384,8 +383,8 @@ app.controller('loadAvg', function ($scope, $http, $timeout) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cantLoadInitialData(response) {
|
function cantGetLoadAvgData(response) {
|
||||||
console.log("not good");
|
console.log("Can't get load average data");
|
||||||
}
|
}
|
||||||
|
|
||||||
//$timeout(getStuff, 2000);
|
//$timeout(getStuff, 2000);
|
||||||
@@ -398,6 +397,7 @@ app.controller('loadAvg', function ($scope, $http, $timeout) {
|
|||||||
app.controller('homePageStatus', function ($scope, $http, $timeout) {
|
app.controller('homePageStatus', function ($scope, $http, $timeout) {
|
||||||
|
|
||||||
getStuff();
|
getStuff();
|
||||||
|
getLoadAvg();
|
||||||
|
|
||||||
function getStuff() {
|
function getStuff() {
|
||||||
|
|
||||||
@@ -500,6 +500,32 @@ app.controller('homePageStatus', function ($scope, $http, $timeout) {
|
|||||||
$timeout(getStuff, 2000);
|
$timeout(getStuff, 2000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getLoadAvg() {
|
||||||
|
|
||||||
|
url = "/base/getLoadAverage";
|
||||||
|
|
||||||
|
$http.get(url).then(ListLoadAvgData, cantGetLoadAvgData);
|
||||||
|
|
||||||
|
|
||||||
|
function ListLoadAvgData(response) {
|
||||||
|
|
||||||
|
$scope.one = response.data.one;
|
||||||
|
$scope.two = response.data.two;
|
||||||
|
$scope.three = response.data.three;
|
||||||
|
|
||||||
|
document.getElementById("load1").innerHTML = $scope.one;
|
||||||
|
document.getElementById("load2").innerHTML = $scope.two;
|
||||||
|
document.getElementById("load3").innerHTML = $scope.three;
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantGetLoadAvgData(response) {
|
||||||
|
console.log("Can't get load average data");
|
||||||
|
}
|
||||||
|
|
||||||
|
$timeout(getLoadAvg, 2000);
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
////////////
|
////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user