Title: [190687] trunk/Websites/perf.webkit.org
Revision
190687
Author
[email protected]
Date
2015-10-07 14:24:54 -0700 (Wed, 07 Oct 2015)

Log Message

Make the site name configurable in perf dashboard
https://bugs.webkit.org/show_bug.cgi?id=149894

Reviewed by Chris Dumez.

Added "siteTitle" as a new configuration key to specify the site name.

* public/include/db.php:
(config): Now takes the default value as an argument.
* public/include/manifest.php:
(ManifestGenerator::generate): Include siteTitle in the manifest.
* public/index.html: Update the title and the heading when the manifest is loaded.
* public/v2/index.html: Use App.Manifest.siteTitle as the heading. document.title needs to be updated manually.
* public/v2/manifest.js: 
(App.MetricSerializer.normalizePayload): Update document.title and App.Manifest.siteTitle.

Modified Paths

Diff

Modified: trunk/Websites/perf.webkit.org/ChangeLog (190686 => 190687)


--- trunk/Websites/perf.webkit.org/ChangeLog	2015-10-07 21:19:15 UTC (rev 190686)
+++ trunk/Websites/perf.webkit.org/ChangeLog	2015-10-07 21:24:54 UTC (rev 190687)
@@ -1,5 +1,23 @@
 2015-10-07  Ryosuke Niwa  <[email protected]>
 
+        Make the site name configurable in perf dashboard
+        https://bugs.webkit.org/show_bug.cgi?id=149894
+
+        Reviewed by Chris Dumez.
+
+        Added "siteTitle" as a new configuration key to specify the site name.
+
+        * public/include/db.php:
+        (config): Now takes the default value as an argument.
+        * public/include/manifest.php:
+        (ManifestGenerator::generate): Include siteTitle in the manifest.
+        * public/index.html: Update the title and the heading when the manifest is loaded.
+        * public/v2/index.html: Use App.Manifest.siteTitle as the heading. document.title needs to be updated manually.
+        * public/v2/manifest.js: 
+        (App.MetricSerializer.normalizePayload): Update document.title and App.Manifest.siteTitle.
+
+2015-10-07  Ryosuke Niwa  <[email protected]>
+
         Perf dashboard doesn't show analysis tasks anchored at outliers
         https://bugs.webkit.org/show_bug.cgi?id=149870
 

Modified: trunk/Websites/perf.webkit.org/public/include/db.php (190686 => 190687)


--- trunk/Websites/perf.webkit.org/public/include/db.php	2015-10-07 21:19:15 UTC (rev 190686)
+++ trunk/Websites/perf.webkit.org/public/include/db.php	2015-10-07 21:24:54 UTC (rev 190687)
@@ -29,11 +29,11 @@
 
 define('CONFIG_DIR', dirname(__FILE__) . '/../../');
 
-function config($key) {
+function config($key, $default = NULL) {
     global $_config;
     if (!$_config)
         $_config = json_decode(file_get_contents(CONFIG_DIR . 'config.json'), true);
-    return $_config[$key];
+    return array_get($_config, $key, $default);
 }
 
 function config_path($key, $path) {

Modified: trunk/Websites/perf.webkit.org/public/include/manifest.php (190686 => 190687)


--- trunk/Websites/perf.webkit.org/public/include/manifest.php	2015-10-07 21:19:15 UTC (rev 190686)
+++ trunk/Websites/perf.webkit.org/public/include/manifest.php	2015-10-07 21:24:54 UTC (rev 190687)
@@ -27,6 +27,7 @@
             $row = $row['commit_repository'];
 
         $this->manifest = array(
+            'siteTitle' => config('siteTitle', 'Performance Dashboard'),
             'tests' => (object)$this->tests(),
             'metrics' => (object)$this->metrics(),
             'all' => (object)$this->platforms($config_table, $platform_table, false),

Modified: trunk/Websites/perf.webkit.org/public/index.html (190686 => 190687)


--- trunk/Websites/perf.webkit.org/public/index.html	2015-10-07 21:19:15 UTC (rev 190686)
+++ trunk/Websites/perf.webkit.org/public/index.html	2015-10-07 21:24:54 UTC (rev 190687)
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html>
 <head>
-<title>WebKit Perf Monitor</title>
+<title>Perf Monitor is Loading...</title>
 <script src="" defer></script>
 <script src="" defer></script>
 <script src="" defer></script>
@@ -1220,6 +1220,9 @@
         builders = manifest.builders;
         bugTrackers = manifest.bugTrackers;
 
+        document.title = manifest.siteTitle;
+        document.getElementById('siteTitle').textContent = manifest.siteTitle;
+
         setMode(URLState.get('mode', 'dashboard'));
     });
 }
@@ -1231,7 +1234,7 @@
 <body>
 
 <header id="title">
-<h1><a href="" Perf Monitor</a></h1>
+<h1><a id="siteTitle" href="" Monitor</a></h1>
 <ul>
     <li id="numberOfDaysPicker"><input id="numberOfDays" type="range" min="1" max="5.9" step="0.001" value="2.3"><span class="output"></span></li>
     <li><a href=""

Modified: trunk/Websites/perf.webkit.org/public/v2/index.html (190686 => 190687)


--- trunk/Websites/perf.webkit.org/public/v2/index.html	2015-10-07 21:19:15 UTC (rev 190686)
+++ trunk/Websites/perf.webkit.org/public/v2/index.html	2015-10-07 21:24:54 UTC (rev 190687)
@@ -2,7 +2,7 @@
 <html>
 <head>
     <meta charset="utf-8">
-    <title>WebKit Performance Monitor (Beta)</title>
+    <title>Performance Dashboard is Loading...</title>
 
     <link rel="prefetch" href=""
     <script type="application/json" src=""
@@ -486,7 +486,7 @@
 
     <script type="text/x-handlebars" data-template-name="navbar">
         <nav id="navigation" role="navigation">
-            <h1><a href="" Perf Monitor</a></h1>
+            <h1><a href=""
             <ul>
                 {{#each App.Manifest.dashboards}}
                     {{#if name}}

Modified: trunk/Websites/perf.webkit.org/public/v2/manifest.js (190686 => 190687)


--- trunk/Websites/perf.webkit.org/public/v2/manifest.js	2015-10-07 21:19:15 UTC (rev 190686)
+++ trunk/Websites/perf.webkit.org/public/v2/manifest.js	2015-10-07 21:24:54 UTC (rev 190687)
@@ -214,6 +214,12 @@
             id++;
         }
 
+        var siteTitle = payload['siteTitle'];
+        if (siteTitle) {
+            App.Manifest.set('siteTitle', siteTitle);
+            document.title = siteTitle;
+        }
+
         return results;
     },
     _normalizeIdMap: function (idMap)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to