You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/04/14 20:38:14 UTC

[GitHub] [trafficcontrol] zrhoffman commented on a change in pull request #4543: 'fixed' grafana scripted dashboard to use exact hostname instead of regular expression match

zrhoffman commented on a change in pull request #4543: 'fixed' grafana scripted dashboard to use exact hostname instead of regular expression match
URL: https://github.com/apache/trafficcontrol/pull/4543#discussion_r408418440
 
 

 ##########
 File path: traffic_stats/grafana/traffic_ops_server.js
 ##########
 @@ -13,1368 +13,1359 @@
      limitations under the License.
 */
 
-/* global _ */
-
 /*
  * Scripted dashboard for traffic ops.
  *
  * Based on the grafana scripted.js script (which is ASF 2.0 licensed).
  */
 
-
-
-// accessible variables in this scope
-var window, document, ARGS, $, jQuery, moment, kbn;
+'use strict';
 
 // Setup some variables
 var dashboard;
 
-// All url parameters are available via the ARGS object
+// All URL parameters are available via the ARGS object
 var ARGS;
 
-// Intialize a skeleton with nothing but a rows array and service object
+// Intialize a skeleton with nothing but a rows array and service object,
+// and setting default time and refresh interval.
 dashboard = {
-  rows : [],
-};
-
-
-// Set default time
-// time can be overriden in the url using from/to parameters, but this is
-// handled automatically in grafana core during dashboard initialization
-dashboard.time = {
-  from: "now-24h",
-  to: "now"
+  refresh: "30s",
+  rows: [],
+  // time can be overridden in the URL using from/to parameters, but this is
+  // handled automatically in grafana core during dashboard initialization
+  time: {
+    from: "now-24h",
+    to: "now"
+  }
 };
 
-var which = 'argName';
+let which = 'argName';
 
-if(!_.isUndefined(ARGS.which)) {
+if(ARGS.which !== undefined) {
 
 Review comment:
   Nit: Since the whole file is reformatted now, `if(` should be `if (`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services