-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
sdntrace/ui/k-info-panel/show_trace_results.kytos
Lines 74 to 154 in 6f65241
| fetchTrace() { | |
| var self = this; | |
| $.ajax({ | |
| async: true, | |
| dataType: "json", | |
| type: "GET", | |
| url: `${self.$kytos_server_api}amlight/sdntrace/v1/trace/${self.traceId}`, | |
| success: function(response) { | |
| if (response?.msg) { | |
| let notification = { | |
| icon: 'gear', | |
| title: 'Trace in progress...' | |
| }; | |
| self.$kytos.eventBus.$emit("setNotification", notification); | |
| } else { | |
| self.trace_results = response.result; | |
| self.updateId = response.request_id; | |
| self.is_empty = !self.trace_results.length; | |
| } | |
| }, | |
| error: function() { | |
| self.is_empty = true; | |
| self.trace_results = []; | |
| } | |
| }); | |
| }, | |
| get_all_traces () { | |
| var self = this | |
| self.get_topology() | |
| let request = $.ajax({ | |
| async: true, | |
| dataType: "json", | |
| type: "GET", | |
| contentType: "application/json", | |
| url: this.$kytos_server_api + "amlight/sdntrace/v1/trace", | |
| }); | |
| request.done(function(data) { | |
| self.trace = data; | |
| self.show_traces(); | |
| }); | |
| request.fail(function(data) { | |
| let notification = { | |
| icon: 'gear', | |
| title: 'Bad request', | |
| description: data.status + ': ' + data.responseJSON.description | |
| }; | |
| self.$kytos.eventBus.$emit("setNotification", notification); | |
| }); | |
| }, | |
| show_traces: function() { | |
| var content = { | |
| "component": 'amlight-sdntrace-k-info-panel-show_all_traces', | |
| "content": this.trace, | |
| "icon": "map-marker", | |
| "maximized": true, | |
| "title": "Trace", | |
| "subtitle": "by amlight/sdntrace" | |
| } | |
| this.$kytos.eventBus.$emit("showInfoPanel", content) | |
| }, | |
| get_topology: function() { | |
| var self = this; | |
| $.ajax({ | |
| async: true, | |
| dataType: "json", | |
| url: this.$kytos_server_api + "kytos/topology/v3", | |
| success: function(data) { | |
| self.switches = data['topology']['switches'] | |
| self.links = data['topology']['links'] | |
| } | |
| }); | |
| } | |
| }, |
jQuery AJAX should be replaced with Axios
Use as reference:
kytos-ng/mef_eline#659
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels