diff --git a/ui/src/components/view/ListView.vue b/ui/src/components/view/ListView.vue
index 0d594fcd04f..3c93db54db4 100644
--- a/ui/src/components/view/ListView.vue
+++ b/ui/src/components/view/ListView.vue
@@ -117,6 +117,33 @@
{{ text }}
+
+
+ Move to top
+
+
+
+ Move to bottom
+
+
+
+ Move up one row
+
+
+
+ Move down one row
+
+
+
+
{
+ console.error(error)
+ }).finally(() => {
+ this.parentFetchData()
+ this.parentToggleLoading()
+ })
+ },
+ moveItemUp (record) {
+ const data = this.items
+ const index = data.findIndex(item => item.id === record.id)
+ if (index === 0) return
+
+ data.splice(index - 1, 0, data.splice(index, 1)[0])
+
+ data.forEach((item, index) => {
+ this.handleUpdateOrder(item.id, index + 1)
+ })
+ },
+ moveItemDown (record) {
+ const data = this.items
+ const index = data.findIndex(item => item.id === record.id)
+ if (index === data.length - 1) return
+
+ data.splice(index + 1, 0, data.splice(index, 1)[0])
+
+ data.forEach((item, index) => {
+ this.handleUpdateOrder(item.id, index + 1)
+ })
+ },
+ moveItemTop (record) {
+ const data = this.items
+ const index = data.findIndex(item => item.id === record.id)
+ if (index === 0) return
+
+ data.unshift(data.splice(index, 1)[0])
+
+ data.forEach((item, index) => {
+ this.handleUpdateOrder(item.id, index + 1)
+ })
+ },
+ moveItemBottom (record) {
+ const data = this.items
+ const index = data.findIndex(item => item.id === record.id)
+ if (index === data.length - 1) return
+
+ data.push(data.splice(index, 1)[0])
+
+ data.forEach((item, index) => {
+ this.handleUpdateOrder(item.id, index + 1)
+ })
}
}
}
@@ -255,3 +367,27 @@ export default {
background-color: #f9f9f9;
}
+
+
diff --git a/ui/src/config/section/image.js b/ui/src/config/section/image.js
index ffa7f6b90f1..93e94821fd3 100644
--- a/ui/src/config/section/image.js
+++ b/ui/src/config/section/image.js
@@ -27,7 +27,7 @@ export default {
permission: ['listTemplates'],
params: { templatefilter: 'executable' },
resourceType: 'Template',
- columns: ['name', 'ostypename', 'status', 'hypervisor', 'account', 'domain'],
+ columns: ['name', 'ostypename', 'status', 'hypervisor', 'account', 'domain', 'order'],
details: ['name', 'id', 'displaytext', 'checksum', 'hypervisor', 'format', 'ostypename', 'size', 'isready', 'passwordenabled', 'directdownload', 'isextractable', 'isdynamicallyscalable', 'ispublic', 'isfeatured', 'crosszones', 'type', 'account', 'domain', 'created'],
related: [{
name: 'vm',
diff --git a/ui/src/config/section/infra/zones.js b/ui/src/config/section/infra/zones.js
index 7e26bc4ab6d..fe1b3d94cc2 100644
--- a/ui/src/config/section/infra/zones.js
+++ b/ui/src/config/section/infra/zones.js
@@ -20,7 +20,7 @@ export default {
title: 'Zones',
icon: 'global',
permission: ['listZonesMetrics', 'listZones'],
- columns: ['name', 'state', 'networktype', 'clusters', 'cpuused', 'cpumaxdeviation', 'cpuallocated', 'cputotal', 'memoryused', 'memorymaxdeviation', 'memoryallocated', 'memorytotal'],
+ columns: ['name', 'state', 'networktype', 'clusters', 'cpuused', 'cpumaxdeviation', 'cpuallocated', 'cputotal', 'memoryused', 'memorymaxdeviation', 'memoryallocated', 'memorytotal', 'order'],
details: ['name', 'id', 'allocationstate', 'networktype', 'guestcidraddress', 'localstorageenabled', 'securitygroupsenabled', 'dns1', 'dns2', 'internaldns1', 'internaldns2'],
related: [{
name: 'physicalnetwork',
diff --git a/ui/src/config/section/offering.js b/ui/src/config/section/offering.js
index 14d29defeda..c132e5742c0 100644
--- a/ui/src/config/section/offering.js
+++ b/ui/src/config/section/offering.js
@@ -27,7 +27,7 @@ export default {
icon: 'cloud',
permission: ['listServiceOfferings'],
params: { isrecursive: 'true' },
- columns: ['name', 'displaytext', 'cpunumber', 'cpuspeed', 'memory', 'tags', 'domain', 'zone'],
+ columns: ['name', 'displaytext', 'cpunumber', 'cpuspeed', 'memory', 'tags', 'domain', 'zone', 'order'],
details: ['name', 'id', 'displaytext', 'offerha', 'provisioningtype', 'storagetype', 'iscustomized', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'tags', 'domain', 'zone', 'created'],
related: [{
name: 'vm',
@@ -67,7 +67,7 @@ export default {
icon: 'setting',
permission: ['listServiceOfferings', 'listInfrastructure'],
params: { issystem: 'true', isrecursive: 'true' },
- columns: ['name', 'systemvmtype', 'cpunumber', 'cpuspeed', 'memory', 'storagetype', 'tags'],
+ columns: ['name', 'systemvmtype', 'cpunumber', 'cpuspeed', 'memory', 'storagetype', 'tags', 'order'],
details: ['name', 'id', 'displaytext', 'systemvmtype', 'provisioningtype', 'storagetype', 'iscustomized', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'tags', 'domain', 'zone', 'created'],
actions: [{
api: 'createServiceOffering',
@@ -98,7 +98,7 @@ export default {
icon: 'hdd',
permission: ['listDiskOfferings'],
params: { isrecursive: 'true' },
- columns: ['name', 'displaytext', 'disksize', 'tags', 'domain', 'zone'],
+ columns: ['name', 'displaytext', 'disksize', 'tags', 'domain', 'zone', 'order'],
details: ['name', 'id', 'displaytext', 'disksize', 'provisioningtype', 'storagetype', 'iscustomized', 'tags', 'domain', 'zone', 'created'],
related: [{
name: 'volume',
diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json
index d73e17db4e8..55750213ccb 100644
--- a/ui/src/locales/en.json
+++ b/ui/src/locales/en.json
@@ -710,6 +710,7 @@
"offerha": "Offer HA",
"offeringType": "Compute offering type",
"operation": "Operation",
+"order": "Order",
"osTypeId": "OS Type",
"oscategoryid": "OS Preference",
"ostypeid": "OS Type",