|
@@ -23,29 +23,29 @@ var PWM_MAIN = PWM_MAIN || {};
|
|
|
var PWM_GLOBAL = PWM_GLOBAL || {};
|
|
|
|
|
|
PWM_ADMIN.initAdminNavMenu = function() {
|
|
|
- var makeMenu = function(){
|
|
|
+ const makeMenu = function () {
|
|
|
|
|
|
- require(["dijit/form/DropDownButton", "dijit/DropDownMenu", "dijit/Menu","dijit/MenuItem", "dijit/PopupMenuItem", "dojo/dom", "dijit/MenuSeparator"],
|
|
|
- function(DropDownButton, DropDownMenu, Menu, MenuItem, PopupMenuItem, dom, MenuSeparator){
|
|
|
- var pMenu = new DropDownMenu({ style: "display: none;"});
|
|
|
+ require(["dijit/form/DropDownButton", "dijit/DropDownMenu", "dijit/Menu", "dijit/MenuItem", "dijit/PopupMenuItem", "dojo/dom", "dijit/MenuSeparator"],
|
|
|
+ function (DropDownButton, DropDownMenu, Menu, MenuItem, PopupMenuItem, dom, MenuSeparator) {
|
|
|
+ const pMenu = new DropDownMenu({style: "display: none;"});
|
|
|
pMenu.addChild(new MenuItem({
|
|
|
label: PWM_ADMIN.showString('Title_LogViewer'),
|
|
|
id: 'eventLog_dropitem',
|
|
|
- onClick: function() {
|
|
|
+ onClick: function () {
|
|
|
PWM_MAIN.gotoUrl(PWM_GLOBAL['url-context'] + '/private/admin/logs');
|
|
|
}
|
|
|
}));
|
|
|
pMenu.addChild(new MenuItem({
|
|
|
label: PWM_ADMIN.showString('Title_TokenLookup'),
|
|
|
id: 'tokenLookup_dropitem',
|
|
|
- onClick: function() {
|
|
|
+ onClick: function () {
|
|
|
PWM_MAIN.gotoUrl(PWM_GLOBAL['url-context'] + '/private/admin/tokens');
|
|
|
}
|
|
|
}));
|
|
|
pMenu.addChild(new MenuItem({
|
|
|
label: PWM_ADMIN.showString('Title_URLReference'),
|
|
|
id: 'urlReference_dropitem',
|
|
|
- onClick: function() {
|
|
|
+ onClick: function () {
|
|
|
PWM_MAIN.gotoUrl(PWM_GLOBAL['url-context'] + '/private/admin/urls');
|
|
|
}
|
|
|
}));
|
|
@@ -53,7 +53,7 @@ PWM_ADMIN.initAdminNavMenu = function() {
|
|
|
pMenu.addChild(new MenuItem({
|
|
|
label: 'Full Page Health Status',
|
|
|
id: 'fullPageHealthStatus_dropitem',
|
|
|
- onClick: function() {
|
|
|
+ onClick: function () {
|
|
|
PWM_MAIN.gotoUrl(PWM_GLOBAL['url-context'] + '/public/health');
|
|
|
}
|
|
|
}));
|
|
@@ -61,16 +61,16 @@ PWM_ADMIN.initAdminNavMenu = function() {
|
|
|
pMenu.addChild(new MenuItem({
|
|
|
label: '<span class="pwm-icon pwm-icon-external-link"></span> Application Reference',
|
|
|
id: 'applictionReference_dropitem',
|
|
|
- onClick: function() {
|
|
|
- PWM_MAIN.newWindowOpen(PWM_GLOBAL['url-context'] + '/public/reference/','referencedoc');
|
|
|
+ onClick: function () {
|
|
|
+ PWM_MAIN.newWindowOpen(PWM_GLOBAL['url-context'] + '/public/reference/', 'referencedoc');
|
|
|
}
|
|
|
}));
|
|
|
if (PWM_GLOBAL['setting-displayEula'] === true) {
|
|
|
pMenu.addChild(new MenuItem({
|
|
|
label: 'View EULA',
|
|
|
id: 'viewEULA_dropitem',
|
|
|
- onClick: function() {
|
|
|
- PWM_MAIN.showEula(false,null);
|
|
|
+ onClick: function () {
|
|
|
+ PWM_MAIN.showEula(false, null);
|
|
|
}
|
|
|
}));
|
|
|
}
|
|
@@ -78,20 +78,20 @@ PWM_ADMIN.initAdminNavMenu = function() {
|
|
|
pMenu.addChild(new MenuItem({
|
|
|
label: 'Configuration Manager',
|
|
|
id: 'configurationManager_dropitem',
|
|
|
- onClick: function() {
|
|
|
+ onClick: function () {
|
|
|
PWM_MAIN.gotoUrl(PWM_GLOBAL['url-context'] + '/private/config/manager');
|
|
|
}
|
|
|
}));
|
|
|
pMenu.addChild(new MenuItem({
|
|
|
label: 'Configuration Editor',
|
|
|
id: 'configurationEditor_dropitem',
|
|
|
- onClick: function() {
|
|
|
+ onClick: function () {
|
|
|
PWM_MAIN.gotoUrl(PWM_GLOBAL['url-context'] + '/private/config/editor');
|
|
|
}
|
|
|
}));
|
|
|
|
|
|
|
|
|
- var dropDownButton = new DropDownButton({
|
|
|
+ const dropDownButton = new DropDownButton({
|
|
|
label: "More Options",
|
|
|
name: "More Options",
|
|
|
dropDown: pMenu,
|
|
@@ -118,7 +118,7 @@ PWM_ADMIN.initDownloadProcessReportZipForm = function() {
|
|
|
});
|
|
|
PWM_MAIN.doQuery("#reportCancelButton", function(node){
|
|
|
PWM_MAIN.addEventHandler(node, "click", function() {
|
|
|
- var url = PWM_MAIN.addParamToUrl(window.location.href,'processAction','cancelDownload');
|
|
|
+ const url = PWM_MAIN.addParamToUrl(window.location.href, 'processAction', 'cancelDownload');
|
|
|
PWM_MAIN.ajaxRequest(url, function(){
|
|
|
PWM_MAIN.showDialog({title:"Report Status",text:"Download Cancelled"})
|
|
|
});
|
|
@@ -172,14 +172,14 @@ PWM_ADMIN.webSessionHeaders = function() {
|
|
|
};
|
|
|
|
|
|
PWM_ADMIN.initActiveSessionGrid=function() {
|
|
|
- var headers = PWM_ADMIN.webSessionHeaders();
|
|
|
+ const headers = PWM_ADMIN.webSessionHeaders();
|
|
|
|
|
|
require(["dojo","dojo/_base/declare", "dgrid/Grid", "dgrid/Keyboard", "dgrid/Selection", "dgrid/extensions/ColumnResizer", "dgrid/extensions/ColumnReorder", "dgrid/extensions/ColumnHider", "dgrid/extensions/DijitRegistry"],
|
|
|
function(dojo, declare, Grid, Keyboard, Selection, ColumnResizer, ColumnReorder, ColumnHider, DijitRegistry){
|
|
|
- var columnHeaders = headers;
|
|
|
+ const columnHeaders = headers;
|
|
|
|
|
|
// Create a new constructor by mixing in the components
|
|
|
- var CustomGrid = declare([ Grid, Keyboard, Selection, ColumnResizer, ColumnReorder, ColumnHider, DijitRegistry ]);
|
|
|
+ const CustomGrid = declare([Grid, Keyboard, Selection, ColumnResizer, ColumnReorder, ColumnHider, DijitRegistry]);
|
|
|
|
|
|
// Now, create an instance of our custom grid
|
|
|
PWM_VAR['activeSessionsGrid'] = new CustomGrid({
|
|
@@ -195,15 +195,15 @@ PWM_ADMIN.initActiveSessionGrid=function() {
|
|
|
};
|
|
|
|
|
|
PWM_ADMIN.refreshActiveSessionGrid=function() {
|
|
|
- var grid = PWM_VAR['activeSessionsGrid'];
|
|
|
+ const grid = PWM_VAR['activeSessionsGrid'];
|
|
|
grid.refresh();
|
|
|
|
|
|
- var maximum = PWM_MAIN.getObject('maxActiveSessionResults').value;
|
|
|
- var url = PWM_MAIN.addParamToUrl(window.location.href,"processAction", "sessionData");
|
|
|
+ const maximum = PWM_MAIN.getObject('maxActiveSessionResults').value;
|
|
|
+ let url = PWM_MAIN.addParamToUrl(window.location.href, "processAction", "sessionData");
|
|
|
url = PWM_MAIN.addParamToUrl(url,'maximum',maximum);
|
|
|
- var loadFunction = function(data) {
|
|
|
+ const loadFunction = function (data) {
|
|
|
grid.renderArray(data['data']);
|
|
|
- grid.set("sort", { attribute : 'createTime', ascending: false, descending: true });
|
|
|
+ grid.set("sort", {attribute: 'createTime', ascending: false, descending: true});
|
|
|
};
|
|
|
PWM_MAIN.ajaxRequest(url,loadFunction,{method:'GET'});
|
|
|
};
|
|
@@ -221,19 +221,19 @@ PWM_ADMIN.intruderHeaders = function(){
|
|
|
|
|
|
PWM_ADMIN.initIntrudersGrid=function() {
|
|
|
PWM_VAR['intruderRecordTypes'] = ["ADDRESS","USERNAME","USER_ID","ATTRIBUTE","TOKEN_DEST"];
|
|
|
- var intruderGridHeaders = PWM_ADMIN.intruderHeaders();
|
|
|
+ const intruderGridHeaders = PWM_ADMIN.intruderHeaders();
|
|
|
|
|
|
require(["dojo","dojo/_base/declare", "dgrid/Grid", "dgrid/Keyboard", "dgrid/Selection", "dgrid/extensions/ColumnResizer", "dgrid/extensions/ColumnReorder", "dgrid/extensions/ColumnHider", "dgrid/extensions/DijitRegistry"],
|
|
|
function(dojo, declare, Grid, Keyboard, Selection, ColumnResizer, ColumnReorder, ColumnHider, DijitRegistry){
|
|
|
// Create a new constructor by mixing in the components
|
|
|
- var CustomGrid = declare([ Grid, Keyboard, Selection, ColumnResizer, ColumnReorder, ColumnHider, DijitRegistry ]);
|
|
|
+ const CustomGrid = declare([Grid, Keyboard, Selection, ColumnResizer, ColumnReorder, ColumnHider, DijitRegistry]);
|
|
|
|
|
|
// Now, create an instance of our custom grid
|
|
|
PWM_VAR['intruderGrid'] = {};
|
|
|
- for (var i = 0; i < PWM_VAR['intruderRecordTypes'].length; i++) {
|
|
|
+ for (let i = 0; i < PWM_VAR['intruderRecordTypes'].length; i++) {
|
|
|
(function(iter){
|
|
|
- var recordType = PWM_VAR['intruderRecordTypes'][iter];
|
|
|
- var grid = new CustomGrid({ columns: intruderGridHeaders}, recordType + "_Grid");
|
|
|
+ const recordType = PWM_VAR['intruderRecordTypes'][iter];
|
|
|
+ const grid = new CustomGrid({columns: intruderGridHeaders}, recordType + "_Grid");
|
|
|
PWM_VAR['intruderGrid'][recordType] = grid;
|
|
|
|
|
|
grid.on(".dgrid-row:click", function(evt){
|
|
@@ -248,8 +248,8 @@ PWM_ADMIN.initIntrudersGrid=function() {
|
|
|
};
|
|
|
|
|
|
PWM_ADMIN.refreshIntruderGrid=function() {
|
|
|
- for (var i = 0; i < PWM_VAR['intruderRecordTypes'].length; i++) {
|
|
|
- var recordType = PWM_VAR['intruderRecordTypes'][i];
|
|
|
+ for (let i = 0; i < PWM_VAR['intruderRecordTypes'].length; i++) {
|
|
|
+ const recordType = PWM_VAR['intruderRecordTypes'][i];
|
|
|
PWM_VAR['intruderGrid'][recordType].refresh();
|
|
|
}
|
|
|
try {
|
|
@@ -257,11 +257,11 @@ PWM_ADMIN.refreshIntruderGrid=function() {
|
|
|
} catch (e) {
|
|
|
maximum = 1000;
|
|
|
}
|
|
|
- var url = PWM_MAIN.addParamToUrl(window.location.href,"processAction", "intruderData");
|
|
|
+ let url = PWM_MAIN.addParamToUrl(window.location.href, "processAction", "intruderData");
|
|
|
url = PWM_MAIN.addParamToUrl(url,'maximum',maximum);
|
|
|
- var loadFunction = function(data) {
|
|
|
- for (var i = 0; i < PWM_VAR['intruderRecordTypes'].length; i++) {
|
|
|
- var recordType = PWM_VAR['intruderRecordTypes'][i];
|
|
|
+ const loadFunction = function (data) {
|
|
|
+ for (let i = 0; i < PWM_VAR['intruderRecordTypes'].length; i++) {
|
|
|
+ const recordType = PWM_VAR['intruderRecordTypes'][i];
|
|
|
PWM_VAR['intruderGrid'][recordType].renderArray(data['data'][recordType]);
|
|
|
}
|
|
|
};
|
|
@@ -331,7 +331,7 @@ PWM_ADMIN.initLogGrid=function() {
|
|
|
require(["dojo","dojo/_base/declare", "dgrid/Grid", "dgrid/Keyboard", "dgrid/Selection", "dgrid/extensions/ColumnResizer", "dgrid/extensions/ColumnReorder", "dgrid/extensions/ColumnHider", "dgrid/extensions/DijitRegistry"],
|
|
|
function(dojo, declare, Grid, Keyboard, Selection, ColumnResizer, ColumnReorder, ColumnHider, DijitRegistry){
|
|
|
// Create a new constructor by mixing in the components
|
|
|
- var CustomGrid = declare([ Grid, Keyboard, Selection, ColumnResizer, ColumnReorder, ColumnHider, DijitRegistry ]);
|
|
|
+ const CustomGrid = declare([Grid, Keyboard, Selection, ColumnResizer, ColumnReorder, ColumnHider, DijitRegistry]);
|
|
|
|
|
|
// Now, create an instance of our custom userGrid
|
|
|
PWM_VAR['logViewerGrid'] = new CustomGrid({columns: PWM_ADMIN.logHeaders()}, "logViewerGrid");
|
|
@@ -341,23 +341,23 @@ PWM_ADMIN.initLogGrid=function() {
|
|
|
}
|
|
|
);
|
|
|
|
|
|
- var saveSettings = function() {
|
|
|
- var logSettings = PWM_ADMIN.readLogFormData();
|
|
|
- PWM_MAIN.Preferences.writeSessionStorage('logSettings',logSettings);
|
|
|
+ const saveSettings = function () {
|
|
|
+ const logSettings = PWM_ADMIN.readLogFormData();
|
|
|
+ PWM_MAIN.Preferences.writeSessionStorage('logSettings', logSettings);
|
|
|
};
|
|
|
|
|
|
PWM_MAIN.addEventHandler('form-loadLog','change', saveSettings);
|
|
|
PWM_MAIN.addEventHandler('form-downloadLog','change', saveSettings);
|
|
|
|
|
|
- var loadSettings = function () {
|
|
|
- var settings = PWM_MAIN.Preferences.readSessionStorage('logSettings');
|
|
|
+ const loadSettings = function () {
|
|
|
+ const settings = PWM_MAIN.Preferences.readSessionStorage('logSettings');
|
|
|
if (settings) {
|
|
|
PWM_MAIN.getObject('username').value = settings['username'];
|
|
|
PWM_MAIN.getObject('text').value = settings['text'];
|
|
|
PWM_MAIN.getObject('count').value = settings['count'];
|
|
|
PWM_MAIN.getObject('maxTime').value = settings['maxTime'];
|
|
|
- PWM_MAIN.JSLibrary.setValueOfSelectElement('type',settings['type']);
|
|
|
- PWM_MAIN.JSLibrary.setValueOfSelectElement('level',settings['level']);
|
|
|
+ PWM_MAIN.JSLibrary.setValueOfSelectElement('type', settings['type']);
|
|
|
+ PWM_MAIN.JSLibrary.setValueOfSelectElement('level', settings['level']);
|
|
|
PWM_MAIN.JSLibrary.setValueOfSelectElement('displayType', settings['displayType']);
|
|
|
if (PWM_MAIN.getObject('form-downloadLog')) {
|
|
|
PWM_MAIN.JSLibrary.setValueOfSelectElement('downloadType', settings['downloadType']);
|
|
@@ -369,7 +369,7 @@ PWM_ADMIN.initLogGrid=function() {
|
|
|
};
|
|
|
|
|
|
PWM_ADMIN.readLogFormData = function() {
|
|
|
- var settings = {};
|
|
|
+ const settings = {};
|
|
|
settings['username'] = PWM_MAIN.getObject('username').value;
|
|
|
settings['text'] = PWM_MAIN.getObject('text').value;
|
|
|
settings['count'] = PWM_MAIN.getObject('count').value;
|
|
@@ -386,12 +386,12 @@ PWM_ADMIN.readLogFormData = function() {
|
|
|
|
|
|
PWM_ADMIN.refreshLogData = function() {
|
|
|
PWM_MAIN.getObject('button-search').disabled = true;
|
|
|
- var logSettings = PWM_ADMIN.readLogFormData();
|
|
|
+ const logSettings = PWM_ADMIN.readLogFormData();
|
|
|
|
|
|
- var processFunction = function(data) {
|
|
|
+ const processFunction = function (data) {
|
|
|
console.time('someFunction');
|
|
|
|
|
|
- var records = data['data']['records'];
|
|
|
+ const records = data['data']['records'];
|
|
|
if (PWM_MAIN.JSLibrary.isEmpty(records)) {
|
|
|
PWM_MAIN.removeCssClass('div-noResultsMessage', 'nodisplay');
|
|
|
PWM_MAIN.addCssClass('wrapper-logViewerGrid', 'nodisplay');
|
|
@@ -402,18 +402,18 @@ PWM_ADMIN.refreshLogData = function() {
|
|
|
PWM_MAIN.addCssClass('div-noResultsMessage', 'nodisplay');
|
|
|
PWM_MAIN.removeCssClass('wrapper-logViewerGrid', 'nodisplay');
|
|
|
PWM_MAIN.addCssClass('wrapper-lineViewer', 'nodisplay');
|
|
|
- var grid = PWM_VAR['logViewerGrid'];
|
|
|
+ const grid = PWM_VAR['logViewerGrid'];
|
|
|
grid.refresh();
|
|
|
grid.renderArray(records);
|
|
|
- grid.set("timestamp", { attribute : 'createTime', ascending: false, descending: true });
|
|
|
+ grid.set("timestamp", {attribute: 'createTime', ascending: false, descending: true});
|
|
|
} else {
|
|
|
PWM_MAIN.addCssClass('div-noResultsMessage', 'nodisplay');
|
|
|
PWM_MAIN.addCssClass('wrapper-logViewerGrid', 'nodisplay');
|
|
|
PWM_MAIN.removeCssClass('wrapper-lineViewer', 'nodisplay');
|
|
|
- var textOutput = '';
|
|
|
+ let textOutput = '';
|
|
|
|
|
|
- for (var iterator in records) {
|
|
|
- (function(record) {
|
|
|
+ for (let iterator in records) {
|
|
|
+ (function (record) {
|
|
|
textOutput += records[record];
|
|
|
textOutput += "\n";
|
|
|
}(iterator));
|
|
@@ -427,8 +427,8 @@ PWM_ADMIN.refreshLogData = function() {
|
|
|
PWM_MAIN.closeWaitDialog();
|
|
|
};
|
|
|
|
|
|
- var url = PWM_MAIN.addParamToUrl(PWM_GLOBAL['url-context'] + '/private/admin', 'processAction', 'readLogData');
|
|
|
- var options = {};
|
|
|
+ const url = PWM_MAIN.addParamToUrl(PWM_GLOBAL['url-context'] + '/private/admin', 'processAction', 'readLogData');
|
|
|
+ const options = {};
|
|
|
options.content = logSettings;
|
|
|
|
|
|
PWM_MAIN.showWaitDialog({loadFunction:function(){
|
|
@@ -442,7 +442,7 @@ PWM_ADMIN.initAuditGrid=function() {
|
|
|
require(["dojo","dojo/_base/declare", "dgrid/Grid", "dgrid/Keyboard", "dgrid/Selection", "dgrid/extensions/ColumnResizer", "dgrid/extensions/ColumnReorder", "dgrid/extensions/ColumnHider", "dgrid/extensions/DijitRegistry"],
|
|
|
function(dojo, declare, Grid, Keyboard, Selection, ColumnResizer, ColumnReorder, ColumnHider, DijitRegistry){
|
|
|
// Create a new constructor by mixing in the components
|
|
|
- var CustomGrid = declare([ Grid, Keyboard, Selection, ColumnResizer, ColumnReorder, ColumnHider, DijitRegistry ]);
|
|
|
+ const CustomGrid = declare([Grid, Keyboard, Selection, ColumnResizer, ColumnReorder, ColumnHider, DijitRegistry]);
|
|
|
|
|
|
// Now, create an instance of our custom userGrid
|
|
|
PWM_VAR['auditUserGrid'] = new CustomGrid({columns: PWM_ADMIN.auditUserHeaders()}, "auditUserGrid");
|
|
@@ -486,10 +486,10 @@ PWM_ADMIN.refreshAuditGridData=function(maximum,type) {
|
|
|
maximum = 100;
|
|
|
}
|
|
|
|
|
|
- var url = PWM_MAIN.addParamToUrl(window.location.href, "processAction", "auditData");
|
|
|
+ let url = PWM_MAIN.addParamToUrl(window.location.href, "processAction", "auditData");
|
|
|
url = PWM_MAIN.addParamToUrl(url,'maximum',maximum);
|
|
|
url = PWM_MAIN.addParamToUrl(url,'type',type);
|
|
|
- var loadFunction = function(data) {
|
|
|
+ const loadFunction = function (data) {
|
|
|
grid.renderArray(data['data']['records']);
|
|
|
};
|
|
|
PWM_MAIN.ajaxRequest(url,loadFunction,{method:'GET'});
|
|
@@ -497,12 +497,17 @@ PWM_ADMIN.refreshAuditGridData=function(maximum,type) {
|
|
|
|
|
|
PWM_ADMIN.showStatChart = function(statName,days,divName,options) {
|
|
|
options = options === undefined ? {} : options;
|
|
|
- var doRefresh = options['refreshTime']
|
|
|
- ? function(){setTimeout(function(){PWM_ADMIN.showStatChart(statName,days,divName,options);},options['refreshTime']);}
|
|
|
- : function(){};
|
|
|
- var statsGetUrl = PWM_MAIN.addParamToUrl( PWM_GLOBAL['url-context'] + '/public/api',"processAction","statistics");
|
|
|
- var epsTypes = PWM_GLOBAL['epsTypes'];
|
|
|
- var epsDurations = PWM_GLOBAL['epsDurations'];
|
|
|
+ const doRefresh = options['refreshTime']
|
|
|
+ ? function () {
|
|
|
+ setTimeout(function () {
|
|
|
+ PWM_ADMIN.showStatChart(statName, days, divName, options);
|
|
|
+ }, options['refreshTime']);
|
|
|
+ }
|
|
|
+ : function () {
|
|
|
+ };
|
|
|
+ let statsGetUrl = PWM_MAIN.addParamToUrl(PWM_GLOBAL['url-context'] + '/public/api', "processAction", "statistics");
|
|
|
+ const epsTypes = PWM_GLOBAL['epsTypes'];
|
|
|
+ const epsDurations = PWM_GLOBAL['epsDurations'];
|
|
|
require(["dojo",
|
|
|
"dijit",
|
|
|
"dijit/registry",
|
|
@@ -517,15 +522,15 @@ PWM_ADMIN.showStatChart = function(statName,days,divName,options) {
|
|
|
statsGetUrl = PWM_MAIN.addParamToUrl(statsGetUrl, "statName", statName);
|
|
|
statsGetUrl = PWM_MAIN.addParamToUrl(statsGetUrl, "days", days);
|
|
|
|
|
|
- var errorFunction = function() {
|
|
|
- for (var loopEpsTypeIndex = 0; loopEpsTypeIndex < epsTypes.length; loopEpsTypeIndex++) { // clear all the gauges
|
|
|
- var loopEpsName = epsTypes[loopEpsTypeIndex] + '';
|
|
|
- for (var loopEpsDurationsIndex = 0; loopEpsDurationsIndex < epsDurations.length; loopEpsDurationsIndex++) { // clear all the gauges
|
|
|
- var loopEpsDuration = epsDurations[loopEpsDurationsIndex] + '';
|
|
|
- var loopEpsID = "EPS-GAUGE-" + loopEpsName + "_" + loopEpsDuration;
|
|
|
+ const errorFunction = function () {
|
|
|
+ for (let loopEpsTypeIndex = 0; loopEpsTypeIndex < epsTypes.length; loopEpsTypeIndex++) { // clear all the gauges
|
|
|
+ const loopEpsName = epsTypes[loopEpsTypeIndex] + '';
|
|
|
+ for (let loopEpsDurationsIndex = 0; loopEpsDurationsIndex < epsDurations.length; loopEpsDurationsIndex++) { // clear all the gauges
|
|
|
+ const loopEpsDuration = epsDurations[loopEpsDurationsIndex] + '';
|
|
|
+ const loopEpsID = "EPS-GAUGE-" + loopEpsName + "_" + loopEpsDuration;
|
|
|
if (PWM_MAIN.getObject(loopEpsID) !== null) {
|
|
|
if (registry.byId(loopEpsID)) {
|
|
|
- registry.byId(loopEpsID).setAttribute('value','0');
|
|
|
+ registry.byId(loopEpsID).setAttribute('value', '0');
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -533,20 +538,20 @@ PWM_ADMIN.showStatChart = function(statName,days,divName,options) {
|
|
|
doRefresh();
|
|
|
};
|
|
|
|
|
|
- var loadFunction = function(data) {
|
|
|
+ const loadFunction = function (data) {
|
|
|
{// gauges
|
|
|
console.log('Beginning stats update process...');
|
|
|
data = data['data'];
|
|
|
- var activityCount = 0;
|
|
|
- for (var loopEpsIndex = 0; loopEpsIndex < epsTypes.length; loopEpsIndex++) {
|
|
|
- var loopEpsName = epsTypes[loopEpsIndex] + '';
|
|
|
- for (var loopEpsDurationsIndex = 0; loopEpsDurationsIndex < epsDurations.length; loopEpsDurationsIndex++) { // clear all the gauges
|
|
|
- var loopEpsDuration = epsDurations[loopEpsDurationsIndex] + '';
|
|
|
- var loopEpsID = "EPS-GAUGE-" + loopEpsName + "_" + loopEpsDuration;
|
|
|
- var loopFieldEpsID = "FIELD_" + loopEpsName + "_" + loopEpsDuration;
|
|
|
- var loopEpsValue = data['EPS'][loopEpsName + "_" + loopEpsDuration];
|
|
|
- var loopEpmValue = (loopEpsValue * 60).toFixed(3);
|
|
|
- var loopTop = PWM_GLOBAL['client.activityMaxEpsRate'];
|
|
|
+ let activityCount = 0;
|
|
|
+ for (let loopEpsIndex = 0; loopEpsIndex < epsTypes.length; loopEpsIndex++) {
|
|
|
+ const loopEpsName = epsTypes[loopEpsIndex] + '';
|
|
|
+ for (let loopEpsDurationsIndex = 0; loopEpsDurationsIndex < epsDurations.length; loopEpsDurationsIndex++) { // clear all the gauges
|
|
|
+ const loopEpsDuration = epsDurations[loopEpsDurationsIndex] + '';
|
|
|
+ const loopEpsID = "EPS-GAUGE-" + loopEpsName + "_" + loopEpsDuration;
|
|
|
+ const loopFieldEpsID = "FIELD_" + loopEpsName + "_" + loopEpsDuration;
|
|
|
+ const loopEpsValue = data['EPS'][loopEpsName + "_" + loopEpsDuration];
|
|
|
+ const loopEpmValue = (loopEpsValue * 60).toFixed(3);
|
|
|
+ const loopTop = PWM_GLOBAL['client.activityMaxEpsRate'];
|
|
|
if (loopEpsDuration === "HOURLY") {
|
|
|
activityCount += loopEpsValue;
|
|
|
}
|
|
@@ -556,10 +561,10 @@ PWM_ADMIN.showStatChart = function(statName,days,divName,options) {
|
|
|
if (PWM_MAIN.getObject(loopEpsID) !== null) {
|
|
|
console.log('EpsID=' + loopEpsID + ', ' + 'Eps=' + loopEpsValue + ', ' + 'Epm=' + loopEpmValue);
|
|
|
if (registry.byId(loopEpsID)) {
|
|
|
- registry.byId(loopEpsID).setAttribute('value',loopEpmValue);
|
|
|
- registry.byId(loopEpsID).setAttribute('max',loopTop);
|
|
|
+ registry.byId(loopEpsID).setAttribute('value', loopEpmValue);
|
|
|
+ registry.byId(loopEpsID).setAttribute('max', loopTop);
|
|
|
} else {
|
|
|
- var glossyCircular = new dojox.gauges.GlossyCircularGauge({
|
|
|
+ const glossyCircular = new dojox.gauges.GlossyCircularGauge({
|
|
|
background: [255, 255, 255, 0],
|
|
|
noChange: true,
|
|
|
value: loopEpmValue,
|
|
@@ -579,19 +584,19 @@ PWM_ADMIN.showStatChart = function(statName,days,divName,options) {
|
|
|
PWM_GLOBAL['epsActivityCount'] = activityCount;
|
|
|
}
|
|
|
if (divName !== null && PWM_MAIN.getObject(divName)) { // stats chart
|
|
|
- var values = [];
|
|
|
- for(var key in data['nameData']) {
|
|
|
- var value = data['nameData'][key];
|
|
|
+ const values = [];
|
|
|
+ for (let key in data['nameData']) {
|
|
|
+ const value = data['nameData'][key];
|
|
|
values.push(parseInt(value));
|
|
|
}
|
|
|
|
|
|
if (PWM_GLOBAL[divName + '-stored-reference']) {
|
|
|
- var existingChart = PWM_GLOBAL[divName + '-stored-reference'];
|
|
|
+ const existingChart = PWM_GLOBAL[divName + '-stored-reference'];
|
|
|
existingChart.destroy();
|
|
|
}
|
|
|
- var c = new dojox.charting.Chart2D(divName);
|
|
|
+ const c = new dojox.charting.Chart2D(divName);
|
|
|
PWM_GLOBAL[divName + '-stored-reference'] = c;
|
|
|
- c.addPlot("default", {type: "Columns", gap:'2'});
|
|
|
+ c.addPlot("default", {type: "Columns", gap: '2'});
|
|
|
c.addAxis("x", {});
|
|
|
c.addAxis("y", {vertical: true});
|
|
|
c.setTheme(dojox.charting.themes.Wetland);
|
|
@@ -607,17 +612,17 @@ PWM_ADMIN.showStatChart = function(statName,days,divName,options) {
|
|
|
|
|
|
PWM_ADMIN.showAppHealth = function(parentDivID, options, refreshNow) {
|
|
|
|
|
|
- var inputOpts = options || PWM_GLOBAL['showPwmHealthOptions'] || {};
|
|
|
+ const inputOpts = options || PWM_GLOBAL['showPwmHealthOptions'] || {};
|
|
|
PWM_GLOBAL['showPwmHealthOptions'] = options;
|
|
|
- var refreshUrl = inputOpts['sourceUrl'] || PWM_GLOBAL['url-context'] + "/public/api?processAction=health";
|
|
|
- var showRefresh = inputOpts['showRefresh'];
|
|
|
- var showTimestamp = inputOpts['showTimestamp'];
|
|
|
- var refreshTime = inputOpts['refreshTime'] || 60 * 1000;
|
|
|
- var finishFunction = inputOpts['finishFunction'];
|
|
|
+ let refreshUrl = inputOpts['sourceUrl'] || PWM_GLOBAL['url-context'] + "/public/api?processAction=health";
|
|
|
+ const showRefresh = inputOpts['showRefresh'];
|
|
|
+ const showTimestamp = inputOpts['showTimestamp'];
|
|
|
+ const refreshTime = inputOpts['refreshTime'] || 60 * 1000;
|
|
|
+ const finishFunction = inputOpts['finishFunction'];
|
|
|
|
|
|
console.log('starting showPwmHealth: refreshTime=' + refreshTime);
|
|
|
require(["dojo"],function(dojo){
|
|
|
- var parentDiv = dojo.byId(parentDivID);
|
|
|
+ const parentDiv = dojo.byId(parentDivID);
|
|
|
if (PWM_GLOBAL['inhibitHealthUpdate'] === true) {
|
|
|
try { parentDiv.innerHTML = ''; } catch (e) { console.log('unable to update health div' + e) };
|
|
|
return;
|
|
@@ -634,23 +639,23 @@ PWM_ADMIN.showAppHealth = function(parentDivID, options, refreshNow) {
|
|
|
refreshUrl = PWM_MAIN.addParamToUrl(refreshUrl, 'refreshImmediate', 'true');
|
|
|
}
|
|
|
|
|
|
- var loadFunction = function(data) {
|
|
|
+ const loadFunction = function (data) {
|
|
|
if (data['error']) {
|
|
|
PWM_MAIN.showErrorDialog(data);
|
|
|
} else {
|
|
|
PWM_GLOBAL['pwm-health'] = data['data']['overall'];
|
|
|
- var htmlBody = PWM_ADMIN.makeHealthHtml(data['data'], showTimestamp, showRefresh);
|
|
|
+ const htmlBody = PWM_ADMIN.makeHealthHtml(data['data'], showTimestamp, showRefresh);
|
|
|
parentDiv.innerHTML = htmlBody;
|
|
|
PWM_MAIN.TimestampHandler.initElement(PWM_MAIN.getObject('healthCheckTimestamp'));
|
|
|
|
|
|
- PWM_MAIN.addEventHandler('button-refreshHealth','click',function(){
|
|
|
+ PWM_MAIN.addEventHandler('button-refreshHealth', 'click', function () {
|
|
|
PWM_ADMIN.showAppHealth(parentDivID, options, true);
|
|
|
});
|
|
|
|
|
|
PWM_GLOBAL['healthCheckInProgress'] = false;
|
|
|
|
|
|
if (refreshTime > 0) {
|
|
|
- setTimeout(function() {
|
|
|
+ setTimeout(function () {
|
|
|
PWM_ADMIN.showAppHealth(parentDivID, options);
|
|
|
}, refreshTime);
|
|
|
}
|
|
@@ -663,11 +668,11 @@ PWM_ADMIN.showAppHealth = function(parentDivID, options, refreshNow) {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- var errorFunction = function(error) {
|
|
|
+ const errorFunction = function (error) {
|
|
|
if (error !== null) {
|
|
|
console.log('error reaching server: ' + error);
|
|
|
}
|
|
|
- var htmlBody = '<div style="text-align:center; background-color: #d20734">';
|
|
|
+ let htmlBody = '<div style="text-align:center; background-color: #d20734">';
|
|
|
htmlBody += '<br/><span style="font-weight: bold;">unable to load health data from server</span></br>';
|
|
|
htmlBody += '<br/>' + new Date().toLocaleString() + ' ';
|
|
|
if (showRefresh) {
|
|
@@ -678,7 +683,7 @@ PWM_ADMIN.showAppHealth = function(parentDivID, options, refreshNow) {
|
|
|
PWM_GLOBAL['healthCheckInProgress'] = false;
|
|
|
PWM_GLOBAL['pwm-health'] = 'WARN';
|
|
|
if (refreshTime > 0) {
|
|
|
- setTimeout(function() {
|
|
|
+ setTimeout(function () {
|
|
|
PWM_ADMIN.showAppHealth(parentDivID, options);
|
|
|
}, refreshTime);
|
|
|
}
|
|
@@ -692,12 +697,12 @@ PWM_ADMIN.showAppHealth = function(parentDivID, options, refreshNow) {
|
|
|
};
|
|
|
|
|
|
PWM_ADMIN.makeHealthHtml = function(healthData, showTimestamp, showRefresh) {
|
|
|
- var healthRecords = healthData['records'];
|
|
|
- var htmlBody = '<div>';
|
|
|
+ const healthRecords = healthData['records'];
|
|
|
+ let htmlBody = '<div>';
|
|
|
htmlBody += '<div class="healthTable-wrapper"><table>';
|
|
|
- for (var i = 0; i < healthRecords.length; i++) {
|
|
|
+ for (let i = 0; i < healthRecords.length; i++) {
|
|
|
(function(iter){
|
|
|
- var loopRecord = healthRecords[iter];
|
|
|
+ const loopRecord = healthRecords[iter];
|
|
|
htmlBody += '<tr><td class="key" style="width:1px; white-space:nowrap;"">';
|
|
|
htmlBody += loopRecord['topic'];
|
|
|
htmlBody += '</td><td class="health-' + loopRecord['status'] + '">';
|
|
@@ -729,7 +734,7 @@ PWM_ADMIN.makeHealthHtml = function(healthData, showTimestamp, showRefresh) {
|
|
|
PWM_ADMIN.initPwNotifyPage = function() {
|
|
|
PWM_MAIN.addEventHandler('button-executePwNotifyJob','click',function(){
|
|
|
PWM_MAIN.showWaitDialog({loadFunction:function(){
|
|
|
- var url = PWM_MAIN.addParamToUrl(window.location.pathname, 'processAction','startPwNotifyJob');
|
|
|
+ const url = PWM_MAIN.addParamToUrl(window.location.pathname, 'processAction', 'startPwNotifyJob');
|
|
|
PWM_MAIN.ajaxRequest(url,function(data){
|
|
|
setTimeout(function(){
|
|
|
PWM_MAIN.showDialog({title:'Job Started',text:data['successMessage'],okAction:function(){
|
|
@@ -764,14 +769,14 @@ PWM_ADMIN.initPwNotifyPage = function() {
|
|
|
};
|
|
|
|
|
|
PWM_ADMIN.loadPwNotifyStatus = function () {
|
|
|
- var processData = function (data) {
|
|
|
- var statusData = data['data']['statusData'];
|
|
|
- var htmlData = '<tr><td colspan="2" class="title">Password Expiration Notification Job Status</td></tr>';
|
|
|
+ const processData = function (data) {
|
|
|
+ const statusData = data['data']['statusData'];
|
|
|
+ let htmlData = '<tr><td colspan="2" class="title">Password Expiration Notification Job Status</td></tr>';
|
|
|
for (var item in statusData) {
|
|
|
- (function(key){
|
|
|
- var item = statusData[key];
|
|
|
+ (function (key) {
|
|
|
+ const item = statusData[key];
|
|
|
htmlData += '<tr><td>' + item['label'] + '</td><td>';
|
|
|
- if ( item['type'] === 'timestamp') {
|
|
|
+ if (item['type'] === 'timestamp') {
|
|
|
htmlData += '<span id="pwNotifyStatusRow-' + key + '" class="timestamp">' + item['value'] + '</span>';
|
|
|
} else {
|
|
|
htmlData += item['value'];
|
|
@@ -783,9 +788,9 @@ PWM_ADMIN.loadPwNotifyStatus = function () {
|
|
|
PWM_MAIN.getObject('table-pwNotifyStatus').innerHTML = htmlData;
|
|
|
|
|
|
for (var item in statusData) {
|
|
|
- (function(key){
|
|
|
- var item = statusData[key];
|
|
|
- if ( item['type'] === 'timestamp') {
|
|
|
+ (function (key) {
|
|
|
+ const item = statusData[key];
|
|
|
+ if (item['type'] === 'timestamp') {
|
|
|
PWM_MAIN.TimestampHandler.initElement(PWM_MAIN.getObject('pwNotifyStatusRow-' + key));
|
|
|
}
|
|
|
})(item);
|
|
@@ -793,14 +798,14 @@ PWM_ADMIN.loadPwNotifyStatus = function () {
|
|
|
|
|
|
PWM_MAIN.getObject('button-executePwNotifyJob').disabled = !data['data']['enableStartButton'];
|
|
|
};
|
|
|
- var url = PWM_MAIN.addParamToUrl(window.location.href,'processAction','readPwNotifyStatus');
|
|
|
+ const url = PWM_MAIN.addParamToUrl(window.location.href, 'processAction', 'readPwNotifyStatus');
|
|
|
PWM_MAIN.ajaxRequest(url, processData);
|
|
|
|
|
|
};
|
|
|
|
|
|
PWM_ADMIN.loadPwNotifyLog = function () {
|
|
|
- var processData = function (data) {
|
|
|
- var debugData = data['data'];
|
|
|
+ const processData = function (data) {
|
|
|
+ const debugData = data['data'];
|
|
|
if (debugData && debugData.length > 0) {
|
|
|
PWM_MAIN.getObject('div-pwNotifyDebugLog').innerHTML = '';
|
|
|
PWM_MAIN.getObject('div-pwNotifyDebugLog').appendChild(document.createTextNode(debugData));
|
|
@@ -808,21 +813,21 @@ PWM_ADMIN.loadPwNotifyLog = function () {
|
|
|
PWM_MAIN.getObject('div-pwNotifyDebugLog').innerHTML = '<span class="footnote">Job has not been run on this server since startup.</span>';
|
|
|
}
|
|
|
};
|
|
|
- var url = PWM_MAIN.addParamToUrl(window.location.href,'processAction','readPwNotifyLog');
|
|
|
+ const url = PWM_MAIN.addParamToUrl(window.location.href, 'processAction', 'readPwNotifyLog');
|
|
|
PWM_MAIN.ajaxRequest(url, processData);
|
|
|
|
|
|
};
|
|
|
|
|
|
PWM_ADMIN.detailView = function(evt, headers, grid){
|
|
|
- var row = grid.row(evt);
|
|
|
- var text = '<table>';
|
|
|
- var postExecuteFunctions = [];
|
|
|
- for (var item in headers) {
|
|
|
+ const row = grid.row(evt);
|
|
|
+ let text = '<table>';
|
|
|
+ const postExecuteFunctions = [];
|
|
|
+ for (let item in headers) {
|
|
|
(function(key){
|
|
|
- var field = headers[key]['field'];
|
|
|
- var label = headers[key]['label'];
|
|
|
- var value = field in row.data ? row.data[field] : '';
|
|
|
- var id = "record-detail-" + key;
|
|
|
+ const field = headers[key]['field'];
|
|
|
+ const label = headers[key]['label'];
|
|
|
+ const value = field in row.data ? row.data[field] : '';
|
|
|
+ const id = "record-detail-" + key;
|
|
|
text += '<tr><td class="key">' + label + '</td>';
|
|
|
text += '<td><span id="' + id + '" style="max-height: 200px; overflow: auto; max-width: 400px" class="timestamp">';
|
|
|
if (key.toLowerCase().indexOf('time') >= 0) {
|
|
@@ -840,7 +845,7 @@ PWM_ADMIN.detailView = function(evt, headers, grid){
|
|
|
}
|
|
|
text += '</table>';
|
|
|
PWM_MAIN.showDialog({title:"Record Detail",text:text,showClose:true,allowMove:true,loadFunction:function(){
|
|
|
- for (var i = 0; i < postExecuteFunctions.length; i++) {
|
|
|
+ for (let i = 0; i < postExecuteFunctions.length; i++) {
|
|
|
postExecuteFunctions[i]();
|
|
|
}
|
|
|
}});
|