Skip to content

Commit

Permalink
Merge pull request #223 from kytos-ng/hotfix/issue_220
Browse files Browse the repository at this point in the history
backport/hotfix for issue #220 into 2024.1 -- add confirmation to link enabling/disabling
  • Loading branch information
italovalcy authored Oct 8, 2024
2 parents 10fad8f + 0ce4128 commit 229bf1b
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ All notable changes to the ``topology`` project will be documented in this file.
[UNRELEASED] - Under development
********************************

[2024.1.4] - 2024-10-08
***********************

Changed
=======
- UI: topology link now asks for confirmation when enabling/disabling

[2024.1.3] - 2024-09-13
***********************

Expand Down
2 changes: 1 addition & 1 deletion kytos.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"username": "kytos",
"name": "topology",
"description": "Manage the network topology.",
"version": "2024.1.3",
"version": "2024.1.4",
"napp_dependencies": ["kytos/of_core", "kytos/of_lldp"],
"license": "MIT",
"tags": ["topology", "rest"],
Expand Down
38 changes: 37 additions & 1 deletion ui/k-info-panel/link_info.kytos
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,31 @@
<k-button @click="bt_delete" title="Delete"></k-button>
</div>
</div>
<template v-if="show_modal_state_toggle">
<div class="modal-mask">
<div class="modal-wrapper">
<div class="modal-container">
<div class="modal-header">
<slot name="header">
</slot>
</div>
<div class="modal-body">
<slot name="body">
{{next_state}} Link {{metadata.link_name !== undefined && metadata.link_name.length !== 0? '"' + metadata.link_name + '"' : details.id}}?
</slot>
</div>
<div class="modal-footer">
<slot name="footer">
<k-button tooltip="Cancel" title="Cancel" @click="modal_cancel_state_toggle">
</k-button>
<k-button id="modal-delete" :title="next_state" @click="modal_proceed_state_toggle">
</k-button>
</slot>
</div>
</div>
</div>
</div>
</template>
<template v-if="show_modal">
<div class="modal-mask">
<div class="modal-wrapper">
Expand Down Expand Up @@ -93,6 +118,7 @@
'status_reason': '',
},
show_modal: false,
show_modal_state_toggle: false,
}
},
methods: {
Expand Down Expand Up @@ -140,6 +166,16 @@
this.$kytos.eventBus.$emit("setNotification", notification)
},
bt_state_toggle(){
this.show_modal_state_toggle = true;
},
modal_cancel_state_toggle(){
this.show_modal_state_toggle = false;
},
modal_proceed_state_toggle(){
this.show_modal_state_toggle = false;
this.state_toggle_link();
},
state_toggle_link(){
let request = $.ajax({
type:"POST",
url: this.$kytos_server_api + "kytos/topology/v3/links/" + this.details.id
Expand Down Expand Up @@ -360,4 +396,4 @@
color: #ffc5c5;
background: #be0000;
}
</style>
</style>

0 comments on commit 229bf1b

Please sign in to comment.