summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-05-24 17:25:29 +0300
committerLars-Dominik Braun <lars@6xq.net>2019-05-24 17:25:29 +0300
commitf6522475833c084c47f6a3c142feeca1c3b4261f (patch)
treeff8ccccbde97a8a18ad2c2ddbd7bdcbf97469043
parent94590852e026ebb39dba93972da6ccf18f547a83 (diff)
downloadcrocoite-f6522475833c084c47f6a3c142feeca1c3b4261f.tar.gz
crocoite-f6522475833c084c47f6a3c142feeca1c3b4261f.tar.bz2
crocoite-f6522475833c084c47f6a3c142feeca1c3b4261f.zip
dashboard: Remove delete button
There’s really no point in having it
-rw-r--r--contrib/dashboard.html2
-rw-r--r--contrib/dashboard.js17
2 files changed, 3 insertions, 16 deletions
diff --git a/contrib/dashboard.html b/contrib/dashboard.html
index 4468786..49a15bc 100644
--- a/contrib/dashboard.html
+++ b/contrib/dashboard.html
@@ -15,7 +15,7 @@
<h1 class="title">chromebot dashboard</h1>
<bot-status v-bind:jobs="jobs"></bot-status>
<div class="jobs">
- <job-item v-for="j in jobs" v-bind:job="j" v-bind:jobs="jobs" v-bind:ignored="ignored" v-bind:key="j.id"></job-item>
+ <job-item v-for="j in jobs" v-bind:job="j" v-bind:jobs="jobs" v-bind:key="j.id"></job-item>
</div>
</section>
<script src="dashboard.js"></script>
diff --git a/contrib/dashboard.js b/contrib/dashboard.js
index e07f8e3..b854106 100644
--- a/contrib/dashboard.js
+++ b/contrib/dashboard.js
@@ -35,19 +35,12 @@ class Job {
}
let jobs = {};
-/* list of ignored job ids, i.e. those the user deleted from the dashboard */
-let ignored = [];
let ws = new WebSocket(socket);
ws.onmessage = function (event) {
var msg = JSON.parse (event.data);
let msgdate = new Date (Date.parse (msg.date));
var j = undefined;
- console.log (msg);
if (msg.job) {
- if (ignored.includes (msg.job)) {
- console.log ("job ignored", msg.job);
- return;
- }
j = jobs[msg.job];
if (j === undefined) {
j = new Job (msg.job, 'unknown', '<unknown>', new Date ());
@@ -91,14 +84,8 @@ ws.onerror = function (event) {
};
Vue.component('job-item', {
- props: ['job', 'jobs', 'ignored'],
- template: '<div class="job box" :id="job.id"><ul class="columns"><li class="jid column is-narrow"><a :href="\'#\' + job.id">{{ job.id }}</a></li><li class="url column"><a :href="job.url">{{ job.url }}</a></li><li class="status column is-narrow"><job-status v-bind:job="job"></job-status></li><li class="column is-narrow"><a class="delete" v-on:click="del(job.id)"></a></li></ul><job-stats v-bind:job="job"></job-stats></div>',
- methods: {
- del: function (id) {
- Vue.delete(this.jobs, id);
- this.ignored.push (id);
- }
- }
+ props: ['job', 'jobs'],
+ template: '<div class="job box" :id="job.id"><ul class="columns"><li class="jid column is-narrow"><a :href="\'#\' + job.id">{{ job.id }}</a></li><li class="url column"><a :href="job.url">{{ job.url }}</a></li><li class="status column is-narrow"><job-status v-bind:job="job"></job-status></li></ul><job-stats v-bind:job="job"></job-stats></div>',
});
Vue.component('job-status', {
props: ['job'],