SR host names displayed when necessary

This commit is contained in:
Fabrice Marsaud
2015-12-22 12:00:15 +01:00
parent 12a4af5900
commit 26b958c270
3 changed files with 6 additions and 4 deletions

View File

@@ -26,7 +26,6 @@ export default angular.module('backup.restore', [
const srs = xoApi.getView('SRs').all
this.writable_SRs = filter(srs, (sr) => sr.content_type !== 'iso')
this.bytesToSize = bytesToSizeFilter
this.isEmpty = backups => backups && !(Object.keys(backups.delta) || backups.other.length)
this.size = size
@@ -41,6 +40,7 @@ export default angular.module('backup.restore', [
}
})
this.backUpRemotes = remotes
this.writable_SRs = filter(srs, (sr) => sr.content_type !== 'iso')
})
}

View File

@@ -49,6 +49,7 @@
a(xo-click = "ctrl.importDeltaBackup(remote.id, backup.path, sr.id)")
i.xo-icon-host.fa-fw
| To {{sr.name_label}} ({{sr.size - sr.usage | bytesToSize }})
span  {{ (sr.$container | resolve).name_label }}
hr
hr
div(ng-if = 'ctrl.size(remote.backups.other)')
@@ -63,4 +64,5 @@
a(xo-click = "ctrl.importBackup(remote.id, backup, sr.id)")
i.xo-icon-host.fa-fw
| To {{sr.name_label}} ({{sr.size - sr.usage | bytesToSize }})
span  {{ (sr.$container | resolve).name_label }}
hr

View File

@@ -472,12 +472,12 @@
span(
ng-if = 'canView((VDI.$SR | resolve).id)'
editable-select="(VDI.$SR | resolve).id"
e-ng-options="SR.id as (SR.name_label + ' (' + (SR.size - SR.usage | bytesToSize) + ' free)') for SR in writable_SRs"
e-ng-options="SR.id as (SR.name_label + ' (' + (SR.size - SR.usage | bytesToSize) + ' free) ' + (SR.$container | resolve).name_label) for SR in writable_SRs"
e-name = '{{VDI.id}}/$SR'
)
//- Are SR editable? will trigger moving VDI to the new SR
a(xo-sref="SRs_view({id: (VDI.$SR | resolve).id})")
| {{(VDI.$SR | resolve).name_label}}
| {{(VDI.$SR | resolve).name_label}} ({{((VDI.$SR | resolve).$container | resolve).name_label}})
td(ng-if="isConnected(VDI)")
span.label.label-success Connected
span.pull-right.btn-group.quick-buttons(ng-if="canAdmin()")
@@ -599,7 +599,7 @@
|  
.form-group
//- label(for = 'newDiskSR') SR 
select.form-control(ng-model = 'newDiskSR', required, ng-options="SR.id as (SR.name_label + ' (' + (SR.size - SR.usage | bytesToSize) + ' free)') for SR in writable_SRs")
select.form-control(ng-model = 'newDiskSR', required, ng-options="SR.id as (SR.name_label + ' (' + (SR.size - SR.usage | bytesToSize) + ' free) ' + (SR.$container | resolve).name_label) for SR in writable_SRs")
option(value = '', disabled) Choose your SR
|  
br