diff options
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/dashboard.html | 2 | ||||
-rw-r--r-- | contrib/dashboard.js | 17 |
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'], |