mirror of
https://github.com/wassname/ray.git
synced 2026-07-03 20:56:58 +08:00
33d7004914
* remove node.js webui * temp commit * flesh out web ui * add documentation * add ray timeline * Small changes to documentation and formatting.
56 lines
1.7 KiB
HTML
56 lines
1.7 KiB
HTML
<!--
|
|
@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>
|