From df4d731a4d0b3a4d76c13da3f192dbbf4a0bdb07 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 12 Oct 2020 22:43:23 +0200 Subject: [PATCH 1/3] fix: search by job name, small side bar design fixe and toggle improvements looked like name was already implemented in the api, but got lost on frontend ;) (cherry picked from commit f045f682efb16ebaf792e0ffa2c871f5fb5abc32) --- public/app/css/styles.css | 2 +- public/app/js/joblist.js | 26 +++++++++++++++++--------- public/app/js/main.js | 15 ++++++++------- public/app/js/sidebar.js | 8 ++++---- public/app/js/topbar.js | 28 ++++++++++++++-------------- 5 files changed, 44 insertions(+), 35 deletions(-) diff --git a/public/app/css/styles.css b/public/app/css/styles.css index 1fd6585..7fb3cca 100644 --- a/public/app/css/styles.css +++ b/public/app/css/styles.css @@ -38,7 +38,7 @@ background: #000000; } .sidebar { - max-height: 100vh; + max-height: calc(100vh - 45px); overflow-y: scroll; } diff --git a/public/app/js/joblist.js b/public/app/js/joblist.js index 1e1d312..2a7d142 100644 --- a/public/app/js/joblist.js +++ b/public/app/js/joblist.js @@ -53,14 +53,22 @@ const jobList = Vue.component('job-list', { for (const checkbox of checkboxes) { checkbox.click(); } + }, + toggleList(job) { + if(this.multijobs.includes(job.job._id)) { + this.multijobs.splice(this.multijobs.indexOf(job.job._id), 1); + } else { + this.multijobs.push(job.job._id); + } } }, template: `
-
+
- - + {{ multijobs.length }} jobs selected + +
@@ -121,11 +129,11 @@ const jobList = Vue.component('job-list', { Failed Running - {{job.job.name}} - {{ formatDate(job.job.lastRunAt) }} - {{ formatDate(job.job.nextRunAt) }} - {{ formatDate(job.job.lastFinishedAt) }} - {{ job.job.lockedAt ? formatDate(job.job.lockedAt) : "" }} + {{job.job.name}} + {{ formatDate(job.job.lastRunAt) }} + {{ formatDate(job.job.nextRunAt) }} + {{ formatDate(job.job.lastFinishedAt) }} + {{ formatDate(job.job.lockedAt) }} update visibility @@ -141,7 +149,7 @@ const jobList = Vue.component('job-list', {
-
+
{{job.job.name}}
diff --git a/public/app/js/main.js b/public/app/js/main.js index f620cef..356b6ee 100644 --- a/public/app/js/main.js +++ b/public/app/js/main.js @@ -65,9 +65,9 @@ const app = Vue.component('app', { this.jobData = data; this.showNewJob = true; }, - searchForm(search, property, limit, skip, refresh, state, object){ + searchForm(name, search, property, limit, skip, refresh, state, object){ this.pagesize = limit ? limit : this.pagesize, - this.name = 'name', + this.name = name, this.search = search, this.property = property, @@ -76,10 +76,10 @@ const app = Vue.component('app', { this.state = state, this.object = object ? object : this.object, - this.fetchData(this.search, this.property, this.pagesize, this.skip, this.refresh, this.state, this.object) + this.fetchData(this.name, this.search, this.property, this.pagesize, this.skip, this.refresh, this.state, this.object) }, refreshData() { - this.fetchData(this.search, this.property, this.pagesize, this.skip, this.refresh, this.state, this.object) + this.fetchData(this.name, this.search, this.property, this.pagesize, this.skip, this.refresh, this.state, this.object) }, pagechange(action){ @@ -90,13 +90,13 @@ const app = Vue.component('app', { this.pagenumber-- } this.skip = (this.pagenumber-1) * this.pagesize - this.fetchData(this.search, this.property, this.pagesize, this.skip, this.refresh,this.state, this.object) + this.fetchData(this.name, this.search, this.property, this.pagesize, this.skip, this.refresh,this.state, this.object) }, - fetchData(search = '', property = '', limit = 15, skip = 0, refresh = 60, state = '', object){ + fetchData(name = '', search = '', property = '', limit = 15, skip = 0, refresh = 60, state = '', object){ this.loading = true; this.pagesize = this.pagesize === 0 ? parseInt(limit) : this.pagesize; this.refresh = parseFloat(refresh); - const url = `api?limit=${limit}&skip=${skip}&property=${property}${object ? '&isObjectId=true' : ""}${state ? `&state=${state}`: ''}&q=${search}`; + const url = `api?limit=${limit}&job=${name}&skip=${skip}&property=${property}${object ? '&isObjectId=true' : ""}${state ? `&state=${state}`: ''}&q=${search}`; return axios.get(url) .then(result => result.data) .then( @@ -152,6 +152,7 @@ const app = Vue.component('app', { return this.fetchData(); }, template: ` +