[ews-app] Add status bubble html template
authoraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2019 18:30:13 +0000 (18:30 +0000)
committeraakash_jain@apple.com <aakash_jain@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2019 18:30:13 +0000 (18:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=194571

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-app/ews/templates: Added.
* BuildSlaveSupport/ews-app/ews/templates/statusbubble.html: Copied from QueueStatusServer/templates/statusbubble.html.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241440 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/BuildSlaveSupport/ews-app/ews/templates/statusbubble.html [new file with mode: 0644]
Tools/ChangeLog

diff --git a/Tools/BuildSlaveSupport/ews-app/ews/templates/statusbubble.html b/Tools/BuildSlaveSupport/ews-app/ews/templates/statusbubble.html
new file mode 100644 (file)
index 0000000..fe30770
--- /dev/null
@@ -0,0 +1,116 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+body {
+    font-family: Verdana, sans-serif;
+    margin: 0px;
+    padding: 0px;
+}
+#bubbleContainer {
+    display: inline-block;
+    white-space: nowrap;
+}
+.status {
+    display: block;
+    float: left;
+    margin: 1px;
+    padding: 1px 2px;
+    -moz-border-radius: 5px;
+    -webkit-border-radius: 5px;
+    border-radius: 5px;
+    border: 1px solid rgba(1, 1, 1, 0.3);
+    background-color: white;
+    font-size: 11px;
+    cursor: pointer;
+    text-decoration: none;
+    color: black;
+}
+.status:hover {
+    border-color: rgba(1, 1, 1, 0.7);
+}
+.pass {
+    background-color: #8FDF5F;
+}
+.fail {
+    background-color: #E98080;
+}
+.started {
+    background-color: #E1F5FF;
+}
+.provisional-fail {
+    background-color: #FFAF05;
+}
+.error {
+  background-color: #E0B0FF;
+}
+.queue_position {
+    font-size: 9px;
+}
+form {
+    display: inline-block;
+}
+</style>
+<script>
+window.addEventListener("message", function(e) {
+  if (e.data === 'containerMetrics') {
+    var parentContainer = bubbleContainer.parentElement;
+    var originalWidth = parentContainer.style.width;
+    parentContainer.style.width = "1000px";
+    var clientRect = bubbleContainer.getBoundingClientRect();
+    parentContainer.style.width = originalWidth;
+    e.source.postMessage({'width': Math.ceil(clientRect.width), 'height': Math.ceil(clientRect.height)}, e.origin);
+  } else
+    console.log("Unknown postMessage: " + e.data);
+}, false);
+</script>
+</head>
+<body>
+<div id="bubbleContainer">
+  {% if show_failure_to_apply %}
+  <a class="status fail" target="_top"
+      href="/patch/{{ patch_id }}"
+      title="None of the queues could apply the patch"
+  >
+    patch does not apply to trunk of repository
+  </a>
+  {% else %}
+  {% for bubble in bubbles %}
+  <a class="status {{ bubble.state }}" target="_top"
+      href="{{ bubble.url }}"
+  {% if bubble.details_message %}
+      title="{{ bubble.details_message }}"
+  {% endif %}
+  >
+    {{ bubble.name }}
+    {% if bubble.queue_position %}
+    <span class="queue_position">#{{ bubble.queue_position }}</span>
+    {% endif %}
+  </a>
+  {% endfor %}
+  {% endif %}
+
+{% if show_submit_to_ews %}
+  <form name="submit_to_ews" method="POST" action="/submit-to-ews">
+    <input type="hidden" name="patch_id" value="{{ patch_id }}">
+    <input type="hidden" name="next_action" value="return_to_bubbles">
+    <input class="status" type="submit" value="Submit for EWS analysis">
+  </form>
+{% endif %}
+
+<script>
+// Convert from UTC dates to local.
+var bubbles = document.getElementsByClassName("status")
+for (var i = 0; i < bubbles.length; ++i) {
+    var bubble = bubbles[i];
+    if (bubble.hasAttribute("title")) {
+        var newTitle = bubble.getAttribute("title").replace(/\[\[(.+)\]\]/, function(match, isoDateString) {
+            return new Date(isoDateString).toString();
+        });
+        bubble.setAttribute("title", newTitle);
+    }
+}
+</script>
+</div>
+</body>
+</html>
index fe1a0d7..3f9996a 100644 (file)
@@ -1,3 +1,13 @@
+2019-02-13  Aakash Jain  <aakash_jain@apple.com>
+
+        [ews-app] Add status bubble html template
+        https://bugs.webkit.org/show_bug.cgi?id=194571
+
+        Reviewed by Lucas Forschler.
+
+        * BuildSlaveSupport/ews-app/ews/templates: Added.
+        * BuildSlaveSupport/ews-app/ews/templates/statusbubble.html: Copied from QueueStatusServer/templates/statusbubble.html.
+
 2019-02-12  Chris Dumez  <cdumez@apple.com>
 
         Regression(PSON) MESSAGE_CHECK() hit under WebPageProxy::didFailProvisionalLoadForFrameShared()