ENTAXY-480 release version 1.8.3

This commit is contained in:
2023-08-03 04:45:45 +03:00
parent 5844a2e5cf
commit 3cc15f7459
236 changed files with 21106 additions and 0 deletions

View File

@ -0,0 +1,102 @@
/*-
* ~~~~~~licensing~~~~~~
* entaxy-management-plugin
* ==========
* Copyright (C) 2020 - 2023 EmDev LLC
* ==========
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ~~~~~~/licensing~~~~~~
*/
var Entaxy;
(function (Entaxy) {
Entaxy._module
.run(AddHeaderTools);
function AddHeaderTools(HawtioExtension, $location, $http, $interval) {
'ngInject';
let baseLocation = getBaseLocation();
let path = '/system/health';
let format = '?format=json';
HawtioExtension.add('context-selector', $scope => {
let div = document.createElement('div');
div.className = 'health-checks-status';
div.appendChild(document.createTextNode('Health checks status:'));
return div;
});
HawtioExtension.add('context-selector', $scope => {
let ref = document.createElement('a');
ref.setAttribute('href', baseLocation + path);
ref.setAttribute('target', '_blank');
let span = document.createElement('span');
changeSpanClassname();
ref.appendChild(span);
let updateStatus;
$scope.startUpdate = function() {
if (angular.isDefined(updateStatus)) return;
updateStatus = $interval(changeSpanClassname, 15000);
}
$scope.startUpdate();
$scope.stopUpdate = function() {
if (angular.isDefined(updateStatus)) {
$interval.cancel(updateStatus);
updateStatus = undefined;
}
}
$scope.$on('$destroy', function() {
$scope.stopUpdate();
});
function changeSpanClassname() {
$http.get(baseLocation + path + format).then(
(response) => {
let status = response.data.overallResult;
if (status === 'OK') {
span.className = 'health-checks pficon pficon-ok';
} else if (status === 'WARN') {
span.className = 'health-checks pficon pficon-warning-triangle-o';
} else {
span.className = 'health-checks pficon pficon-error-circle-o';
}
},
(error) => {
Entaxy.log.error('Unable to get health checks status');
}
);
}
return ref;
});
function getBaseLocation() {
let port = $location.port();
return $location.protocol() + '://' + $location.host() + (port ? (':' + port) : '');
}
}
AddHeaderTools.$inject = ['HawtioExtension', '$location', '$http', '$interval'];
})(Entaxy || (Entaxy = {}));