mirror of
https://github.com/wassname/ray.git
synced 2026-07-11 11:08:24 +08:00
ced13ca5b1
* backend ui work * instll block * easy mvp * Small changes.
47 lines
1.2 KiB
HTML
47 lines
1.2 KiB
HTML
<link rel="import" href="../bower_components/polymer/polymer.html">
|
|
<link rel="import" href="shared-styles.html">
|
|
|
|
<dom-module id="ray-errors">
|
|
<template>
|
|
<style include="shared-styles">
|
|
:host {
|
|
display: block;
|
|
|
|
padding: 10px;
|
|
}
|
|
</style>
|
|
|
|
<div class="card">
|
|
<h1>Errors</h1>
|
|
<vaadin-grid id="errors">
|
|
<table>
|
|
<colgroup>
|
|
<col name="driver_id" sortable="" sort-direction="desc"/>
|
|
<col name="task_id" sortable="" sort-direction="desc"/>
|
|
<col name="error" sortable="" sort-direction="desc"/>
|
|
</colgroup>
|
|
</table>
|
|
</vaadin-grid>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
var backend_address = "ws://127.0.0.1:8888";
|
|
Polymer({
|
|
is: 'ray-errors',
|
|
ready: function() {
|
|
var eventSocket = new WebSocket(backend_address);
|
|
var errors = Polymer.dom(this.root).querySelector("#errors");
|
|
|
|
eventSocket.onopen = function() {
|
|
eventSocket.send(JSON.stringify({"command": "get-errors"}));
|
|
}
|
|
eventSocket.onmessage = function(answer) {
|
|
console.dir(answer.data);
|
|
errors.items = JSON.parse(answer.data);
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
</dom-module>
|