Skip to content

Commit

Permalink
Made changes for vue3sfcloader compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
HeriLFIU committed Nov 25, 2024
1 parent 04ec80e commit 90aa97d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions ui/k-toolbar/main.kytos
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,7 @@
<k-input icon="arrow-right"
placeholder='["blue", "red"]'
v-model:value="form_constraints[constraint].not_ownership"
:action="function(val){
try{form_constraints[constraint].metrics.not_ownership = JSON.parse(val)}
catch(e){
if(e instanceof SyntaxError){form_constraints[constraint].metrics.not_ownership=val}
else{throw e}}}"></k-input>
:action="function (val) { set_metrics(val, constraint) }"></k-input>
</div>
</div>
</k-accordion-item>
Expand Down Expand Up @@ -309,6 +305,13 @@ module.exports = {
},
},
methods: {
set_metrics: function (val, constraint) {
try { this.form_constraints[constraint].metrics.not_ownership = JSON.parse(val) }
catch (e) {
if (e instanceof SyntaxError) { this.form_constraints[constraint].metrics.not_ownership = val }
else { throw e }
}
},
parse_check: function (val) {
try { return JSON.parse(val) }
catch (e) {
Expand Down Expand Up @@ -556,11 +559,11 @@ module.exports = {
},
fetch_dpids: function() {
var self = this // create a closure to access component in the callback below
dataUrl = "/api/kytos/topology/v3/interfaces"
let dataUrl = "/api/kytos/topology/v3/interfaces"
// Autocomplete usage example.
fetch(dataUrl).then(response => response.json())
.then(data => {
dpids = []
let dpids = []
for ( const [key,value] of Object.entries( data.interfaces ) ) {
let item = key;
if(value.name) {
Expand Down

0 comments on commit 90aa97d

Please sign in to comment.