Fixed backup overview links

This commit is contained in:
Fabrice Marsaud
2015-11-06 11:34:59 +01:00
parent 6cd212398e
commit e6e8fe4763
2 changed files with 10 additions and 6 deletions

View File

@@ -25,6 +25,11 @@ export default angular.module('backup.management', [
'rollingBackup': 'backup'
}
const mapJobKeyToJobDisplay = {
'rollingSnapshot': 'Rolling Snapshot',
'rollingBackup': 'Backup'
}
const refreshSchedules = () => {
xo.schedule.getAll()
.then(schedules => this.schedules = schedules)
@@ -68,9 +73,8 @@ export default angular.module('backup.management', [
.finally(() => { this.working[id] = false })
.then(refreshSchedules)
}
this.resolveJobKey = schedule => {
return mapJobKeyToState[this.jobs[schedule.job].key]
}
this.resolveJobKey = schedule => mapJobKeyToState[this.jobs[schedule.job].key]
this.displayJobKey = schedule => mapJobKeyToJobDisplay[this.jobs[schedule.job].key]
this.collectionLength = col => Object.keys(col).length
this.working = {}

View File

@@ -1,7 +1,7 @@
.panel.panel-default
p.page-title
i.fa.fa-clock-o(style="color: #e25440;")
| Scheduler
| Backup Schedules Overview
.panel.panel-default
.panel-body
//- The 2 tables below are here for a "full-width" effect of the content vs the menu (cf sheduler/view.jade)
@@ -19,8 +19,8 @@
th State
th
tr(ng-repeat = 'schedule in ctrl.schedules | orderBy:"id":true track by schedule.id')
td: a(ui-sref = 'scheduler.{{ctrl.resolveJobKey(schedule)}}({id: schedule.id})') {{ schedule.id }}
td {{ ctrl.jobs[schedule.job].key }}
td: a(ui-sref = 'backup.{{ctrl.resolveJobKey(schedule)}}({id: schedule.id})') {{ schedule.id }}
td {{ ctrl.displayJobKey(schedule) }}
td {{ ctrl.prettyCron(schedule.cron) }}
td
span.text-success(ng-if = 'ctrl.scheduleTable[schedule.id] === true')