|
90 | 90 | </div> |
91 | 91 | </div> |
92 | 92 | <div class="list__actions"> |
| 93 | + <tooltip-button |
| 94 | + v-if="element.id !== acls[0].id" |
| 95 | + :tooltip="$t('label.move.to.top')" |
| 96 | + icon="vertical-align-top-outlined" |
| 97 | + @onClick="() => moveRuleToTop(element)" /> |
| 98 | + <tooltip-button |
| 99 | + v-if="element.id !== acls[acls.length - 1].id" |
| 100 | + :tooltip="$t('label.move.to.bottom')" |
| 101 | + icon="vertical-align-bottom-outlined" |
| 102 | + @onClick="() => moveRuleToBottom(element)" /> |
93 | 103 | <tooltip-button :tooltip="$t('label.tags')" icon="tag-outlined" @onClick="() => openTagsModal(element)" /> |
94 | 104 | <tooltip-button :tooltip="$t('label.edit')" icon="edit-outlined" @onClick="() => openEditRuleModal(element)" /> |
95 | 105 | <tooltip-button |
@@ -636,6 +646,12 @@ export default { |
636 | 646 |
|
637 | 647 | if (e.moved.newIndex + 1 < this.acls.length) nextaclruleid = this.acls[e.moved.newIndex + 1].id |
638 | 648 |
|
| 649 | + this.moveRule( |
| 650 | + id, |
| 651 | + previousaclruleid, |
| 652 | + nextaclruleid) |
| 653 | + }, |
| 654 | + moveRule (id, previousaclruleid, nextaclruleid) { |
639 | 655 | this.fetchLoading = true |
640 | 656 | api('moveNetworkAclItem', { |
641 | 657 | id, |
@@ -668,6 +684,12 @@ export default { |
668 | 684 | this.fetchLoading = false |
669 | 685 | }) |
670 | 686 | }, |
| 687 | + moveRuleToTop (element) { |
| 688 | + this.moveRule(element.id, null, this.acls[0].id) |
| 689 | + }, |
| 690 | + moveRuleToBottom (element) { |
| 691 | + this.moveRule(element.id, this.acls[this.acls.length - 1].id, null) |
| 692 | + }, |
671 | 693 | exportAclList () { |
672 | 694 | const csvData = this.csv({ data: this.acls }) |
673 | 695 |
|
|
0 commit comments