mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ui: add move to top/bottom for acl rules list (#9119)
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
parent
c07953cc93
commit
8bb7bbea88
@ -167,6 +167,8 @@ import {
|
|||||||
UserOutlined,
|
UserOutlined,
|
||||||
UserSwitchOutlined,
|
UserSwitchOutlined,
|
||||||
UploadOutlined,
|
UploadOutlined,
|
||||||
|
VerticalAlignBottomOutlined,
|
||||||
|
VerticalAlignTopOutlined,
|
||||||
WarningOutlined,
|
WarningOutlined,
|
||||||
WifiOutlined,
|
WifiOutlined,
|
||||||
SolutionOutlined
|
SolutionOutlined
|
||||||
@ -326,6 +328,8 @@ export default {
|
|||||||
app.component('UserOutlined', UserOutlined)
|
app.component('UserOutlined', UserOutlined)
|
||||||
app.component('UserSwitchOutlined', UserSwitchOutlined)
|
app.component('UserSwitchOutlined', UserSwitchOutlined)
|
||||||
app.component('UploadOutlined', UploadOutlined)
|
app.component('UploadOutlined', UploadOutlined)
|
||||||
|
app.component('VerticalAlignBottomOutlined', VerticalAlignBottomOutlined)
|
||||||
|
app.component('VerticalAlignTopOutlined', VerticalAlignTopOutlined)
|
||||||
app.component('WarningOutlined', WarningOutlined)
|
app.component('WarningOutlined', WarningOutlined)
|
||||||
app.component('WifiOutlined', WifiOutlined)
|
app.component('WifiOutlined', WifiOutlined)
|
||||||
app.component('renderIcon', renderIcon)
|
app.component('renderIcon', renderIcon)
|
||||||
|
|||||||
@ -90,6 +90,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="list__actions">
|
<div class="list__actions">
|
||||||
|
<tooltip-button
|
||||||
|
v-if="element.id !== acls[0].id"
|
||||||
|
:tooltip="$t('label.move.to.top')"
|
||||||
|
icon="vertical-align-top-outlined"
|
||||||
|
@onClick="() => moveRuleToTop(element)" />
|
||||||
|
<tooltip-button
|
||||||
|
v-if="element.id !== acls[acls.length - 1].id"
|
||||||
|
:tooltip="$t('label.move.to.bottom')"
|
||||||
|
icon="vertical-align-bottom-outlined"
|
||||||
|
@onClick="() => moveRuleToBottom(element)" />
|
||||||
<tooltip-button :tooltip="$t('label.tags')" icon="tag-outlined" @onClick="() => openTagsModal(element)" />
|
<tooltip-button :tooltip="$t('label.tags')" icon="tag-outlined" @onClick="() => openTagsModal(element)" />
|
||||||
<tooltip-button :tooltip="$t('label.edit')" icon="edit-outlined" @onClick="() => openEditRuleModal(element)" />
|
<tooltip-button :tooltip="$t('label.edit')" icon="edit-outlined" @onClick="() => openEditRuleModal(element)" />
|
||||||
<tooltip-button
|
<tooltip-button
|
||||||
@ -636,6 +646,12 @@ export default {
|
|||||||
|
|
||||||
if (e.moved.newIndex + 1 < this.acls.length) nextaclruleid = this.acls[e.moved.newIndex + 1].id
|
if (e.moved.newIndex + 1 < this.acls.length) nextaclruleid = this.acls[e.moved.newIndex + 1].id
|
||||||
|
|
||||||
|
this.moveRule(
|
||||||
|
id,
|
||||||
|
previousaclruleid,
|
||||||
|
nextaclruleid)
|
||||||
|
},
|
||||||
|
moveRule (id, previousaclruleid, nextaclruleid) {
|
||||||
this.fetchLoading = true
|
this.fetchLoading = true
|
||||||
api('moveNetworkAclItem', {
|
api('moveNetworkAclItem', {
|
||||||
id,
|
id,
|
||||||
@ -668,6 +684,12 @@ export default {
|
|||||||
this.fetchLoading = false
|
this.fetchLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
moveRuleToTop (element) {
|
||||||
|
this.moveRule(element.id, null, this.acls[0].id)
|
||||||
|
},
|
||||||
|
moveRuleToBottom (element) {
|
||||||
|
this.moveRule(element.id, this.acls[this.acls.length - 1].id, null)
|
||||||
|
},
|
||||||
exportAclList () {
|
exportAclList () {
|
||||||
const csvData = this.csv({ data: this.acls })
|
const csvData = this.csv({ data: this.acls })
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user