X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fqueryupdater%2Fstatic%2Fjs%2Fqueryupdater.js;fp=plugins%2Fqueryupdater%2Fstatic%2Fjs%2Fqueryupdater.js;h=2e7362939773a667f7c5fd18e6c94a4edf828eea;hb=aed78ef2aa329dbc3d15aa9dca4795e5cc4464ed;hp=5d017b9dcf113a31cda96ecb453a0da127c2815f;hpb=f7308899def626ccdb7218a2fc504bf50cd5cafc;p=unfold.git diff --git a/plugins/queryupdater/static/js/queryupdater.js b/plugins/queryupdater/static/js/queryupdater.js index 5d017b9d..2e736293 100644 --- a/plugins/queryupdater/static/js/queryupdater.js +++ b/plugins/queryupdater/static/js/queryupdater.js @@ -75,228 +75,104 @@ do_checksla: function(e) { var username = e.data.options.username; var urn = data.value; - var arrayselectedresources = data.selected_resources; + var arraySelectedResources = data.selected_resources; - var accepted_sla = Array(); + var accepted_sla = []; var count = 0; var self = e.data; - // XXX check that the query is not disabled - - console.log("DATA VALUE: " + data.value); + // var testbedsWithSLA = ["iminds", "fuseco", "netmode"]; + var testbedsWithSLA; - //
SLA description
- //Testbed guarantees 0.99 Uptime rate for 0.99 rate of the VirtualWall resources during the sliver lifetime
- //SLA description
- //Testbed guarantees 0.99 Uptime rate for 0.99 rate of the WiLab2 resources during the sliver lifetime
- var promt = $('#modal-body'); - - // id="myModalLabel" - var flagVW = false; - var flagWi = false; + var sliverPattern = /IDN\+(.+)\+(node|channel)\+/; + var list = []; - promt.append('SLA description
'); + var promt = $('#sla-table-body'); - var wilabForm = ""; - wilabForm += "SLA description
Testbed guarantees 0.99 Uptime rate for 0.99 rate of the VirtualWall resources during the sliver lifetime
'; - - var wallForm = ""; - wallForm += "Testbed guarantees 0.99 Uptime rate for 0.99 rate of the WiLab2 resources during the sliver lifetime
'); - //promt.append(wilabForm); - promt.append('Testbed guarantees 0.99 Uptime rate for 0.99 rate of the VirtualWall resources during the sliver lifetime
'); - //promt.append(wallForm); - promt.append('SLA description
Testbed guarantees 0.99 Uptime rate for 0.99 rate of the VirtualWall resources during the sliver lifetime
' - - if(flagWi || flagVW){ - $('#sla_dialog').show(); - - $('#slamodal-wilab2').modal('show'); - } - else - { - - - var username = e.data.options.username; - var urn = data.value; - // XXX check that the query is not disabled - - self.spin(); - console.log("do_update"); - // XXX check that the query is not disabled - manifold.raise_event(self.options.query_uuid, RUN_UPDATE); - return; - } - - $("#accept_sla_wilab2").click(function(){ - console.log("SLA ACCEPTED"); - console.log("With username: " + username); - - // var promt = $('#modal-body'); - // var notchecked = true; - // for (var i=0;i<50;i++) - // { - // var wielement = $('#wi'+i); - // var wallElement = $('#wall'+i); - // if(wielement != null && !wielement.checked) - // { - // notchecked = false; - // } - // if(wallElement!= null && !wallElement.checked) - // { - // notchecked = false; - // } - // } - - if(flagDouble) - { - $.post("/sla/agreements/simplecreate", - { "template_id": "iMindsServiceWiLab2", - "user": username, - "expiration_time": new Date().toISOString() - }); - $.post("/sla/agreements/simplecreate", - { "template_id": "iMindsServiceVirtualwall", - "user": username, - "expiration_time": new Date().toISOString() - }); - - $('#slamodal-wilab2').modal('hide'); - accepted_sla["wilab2"] = true; - - //manifold.raise_event(self.options.query_uuid, RUN_UPDATE); - } - $('#modal-body').empty(); - }); + }); - $("#dismiss_sla_wilab2").click(function(){ - console.log("SLA NOT ACCEPTED"); - $('#slamodal-wilab2').modal('hide'); - $('#modal-body').empty(); - }); + $("#submit_sla").unbind().click(function(){ + console.log("With username: " + username); + + var notChecked = $("input[name='slaaccept']:not(:checked)"); - // } else { - // this.do_update(e); - // } + if (notChecked.length > 0) { + for (var i = 0; i < notChecked.length; i++) { + console.log("SLA not accepted: " + notChecked[i].value); + } - // for(var iter = 0; iter < arrayselectedresources.length; iter++){ - // var list = ''+arrayselectedresources[iter].toLowerCase()+'