Merge "Restores sorting in the launch dialog source page"
This commit is contained in:
commit
02bb50fa5b
|
@ -132,32 +132,32 @@
|
|||
// Mapping for dynamic table headers
|
||||
var tableHeadCellsMap = {
|
||||
image: [
|
||||
{ text: gettext('Name'), sortable: true, sortDefault: true },
|
||||
{ text: gettext('Updated'), sortable: true },
|
||||
{ text: gettext('Size'), classList: ['number'], sortable: true },
|
||||
{ text: gettext('Type'), sortable: true },
|
||||
{ text: gettext('Visibility'), sortable: true }
|
||||
{ text: gettext('Name') },
|
||||
{ text: gettext('Updated') },
|
||||
{ text: gettext('Size') },
|
||||
{ text: gettext('Type') },
|
||||
{ text: gettext('Visibility') }
|
||||
],
|
||||
snapshot: [
|
||||
{ text: gettext('Name'), sortable: true, sortDefault: true },
|
||||
{ text: gettext('Updated'), sortable: true },
|
||||
{ text: gettext('Size'), classList: ['number'], sortable: true },
|
||||
{ text: gettext('Type'), sortable: true },
|
||||
{ text: gettext('Visibility'), sortable: true }
|
||||
{ text: gettext('Name') },
|
||||
{ text: gettext('Updated') },
|
||||
{ text: gettext('Size') },
|
||||
{ text: gettext('Type') },
|
||||
{ text: gettext('Visibility') }
|
||||
],
|
||||
volume: [
|
||||
{ text: gettext('Name'), sortable: true, sortDefault: true },
|
||||
{ text: gettext('Description'), sortable: true },
|
||||
{ text: gettext('Size'), classList: ['number'], sortable: true },
|
||||
{ text: gettext('Type'), sortable: true },
|
||||
{ text: gettext('Availability Zone'), sortable: true }
|
||||
{ text: gettext('Name') },
|
||||
{ text: gettext('Description') },
|
||||
{ text: gettext('Size') },
|
||||
{ text: gettext('Type') },
|
||||
{ text: gettext('Availability Zone') }
|
||||
],
|
||||
volume_snapshot: [
|
||||
{ text: gettext('Name'), sortable: true, sortDefault: true },
|
||||
{ text: gettext('Description'), sortable: true },
|
||||
{ text: gettext('Size'), classList: ['number'], sortable: true },
|
||||
{ text: gettext('Created'), sortable: true },
|
||||
{ text: gettext('Status'), sortable: true }
|
||||
{ text: gettext('Name') },
|
||||
{ text: gettext('Description') },
|
||||
{ text: gettext('Size') },
|
||||
{ text: gettext('Created') },
|
||||
{ text: gettext('Status') }
|
||||
]
|
||||
};
|
||||
|
||||
|
@ -196,6 +196,22 @@
|
|||
]
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a map of functions that sort by the key at a given index for
|
||||
* the selected object
|
||||
*/
|
||||
ctrl.sortByField = [];
|
||||
|
||||
var sortFunction = function(columnIndex, comparedObject) {
|
||||
var cell = tableBodyCellsMap[ctrl.currentBootSource];
|
||||
var key = cell[columnIndex].key;
|
||||
return comparedObject[key];
|
||||
};
|
||||
|
||||
for (var i = 0; i < 5; ++i) {
|
||||
ctrl.sortByField.push(sortFunction.bind(null, i));
|
||||
}
|
||||
|
||||
/**
|
||||
* Filtering - client-side MagicSearch
|
||||
*/
|
||||
|
|
|
@ -56,7 +56,8 @@
|
|||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div ng-if="model.newInstanceSpec.vol_create == true">
|
||||
<div class="form-group" ng-class="{ 'has-error': launchInstanceSourceForm['volume-size'].$invalid }">
|
||||
<div class="form-group"
|
||||
ng-class="{ 'has-error': launchInstanceSourceForm['volume-size'].$invalid }">
|
||||
<label for="volume-size" class="control-label">
|
||||
<translate>Volume Size (GB)</translate>
|
||||
<span class="hz-icon-required fa fa-asterisk"></span>
|
||||
|
@ -102,7 +103,8 @@
|
|||
|
||||
<transfer-table help-text="ctrl.helpText"
|
||||
tr-model="ctrl.tableData">
|
||||
<allocated validate-number-min="1" ng-model="ctrl.tableData.allocated.length">
|
||||
<allocated validate-number-min="1"
|
||||
ng-model="ctrl.tableData.allocated.length">
|
||||
<table class="table table-striped table-rsp table-detail modern"
|
||||
hz-table
|
||||
st-safe-src="ctrl.tableData.allocated"
|
||||
|
@ -182,7 +184,7 @@
|
|||
ng-repeat-end
|
||||
ng-include="ctrl.sourceDetails">
|
||||
</tr>
|
||||
</tbody><!-- /transfer table, allocated table body -->
|
||||
</tbody>
|
||||
</table>
|
||||
</allocated>
|
||||
|
||||
|
@ -200,35 +202,24 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th class="expander"></th>
|
||||
<th ng-attr-st-sort-default="{$ ctrl.tableHeadCells[0].sortDefault $}"
|
||||
ng-class="ctrl.tableHeadCells[0].classList"
|
||||
st-sort="{$ ctrl.tableHeadCells[0].sortable && ctrl.tableBodyCells[0].key $}">
|
||||
<th st-sort="ctrl.sortByField[0]">
|
||||
{$ ctrl.tableHeadCells[0].text $}
|
||||
</th>
|
||||
<th ng-attr-st-sort-default="{$ ctrl.tableHeadCells[1].sortDefault $}"
|
||||
ng-class="ctrl.tableHeadCells[1].classList"
|
||||
st-sort="{$ ctrl.tableHeadCells[1].sortable && ctrl.tableBodyCells[1].key $}">
|
||||
<th st-sort="ctrl.sortByField[1]">
|
||||
{$ ctrl.tableHeadCells[1].text $}
|
||||
</th>
|
||||
<th ng-attr-st-sort-default="{$ ctrl.tableHeadCells[2].sortDefault $}"
|
||||
ng-class="ctrl.tableHeadCells[2].classList"
|
||||
st-sort="{$ ctrl.tableHeadCells[2].sortable && ctrl.tableBodyCells[2].key $}">
|
||||
<th st-sort="ctrl.sortByField[2]">
|
||||
{$ ctrl.tableHeadCells[2].text $}
|
||||
</th>
|
||||
<th ng-attr-st-sort-default="{$ ctrl.tableHeadCells[3].sortDefault $}"
|
||||
ng-class="ctrl.tableHeadCells[3].classList"
|
||||
st-sort="{$ ctrl.tableHeadCells[3].sortable && ctrl.tableBodyCells[3].key $}">
|
||||
<th st-sort="ctrl.sortByField[3]">
|
||||
{$ ctrl.tableHeadCells[3].text $}
|
||||
</th>
|
||||
<th ng-attr-st-sort-default="{$ ctrl.tableHeadCells[4].sortDefault $}"
|
||||
ng-class="ctrl.tableHeadCells[4].classList"
|
||||
st-sort="{$ ctrl.tableHeadCells[4].sortable && ctrl.tableBodyCells[4].key $}">
|
||||
<th st-sort="ctrl.sortByField[4]">
|
||||
{$ ctrl.tableHeadCells[4].text $}
|
||||
</th>
|
||||
<th class="action"></th>
|
||||
<th class="action" translate></th>
|
||||
</tr>
|
||||
</thead><!-- /transfer table, available table head -->
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<tr ng-if="trCtrl.numAvailable() === 0">
|
||||
|
@ -290,8 +281,8 @@
|
|||
</transfer-table>
|
||||
</div>
|
||||
<div ng-if="model.allowedBootSources.length === 0">
|
||||
<div translate class="subtitle text-danger">There are no allowed boot sources.
|
||||
If you think this is wrong please contact your administrator.
|
||||
<div translate class="subtitle text-danger">There are no allowed boot
|
||||
sources. If you think this is wrong please contact your administrator.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue