diff --git a/.travis.yml b/.travis.yml
index c793d00..ff4d4e6 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -3,6 +3,7 @@ sudo: false
# Specify the build matrix
language: php
+dist: trusty
php:
- '5.4'
- '7.0'
@@ -28,5 +29,8 @@ before_install: git clone --depth=1 --branch="v1" https://github.com/ubccr/xdmod
# Delegate the installation step to the shared Travis installation script
install: .qa/travis/install.sh
+# Need to make sure that the style config files are in place before the build step.
+before_script: .qa/style/install.sh ./
+
# Delegate the build step to the shared Travis build script
script: .qa/travis/build.sh
diff --git a/build.json b/build.json
index 3c867d3..3a87261 100644
--- a/build.json
+++ b/build.json
@@ -42,7 +42,8 @@
"configuration/rest.d": "rest.d",
"configuration/assets.d": "assets.d",
"configuration/modules.d/appkernels.json": "modules.d/appkernels.json",
- "configuration/linker.d/appkernels.json": "linker.d/appkernels.json"
+ "configuration/linker.d/appkernels.json": "linker.d/appkernels.json",
+ "configuration/roles.d/appkernels-center_report_card.json": "roles.d/appkernels-center_report_card.json"
},
"etc/crond": {
"configuration/cron.conf": "xdmod-appkernels"
diff --git a/classes/AppKernel/AppKernelDb.php b/classes/AppKernel/AppKernelDb.php
index 8789194..2d85dea 100644
--- a/classes/AppKernel/AppKernelDb.php
+++ b/classes/AppKernel/AppKernelDb.php
@@ -106,6 +106,7 @@ public function __construct(\Log $logger = NULL, $configSection = NULL)
: $configSection);
$this->db = DB::factory($configSection);
+ $this->modwDB = DB::factory('database');
$this->logger = $logger !== NULL ? $logger : \Log::singleton('null');
} // __construct()
@@ -401,18 +402,12 @@ public function getResources($start_date = NULL, $end_date = NULL, array $pu_cou
$access_to_some_resource=true;
//get all associated organization
- $organizations=array();
- if(in_array("cd",$roles))
- $organizations=array_merge($organizations,$user->getOrganizationCollection("cd"));
- if(in_array("cs",$roles))
- $organizations=array_merge($organizations,$user->getOrganizationCollection("cs"));
-
- $organizations[]=$user->getPrimaryOrganization();
- $organizations[]=$user->getActiveOrganization();
+ $organizations = array(
+ $user->getOrganizationID()
+ );
#get resource_id for all associated resources
- $c=new \Compliance();
- $rr=$c->getResourceListing(date_format(date_sub(date_create(), date_interval_create_from_date_string("90 days")),'Y-m-d'),date_format(date_create(),'Y-m-d'));
+ $rr=$this->getResourceListing(date_format(date_sub(date_create(), date_interval_create_from_date_string("90 days")),'Y-m-d'),date_format(date_create(),'Y-m-d'));
$organizations_resources_id=array();
foreach($rr as $r){
@@ -436,6 +431,99 @@ public function getResources($start_date = NULL, $end_date = NULL, array $pu_cou
return $resources;
} // getResources()
+ /**
+ * This function has been lifted from the XSEDE Modules Compliance class so that AppKernels can
+ * be used by Open Source Users. Retrieves a list of resources filtered by the optionally provided
+ * `$start_date` and `$end_date`
+ *
+ * @param string|null $start_date
+ * @param string|null $end_date
+ * @return mixed
+ */
+ public function getResourceListing($start_date = null, $end_date = null) {
+
+ // Order by descending end_date and processors
+
+ $ts = "";
+
+ // Resources which have no end date are considered still active so use the max date
+ // possible. Resources are sorted in order of decreasing end date so this will keep active
+ // resources at the top of the list.
+
+ $m = "CASE WHEN rf.end_date IS NULL THEN '9999-12-31' ELSE rf.end_date END";
+
+ $query_params = array();
+
+ if (isset($start_date) && isset($end_date)) {
+
+ /*
+
+ Account for ALL resources (in other words, an overlap between the supplied timeframe and the resource timeframe)
+
+ S(t) E(t)
+ |----------------------------|
+ |------------------------|
+ S(r) E(r)
+
+
+ (t): Supplied timeframe
+ (r): A resource
+
+ Overlap exists when S(r) <= E(t) AND E(r) >= S(t)
+
+ */
+
+ $ts .= " AND rf.start_date <= :ts_start_date_lte AND ($m) >= :ts_end_date_gte";
+
+ $query_params[':ts_start_date_lte'] = $end_date;
+ $query_params[':ts_end_date_gte'] = $start_date;
+
+ }
+
+ $query = "
+ SELECT
+ rf.code,
+ rf.organization_id,
+ rf.id,
+ rt.description,
+ rt.abbrev,
+ CASE
+ WHEN rf.end_date IS NULL THEN 'N/A'
+ ELSE DATE_FORMAT(rf.end_date, '%Y-%m-%d')
+ END AS official_end_date,
+ $m AS resource_end_date,
+ DATE_FORMAT(rf.start_date, '%Y-%m-%d') AS resource_start_date,
+ CASE
+ WHEN rs.processors IS NULL THEN 0
+ ELSE rs.processors
+ END AS processors
+ FROM
+ modw.resourcefact AS rf,
+ modw.resourcespecs rs,
+ modw.resourcetype AS rt
+ WHERE
+ rf.id = rs.resource_id
+ AND rf.resourcetype_id = rt.id
+ AND rt.abbrev IN ('HPC', 'HTC', 'DIC', 'Vis', 'Disk', 'Cloud')
+ AND rf.code NOT LIKE 'TG%'
+ $ts
+ AND UNIX_TIMESTAMP(:start_date_lte) >= rs.start_date_ts
+ AND (
+ rs.end_date_ts IS NULL
+ OR UNIX_TIMESTAMP(:end_date_gte) <= rs.end_date_ts
+ )
+ ORDER BY
+ rs.processors DESC,
+ resource_end_date DESC,
+ rf.code DESC"
+ ;
+
+ $query_params[':start_date_lte'] = $end_date;
+ $query_params[':end_date_gte'] = $end_date;
+
+ return $this->modwDB->query($query, $query_params);
+ }//getResourceListing
+
// --------------------------------------------------------------------------------
public function getProcessingUnits($start_date = NULL, $end_date = NULL, array $resource_ids = array(), array $metrics = array())
diff --git a/classes/AppKernel/PerformanceMap.php b/classes/AppKernel/PerformanceMap.php
index a720efc..952e079 100644
--- a/classes/AppKernel/PerformanceMap.php
+++ b/classes/AppKernel/PerformanceMap.php
@@ -19,6 +19,13 @@ class PerformanceMap
public $appKer; /** @param string[]|null*/
public $problemSize; /** @param string[]|null*/
+ /**
+ * The organization id of the user who is requesting data from this object.
+ *
+ * @var int
+ */
+ public $userOrganization;
+
public $perfMap;
public $ak_shortnames;
@@ -99,10 +106,25 @@ public function __construct($options)
$this->ak_def_ids=$ak_def_ids;
//get resource_ids
+ $sql = 'SELECT akr.resource_id, akr.resource, akr.nickname FROM mod_appkernel.resource akr';
+ $params = array();
+
+ if(isset($this->resource)) {
+ $quotedResourceIds = array_reduce(
+ $this->resource['data'],
+ function ($carry, $item) use ($pdo) {
+ $carry[] = $pdo->quote($item['id']);
+ return $carry;
+ },
+ array()
+ );
+ $sql = "SELECT akr.resource_id, akr.resource, akr.nickname FROM mod_appkernel.resource akr " .
+ "WHERE akr.xdmod_resource_id IN (" . implode(', ', $quotedResourceIds) . ')';
+ }
+
+ $sqlres_tasdb=$pdo->query($sql, $params);
+
$resource_ids=array();
- $sql = "SELECT resource_id,resource,nickname
- FROM resource;";
- $sqlres_tasdb=$pdo->query($sql);
foreach($sqlres_tasdb as $row)
{
$resource_ids[$row['nickname']]=$row['resource_id'];
@@ -121,8 +143,6 @@ public function __construct($options)
$this->perfMap=$this->getMap();
- //print_r($this->perfMap);
- //print_r($this->appKer);
}
/**
* Generate html-report with performance map table
@@ -145,19 +165,12 @@ public function make_report($internal_dashboard_user=false)
$runsStatus=$this->perfMap['runsStatus'];
$rec_dates=$this->perfMap['rec_dates'];
- $controlThreshold=$this->controlThreshold*$this->controlThresholdCoeff;
//print table
$tdStyle_Resource='style=""';
- $tdStyle_AppKer='style="""';
$tdStyle_ProblemSize='style=""';
$tdStyle_Day='style="" align="center"';
- $tdStyle_Day_Empty='style="background-color:white;"';
- $tdStyle_Day_Good='style="background-color:#B0FFC5;"';
- $tdStyle_Day_Warning='style="background-color:#FFFF99;"';
- $tdStyle_Day_Error='style="background-color:#FFB0C4;"';
-
$tdStyle=array(
' '=>'style="background-color:white;"',
'F'=>'style="background-color:#FFB0C4;"',
@@ -168,16 +181,9 @@ public function make_report($internal_dashboard_user=false)
'R'=>'style="background-color:#F781F3;"'
);
- //'
' + value + '
';
- //'
' + value + '
';
- //'
' + value + '
';
$message='';
$message.='
Table 3. Performance Heat Map of All App Kernels on Each System
';
- /*$message.='KEY: For each day a triplet of integers are used to represent the status of a given application kernel run for each node size.
-The first integer is the number of successful runs, the second the number of out of control runs, and the third the number of failed runs.
-Color coding is as follows: RED - failed run, YELLOW - out of
-control, GREEN - no out of control or failed run.';*/
$message.='KEY: Each day is summarized in a table cell as pair of a symbol and a number. The symbol represents the status of last application kernel'
. ' execution on that day and the number shows the total number of runs. Each cell is colored according to the status of last application kernel run.'
. ' The description of the codes are:
'
@@ -202,7 +208,6 @@ public function make_report($internal_dashboard_user=false)
$totalColumns=1+count($rec_dates)+1;
//body
- $headerCount=0;
foreach ($runsStatus as $resource => $val0)
{
//table header
@@ -231,8 +236,6 @@ public function make_report($internal_dashboard_user=false)
$message.='';
$message.='
';
- //$message.='
Resource
';
- //$message.='
App Kernel
';
$message.='
Nodes
';
foreach ($rec_dates as $rec_date)
@@ -260,8 +263,6 @@ public function make_report($internal_dashboard_user=false)
{
$message.='
',
+ ' Runs used for control calculations: {controlJobs} ',
+ '
',
+ '
',
+ '
',
+ '
',
+ ' Runs without control information: {noControlInfoJobs} ',
+ '
',
+ '
',
+ '
',
+ this.legend
+ );
+ this.commentsPanel = new Ext.Panel({
+ id: 'commentsPanel',
+ region: 'south',
+ autoScroll: true,
+ border: true,
+ collapsible: true,
+ split: true,
+ title: 'Description',
+ height: 130,
+ html: this.legend
+ }); // commentsPanel
+
+ this.appKerPerformanceMapGrid.getSelectionModel().on('cellselect', function (sm, rowIdx, colIndex) {
+ /* populate detailed view pannele with arr job ids */
+ // eslint-disable-next-line no-shadow
+ var i;
+ var j;
+
+ var detailPanel = Ext.getCmp('commentsPanel');
+ var dataIndex = sm.grid.getColumnModel().getDataIndex(colIndex);
+ var record = sm.grid.getStore().getAt(rowIdx);
+
+ var dataIndexAll = [dataIndex];
+ // if columns with resource or appkernel name is selected show all jobs for the queried period
+ if (colIndex <= 2) {
+ dataIndexAll = [];
+ for (j = 3; j < record.fields.getCount(); j++) {
+ var key = record.fields.getKey(record.fields.itemAt(j));
+ if (key.indexOf('Failed') >= 0) {
+ continue;
+ }
+ if (key.indexOf('InControl') >= 0) {
+ continue;
+ }
+ if (key.indexOf('OutOfControl') >= 0) {
+ continue;
+ }
+ dataIndexAll.push(key);
+ }
+ }
+ // pack jobs
+ var iStatus;
+ var statuses = ['F', 'U', 'N', 'O', 'C', 'R'];
+ var ref = {
+ F: 'failedJobs',
+ U: 'underPerformingJobs',
+ N: 'inControlJobs',
+ O: 'overPerformingJobs',
+ C: 'controlJobs',
+ R: 'noControlInfoJobs'
+ };
+ var jobsIDs = {
+ F: '',
+ U: '',
+ N: '',
+ O: '',
+ C: '',
+ R: ''
+ };
+
+ for (j = dataIndexAll.length - 1; j >= 0; j--) {
+ var dataIndexRun = dataIndexAll[j];
+ var s;
+ for (iStatus = 0; iStatus < statuses.length; iStatus++) {
+ s = record.get(dataIndexRun + '-IDs-' + statuses[iStatus]);
+ if (typeof s !== 'undefined' && s !== '' && s !== ' ') {
+ var runs = s.split(',');
+ for (i = 0; i < runs.length; i++) {
+ runs[i] = parseInt(runs[i], 10);
+ }
+ runs.sort(function (a, b) {
+ return b - a;
+ });
+ for (i = 0; i < runs.length; i++) {
+ if (jobsIDs[statuses[iStatus]] !== '') {
+ jobsIDs[statuses[iStatus]] += ', ';
+ }
+ jobsIDs[statuses[iStatus]] += '' + runs[i] + '';
+ }
+ }
+ }
+ }
+ var dataValue = record.get(dataIndex);
+ var values = {
+ appKer: record.get('appKer'),
+ resource: record.get('resource'),
+ rowIdx: rowIdx,
+ colIndex: colIndex,
+ dataIndex: dataIndex,
+ dataValue: dataValue
+ };
+ for (iStatus = 0; iStatus < statuses.length; iStatus++) {
+ values[ref[statuses[iStatus]]] = jobsIDs[statuses[iStatus]];
+ }
+ commentsTemplate.overwrite(detailPanel.body, values);
+ });
+
+ var viewPanel = new Ext.Panel({
+ layout: 'border',
+ region: 'center',
+ items: [this.appKerPerformanceMapGrid, this.commentsPanel],
+ border: true
+ }); // viewPanel
+
+ this.durationToolbar = new CCR.xdmod.ui.DurationToolbar({
+ id: 'duration_selector_' + this.id,
+ alignRight: false,
+ showRefresh: true,
+ showAggregationUnit: false,
+ handler: function () {
+ // eslint-disable-next-line no-use-before-define
+ reloadAll.call(this);
+ },
+ scope: this // also scope of handle
+ });
+
+ this.durationToolbar.dateSlider.region = 'south';
+
+ function exportFunction(format) {
+ var parameters = appKerPerformanceMapGrid.store.baseParams;
+
+ parameters.format = format;
+
+ CCR.invokePost('controllers/arr_controller.php', parameters, {
+ checkDashboardUser: true
+ });
+ }
+ var exportButton = new Ext.Button({
+ id: 'export_button_' + this.id,
+ text: 'Export',
+ iconCls: 'export',
+ tooltip: 'Export chart data',
+ menu: [{
+ text: 'CSV - comma Separated Values',
+ iconCls: 'csv',
+ handler: function () {
+ exportFunction('csv', false);
+ }
+ }]
+ });
+ this.durationToolbar.addItem('-');
+ this.durationToolbar.addItem(exportButton);
+
+ var getBaseParams = function () {
+ return {
+ start_date: this.durationToolbar.getStartDate().format('Y-m-d'),
+ end_date: this.durationToolbar.getEndDate().format('Y-m-d'),
+ format: 'json'
+ };
+ };
+
+ this.appKerPerformanceMapGrid.store.on('beforeload', function () {
+ if (!this.durationToolbar.validate()) {
+ return;
+ }
+
+ var baseParams = {};
+ Ext.apply(baseParams, getBaseParams.call(this));
+
+ this.appKerPerformanceMapGrid.store.baseParams = baseParams;
+ }, this);
+
+ this.appKerPerformanceMapGrid.store.on('load', function () {
+ if (this.resource && this.app_kernel) {
+ var index = this.appKerPerformanceMapGrid.store.findBy(function (record) {
+ return record.get('resource') === this.resource && this.app_kernel.indexOf(record.get('appKer').toLowerCase()) !== -1;
+ }, this);
+
+ if (index >= 0) {
+ this.appKerPerformanceMapGrid.getSelectionModel().select(index, 0);
+
+ this.resource = undefined;
+ this.app_kernel = undefined;
+ }
+ }
+
+ // Ensure that we unmask the main interface once we're done loading.
+ var viewer = CCR.xdmod.ui.Viewer.getViewer();
+ if (viewer.el) {
+ viewer.el.unmask();
+ }
+ }, this);
+
+ function reloadAll() {
+ this.appKerPerformanceMapGrid.store.load();
+ }
+
+ Ext.apply(this, {
+ layout: 'border',
+ tbar: this.durationToolbar,
+ items: [viewPanel],
+ listeners: {
+ activate: function () {
+ var token = CCR.tokenize(document.location.hash);
+ var params = Ext.urlDecode(token.params);
+
+ if (params.ak) {
+ var info = Ext.decode(window.atob(params.ak));
+
+ if (info.resource) {
+ this.resource = info.resource;
+ }
+
+ if (info.app_kernel) {
+ this.app_kernel = info.app_kernel;
+ }
+
+ var refresh = false;
+ if (info.start_date) {
+ this.durationToolbar.startDateField.setValue(info.start_date);
+ refresh = true;
+ }
+ if (info.end_date) {
+ this.durationToolbar.endDateField.setValue(info.end_date);
+ refresh = true;
+ }
+
+ if (refresh) {
+ this.durationToolbar.onHandle(true);
+ }
+ }
+ }
+ }
+ }); // Ext.apply
+
+ XDMoD.Arr.AppKerPerformanceMapPanel.superclass.initComponent.apply(this, arguments);
+ } // initComponent
+});
+// XDMoD.Arr.AppKerPerformanceMapPanel
diff --git a/html/gui/js/modules/app_kernels/AppKernelExplorer.js b/html/gui/js/modules/app_kernels/AppKernelExplorer.js
index 212f490..c6a7fc9 100644
--- a/html/gui/js/modules/app_kernels/AppKernelExplorer.js
+++ b/html/gui/js/modules/app_kernels/AppKernelExplorer.js
@@ -10,16 +10,12 @@
* Contains the code for the App Kernel Explorer
*
*/
-
+/* global XDMoD, Ext, CCR */
XDMoD.Module.AppKernels.AppKernelExplorer = function (config) {
-
XDMoD.Module.AppKernels.AppKernelExplorer.superclass.constructor.call(this, config);
-
};
-// ===========================================================================
-
Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
module_id: 'data_explorer',
@@ -36,7 +32,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
showAggregationUnit: false
}
- }, //durationSelector
+ }, // durationSelector
exportMenu: true,
printButton: true,
@@ -48,101 +44,83 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
font_size: 3,
swap_xy: false,
- // ------------------------------------------------------------------
-
getSelectedResourceIds: function () {
-
var resources = [];
var selNodes = this.resourcesTree.getChecked();
Ext.each(selNodes, function (node) {
- if (!node.disabled) resources.push(node.id);
+ if (!node.disabled) {
+ resources.push(node.id);
+ }
});
return resources;
-
- }, //getSelectedResourceIds
-
- // ------------------------------------------------------------------
+ }, // getSelectedResourceIds
getSelectedPUCounts: function () {
-
var nodes = [];
var selNodes = this.pusTree.getChecked();
Ext.each(selNodes, function (node) {
- if (!node.disabled) nodes.push(node.id);
+ if (!node.disabled) {
+ nodes.push(node.id);
+ }
});
return nodes;
-
- }, //getSelectedPUCounts
-
- // ------------------------------------------------------------------
+ }, // getSelectedPUCounts
getExpandedAppKernels: function () {
-
var aks = [];
this.metricsTree.root.cascade(function (node) {
-
if (node.isExpanded()) {
aks.push(node.id);
}
-
}, this);
return aks;
-
- }, //getExpandedAppKernels
-
- // ------------------------------------------------------------------
+ }, // getExpandedAppKernels
getSelectedMetrics: function () {
-
var metrics = [];
var selNodes = this.metricsTree.getChecked();
Ext.each(selNodes, function (node) {
- if (!node.disabled) metrics.push(node.id);
+ if (!node.disabled) {
+ metrics.push(node.id);
+ }
});
return metrics;
-
- }, //getSelectedMetrics
-
- // ------------------------------------------------------------------
+ }, // getSelectedMetrics
initComponent: function () {
-
var self = this;
var chartScale = 1;
- var chartThumbScale = 0.45;
var chartWidth = 740;
var chartHeight = 345;
- // ---------------------------------------------------------
-
self.on('duration_change', function (d) {
var start_time = self.getDurationSelector().getStartDate() / 1000.0;
var end_time = self.getDurationSelector().getEndDate() / 1000.0;
self.metricsTree.getRootNode().cascade(function (n) {
var enabled = (start_time <= n.attributes.end_ts && n.attributes.end_ts <= end_time) ||
(n.attributes.start_ts <= end_time && end_time <= n.attributes.end_ts);
- if (enabled) n.enable();
- else n.disable();
- //if(!enabled)n.setText(n.text+'*');
-
+ if (enabled) {
+ n.enable();
+ } else {
+ n.disable();
+ }
return true;
});
+ /* eslint-disable no-use-before-define */
reloadResources.call(this);
reloadChart.call(this, 150);
-
- }); //self.on('duration_change', ...
-
- // ---------------------------------------------------------
+ /* eslint-enable no-use-before-define */
+ }); // self.on('duration_change', ...
var resourcesStore = new CCR.xdmod.CustomJsonStore({
@@ -161,10 +139,9 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
listeners: {
- 'load': {
+ load: {
fn: function (tstore) {
-
if (tstore.getCount() <= 0) {
return;
}
@@ -177,32 +154,25 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
id: 'resources',
children: Ext.util.JSON.decode(tstore.getAt(0).get('nodes'))
- }); //root
+ }); // root
this.resourcesTree.setRootNode(root);
this.resourcesTree.render();
root.expand();
-
- }, //fn
-
+ }, // fn
scope: this
-
- } //load
-
- } //listeners
-
- }); //resourcesStore
-
- // ---------------------------------------------------------
+ } // load
+ } // listeners
+ }); // resourcesStore
var getBaseParams = function () {
-
var selectedResourceIds = this.getSelectedResourceIds();
var selectedPUCounts = this.getSelectedPUCounts();
var selectedMetrics = this.getSelectedMetrics();
var expandedAppKernels = this.getExpandedAppKernels();
var baseParams = {};
+ // eslint-disable-next-line no-use-before-define
baseParams.show_change_indicator = toggleChangeIndicator.pressed ? 'y' : 'n';
baseParams.show_title = 'n';
baseParams.start_date = self.getDurationSelector().getStartDate().format('Y-m-d');
@@ -219,32 +189,25 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
baseParams.show_title = 'y';
return baseParams;
-
- }; //getBaseParams
-
- // ---------------------------------------------------------
+ }; // getBaseParams
var reloadResources = function () {
-
Ext.apply(resourcesStore.baseParams, getBaseParams.call(this));
resourcesStore.load();
-
- }; //reloadResources
-
- // ---------------------------------------------------------
+ }; // reloadResources
var suppressResourceCheckTrackCall = false;
var resoucesTreeCheckChange = function (node, checked) {
-
- if (suppressResourceCheckTrackCall == false)
- XDMoD.TrackEvent('App Kernel Explorer', 'Clicked a checkbox in the Resources tree', Ext.encode({item: node.getPath('text'), checked: checked}));
-
+ if (suppressResourceCheckTrackCall === false) {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Clicked a checkbox in the Resources tree', Ext.encode({
+ item: node.getPath('text'),
+ checked: checked
+ }));
+ }
+ // eslint-disable-next-line no-use-before-define
reloadChart.call(this);
-
- }; //resoucesTreeCheckChange
-
- // ---------------------------------------------------------
+ }; // resoucesTreeCheckChange
this.resourcesTree = new Ext.tree.TreePanel({
@@ -255,7 +218,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
animate: false,
enableDD: false,
region: 'north',
- //height: 200,
+ // height: 200,
root: {
nodeType: 'async',
@@ -276,65 +239,65 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
scope: this,
handler: function () {
-
XDMoD.TrackEvent('App Kernel Explorer', 'Clicked on the uncheck all tool in the Resources tree');
suppressResourceCheckTrackCall = true;
this.resourcesTree.un('checkchange', resoucesTreeCheckChange, this);
var lastNode = null;
- var selectAll = true;
- this.resourcesTree.getRootNode().cascade(function(n) {
+ var selectAll = true;
+ this.resourcesTree.getRootNode().cascade(function (n) {
var ui = n.getUI();
- if(ui.isChecked()) selectAll=false;
+ if (ui.isChecked()) {
+ selectAll = false;
+ }
lastNode = n;
- });
-
- if(selectAll){
- XDMoD.TrackEvent('App Kernel Explorer', 'Checking all items in the Resources tree');
- this.resourcesTree.getRootNode().cascade(function(n) {
- var ui = n.getUI();
- if(!ui.isChecked()) ui.toggleCheck(true);
- lastNode = n;
+ });
+
+ if (selectAll) {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Checking all items in the Resources tree');
+ this.resourcesTree.getRootNode().cascade(function (n) {
+ var ui = n.getUI();
+ if (!ui.isChecked()) {
+ ui.toggleCheck(true);
+ }
+ lastNode = n;
});
- }
- else{
- XDMoD.TrackEvent('App Kernel Explorer', 'Clearing all checked items in the Resources tree');
- this.resourcesTree.getRootNode().cascade(function(n) {
- var ui = n.getUI();
- if(ui.isChecked()) ui.toggleCheck(false);
- lastNode = n;
+ } else {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Clearing all checked items in the Resources tree');
+ this.resourcesTree.getRootNode().cascade(function (n) {
+ var ui = n.getUI();
+ if (ui.isChecked()) {
+ ui.toggleCheck(false);
+ }
+ lastNode = n;
});
- }
+ }
- if (lastNode) resoucesTreeCheckChange.call(this, lastNode, false);
+ if (lastNode) {
+ resoucesTreeCheckChange.call(this, lastNode, false);
+ }
this.resourcesTree.on('checkchange', resoucesTreeCheckChange, this);
suppressResourceCheckTrackCall = false;
-
- } //handler
+ } // handler
},
{
-
id: 'refresh',
qtip: 'Refresh',
hidden: true,
scope: this,
handler: reloadResources
-
}
- ], //tools
+ ], // tools
margins: '0 0 0 0',
border: false,
split: true,
flex: 1.5
-
- }); //this.resourcesTree
-
- // ---------------------------------------------------------
+ }); // this.resourcesTree
this.resourcesTree.on('checkchange', resoucesTreeCheckChange, this);
@@ -355,10 +318,9 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
listeners: {
- 'load': {
+ load: {
fn: function (tstore) {
-
if (tstore.getCount() <= 0) {
return;
}
@@ -371,53 +333,43 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
id: 'nodes',
children: Ext.util.JSON.decode(tstore.getAt(0).get('nodes'))
- }); //root
+ }); // root
this.pusTree.setRootNode(root);
this.pusTree.render();
root.expand();
-
- }, //fn
+ }, // fn
scope: this
-
- } //load
-
- } //listeners
-
- }); //pusStore
-
- // ---------------------------------------------------------
+ } // load
+ } // listeners
+ }); // pusStore
var reloadPUs = function () {
-
Ext.apply(pusStore.baseParams, getBaseParams.call(this));
pusStore.load();
-
- }; //reloadPUs
-
- // ---------------------------------------------------------
+ }; // reloadPUs
var suppressPUsCheckTrackCall = false;
var pusTreeCheckChange = function (node, checked) {
-
- if (suppressPUsCheckTrackCall == false)
- XDMoD.TrackEvent('App Kernel Explorer', 'Clicked a checkbox in the Processing Units tree', Ext.encode({item: node.getPath('text'), checked: checked}));
+ if (suppressPUsCheckTrackCall === false) {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Clicked a checkbox in the Processing Units tree', Ext.encode({
+ item: node.getPath('text'),
+ checked: checked
+ }));
+ }
reloadResources.call(this);
- //reloadMetrics.call(this);
+ // eslint-disable-next-line no-use-before-define
reloadChart.call(this);
-
- }; //pusTreeCheckChange
-
- // ---------------------------------------------------------
+ }; // pusTreeCheckChange
this.pusTree = new Ext.tree.TreePanel({
flex: 1,
- title: "Processing Units",
+ title: 'Processing Units',
id: 'tree_pus_' + this.id,
useArrows: true,
autoScroll: true,
@@ -443,74 +395,75 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
scope: this,
handler: function () {
-
XDMoD.TrackEvent('App Kernel Explorer', 'Clicked on the uncheck all tool in the Processing Units tree');
suppressPUsCheckTrackCall = true;
this.pusTree.un('checkchange', pusTreeCheckChange, this);
var lastNode = null;
- var selectAll = true;
+ var selectAll = true;
- this.pusTree.getRootNode().cascade(function(n) {
- var ui = n.getUI();
- if(ui.isChecked()) selectAll=false;
- lastNode = n;
- });
+ this.pusTree.getRootNode().cascade(function (n) {
+ var ui = n.getUI();
+ if (ui.isChecked()) {
+ selectAll = false;
+ }
+ lastNode = n;
+ });
- if(selectAll){
- XDMoD.TrackEvent('App Kernel Explorer', 'Checking all items in the Processing Units tree');
- this.pusTree.getRootNode().cascade(function(n) {
+ if (selectAll) {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Checking all items in the Processing Units tree');
+ this.pusTree.getRootNode().cascade(function (n) {
+ var ui = n.getUI();
+ if (!ui.isChecked()) {
+ ui.toggleCheck(true);
+ }
+ lastNode = n;
+ });
+ } else {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Clearing all checked items in the Processing Units tree');
+ this.pusTree.getRootNode().cascade(function (n) {
var ui = n.getUI();
- if(!ui.isChecked()) ui.toggleCheck(true);
+ if (ui.isChecked()) {
+ ui.toggleCheck(false);
+ }
lastNode = n;
- });
- }
- else{
- XDMoD.TrackEvent('App Kernel Explorer', 'Clearing all checked items in the Processing Units tree');
- this.pusTree.getRootNode().cascade(function(n) {
- var ui = n.getUI();
- if(ui.isChecked()) ui.toggleCheck(false);
- lastNode = n;
- });
- }
-
- if (lastNode) pusTreeCheckChange.call(this, lastNode, false);
+ });
+ }
+
+ if (lastNode) {
+ pusTreeCheckChange.call(this, lastNode, false);
+ }
this.pusTree.on('checkchange', pusTreeCheckChange, this);
suppressPUsCheckTrackCall = false;
-
- } //handler
+ } // handler
},
{
-
id: 'refresh',
qtip: 'Refresh',
scope: this,
hidden: true,
handler: reloadPUs
-
}
- ], //tools
+ ], // tools
margins: '0 0 0 0',
border: false,
listeners: {
- 'checkchange': {
+ checkchange: {
fn: pusTreeCheckChange,
scope: this
}
- } //listeners
-
- }); //this.pusTree
+ } // listeners
- // ---------------------------------------------------------
+ }); // this.pusTree
this.pusTree.on('checkchange', pusTreeCheckChange, this);
@@ -531,10 +484,9 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
listeners: {
- 'load': {
+ load: {
fn: function (tstore) {
-
if (tstore.getCount() <= 0) {
return;
}
@@ -547,46 +499,37 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
id: 'app_kernels',
children: Ext.util.JSON.decode(tstore.getAt(0).get('nodes'))
- }); //root
+ }); // root
this.metricsTree.setRootNode(root);
this.metricsTree.render();
root.expand();
-
- }, //fn
+ }, // fn
scope: this
-
- }
- } //listeners
-
- }); //metricsStore
-
- // ---------------------------------------------------------
+ } // load
+ } // listeners
+ }); // metricsStore
var reloadMetrics = function () {
-
Ext.apply(metricsStore.baseParams, getBaseParams.call(this));
metricsStore.load();
-
- }; //reloadMetrics
-
- // ---------------------------------------------------------
+ }; // reloadMetrics
var suppressMetricCheckTrackCall = false;
var metricsTreeCheckChange = function (node, checked) {
-
- if (suppressMetricCheckTrackCall == false)
- XDMoD.TrackEvent('App Kernel Explorer', 'Clicked a checkbox in the Metrics tree', Ext.encode({item: node.getPath('text'), checked: checked}));
+ if (suppressMetricCheckTrackCall === false) {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Clicked a checkbox in the Metrics tree', Ext.encode({
+ item: node.getPath('text'),
+ checked: checked
+ }));
+ }
reloadResources.call(this);
- //reloadPUs.call(this);
+ // eslint-disable-next-line no-use-before-define
reloadChart.call(this);
-
- }; //metricsTreeCheckChange
-
- // ---------------------------------------------------------
+ }; // metricsTreeCheckChange
this.metricsTree = new Ext.tree.TreePanel({
@@ -607,7 +550,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
draggable: false,
id: 'app_kernels'
- }, //root
+ }, // root
rootVisible: false,
containerScroll: true,
@@ -621,7 +564,6 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
scope: this,
handler: function () {
-
XDMoD.TrackEvent('App Kernel Explorer', 'Clicked on the uncheck all tool in the Metrics tree');
suppressMetricCheckTrackCall = true;
@@ -630,54 +572,55 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
var selectAll = true;
- this.metricsTree.getRootNode().cascade(function(n) {
- var ui = n.getUI();
- if(ui.isChecked()) selectAll=false;
- lastNode = n;
+ this.metricsTree.getRootNode().cascade(function (n) {
+ var ui = n.getUI();
+ if (ui.isChecked()) {
+ selectAll = false;
+ }
+ lastNode = n;
});
- if(selectAll){
- XDMoD.TrackEvent('App Kernel Explorer', 'Checking all (rendered) items in Metrics tree');
- this.metricsTree.getRootNode().cascade(function(n) {
- var ui = n.getUI();
- if(!ui.isChecked()) ui.toggleCheck(true);
- lastNode = n;
- });
+ if (selectAll) {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Checking all (rendered) items in Metrics tree');
+ this.metricsTree.getRootNode().cascade(function (n) {
+ var ui = n.getUI();
+ if (!ui.isChecked()) {
+ ui.toggleCheck(true);
+ }
+ lastNode = n;
+ });
+ } else {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Clearing all (rendered) checked items in Metrics tree');
+ this.metricsTree.getRootNode().cascade(function (n) {
+ var ui = n.getUI();
+ if (ui.isChecked()) {
+ ui.toggleCheck(false);
+ }
+ lastNode = n;
+ });
}
- else{
- XDMoD.TrackEvent('App Kernel Explorer', 'Clearing all (rendered) checked items in Metrics tree');
- this.metricsTree.getRootNode().cascade(function(n) {
- var ui = n.getUI();
- if(ui.isChecked()) ui.toggleCheck(false);
- lastNode = n;
- });
+ if (lastNode) {
+ metricsTreeCheckChange.call(this, lastNode, false);
}
- if (lastNode) metricsTreeCheckChange.call(this, lastNode, false);
this.metricsTree.on('checkchange', metricsTreeCheckChange, this);
suppressMetricCheckTrackCall = false;
-
- } //handler
-
+ } // handler
},
-
{
-
id: 'refresh',
qtip: 'Refresh',
scope: this,
hidden: true,
handler: reloadMetrics
-
}
-
- ], //tools
+ ], // tools
margins: '0 0 0 0',
border: false,
listeners: {
- 'checkchange': {
+ checkchange: {
fn: metricsTreeCheckChange,
scope: this
},
@@ -688,31 +631,27 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
var end_time = self.getDurationSelector().getEndDate() / 1000.0;
var enabled = (start_time <= n.attributes.end_ts && n.attributes.end_ts <= end_time) ||
(n.attributes.start_ts <= end_time && end_time <= n.attributes.end_ts);
- if (enabled) n.enable();
- else n.disable();
+ if (enabled) {
+ n.enable();
+ } else {
+ n.disable();
+ }
},
scope: this
},
- expandnode: function(n) {
-
- XDMoD.TrackEvent('App Kernel Explorer', 'Expanded item in Metrics tree', n.getPath('text'));
-
- },//expandnode
+ expandnode: function (n) {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Expanded item in Metrics tree', n.getPath('text'));
+ }, // expandnode
- collapsenode: function(n) {
-
- XDMoD.TrackEvent('App Kernel Explorer', 'Collapsed item in Metrics tree', n.getPath('text'));
-
- }//collapsenode
-
- }, //listeners
+ collapsenode: function (n) {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Collapsed item in Metrics tree', n.getPath('text'));
+ } // collapsenode
+ }, // listeners
flex: 5
- }); //this.metricsTree
-
- // ---------------------------------------------------------
+ }); // this.metricsTree
this.metricsTree.on('checkchange', metricsTreeCheckChange, this);
@@ -729,32 +668,21 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
scope: this,
change: function (t, n, o) {
-
- if (n != o) {
-
+ if (n !== o) {
XDMoD.TrackEvent('App Kernel Explorer', 'Updated chart title', t.getValue());
+ // eslint-disable-next-line no-use-before-define
reloadChart.call(this);
-
}
-
- }, //change
+ }, // change
specialkey: function (t, e) {
-
- if (t.isValid(false) && e.getKey() == e.ENTER) {
-
- //XDMoD.TrackEvent('App Kernel Explorer', 'Updated chart title', t.getValue());
+ if (t.isValid(false) && e.getKey() === e.ENTER) {
+ // eslint-disable-next-line no-use-before-define
reloadChart.call(this);
-
}
-
- } //specialkey
-
- } //listeners
-
- }); //this.chartTitleField
-
- // ---------------------------------------------------------
+ } // specialkey
+ } // listeners
+ }); // this.chartTitleField
this.legendTypeComboBox = new Ext.form.ComboBox({
@@ -795,7 +723,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
]
- }), //store
+ }), // store
disabled: false,
value: this.legend_type,
@@ -807,20 +735,15 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
scope: this,
- 'select': function (combo, record, index) {
-
- XDMoD.TrackEvent('App Kernel Explorer', 'Updated legend placement', Ext.encode({legend_type: record.get('id')}));
+ select: function (combo, record, index) {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Updated legend placement', Ext.encode({ legend_type: record.get('id') }));
this.legend_type = record.get('id');
+ // eslint-disable-next-line no-use-before-define
reloadChart.call(this);
-
- } //select
-
- } //listeners
-
- }); //this.legendTypeComboBox
-
- // ---------------------------------------------------------
+ } // select
+ } // listeners
+ }); // this.legendTypeComboBox
this.fontSizeSlider = new Ext.slider.SingleSlider({
@@ -837,20 +760,15 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
scope: this,
- 'change': function (t, n, o) {
-
- XDMoD.TrackEvent('App Kernel Explorer', 'Used the font size slider', Ext.encode({font_size: t.getValue()}));
+ change: function (t, n, o) {
+ XDMoD.TrackEvent('App Kernel Explorer', 'Used the font size slider', Ext.encode({ font_size: t.getValue() }));
this.font_size = t.getValue();
+ // eslint-disable-next-line no-use-before-define
reloadChart.call(this);
-
- } //change
-
- } //listeners
-
- }); //this.fontSizeSlider
-
- // ---------------------------------------------------------
+ } // change
+ } // listeners
+ }); // this.fontSizeSlider
this.northPanel = new Ext.Panel({
@@ -865,9 +783,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
items: [this.resourcesTree, this.pusTree],
flex: 4
- }); //this.northPanel
-
- // ---------------------------------------------------------
+ }); // this.northPanel
var leftPanel = new Ext.Panel({
@@ -915,7 +831,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
]
- }] //items
+ }] // items
},
@@ -938,11 +854,9 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
}
- ] //items
-
- }); //leftPanel
+ ] // items
- // ---------------------------------------------------------
+ }); // leftPanel
var chartStore = new CCR.xdmod.CustomJsonStore({
@@ -980,21 +894,22 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
method: 'POST',
url: 'controllers/data_explorer.php'
- }) //proxy
-
- }); //chartStore
+ }) // proxy
- // ---------------------------------------------------------
+ }); // chartStore
chartStore.on('beforeload', function () {
-
- if (!self.getDurationSelector().validate()) return;
+ if (!self.getDurationSelector().validate()) {
+ return;
+ }
+ // eslint-disable-next-line no-use-before-define
highChartPanel.un('resize', onResize, this);
+ // eslint-disable-next-line no-use-before-define
maximizeScale.call(this);
Ext.apply(chartStore.baseParams, getBaseParams.call(this));
- chartStore.baseParams.timeframe_label = self.getDurationSelector().getDurationLabel(),
+ chartStore.baseParams.timeframe_label = self.getDurationSelector().getDurationLabel();
chartStore.baseParams.show_guide_lines = 'y';
chartStore.baseParams.scale = 1;
chartStore.baseParams.format = 'hc_jsonstore';
@@ -1003,20 +918,34 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
chartStore.baseParams.controller_module = self.getReportCheckbox().getModule();
- }, this); //chartStore.on('beforeload'
-
- // ---------------------------------------------------------
+ // While we're still pre-load make sure to mask the appropriate
+ // component so that the User knows that we're retrieving data.
+ // eslint-disable-next-line no-use-before-define
+ view.el.mask('Loading...');
+ }, this); // chartStore.on('beforeload'
+ // eslint-disable-next-line no-shadow
chartStore.on('load', function (chartStore) {
+ // Now that we're done loading, make sure to unmask the appropriate
+ // component so that the User knows that we're done.
+ // eslint-disable-next-line no-use-before-define
+ view.el.unmask();
+
+ // Ensure that we unmask the main interface once we're done loading
+ // too.
+ var viewer = CCR.xdmod.ui.Viewer.getViewer();
+ if (viewer.el) {
+ viewer.el.unmask();
+ }
- if (chartStore.getCount() != 1) {
+ if (chartStore.getCount() !== 1) {
return;
}
var selectedResourceIds = this.getSelectedResourceIds();
var selectedMetrics = this.getSelectedMetrics();
var noData = selectedResourceIds.length === 0 || selectedMetrics.length === 0;
-
+ // eslint-disable-next-line no-use-before-define
chartViewPanel.getLayout().setActiveItem(noData ? 1 : 0);
self.getExportMenu().setDisabled(noData);
@@ -1031,12 +960,9 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
reportGeneratorMeta.start_date,
reportGeneratorMeta.end_date,
reportGeneratorMeta.included_in_report);
-
+ // eslint-disable-next-line no-use-before-define
highChartPanel.on('resize', onResize, this);
-
- }, this); //chartStore.on('load'
-
- // ---------------------------------------------------------
+ }, this); // chartStore.on('load'
var reloadChartFunc = function () {
chartStore.load();
@@ -1048,17 +974,6 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
reloadChartTask.delay(delay || 2000);
};
- var chartViewTemplate = new Ext.XTemplate(
- '',
- '
',
- '',
- '',
- '
',
- ''
- );
-
- // ---------------------------------------------------------
-
var assistPanel = new CCR.xdmod.ui.AssistPanel({
region: 'center',
@@ -1068,18 +983,14 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
graphic: 'gui/images/ak_explorer_instructions.png',
userManualRef: 'app+kernel+explorer'
- }); //assistPanel
-
- // ---------------------------------------------------------
+ }); // assistPanel
var highChartPanel = new CCR.xdmod.ui.HighChartPanel({
id: 'hc-panel' + this.id,
store: chartStore
- }); //highChartPanel
-
- // ---------------------------------------------------------
+ }); // highChartPanel
var chartViewPanel = new Ext.Panel({
@@ -1096,49 +1007,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
assistPanel
]
- }); //chartViewPanel
-
- // ---------------------------------------------------------
-
- //self.getDurationSelector().dateSlider.region = 'south';
-
- var datasheetTab = new Ext.Panel({
- title: 'Datasheet'
- });
-
- var detailsTab = new Ext.Panel({
- title: 'Details'
- });
-
- var glossaryTab = new Ext.Panel({
- title: 'Glossary'
- });
-
- var southTabPanel = new Ext.TabPanel({
-
- activeTab: 0,
- region: 'center',
- items: [datasheetTab, detailsTab, glossaryTab]
-
- }); //southTabPanel
-
- // ---------------------------------------------------------
-
- var southView = new Ext.Panel({
-
- hideTitle: true,
- split: true,
- collapsible: true,
- header: false,
- collapseMode: 'mini',
- region: 'south',
- height: 250,
- layout: 'border',
- items: [southTabPanel]
-
- }); //southView
-
- // ---------------------------------------------------------
+ }); // chartViewPanel
var view = new Ext.Panel({
@@ -1148,12 +1017,9 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
border: true,
items: [chartViewPanel]
- }); //view
-
- // ---------------------------------------------------------
+ }); // view
self.on('print_clicked', function () {
-
var parameters = chartStore.baseParams;
parameters.scale = 1;
@@ -1163,8 +1029,10 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
var params = '';
- for (i in parameters) {
- params += i + '=' + parameters[i] + '&';
+ for (var i in parameters) {
+ if (parameters.hasOwnProperty(i)) {
+ params += i + '=' + parameters[i] + '&';
+ }
}
params = params.substring(0, params.length - 1);
@@ -1177,22 +1045,15 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
html: ''
});
-
- }); //self.on('print_clicked',...
-
- // ---------------------------------------------------------
+ }); // self.on('print_clicked',...
self.on('export_option_selected', function (opts) {
-
var parameters = chartStore.baseParams;
Ext.apply(parameters, opts);
- CCR.invokePost("controllers/data_explorer.php", parameters);
-
- }); //self.on('export_option_selected', …
-
- // ---------------------------------------------------------
+ CCR.invokePost('controllers/data_explorer.php', parameters);
+ }); // self.on('export_option_selected', …
var toggleChangeIndicator = new Ext.Button({
@@ -1208,43 +1069,27 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
pressed: true,
tooltip: 'When this option is checked, each app kernel data series plot will show an exclamation point icon whenever a change has occurred in the execution environment of the app kernel (library version, compiler version, etc).'
- }); //toggleChangeIndicator
-
- // ---------------------------------------------------------
+ }); // toggleChangeIndicator
function reloadAll() {
-
reloadResources.call(this);
reloadPUs.call(this);
reloadMetrics.call(this);
reloadChart.call(this, 150);
-
- } //reloadAll
-
- // ---------------------------------------------------------
+ } // reloadAll
this.on('render', reloadAll, this, {
single: true
});
- // ---------------------------------------------------------
-
function maximizeScale() {
-
chartWidth = chartViewPanel.getWidth();
chartHeight = chartViewPanel.getHeight() - (chartViewPanel.tbar ? chartViewPanel.tbar.getHeight() : 0);
-
- } //maximizeScale
-
- // ---------------------------------------------------------
+ } // maximizeScale
function onResize(t) {
-
maximizeScale.call(this);
-
- } //onResize
-
- // ---------------------------------------------------------
+ } // onResize
Ext.apply(this, {
@@ -1260,10 +1105,8 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelExplorer, XDMoD.PortalModule, {
items: [leftPanel, view]
- }); //Ext.apply
+ }); // Ext.apply
XDMoD.Module.AppKernels.AppKernelExplorer.superclass.initComponent.apply(this, arguments);
-
- } //initComponent
-
-}); //XDMoD.Module.AppKernels.AppKernelExplorer
+ } // initComponent
+}); // XDMoD.Module.AppKernels.AppKernelExplorer
diff --git a/html/gui/js/modules/app_kernels/AppKernelViewer.js b/html/gui/js/modules/app_kernels/AppKernelViewer.js
index d7b4fb9..7f89f0a 100644
--- a/html/gui/js/modules/app_kernels/AppKernelViewer.js
+++ b/html/gui/js/modules/app_kernels/AppKernelViewer.js
@@ -1,3 +1,4 @@
+/* global XDMoD, CCR, Ext, document, jQuery */
/**
* This class contains functionality for the App Kernels tab.
*
@@ -31,7 +32,7 @@ Ext.apply(XDMoD.Module.AppKernels.AppKernelViewer, {
* @param {Number} kernel_id The selected kernel_id.
*/
selectChildAppKernelChart: function (metric_id, resource_id, kernel_id) {
- if (metric_id == -1 || resource_id == -1 || kernel_id == -1) {
+ if (metric_id === -1 || resource_id === -1 || kernel_id === -1) {
return;
}
@@ -71,8 +72,8 @@ Ext.apply(XDMoD.Module.AppKernels.AppKernelViewer, {
}
if (
- node.attributes.type == 'appkernel' &&
- node.attributes.ak_id == kernel_id
+ node.attributes.type === 'appkernel' &&
+ node.attributes.ak_id === kernel_id
) {
var nodeToExpand = node.findChild('resource_id', resource_id);
@@ -98,8 +99,8 @@ Ext.apply(XDMoD.Module.AppKernels.AppKernelViewer, {
tree.getSelectionModel().select(nodeToSelect);
});
} else if (
- node.attributes.type == 'resource' &&
- node.attributes.resource_id == resource_id
+ node.attributes.type === 'resource' &&
+ node.attributes.resource_id === resource_id
) {
var nodeToSelect = node.findChild('metric_id', metric_id, true);
@@ -112,10 +113,8 @@ Ext.apply(XDMoD.Module.AppKernels.AppKernelViewer, {
}
tree.getSelectionModel().select(nodeToSelect);
- } else {
- if (viewer.el) {
- viewer.el.unmask();
- }
+ } else if (viewer.el) {
+ viewer.el.unmask();
}
});
},
@@ -202,7 +201,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
font_size: 3,
swap_xy: false,
showDateChooser: true,
- current_hash:'',
+ current_hash: '',
chartDataFields: [
'hc_jsonstore',
'title',
@@ -298,13 +297,12 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
chartThumbScale: CCR.xdmod.ui.thumbChartScale,
chartWidth: 740,
chartHeight: 345,
- leftPanelWidth:375,
+ leftPanelWidth: 375,
/**
* Initialize app kernel module.
*/
initComponent: function () {
-
var treeTb = new Ext.Toolbar({
items: [
'->',
@@ -348,6 +346,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
requestMethod: 'GET',
listeners: {
beforeload: function (loader, node, callback) {
+ // eslint-disable-next-line no-param-reassign
loader.baseParams = XDMoD.REST.removeEmptyParameters({
ak: node.attributes.ak_id,
resource: node.attributes.resource_id,
@@ -469,13 +468,13 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
// Is a single chart being displayed?
var isChart =
- n.attributes.type == 'units' ||
- n.attributes.type == 'metric';
+ n.attributes.type === 'units' ||
+ n.attributes.type === 'metric';
// Are multiple charts being displayed with the menu?
var isMenu =
- n.attributes.type == 'resource' ||
- n.attributes.type == 'appkernel';
+ n.attributes.type === 'resource' ||
+ n.attributes.type === 'appkernel';
// Delete the current chart if only one will be displayed.
if (isChart && this.chart) {
@@ -498,7 +497,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
this.updateDescriptionLarge(
chartStore,
- n.attributes.type != 'appkernel'
+ n.attributes.type !== 'appkernel'
);
XDMoD.TrackEvent(
@@ -537,18 +536,17 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
var id = r.get('random_id');
var task = new Ext.util.DelayedTask(function () {
-
// Calculate width and height depending on if
// multiple chart are displayed or just one.
var width =
isMenu ?
- CCR.xdmod.ui.thumbWidth * this.chartThumbScale :
- this.chartWidth * this.chartScale;
+ CCR.xdmod.ui.thumbWidth * this.chartThumbScale :
+ this.chartWidth * this.chartScale;
var height =
isMenu ?
- CCR.xdmod.ui.thumbHeight * this.chartThumbScale :
- this.chartHeight * this.chartScale;
+ CCR.xdmod.ui.thumbHeight * this.chartThumbScale :
+ this.chartHeight * this.chartScale;
var baseChartOptions = {
chart: {
@@ -558,7 +556,6 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
animation: false,
events: {
load: function (e) {
-
// Check if an empty data set was
// returned. If not, display the
// "no data" image.
@@ -587,8 +584,8 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
}
}
},
- plotOptions:{
- series:{
+ plotOptions: {
+ series: {
animation: false,
point: {
events: {
@@ -686,7 +683,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
});
this.view = new Ext.DataView({
- loadingText: "Loading...",
+ loadingText: 'Loading...',
itemSelector: 'chart_thumb-wrap',
style: 'overflow:auto',
multiSelect: true,
@@ -717,7 +714,13 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
// Update the selected tree node when the panel is activated.
this.on('activate', function (panel) {
+ var token = CCR.tokenize(document.location.hash);
+ // If we've received the activate event but the token does not specify
+ // us as the subtab then exit.
+ if (token.subtab && token.subtab !== this.id) {
+ return;
+ }
// If the tree is already loading, replace the "load"
// handler. Otherwise, the node can be selected
// immediately.
@@ -847,8 +850,8 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
scope: this,
iconCls: 'exclamation',
toggleHandler: function (b) {
- XDMoD.TrackEvent('App Kernels', 'Clicked on ' + b.getText(), Ext.encode({pressed: b.pressed}));
- this.reloadChartStore();
+ XDMoD.TrackEvent('App Kernels', 'Clicked on ' + b.getText(), Ext.encode({ pressed: b.pressed }));
+ this.reloadChartStore();
},
pressed: false,
tooltip: 'For each app kernel plot, show an exclamation point icon whenever a change has occurred in the execution environment (library version, compiler version, etc).'
@@ -861,8 +864,8 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
scope: this,
iconCls: '',
toggleHandler: function (b) {
- XDMoD.TrackEvent('App Kernels', 'Clicked on ' + b.getText(), Ext.encode({pressed: b.pressed}));
- this.reloadChartStore();
+ XDMoD.TrackEvent('App Kernels', 'Clicked on ' + b.getText(), Ext.encode({ pressed: b.pressed }));
+ this.reloadChartStore();
},
pressed: true,
tooltip: 'Show the running average values as a dashed line on the chart. The running average is the linear average of the last five values.'
@@ -875,8 +878,8 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
scope: this,
iconCls: '',
toggleHandler: function (b) {
- XDMoD.TrackEvent('App Kernels', 'Clicked on ' + b.getText(), Ext.encode({pressed: b.pressed}));
- this.reloadChartStore();
+ XDMoD.TrackEvent('App Kernels', 'Clicked on ' + b.getText(), Ext.encode({ pressed: b.pressed }));
+ this.reloadChartStore();
},
pressed: true,
tooltip: 'Show a band on the chart representing the values of the running average considered "In Control" at any given time. A control region is picked to be first few points in a dataset and updated whenever an execution environment change is detected by the app kernel system. The control band then is calculated by clustering the control region into two sets based on the median and then finding the average of each set. The two averages define the control band.'
@@ -889,8 +892,8 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
scope: this,
iconCls: '',
toggleHandler: function (b) {
- XDMoD.TrackEvent('App Kernels', 'Clicked on ' + b.getText(), Ext.encode({pressed: b.pressed}));
- this.reloadChartStore();
+ XDMoD.TrackEvent('App Kernels', 'Clicked on ' + b.getText(), Ext.encode({ pressed: b.pressed }));
+ this.reloadChartStore();
},
pressed: true,
tooltip: 'Show a red interval on the plot when the control value falls below -0.5, indicating an out of control (worse than expected) running average, and a green interval when the control value is greater than 0, indicating a better than control (better than expected) running average. Other running average values are considered "In Control"'
@@ -903,8 +906,8 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
scope: this,
iconCls: '',
toggleHandler: function (b) {
- XDMoD.TrackEvent('App Kernels', 'Clicked on ' + b.getText(), Ext.encode({pressed: b.pressed}));
- this.reloadChartStore();
+ XDMoD.TrackEvent('App Kernels', 'Clicked on ' + b.getText(), Ext.encode({ pressed: b.pressed }));
+ this.reloadChartStore();
},
pressed: false,
listeners: {
@@ -919,7 +922,6 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
this.toggleControlZones.show();
this.toggleRunningAverages.show();
this.toggleControlInterval.show();
-
},
hide: function () {
this.toggleDiscreteControls.hide();
@@ -944,8 +946,8 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
scope: this,
iconCls: '',
toggleHandler: function (b) {
- XDMoD.TrackEvent('App Kernels', 'Clicked on ' + b.getText(), Ext.encode({pressed: b.pressed}));
- this.reloadChartStore();
+ XDMoD.TrackEvent('App Kernels', 'Clicked on ' + b.getText(), Ext.encode({ pressed: b.pressed }));
+ this.reloadChartStore();
},
hidden: true,
pressed: false,
@@ -961,13 +963,13 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
listeners: {
scope: this,
change: function (t, n, o) {
- if (n != o) {
+ if (n !== o) {
XDMoD.TrackEvent('App Kernels', 'Updated title', t.getValue());
this.reloadChartStore();
}
},
specialkey: function (t, e) {
- if (t.isValid(false) && e.getKey() == e.ENTER) {
+ if (t.isValid(false) && e.getKey() === e.ENTER) {
XDMoD.TrackEvent('App Kernels', 'Updated title', t.getValue());
this.reloadChartStore();
}
@@ -1015,7 +1017,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
listeners: {
scope: this,
select: function (combo, record, index) {
- XDMoD.TrackEvent('App Kernels', 'Updated legend placement', Ext.encode({legend_type: record.get('id')}));
+ XDMoD.TrackEvent('App Kernels', 'Updated legend placement', Ext.encode({ legend_type: record.get('id') }));
this.legend_type = record.get('id');
this.reloadChartStore(2000);
@@ -1034,7 +1036,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
listeners: {
scope: this,
change: function (t, n, o) {
- XDMoD.TrackEvent('App Kernels', 'Used the font size slider', Ext.encode({font_size: t.getValue()}));
+ XDMoD.TrackEvent('App Kernels', 'Used the font size slider', Ext.encode({ font_size: t.getValue() }));
this.font_size = t.getValue();
this.reloadChartStore(2000);
@@ -1123,15 +1125,16 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
var thumbWidth = CCR.xdmod.ui.thumbWidth * this.chartThumbScale;
- var portalWidth = viewer.getWidth()-this.leftPanelWidth;
+ var portalWidth = viewer.getWidth() - this.leftPanelWidth;
- portalWidth = portalWidth - (CCR.xdmod.ui.scrollBarWidth - CCR.xdmod.ui.thumbPadding / 2);
+ // eslint-disable-next-line no-mixed-operators
+ portalWidth -= (CCR.xdmod.ui.scrollBarWidth - CCR.xdmod.ui.thumbPadding / 2);
- if(portalWidth<50.0){
- portalWidth=this.chartWidth;
+ if (portalWidth < 50.0) {
+ portalWidth = this.chartWidth;
}
- var portalColumnsCount = Math.max(1, Math.round(portalWidth / thumbWidth) );
+ var portalColumnsCount = Math.max(1, Math.round(portalWidth / thumbWidth));
thumbWidth = portalWidth / portalColumnsCount;
thumbWidth -= CCR.xdmod.ui.thumbPadding;
@@ -1204,7 +1207,6 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
if (node.childNodes.length > 0) {
tree.expandPath(path, null, expander);
} else {
-
// Delay the expansion so the child nodes are ready.
new Ext.util.DelayedTask(function () {
tree.expandPath(path, null, expander);
@@ -1271,6 +1273,14 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
* Select the first node in the tree if none are selected.
*/
selectFirstNode: function () {
+ var token = CCR.tokenize(document.location.hash);
+
+ // If we've received the activate event but the token does not specify
+ // us as the subtab then exit.
+ if (token.subtab && token.subtab !== this.id) {
+ return;
+ }
+
var sm = this.tree.getSelectionModel();
var node = sm.getSelectedNode();
@@ -1282,15 +1292,15 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
var root = this.tree.getRootNode();
if (root.hasChildNodes()) {
- var selected=false;
+ var selected = false;
for (var i = 0; i < root.childNodes.length; i++) {
- if(root.childNodes[i].disabled===false){
+ if (root.childNodes[i].disabled === false) {
sm.select(root.childNodes[i]);
- selected=true;
+ selected = true;
break;
}
}
- if(selected===false){
+ if (selected === false) {
sm.select(root.childNodes[0]);
}
} else {
@@ -1325,7 +1335,6 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
* @param {Ext.tree.TreeNode} n The selected tree node.
*/
getParameters: function (n) {
-
var parameters = {
show_change_indicator: this.toggleChangeIndicator.pressed ? 'y' : 'n',
collected: n.attributes.collected,
@@ -1337,7 +1346,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
swap_xy: this.swap_xy
};
- if (n.attributes.type == 'units') {
+ if (n.attributes.type === 'units') {
parameters.num_proc_units = n.attributes.num_proc_units;
parameters.metric = n.attributes.metric_id;
parameters.resource = n.attributes.resource_id;
@@ -1352,7 +1361,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
parameters.show_control_zones = this.toggleControlZones.pressed ? 'y' : 'n';
parameters.show_running_averages = this.toggleRunningAverages.pressed ? 'y' : 'n';
parameters.show_control_interval = this.toggleControlInterval.pressed ? 'y' : 'n';
- } else if (n.attributes.type == 'metric') {
+ } else if (n.attributes.type === 'metric') {
parameters.metric = n.attributes.metric_id;
parameters.resource = n.attributes.resource_id;
parameters.ak = n.attributes.ak_id;
@@ -1361,7 +1370,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
parameters.show_title = 'y';
parameters.width = this.chartWidth * this.chartScale;
parameters.height = this.chartHeight * this.chartScale;
- } else if (n.attributes.type == 'resource') {
+ } else if (n.attributes.type === 'resource') {
parameters.resource = n.attributes.resource_id;
parameters.ak = n.attributes.ak_id;
parameters.width = CCR.xdmod.ui.thumbWidth * this.chartThumbScale;
@@ -1370,8 +1379,8 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
parameters.format = 'session_variable';
parameters.thumbnail = 'y';
parameters.show_guide_lines = 'n';
- parameters.font_size = parameters.font_size - 3;
- } else if (n.attributes.type == 'appkernel') {
+ parameters.font_size -= 3;
+ } else if (n.attributes.type === 'appkernel') {
parameters.ak = n.attributes.ak_id;
parameters.metric = 'Wall Clock Time';
parameters.width = CCR.xdmod.ui.thumbWidth * this.chartThumbScale;
@@ -1380,7 +1389,7 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
parameters.format = 'session_variable';
parameters.thumbnail = 'y';
parameters.show_guide_lines = 'n';
- parameters.font_size = parameters.font_size - 3;
+ parameters.font_size -= 3;
}
return parameters;
@@ -1399,7 +1408,8 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
// This will allow the user to selected a time period that
// contains to data for the ak and then select a time period
// where there is data for the ak.
- if (this.selectedNode&&(!n || n.disabled)) {
+ if (this.selectedNode && (!n || n.disabled)) {
+ // eslint-disable-next-line no-param-reassign
n = this.selectedNode;
} else {
this.selectedNode = n;
@@ -1421,24 +1431,24 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
'?kernel=' + n.id +
'&start=' + start +
'&end=' + end;
- this.current_hash=token
+ this.current_hash = token;
Ext.History.add(token, true);
this.images.setTitle(n.getPath('text'));
- if (n.attributes.type == 'units') {
+ if (n.attributes.type === 'units') {
this.toggleControlPlot.show();
} else {
this.toggleControlPlot.hide();
}
var isChart =
- n.attributes.type == 'units' ||
- n.attributes.type == 'metric';
+ n.attributes.type === 'units' ||
+ n.attributes.type === 'metric';
var isMenu =
- n.attributes.type == 'resource' ||
- n.attributes.type == 'appkernel';
+ n.attributes.type === 'resource' ||
+ n.attributes.type === 'appkernel';
XDMoD.TrackEvent(
'App Kernels',
@@ -1468,10 +1478,8 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
}
this.chartStore.load({ params: parameters });
- } else {
- if (viewer.el) {
- viewer.el.unmask();
- }
+ } else if (viewer.el) {
+ viewer.el.unmask();
}
this.updateEnabledNodes();
},
@@ -1490,11 +1498,11 @@ Ext.extend(XDMoD.Module.AppKernels.AppKernelViewer, XDMoD.PortalModule, {
var start = viewer.getParameterByName('start', token.content);
var end = viewer.getParameterByName('end', token.content);
- if (start !== "" && end !== "") {
+ if (start !== '' && end !== '') {
this.getDurationSelector().setValues(start, end);
}
- if (token.subtab === panel.id) {
+ if (token.subtab === panel.id && kernel_id) {
this.selectAppKernel(kernel_id);
} else {
this.selectFirstNode();
diff --git a/html/gui/js/modules/summary/CenterReportCardPortlet.js b/html/gui/js/modules/summary/CenterReportCardPortlet.js
new file mode 100644
index 0000000..8825590
--- /dev/null
+++ b/html/gui/js/modules/summary/CenterReportCardPortlet.js
@@ -0,0 +1,388 @@
+/* global Ext, XDMoD, CCR, window */
+Ext.namespace('XDMoD.Modules.SummaryPortlets');
+
+/**
+ * XDMoD.Modules.SummaryPortlets.CenterReportCardPortlet
+ *
+ * This portlet is responsible for displaying data that could be used to determine
+ * the "health" of a center. Specifically, this implementation shows App Kernel
+ * data for a given XDMoD Installation. Specifically it will display a horizontal
+ * stacked barchart of the failed, in control, and under / over performing runs
+ * of an app kernel by resource.
+ *
+ * The resources shown are restricted to those that the currently logged in user
+ * is authorized to view. This is done via their associated organization,
+ * `moddb.Users.organization_id`, which is in turn used as a filter via
+ * `modw.resourcefact.organization_id`.
+ *
+ *
+ * This portlet is driven by the REST Endpoint at
+ * `/app_kernels/performance_map/raw`. Which in turn is served by
+ * the `AppKernelControllerProvider::getRawPerformanceMap` function.
+ *
+ * It will display a message if no app kernel data is retrieved:
+ * - `this.grid.viewConfig.emptyText`
+ *
+ * It will mask itself while retrieving data:
+ * - `this.listeners.afterrender`
+ *
+ * It will unmask itself when it is done retrieving data or when an exception
+ * is detected:
+ * - `this.gridstore.listeners.load`
+ * - `this.gridstore.listeners.exception`
+ */
+XDMoD.Modules.SummaryPortlets.CenterReportCardPortlet = Ext.extend(Ext.ux.Portlet, {
+
+ layout: 'fit',
+ autoScroll: true,
+ titleBase: 'Center Report Card',
+
+ tools: [
+ {
+ id: 'help',
+ qtip: [
+ '
',
+ '
',
+ '',
+ 'Failed Runs',
+ '
',
+ '
A run in which the app kernel failed to complete successfully.
',
+ '
',
+ '
',
+ '
',
+ '',
+ 'Under Performing Runs',
+ '
',
+ '
A run in which the app kernel completed successfully but performed below the established control region.
',
+ '
',
+ '
',
+ '
',
+ '',
+ 'In Control Runs',
+ '
',
+ '
A run in which the app kernel completed successfully and performed within the established control region.
',
+ '
',
+ '
',
+ '
',
+ '',
+ 'Over Performing Runs',
+ '
',
+ '
A run in which the app kernel completed successfully and performed better than the established control region.
',
+ '
',
+ '
',
+ '
'
+ ].join(' '),
+ qwidth: 60
+ }
+ ],
+
+ /**
+ * Constructor for the CenterReportCardPortlet.
+ */
+ initComponent: function () {
+ var self = this;
+
+ var aspectRatio = 0.8;
+ this.height = this.width * aspectRatio;
+
+ var dateRanges = CCR.xdmod.ui.DurationToolbar.getDateRanges();
+ for (var i = 0; i < dateRanges.length; i++) {
+ var dateRange = dateRanges[i];
+ if (dateRange.text === this.config.timeframe) {
+ this.config.start_date = this.formatDate(dateRange.start);
+ this.config.end_date = this.formatDate(dateRange.end);
+ }
+ }
+ /**
+ * The main datastore for this portlet. It retrieves app kernel run data
+ * for the specified time period from `this.config.start_date` to
+ * `this.config.end_date`. These values are populated w/ the value from
+ * the XDMoD Duration Toolbar.
+ */
+ this.gridStore = new CCR.xdmod.CustomJsonStore({
+ storeId: 'center-report-card-store',
+ root: 'results',
+ autoLoad: true,
+ fields: [
+ 'resource',
+ 'app_kernel',
+ 'failedRuns',
+ 'inControlRuns',
+ 'overPerformingRuns',
+ 'underPerformingRuns'
+ ],
+ proxy: new Ext.data.HttpProxy({
+ method: 'GET',
+ url: XDMoD.REST.url + '/app_kernels/performance_map/raw'
+ }),
+ baseParams: {
+ start_date: this.config.start_date,
+ end_date: this.config.end_date
+ },
+ listeners: {
+ load: function () {
+ // Make sure that once we're loaded we remove this portlets
+ // mask. This was added during the `afterrender` event.
+ self.el.unmask();
+ },
+ exception: function () {
+ // refresh the grid view so that we can apply the empty text.
+ self.grid.getView().refresh();
+
+ // unmask so that the user can see what's going on.
+ self.el.unmask();
+ }
+ }
+ }); // this.gridStore = new CCR.xdmod.CustomJsonStore({
+
+ /**
+ * A custom column renderer used to generate a stacked horizontal
+ * barchart of each app kernels failed, in control, over and under
+ * performing runs for a given time period.
+ *
+ * @param value {Object} *** UNUSED ***
+ * @param metaData {Object} *** UNUSED ***
+ * @param record {Ext.data.Record} record provided by the `gridStore`
+ * that contains the app kernel run data to be rendered.
+ *
+ * @returns {string}
+ */
+ var valueRenderer = function (value, metaData, record) {
+ var failed = record.get('failedRuns');
+ var inControl = record.get('inControlRuns');
+ var overPerforming = record.get('overPerformingRuns');
+ var underPerforming = record.get('underPerformingRuns');
+
+ var total = failed + inControl + overPerforming + underPerforming;
+
+ /**
+ * Constructs an svg `rect` element based on the provided attributes.
+ * This will be used in a stacked horizontal bar chart.
+ *
+ * @param id {String} The id to use for the rect element.
+ * @param title {String} The title to display for this elements tooltip
+ * @param msg {String} The msg to display w/ this elements tooltip
+ * @param width {Number} The width of this element ( will be interpreted as a percentage ).
+ * @param x {Number} The distance from the left that this element should reside ( will be interpreted as a percentage ).
+ * @param height {Number} The height of this rect element.
+ * @param red {Number} The r of this elements rgb.
+ * @param green {Number} The g of this elements rgb.
+ * @param blue {Number} The b of this elements rgb.
+ *
+ * @returns {string} for an svg rect element
+ */
+ var rect = function (id, title, msg, width, x, height, red, green, blue) {
+ var xValue = x + '%';
+ if (Ext.isChrome) {
+ xValue = 'calc(' + x + '% + 1px)';
+ }
+ return [
+ ''
+ ].join(' ');
+ };
+
+ var height = 20;
+
+ // Make sure that we have at least some runs
+ if (total > 0) {
+ var contents = [
+ '
',
+ '');
+ contents.push('
');
+ } else {
+ // If we don't have any runs then just output a simple message
+ // to let the user know what's up.
+ // eslint-disable-next-line block-scoped-var
+ contents = [
+ '
',
+ 'No Data Found!',
+ '
'
+ ];
+ }
+
+ // eslint-disable-next-line block-scoped-var
+ return contents.join(' ');
+ }; // var valueRenderer = function (value, metaData, record) {
+
+ /**
+ * The main visual element for this portlet. Displays App Kernels by
+ * resource, name, and a stacked horizontal bar chart of the failed,
+ * under performing, in control and over performing runs.
+ */
+ this.grid = new Ext.grid.GridPanel({
+ width: 200,
+ store: this.gridStore,
+ autoExpandColumn: 'ak-status',
+ colModel: new Ext.grid.ColumnModel({
+ columns: [
+ {
+ id: 'ak-resource',
+ header: 'Resource',
+ dataIndex: 'resource',
+ width: 90
+ },
+ {
+ id: 'ak-name',
+ header: 'App Kernel',
+ dataIndex: 'app_kernel',
+ width: 190
+ },
+ {
+ id: 'ak-status',
+ header: 'Status',
+ dataIndex: 'inControlRuns',
+ renderer: valueRenderer
+ }
+ ]
+ }),
+ viewConfig: new Ext.grid.GridView({
+ emptyText: 'No App Kernel information available.'
+ }),
+ listeners: {
+
+ /**
+ * Fires when the user clicks on a row. In this case we construct
+ * a new History token that will direct the UI to the App Kernel
+ * Performance Map tab w/ the currently selected start date and
+ * end date so that the tabs duration toolbar can be set correctly.
+ * The resource / app kernel is also included so that the correct
+ * first row can be selected.
+ *
+ * @param {Ext.grid.GridPanel} grid
+ * @param {number} rowIndex
+ */
+ rowclick: function (grid, rowIndex) {
+ var record = grid.getStore().getAt(rowIndex);
+
+ var info = {
+ start_date: self.config.start_date,
+ end_date: self.config.end_date,
+ resource: record.get('resource'),
+ app_kernel: record.get('app_kernel')
+ };
+
+ var token = 'main_tab_panel:app_kernels:app_kernel_performance_map?ak=' + window.btoa(JSON.stringify(info));
+
+ Ext.History.add(token);
+ }
+ }
+ }); // this.grid
+
+ Ext.apply(this, {
+ items: [
+ this.grid
+ ]
+ });
+
+ this.updateTitle(this.config.start_date, this.config.end_date);
+
+ XDMoD.Modules.SummaryPortlets.CenterReportCardPortlet.superclass.initComponent.apply(this, arguments);
+ }, // initComponent
+
+ listeners: {
+ duration_change: function (timeframe) {
+ // Mask the portlet as we're going to be loading new data.
+ this.el.mask('Loading...');
+
+ this.gridStore.load({
+ params: {
+ start_date: timeframe.start_date,
+ end_date: timeframe.end_date
+ }
+ });
+
+ // Make sure that the portlet title reflects the updated start / end
+ // date
+ this.updateTitle(timeframe.start_date, timeframe.end_date);
+
+ // save the new timeframe data for later use.
+ this.config.start_date = timeframe.start_date;
+ this.config.end_date = timeframe.end_date;
+ },
+
+ afterrender: function () {
+ this.el.mask('Loading...');
+ }
+ }, // listeners: {
+
+ /**
+ * A helper function that will update this portlet's title attribute w/
+ * the start / end date used to generate the data it is displaying.
+ *
+ * @param {Date} startDate
+ * @param {Date} endDate
+ */
+ updateTitle: function (startDate, endDate) {
+ this.setTitle(
+ this.titleBase + ' - ' +
+ startDate +
+ ' to ' +
+ endDate);
+ }, // updateTitle: function(startDate, endDate) {
+
+ formatDate: function (date) {
+ return date.getFullYear() + '-' +
+ ('' + (date.getMonth() + 1)).padStart(2, '0') + '-' +
+ ('' + date.getDate()).padStart(2, '0');
+ } // formatDate: function(date) {
+
+}); // XDMoD.Modules.SummaryPortlets.CenterReportCardPortlet = Ext.extend(Ext.ux.Portlet, {
+
+Ext.reg('CenterReportCardPortlet', XDMoD.Modules.SummaryPortlets.CenterReportCardPortlet);
diff --git a/html/internal_dashboard/js/Arr/AppKerPerformanceMapPanel.js b/html/internal_dashboard/js/Arr/AppKerPerformanceMapPanel.js
deleted file mode 100644
index 2e74250..0000000
--- a/html/internal_dashboard/js/Arr/AppKerPerformanceMapPanel.js
+++ /dev/null
@@ -1,800 +0,0 @@
-/**
- * ARR active tasks grid.
- *
- * @author Nikolay A. Simakov
- */
-
-
-Ext.namespace('XDMoD', 'XDMoD.Arr','CCR', 'CCR.xdmod', 'CCR.xdmod.ui','Ext.ux.grid');
-Ext.QuickTips.init(); // enable tooltips
-
-XDMoD.Arr.AppKerPerformanceMapStore = Ext.extend(Ext.data.JsonStore, {
- restful:true,
-
- proxy: XDMoD.REST.createHttpProxy({
- url: 'app_kernels/performance_map',
- method: 'GET'
- }),
-
- listeners : {
- exception : function(misc) {
- console.log(misc);
- }
- },
-
- constructor : function(config) {
- config = config || {};
-
- var nowEpoch = Date.now();
-
- Ext.apply(config, {
- baseParams : {
- }
- });
-
- XDMoD.Arr.AppKerPerformanceMapStore.superclass.constructor.call(this, config);
- }
-});
-
-
-
-XDMoD.Arr.AppKerPerformanceMapGrid = Ext.extend(Ext.grid.GridPanel, {
- id:'ak_perfmap',
- loadMask : true,
- listeners : {
- viewready : function() {
- this.store.load();
- console.log('viewready');
- }
- },
- colorStyles:{'W':'style="background-color:white;"',
- 'F':'style="background-color:#FFB0C4;"',
- 'U':'style="background-color:#F7FE2E;"',
- 'O':'style="background-color:#FE9A2E;"',
- 'C':'style="background-color:#81BEF7;"',
- 'N':'style="background-color:#B0FFC5;"',
- 'R':'style="background-color:#F781F3;"'},
- rendererForCell : function(value, metaData, record, rowIndex, colIndex, store) {
- if (value != ' ' && value != '') {
- var v = value.split('/');
- for (var i = 1; i < v.length; i++)
- v[i] = parseInt(v[i], 10);
- if(v[0] in this.colorStyles){
- return '