This is an automated email from the ASF dual-hosted git repository.
rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git
The following commit(s) were added to refs/heads/master by this push:
new 5be8e4e compute: New Instance dialog improvements (#401)
5be8e4e is described below
commit 5be8e4e3d5c3a06ca404e4726f9dc398ff6e3dc5
Author: Hoang Nguyen <[email protected]>
AuthorDate: Sat Jun 20 13:02:38 2020 +0700
compute: New Instance dialog improvements (#401)
* add scroll to vm info
* fix "un-choose" the Zone/Pod/Host and row selected when changing page
sections
* remove 'un-choose' selection in zone, cluster, pod, host
* fix issue when selected page, hidden cpu/ram affinity groups
* revert affinityGroup total count
* fix error lint & disk offering selection
---
src/views/compute/DeployVM.vue | 49 ++++++++++--
.../compute/wizard/AffinityGroupSelection.vue | 55 ++++++++++---
.../compute/wizard/ComputeOfferingSelection.vue | 56 ++++++++++---
src/views/compute/wizard/DiskOfferingSelection.vue | 92 +++++++++++++++++-----
src/views/compute/wizard/NetworkSelection.vue | 53 ++++++++++---
src/views/compute/wizard/SshKeyPairSelection.vue | 71 ++++++++++++-----
src/views/compute/wizard/TemplateIsoRadioGroup.vue | 36 ++++-----
src/views/compute/wizard/TemplateIsoSelection.vue | 1 -
8 files changed, 309 insertions(+), 104 deletions(-)
diff --git a/src/views/compute/DeployVM.vue b/src/views/compute/DeployVM.vue
index 9d2ca96..2446516 100644
--- a/src/views/compute/DeployVM.vue
+++ b/src/views/compute/DeployVM.vue
@@ -137,6 +137,8 @@
<div v-if="zoneSelected">
<compute-offering-selection
:compute-items="options.serviceOfferings"
+ :row-count="rowCount.serviceOfferings"
+ :zoneId="zoneId"
:value="serviceOffering ? serviceOffering.id : ''"
:loading="loading.serviceOfferings"
:preFillContent="dataPreFill"
@@ -181,9 +183,12 @@
<div v-if="zoneSelected">
<disk-offering-selection
:items="options.diskOfferings"
+ :row-count="rowCount.diskOfferings"
+ :zoneId="zoneId"
:value="diskOffering ? diskOffering.id : ''"
:loading="loading.diskOfferings"
:preFillContent="dataPreFill"
+ :isIsoSelected="tabKey==='isoid'"
@select-disk-offering-item="($event) =>
updateDiskOffering($event)"
@handle-search-filter="($event) =>
handleSearchFilter('diskOfferings', $event)"
></disk-offering-selection>
@@ -205,6 +210,8 @@
<div v-if="zoneSelected">
<affinity-group-selection
:items="options.affinityGroups"
+ :row-count="rowCount.affinityGroups"
+ :zoneId="zoneId"
:value="affinityGroupIds"
:loading="loading.affinityGroups"
:preFillContent="dataPreFill"
@@ -221,6 +228,7 @@
<div v-if="zoneSelected">
<network-selection
:items="options.networks"
+ :row-count="rowCount.networks"
:value="networkOfferingIds"
:loading="loading.networks"
:zoneId="zoneId"
@@ -245,6 +253,8 @@
<div v-if="zoneSelected">
<ssh-key-pair-selection
:items="options.sshKeyPairs"
+ :row-count="rowCount.sshKeyPairs"
+ :zoneId="zoneId"
:value="sshKeyPair ? sshKeyPair.name : ''"
:loading="loading.sshKeyPairs"
:preFillContent="dataPreFill"
@@ -393,7 +403,25 @@ export default {
podId: null,
clusterId: null,
zoneSelected: false,
- vm: {},
+ vm: {
+ name: null,
+ zoneid: null,
+ zonename: null,
+ hypervisor: null,
+ templateid: null,
+ templatename: null,
+ keyboard: null,
+ keypair: null,
+ group: null,
+ affinitygroupids: [],
+ affinitygroup: [],
+ serviceofferingid: null,
+ serviceofferingname: null,
+ ostypeid: null,
+ ostypename: null,
+ rootdisksize: null,
+ disksize: null
+ },
options: {
templates: [],
isos: [],
@@ -412,6 +440,7 @@ export default {
bootTypes: [],
bootModes: []
},
+ rowCount: {},
loading: {
deploy: false,
templates: false,
@@ -709,9 +738,6 @@ export default {
if (this.serviceOffering) {
this.vm.serviceofferingid = this.serviceOffering.id
this.vm.serviceofferingname = this.serviceOffering.displaytext
- this.vm.cpunumber = this.serviceOffering.cpunumber
- this.vm.cpuspeed = this.serviceOffering.cpuspeed
- this.vm.memory = this.serviceOffering.memory
}
if (this.diskOffering) {
@@ -737,7 +763,11 @@ export default {
this.form.setFieldsValue({ isoid: null })
}
this.instanceConfig = { ...this.form.getFieldsValue(), ...fields }
- this.vm = Object.assign({}, this.instanceConfig)
+ Object.keys(fields).forEach(field => {
+ if (field in this.vm) {
+ this.vm[field] = this.instanceConfig[field]
+ }
+ })
}
})
this.form.getFieldDecorator('computeofferingid', { initialValue:
undefined, preserve: true })
@@ -778,7 +808,6 @@ export default {
this.fetchKeyboard()
this.fetchBootTypes()
this.fetchBootModes()
-
Vue.nextTick().then(() => {
['name', 'keyboard', 'boottype', 'bootmode',
'userdata'].forEach(this.fillValue)
this.instanceConfig = this.form.getFieldsValue() // ToDo: maybe
initialize with some other defaults
@@ -952,6 +981,12 @@ export default {
description: this.$t('message.template.iso')
})
return
+ } else if (values.isoid && (!values.diskofferingid ||
values.diskofferingid === '0')) {
+ this.$notification.error({
+ message: 'Request Failed',
+ description: this.$t('Please select a Disk Offering to continue')
+ })
+ return
}
this.loading.deploy = true
@@ -1107,6 +1142,7 @@ export default {
param.loading = false
_.map(response, (responseItem, responseKey) => {
if (Object.keys(responseItem).length === 0) {
+ this.rowCount[name] = 0
this.options[name] = []
this.$forceUpdate()
return
@@ -1116,6 +1152,7 @@ export default {
}
_.map(responseItem, (response, key) => {
if (key === 'count') {
+ this.rowCount[name] = response
return
}
param.opts = response
diff --git a/src/views/compute/wizard/AffinityGroupSelection.vue
b/src/views/compute/wizard/AffinityGroupSelection.vue
index f429249..25a9fbd 100644
--- a/src/views/compute/wizard/AffinityGroupSelection.vue
+++ b/src/views/compute/wizard/AffinityGroupSelection.vue
@@ -27,12 +27,25 @@
:columns="columns"
:dataSource="items"
:rowKey="record => record.id"
- :pagination="{showSizeChanger: true}"
+ :pagination="false"
:rowSelection="rowSelection"
size="middle"
:scroll="{ y: 225 }"
>
</a-table>
+
+ <div style="display: block; text-align: right;">
+ <a-pagination
+ size="small"
+ :current="options.page"
+ :pageSize="options.pageSize"
+ :total="rowCount"
+ :showTotal="total => `Total ${total} items`"
+ :pageSizeOptions="['10', '20', '40', '80', '100', '500']"
+ @change="onChangePage"
+ @showSizeChange="onChangePageSize"
+ showSizeChanger />
+ </div>
</div>
</template>
@@ -46,6 +59,10 @@ export default {
type: Array,
default: () => []
},
+ rowCount: {
+ type: Number,
+ default: () => 0
+ },
value: {
type: Array,
default: () => []
@@ -57,6 +74,10 @@ export default {
preFillContent: {
type: Object,
default: () => {}
+ },
+ zoneId: {
+ type: String,
+ default: () => ''
}
},
data () {
@@ -74,17 +95,16 @@ export default {
width: '60%'
}
],
- selectedRowKeys: []
- }
- },
- computed: {
- options () {
- return {
+ selectedRowKeys: [],
+ oldZoneId: null,
+ options: {
page: 1,
pageSize: 10,
- keyword: ''
+ keyword: null
}
- },
+ }
+ },
+ computed: {
rowSelection () {
return {
type: 'checkbox',
@@ -107,6 +127,10 @@ export default {
this.selectedRowKeys = this.preFillContent.affinitygroupids
this.$emit('select-affinity-group-item',
this.preFillContent.affinitygroupids)
} else {
+ if (this.oldZoneId === this.zoneId) {
+ return
+ }
+ this.oldZoneId = this.zoneId
this.selectedRowKeys = []
this.$emit('select-affinity-group-item', null)
}
@@ -116,12 +140,19 @@ export default {
methods: {
handleSearch (value) {
this.filter = value
+ this.options.page = 1
+ this.options.pageSize = 10
this.options.keyword = this.filter
this.$emit('handle-search-filter', this.options)
},
- handleTableChange (pagination) {
- this.options.page = pagination.current
- this.options.pageSize = pagination.pageSize
+ onChangePage (page, pageSize) {
+ this.options.page = page
+ this.options.pageSize = pageSize
+ this.$emit('handle-search-filter', this.options)
+ },
+ onChangePageSize (page, pageSize) {
+ this.options.page = page
+ this.options.pageSize = pageSize
this.$emit('handle-search-filter', this.options)
}
}
diff --git a/src/views/compute/wizard/ComputeOfferingSelection.vue
b/src/views/compute/wizard/ComputeOfferingSelection.vue
index 1f6c0f0..6d72af7 100644
--- a/src/views/compute/wizard/ComputeOfferingSelection.vue
+++ b/src/views/compute/wizard/ComputeOfferingSelection.vue
@@ -25,16 +25,28 @@
<a-table
:columns="columns"
:dataSource="tableSource"
- :pagination="{showSizeChanger: true}"
+ :pagination="false"
:rowSelection="rowSelection"
:loading="loading"
size="middle"
- @change="handleTableChange"
:scroll="{ y: 225 }"
>
<span slot="cpuTitle"><a-icon type="appstore" /> {{ $t('label.cpu')
}}</span>
<span slot="ramTitle"><a-icon type="bulb" /> {{ $t('label.memory')
}}</span>
</a-table>
+
+ <div style="display: block; text-align: right;">
+ <a-pagination
+ size="small"
+ :current="options.page"
+ :pageSize="options.pageSize"
+ :total="rowCount"
+ :showTotal="total => `Total ${total} items`"
+ :pageSizeOptions="['10', '20', '40', '80', '100', '500']"
+ @change="onChangePage"
+ @showSizeChange="onChangePageSize"
+ showSizeChanger />
+ </div>
</div>
</template>
@@ -46,6 +58,10 @@ export default {
type: Array,
default: () => []
},
+ rowCount: {
+ type: Number,
+ default: () => 0
+ },
value: {
type: String,
default: ''
@@ -57,6 +73,10 @@ export default {
preFillContent: {
type: Object,
default: () => {}
+ },
+ zoneId: {
+ type: String,
+ default: () => ''
}
},
data () {
@@ -79,17 +99,16 @@ export default {
width: '30%'
}
],
- selectedRowKeys: []
- }
- },
- computed: {
- options () {
- return {
+ selectedRowKeys: [],
+ oldZoneId: null,
+ options: {
page: 1,
pageSize: 10,
- keyword: ''
+ keyword: null
}
- },
+ }
+ },
+ computed: {
tableSource () {
return this.computeItems.map((item) => {
var cpuNumberValue = item.cpunumber + ''
@@ -137,6 +156,10 @@ export default {
this.selectedRowKeys = [this.preFillContent.computeofferingid]
this.$emit('select-compute-item',
this.preFillContent.computeofferingid)
} else {
+ if (this.oldZoneId === this.zoneId) {
+ return
+ }
+ this.oldZoneId = this.zoneId
if (this.computeItems && this.computeItems.length > 0) {
this.selectedRowKeys = [this.computeItems[0].id]
this.$emit('select-compute-item', this.computeItems[0].id)
@@ -152,12 +175,19 @@ export default {
},
handleSearch (value) {
this.filter = value
+ this.options.page = 1
+ this.options.pageSize = 10
this.options.keyword = this.filter
this.$emit('handle-search-filter', this.options)
},
- handleTableChange (pagination) {
- this.options.page = pagination.current
- this.options.pageSize = pagination.pageSize
+ onChangePage (page, pageSize) {
+ this.options.page = page
+ this.options.pageSize = pageSize
+ this.$emit('handle-search-filter', this.options)
+ },
+ onChangePageSize (page, pageSize) {
+ this.options.page = page
+ this.options.pageSize = pageSize
this.$emit('handle-search-filter', this.options)
}
}
diff --git a/src/views/compute/wizard/DiskOfferingSelection.vue
b/src/views/compute/wizard/DiskOfferingSelection.vue
index c2bdf50..7324eb1 100644
--- a/src/views/compute/wizard/DiskOfferingSelection.vue
+++ b/src/views/compute/wizard/DiskOfferingSelection.vue
@@ -26,10 +26,9 @@
:loading="loading"
:columns="columns"
:dataSource="tableSource"
- :pagination="{showSizeChanger: true}"
+ :pagination="false"
:rowSelection="rowSelection"
size="middle"
- @change="handleTableChange"
:scroll="{ y: 225 }"
>
<span slot="diskSizeTitle"><a-icon type="hdd" /> {{ $t('label.disksize')
}}</span>
@@ -46,6 +45,19 @@
<span v-else>-</span>
</template>
</a-table>
+
+ <div style="display: block; text-align: right;">
+ <a-pagination
+ size="small"
+ :current="options.page"
+ :pageSize="options.pageSize"
+ :total="rowCount"
+ :showTotal="total => `Total ${total} items`"
+ :pageSizeOptions="['10', '20', '40', '80', '100', '500']"
+ @change="onChangePage"
+ @showSizeChange="onChangePageSize"
+ showSizeChanger />
+ </div>
</div>
</template>
@@ -57,6 +69,10 @@ export default {
type: Array,
default: () => []
},
+ rowCount: {
+ type: Number,
+ default: () => 0
+ },
value: {
type: String,
default: ''
@@ -68,6 +84,14 @@ export default {
preFillContent: {
type: Object,
default: () => {}
+ },
+ zoneId: {
+ type: String,
+ default: () => ''
+ },
+ isIsoSelected: {
+ type: Boolean,
+ default: false
}
},
data () {
@@ -93,20 +117,19 @@ export default {
}
],
selectedRowKeys: ['0'],
- dataItems: []
+ dataItems: [],
+ oldZoneId: null,
+ options: {
+ page: 1,
+ pageSize: 10,
+ keyword: null
+ }
}
},
created () {
this.initDataItem()
},
computed: {
- options () {
- return {
- page: 1,
- pageSize: 10,
- keyword: ''
- }
- },
tableSource () {
return this.dataItems.map((item) => {
return {
@@ -145,23 +168,43 @@ export default {
this.selectedRowKeys = [this.preFillContent.diskofferingid]
this.$emit('select-disk-offering-item',
this.preFillContent.diskofferingid)
} else {
+ if (this.oldZoneId === this.zoneId) {
+ return
+ }
+ this.oldZoneId = this.zoneId
this.selectedRowKeys = ['0']
this.$emit('select-disk-offering-item', '0')
}
}
+ },
+ isIsoSelected () {
+ if (this.isIsoSelected) {
+ this.dataItems = this.dataItems.filter(item => item.id !== '0')
+ } else {
+ this.dataItems.unshift({
+ id: '0',
+ name: this.$t('label.noselect'),
+ diskSize: undefined,
+ miniops: undefined,
+ maxiops: undefined,
+ isCustomized: undefined
+ })
+ }
}
},
methods: {
initDataItem () {
this.dataItems = []
- this.dataItems.push({
- id: '0',
- name: this.$t('label.noselect'),
- diskSize: undefined,
- miniops: undefined,
- maxiops: undefined,
- isCustomized: undefined
- })
+ if (this.options.page === 1 && !this.isIsoSelected) {
+ this.dataItems.push({
+ id: '0',
+ name: this.$t('label.noselect'),
+ diskSize: undefined,
+ miniops: undefined,
+ maxiops: undefined,
+ isCustomized: undefined
+ })
+ }
},
onSelectRow (value) {
this.selectedRowKeys = value
@@ -169,12 +212,19 @@ export default {
},
handleSearch (value) {
this.filter = value
+ this.options.page = 1
+ this.options.pageSize = 10
this.options.keyword = this.filter
this.$emit('handle-search-filter', this.options)
},
- handleTableChange (pagination) {
- this.options.page = pagination.current
- this.options.pageSize = pagination.pageSize
+ onChangePage (page, pageSize) {
+ this.options.page = page
+ this.options.pageSize = pageSize
+ this.$emit('handle-search-filter', this.options)
+ },
+ onChangePageSize (page, pageSize) {
+ this.options.page = page
+ this.options.pageSize = pageSize
this.$emit('handle-search-filter', this.options)
}
}
diff --git a/src/views/compute/wizard/NetworkSelection.vue
b/src/views/compute/wizard/NetworkSelection.vue
index 171ef9a..2baf4c3 100644
--- a/src/views/compute/wizard/NetworkSelection.vue
+++ b/src/views/compute/wizard/NetworkSelection.vue
@@ -30,9 +30,8 @@
:columns="columns"
:dataSource="networkItems"
:rowKey="record => record.id"
- :pagination="{showSizeChanger: true, size: 'small'}"
+ :pagination="false"
:rowSelection="rowSelection"
- @change="handleTableChange"
:scroll="{ y: 225 }"
>
<a-list
@@ -51,6 +50,20 @@
</a-list-item>
</a-list>
</a-table>
+
+ <div style="display: block; text-align: right;">
+ <a-pagination
+ size="small"
+ :current="options.page"
+ :pageSize="options.pageSize"
+ :total="rowCount"
+ :showTotal="total => `Total ${total} items`"
+ :pageSizeOptions="['10', '20', '40', '80', '100', '500']"
+ @change="onChangePage"
+ @showSizeChange="onChangePageSize"
+ showSizeChanger />
+ </div>
+
<a-modal
:visible="showCreateForm"
:title="$t('label.add.network')"
@@ -84,6 +97,10 @@ export default {
type: Array,
default: () => []
},
+ rowCount: {
+ type: Number,
+ default: () => 0
+ },
value: {
type: Array,
default: () => []
@@ -111,17 +128,16 @@ export default {
loading: false,
opts: []
},
- showCreateForm: false
- }
- },
- computed: {
- options () {
- return {
+ showCreateForm: false,
+ oldZoneId: null,
+ options: {
page: 1,
pageSize: 10,
- keyword: ''
+ keyword: null
}
- },
+ }
+ },
+ computed: {
columns () {
let vpcFilter = []
if (this.vpcs) {
@@ -189,6 +205,10 @@ export default {
this.$emit('select-network-item', this.preFillContent.networkids)
} else {
if (this.items && this.items.length > 0) {
+ if (this.oldZoneId === this.zoneId) {
+ return
+ }
+ this.oldZoneId = this.zoneId
this.selectedRowKeys = [this.items[0].id]
this.$emit('select-network-item', this.selectedRowKeys)
} else {
@@ -225,12 +245,19 @@ export default {
},
handleSearch (value) {
this.filter = value
+ this.options.page = 1
+ this.options.pageSize = 10
this.options.keyword = this.filter
this.$emit('handle-search-filter', this.options)
},
- handleTableChange (pagination) {
- this.options.page = pagination.current
- this.options.pageSize = pagination.pageSize
+ onChangePage (page, pageSize) {
+ this.options.page = page
+ this.options.pageSize = pageSize
+ this.$emit('handle-search-filter', this.options)
+ },
+ onChangePageSize (page, pageSize) {
+ this.options.page = page
+ this.options.pageSize = pageSize
this.$emit('handle-search-filter', this.options)
},
listNetworkOfferings () {
diff --git a/src/views/compute/wizard/SshKeyPairSelection.vue
b/src/views/compute/wizard/SshKeyPairSelection.vue
index fe830f8..c336256 100644
--- a/src/views/compute/wizard/SshKeyPairSelection.vue
+++ b/src/views/compute/wizard/SshKeyPairSelection.vue
@@ -26,15 +26,26 @@
:loading="loading"
:columns="columns"
:dataSource="tableSource"
- :pagination="{showSizeChanger: true}"
:rowSelection="rowSelection"
+ :pagination="false"
size="middle"
- @change="handleTableChange"
:scroll="{ y: 225 }"
>
<template v-slot:account><a-icon type="user" /> {{ $t('label.account')
}}</template>
<template v-slot:domain><a-icon type="block" /> {{ $t('label.domain')
}}</template>
</a-table>
+ <div style="display: block; text-align: right;">
+ <a-pagination
+ size="small"
+ :current="options.page"
+ :pageSize="options.pageSize"
+ :total="rowCount"
+ :showTotal="total => `Total ${total} items`"
+ :pageSizeOptions="['10', '20', '40', '80', '100', '500']"
+ @change="onChangePage"
+ @showSizeChange="onChangePageSize"
+ showSizeChanger />
+ </div>
</div>
</template>
@@ -46,6 +57,10 @@ export default {
type: Array,
default: () => []
},
+ rowCount: {
+ type: Number,
+ default: () => 0
+ },
value: {
type: String,
default: ''
@@ -57,6 +72,10 @@ export default {
preFillContent: {
type: Object,
default: () => {}
+ },
+ zoneId: {
+ type: String,
+ default: () => ''
}
},
data () {
@@ -80,20 +99,19 @@ export default {
}
],
selectedRowKeys: [this.$t('label.noselect')],
- dataItems: []
+ dataItems: [],
+ oldZoneId: null,
+ options: {
+ page: 1,
+ pageSize: 10,
+ keyword: null
+ }
}
},
created () {
this.initDataItem()
},
computed: {
- options () {
- return {
- page: 1,
- pageSize: 10,
- keyword: ''
- }
- },
tableSource () {
return this.dataItems.map((item) => {
return {
@@ -130,8 +148,12 @@ export default {
this.selectedRowKeys = [this.preFillContent.keypair]
this.$emit('select-ssh-key-pair-item', this.preFillContent.keypair)
} else {
- this.selectedRowKeys = [this.$t('label.noselect')]
- this.$emit('select-ssh-key-pair-item', this.$t('label.noselect'))
+ if (this.oldZoneId === this.zoneId) {
+ return
+ }
+ this.oldZoneId = this.zoneId
+ this.selectedRowKeys = [this.dataItems[0].name]
+ this.$emit('select-ssh-key-pair-item', this.dataItems[0].name)
}
}
}
@@ -139,11 +161,13 @@ export default {
methods: {
initDataItem () {
this.dataItems = []
- this.dataItems.push({
- name: this.$t('label.noselect'),
- account: '-',
- domain: '-'
- })
+ if (this.options.page === 1) {
+ this.dataItems.push({
+ name: this.$t('label.noselect'),
+ account: '-',
+ domain: '-'
+ })
+ }
},
onSelectRow (value) {
this.selectedRowKeys = value
@@ -151,12 +175,19 @@ export default {
},
handleSearch (value) {
this.filter = value
+ this.options.page = 1
+ this.options.pageSize = 10
this.options.keyword = this.filter
this.$emit('handle-search-filter', this.options)
},
- handleTableChange (pagination) {
- this.options.page = pagination.current
- this.options.pageSize = pagination.pageSize
+ onChangePage (page, pageSize) {
+ this.options.page = page
+ this.options.pageSize = pageSize
+ this.$emit('handle-search-filter', this.options)
+ },
+ onChangePageSize (page, pageSize) {
+ this.options.page = page
+ this.options.pageSize = pageSize
this.$emit('handle-search-filter', this.options)
}
}
diff --git a/src/views/compute/wizard/TemplateIsoRadioGroup.vue
b/src/views/compute/wizard/TemplateIsoRadioGroup.vue
index a77d97a..f351aa7 100644
--- a/src/views/compute/wizard/TemplateIsoRadioGroup.vue
+++ b/src/views/compute/wizard/TemplateIsoRadioGroup.vue
@@ -22,7 +22,7 @@
itemLayout="vertical"
size="small"
:dataSource="osList"
- :pagination="pagination">
+ :pagination="false">
<a-list-item slot="renderItem" slot-scope="os, osIndex" key="os.id">
<a-radio-group
class="radio-group"
@@ -57,6 +57,19 @@
</a-radio-group>
</a-list-item>
</a-list>
+
+ <div style="display: block; text-align: right;">
+ <a-pagination
+ size="small"
+ :current="page"
+ :pageSize="pageSize"
+ :total="itemCount"
+ :showTotal="total => `Total ${total} items`"
+ :pageSizeOptions="['10', '20', '40', '80', '100', '500']"
+ @change="onChangePage"
+ @showSizeChange="onChangePageSize"
+ showSizeChanger />
+ </div>
</a-form-item>
</template>
@@ -107,19 +120,6 @@ export default {
this.$emit('emit-update-template-iso', this.inputDecorator, this.value)
},
- computed: {
- pagination () {
- return {
- size: 'small',
- page: 1,
- pageSize: 10,
- total: this.itemCount,
- showSizeChanger: true,
- onChange: this.onChangePage,
- onShowSizeChange: this.onChangePageSize
- }
- }
- },
methods: {
isShared (item) {
return !item.ispublic && (item.account !==
store.getters.userInfo.account)
@@ -131,13 +131,13 @@ export default {
this.$emit('emit-update-template-iso', this.inputDecorator, id)
},
onChangePage (page, pageSize) {
- this.pagination.page = page
- this.pagination.pageSize = pageSize
+ this.page = page
+ this.pageSize = pageSize
this.$forceUpdate()
},
onChangePageSize (page, pageSize) {
- this.pagination.page = page
- this.pagination.pageSize = pageSize
+ this.page = page
+ this.pageSize = pageSize
this.$forceUpdate()
},
onFilterTag (tag) {
diff --git a/src/views/compute/wizard/TemplateIsoSelection.vue
b/src/views/compute/wizard/TemplateIsoSelection.vue
index a935c3e..ae1725e 100644
--- a/src/views/compute/wizard/TemplateIsoSelection.vue
+++ b/src/views/compute/wizard/TemplateIsoSelection.vue
@@ -171,7 +171,6 @@ export default {
beforeCreate () {
this.form = this.$form.createForm(this)
},
- inject: ['vmFetchTemplates', 'vmFetchIsos'],
methods: {
mappingDataSource () {
let mappedItems = {}