mirror of
https://github.com/wassname/ray.git
synced 2026-09-12 12:51:15 +08:00
New web UI. (#176)
* remove node.js webui * temp commit * flesh out web ui * add documentation * add ray timeline * Small changes to documentation and formatting.
This commit is contained in:
committed by
Robert Nishihara
parent
417c04bac8
commit
33d7004914
@@ -0,0 +1,55 @@
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<link rel="import" href="../bower_components/polymer/polymer.html">
|
||||
<link rel="import" href="shared-styles.html">
|
||||
|
||||
<dom-module id="ray-tasks">
|
||||
<template>
|
||||
<style include="shared-styles">
|
||||
:host {
|
||||
display: block;
|
||||
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="card">
|
||||
<h1>Tasks</h1>
|
||||
<vaadin-grid id="tasks">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col name="task_id" sortable="" sort-direction="desc"/>
|
||||
<col name="state" sortable="" sort-direction="desc"/>
|
||||
<col name="node_id" sortable="" sort-direction="desc"/>
|
||||
</colgroup>
|
||||
</table>
|
||||
</vaadin-grid>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var backend_address = "ws://127.0.0.1:8888";
|
||||
Polymer({
|
||||
is: 'ray-tasks',
|
||||
ready: function() {
|
||||
var taskSocket = new WebSocket(backend_address);
|
||||
var tasks = Polymer.dom(this.root).querySelector("#tasks");
|
||||
|
||||
taskSocket.onopen = function() {
|
||||
taskSocket.send(JSON.stringify({"command": "get-tasks"}));
|
||||
}
|
||||
taskSocket.onmessage = function(answer) {
|
||||
tasks.items = JSON.parse(answer.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</dom-module>
|
||||
Reference in New Issue
Block a user