From: Loic Baron Date: Sun, 5 Oct 2014 15:53:17 +0000 (+0200) Subject: VTAM & OCF almost integrated X-Git-Tag: myslice-1.2~1^2~17^2~1 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=568d95fec4a3f13dc221e7adc539f3aa20c9a443 VTAM & OCF almost integrated --- diff --git a/plugins/univbrisfv/__init__.py b/plugins/univbrisfv/__init__.py index 93653b9f..6c9aef2f 100644 --- a/plugins/univbrisfv/__init__.py +++ b/plugins/univbrisfv/__init__.py @@ -40,7 +40,7 @@ Current implementation makes the following assumptions as we use 'aoColumnDefs' instead. """ - def __init__ (self, query=None, query_all=None, sync_query=None, + def __init__ (self, query=None, query_all=None, checkboxes=False, columns=None, init_key=None, datatables_options={}, **settings): @@ -49,7 +49,6 @@ Current implementation makes the following assumptions # Until we have a proper way to access queries in Python self.query_all = query_all self.query_all_uuid = query_all.query_uuid if query_all else None - self.sync_query_uuid = sync_query.query_uuid if sync_query else None self.checkboxes = checkboxes # XXX We need to have some hidden columns until we properly handle dynamic queries if columns is not None: @@ -119,6 +118,6 @@ Current implementation makes the following assumptions # the list of things passed to the js plugin def json_settings_list (self): return ['plugin_uuid', 'domid', - 'query_uuid', 'query_all_uuid', 'sync_query_uuid', + 'query_uuid', 'query_all_uuid', 'checkboxes', 'datatables_options', 'hidden_columns', 'init_key',] diff --git a/plugins/univbrisfv/__init__1.py b/plugins/univbrisfv/__init__1.py deleted file mode 100644 index 853bc1ee..00000000 --- a/plugins/univbrisfv/__init__1.py +++ /dev/null @@ -1,40 +0,0 @@ -from unfold.plugin import Plugin - -class UnivbrisFv (Plugin): -""" -//////////////////////////////////////// -modified querytable for univbris foam -///////////////////////////////////////""" - - def __init__ (self, init_key=None,datatables_options={}, **settings): - Plugin.__init__ (self, **settings) - self.columns = list (['switch dpid','port no<->peer dpid/port no.','selected']) - self.init_key=init_key - self.datatables_options=datatables_options - - def template_file (self): - return "univbrisfv.html" - - def template_env (self, request): - env={} - env.update(self.__dict__) - env['columns']=self.columns - return env - - def requirements (self): - reqs = { - 'js_files' : [ "js/spin-presets.js", "js/spin.min.js", "js/jquery.spin.js", - "js/dataTables.js", "js/dataTables.bootstrap.js", "js/with-datatables.js", - "js/manifold.js", "js/manifold-query.js", - "js/unfold-helper.js", - "js/univbrisfv.js", - ] , - 'css_files': [ "css/dataTables.bootstrap.css", - "css/dataTables.full_numbers.css", - "css/univbrisfv.css" , - ],} - return reqs - - # the list of things passed to the js plugin - def json_settings_list (self): - return ['plugin_uuid', 'domid', 'datatables_options', 'init_key',] diff --git a/plugins/univbrisfv/static/js/univbrisfv.js b/plugins/univbrisfv/static/js/univbrisfv.js index 7cefef60..672a674c 100644 --- a/plugins/univbrisfv/static/js/univbrisfv.js +++ b/plugins/univbrisfv/static/js/univbrisfv.js @@ -201,9 +201,9 @@ fnButsubmit:function(e){ - alert("verifying before submitting"); + console.log("verifying before submitting"); - sync_query_uuid=e.data.options.sync_query_uuid; + query_uuid=e.data.options.query_uuid; try{ var controller= $('#controller_loc').val(); @@ -328,7 +328,7 @@ op : STATE_SET_ADD, value: json_rspec } - manifold.raise_event(sync_query_uuid, FIELD_STATE_CHANGED, data); + manifold.raise_event(query_uuid, FIELD_STATE_CHANGED, data); //alert("sending to manifold backend to build rspec"); @@ -343,7 +343,7 @@ fnAddflowspace:function(e){ - sync_query_uuid=e.data.options.sync_query_uuid; + query_uuid=e.data.options.query_uuid; pk_mode=1; hideFvfError(); var port_table=$("#univbris_foam_ports_selection__table").dataTable(); @@ -366,12 +366,12 @@ $("[id='addflowspaceform']").text('add flowspace'); try{ - manifold.raise_event(e.data.options.sync_query_uuid,CLEAR_FILTERS); + manifold.raise_event(e.data.options.query_uuid,CLEAR_FILTERS); var filter=[]; filter.push("link type"); filter.push("!="); filter.push("optical"); - manifold.raise_event(e.data.options.sync_query_uuid,FILTER_ADDED,filter); + manifold.raise_event(e.data.options.query_uuid,FILTER_ADDED,filter); } catch(err){ alert("raise error:"+err); @@ -397,7 +397,7 @@ fnAddcflowspace:function(e){ pk_mode=0; - sync_query_uuid=e.data.options.sync_query_uuid; + query_uuid=e.data.options.query_uuid; hideFvfError(); var port_table=$("#univbris_foam_ports_selection__table").dataTable(); var nodes = $('input',port_table.fnGetNodes()); @@ -416,22 +416,22 @@ $("[id='addflowspaceform']").text('add flowspace'); try{ - manifold.raise_event(e.data.options.sync_query_uuid,CLEAR_FILTERS); + manifold.raise_event(e.data.options.query_uuid,CLEAR_FILTERS); var filter=[]; filter.push("link type"); filter.push("!="); filter.push("packet"); - manifold.raise_event(e.data.options.sync_query_uuid,FILTER_ADDED,filter); + manifold.raise_event(e.data.options.query_uuid,FILTER_ADDED,filter); filter=[]; filter.push("link type"); filter.push("!="); filter.push("compute"); - manifold.raise_event(e.data.options.sync_query_uuid,FILTER_ADDED,filter); + manifold.raise_event(e.data.options.query_uuid,FILTER_ADDED,filter); filter=[]; filter.push("link type"); filter.push("!="); filter.push("federation"); - manifold.raise_event(e.data.options.sync_query_uuid,FILTER_ADDED,filter); + manifold.raise_event(e.data.options.query_uuid,FILTER_ADDED,filter); } catch(err){ alert("raise error:"+err); diff --git a/plugins/univbrisfv/static/js/univbrisfv1.js b/plugins/univbrisfv/static/js/univbrisfv1.js deleted file mode 100644 index 90ca0e8c..00000000 --- a/plugins/univbrisfv/static/js/univbrisfv1.js +++ /dev/null @@ -1,700 +0,0 @@ -/** - * Description: display a query result in a datatables-powered - * Copyright (c) 2012-2013 UPMC Sorbonne Universite - INRIA - * License: GPLv3 - */ - -(function($){ - - var debug=false; - //debug=true - - var UnivbrisFv = Plugin.extend({ - - init: function(options, element) { - //alert("fv init called"); - this.classname="univbrisfv"; - this._super(options, element); - - //alert(this.options.hidden_columns); - /* Member variables */ - // in general we expect 2 queries here - // query_uuid refers to a single object (typically a slice) - // query_all_uuid refers to a list (typically resources or users) - // these can return in any order so we keep track of which has been received yet - //this.received_all_query = True; - //this.received_query = True; - - // We need to remember the active filter for datatables filtering - // this.filters = Array(); - alert("after super"); - // an internal buffer for records that are 'in' and thus need to be checked - this.buffered_records_to_check = []; - // an internal buffer for keeping lines and display them in one call to fnAddData - this.buffered_lines = []; - - /* Events */ - // xx somehow non of these triggers at all for now - //this.elmt().on('show', this, this.on_show); - //this.elmt().on('shown.bs.tab', this, this.on_show); - //this.elmt().on('resize', this, this.on_resize); - - //var query = manifold.query_store.find_analyzed_query(this.options.query_uuid); - //this.object = query.object; - - //// we need 2 different keys - // * canonical_key is the primary key as derived from metadata (typically: urn) - // and is used to communicate about a given record with the other plugins - // * init_key is a key that both kinds of records - // (i.e. records returned by both queries) must have (typically: hrn or hostname) - // in general query_all will return well populated records, but query - // returns records with only the fields displayed on startup - //var keys = manifold.metadata.get_key(this.object); - //this.canonical_key = (keys && keys.length == 1) ? keys[0] : undefined; - //alert("after super"); - this.init_key = this.options.init_key; - // have init_key default to canonical_key - this.init_key = this.init_key || this.canonical_key; - // sanity check - if ( ! this.init_key ) messages.warning ("UnivbrisFv : cannot find init_key"); - if ( ! this.canonical_key ) messages.warning ("UnivbrisFv : cannot find canonical_key"); - if (debug) messages.debug("UnivbrisFv: canonical_key="+this.canonical_key+" init_key="+this.init_key); - - /* Setup query and record handlers */ - //this.listen_query(options.query_uuid); - //this.listen_query(options.query_all_uuid, 'all'); - - /* GUI setup and event binding */ - //alert("fv init called"); - this.initialize_table(); - - }, - - /* PLUGIN EVENTS */ - - on_show: function(e) { - if (debug) messages.debug("univbrisfv.on_show"); - var self = e.data; - self.table.fnAdjustColumnSizing(); - }, - - on_resize: function(e) { - if (debug) messages.debug("univbrisfv.on_resize"); - var self = e.data; - self.table.fnAdjustColumnSizing(); - }, - - /* GUI EVENTS */ - - /* GUI MANIPULATION */ - - initialize_table: function() - { - alert("init table fnc"); - /* Transforms the table into DataTable, and keep a pointer to it */ - var self = this; - var actual_options = { - // Customize the position of Datatables elements (length,filter,button,...) - // we use a fluid row on top and another on the bottom, making sure we take 12 grid elt's each time - //sDom: "<'row'<'col-xs-5'l><'col-xs-1'r><'col-xs-6'f>>t<'row'<'col-xs-5'i><'col-xs-7'p>>", - sDom: "<'row'<'col-xs-9'r>t<'next'>", - // XXX as of sept. 2013, I cannot locate a bootstrap3-friendly mode for now - // hopefully this would come with dataTables v1.10 ? - // in any case, search for 'sPaginationType' all over the code for more comments - sPaginationType: 'bootstrap', - // Handle the null values & the error : Datatables warning Requested unknown parameter - // http://datatables.net/forums/discussion/5331/datatables-warning-...-requested-unknown-parameter/p2 - aoColumnDefs: [{sDefaultContent: '',aTargets: [ '_all' ]}], - // WARNING: this one causes tables in a 'tabs' that are not exposed at the time this is run to show up empty - // sScrollX: '100%', /* Horizontal scrolling */ - bProcessing: true, /* Loading */ - fnDrawCallback: function() { self._querytable_draw_callback.call(self);} - //fnFooterCallback: function() {self._univbrisfv_footer_callback.call(self,nFoot, aData, iStart, iEnd, aiDisplay)};} - // XXX use $.proxy here ! - }; - // the intention here is that options.datatables_options as coming from the python object take precedence - // xxx DISABLED by jordan: was causing errors in datatables.js - // xxx turned back on by Thierry - this is the code that takes python-provided options into account - // check your datatables_options tag instead - // however, we have to accumulate in aoColumnDefs from here (above) - // and from the python wrapper (checkboxes management, plus any user-provided aoColumnDefs) - /*if ( 'aoColumnDefs' in this.options.datatables_options) { - actual_options['aoColumnDefs']=this.options.datatables_options['aoColumnDefs'].concat(actual_options['aoColumnDefs']); - delete this.options.datatables_options['aoColumnDefs']; - }*/ - //this.redraw_table(); - //this.show(); - alert("before 1"); - $.extend(actual_options, this.options.datatables_options ); - this.table = $('#univbris_flowspace_selection__table').dataTable(actual_options); - alert("after 1"); - alert(this.table); - - /* Setup the SelectAll button in the dataTable header */ - /* xxx not sure this is still working */ - var oSelectAll = $('#datatableSelectAll-'+ this.options.plugin_uuid); - oSelectAll.html("Select All"); - oSelectAll.button(); - oSelectAll.css('font-size','11px'); - oSelectAll.css('float','right'); - oSelectAll.css('margin-right','15px'); - oSelectAll.css('margin-bottom','5px'); - oSelectAll.unbind('click'); - oSelectAll.click(this._selectAll); - - /* Add a filtering function to the current table - * Note: we use closure to get access to the 'options' - */ - $.fn.dataTableExt.afnFiltering.push(function( oSettings, aData, iDataIndex ) { - /* No filtering if the table does not match */ - if (oSettings.nTable.id != self.options.plugin_uuid + '__table') - return true; - return self._querytable_filter.call(self, oSettings, aData, iDataIndex); - }); - - //alert(this.options.hidden_columns); - - /* Processing hidden_columns */ - $.each(this.options.hidden_columns, function(i, field) { - //manifold.raise_event(self.options.query_all_uuid, FIELD_REMOVED, field); - //alert (field); - self.hide_column(field); - //self.hide_column(field); - }); - - $('').appendTo('div.next'); - - $('next link').appendTo('div.next'); - alert("before record"); - //this.redraw_table(); - this.new_record("test"); - this._querytable_draw_callback(); - //this.show(e); - alert("after record"); - //this.show_column() - - - }, // initialize_table - - - fnButnext:function(e){ - e.stopPropagation(); - //var sData = this.table.$('input').serialize(); - //var sData = $(this).closest('checkboxes__table').find('input').serialize(); - //var sData = $("form").find('input').serialize(); - //var element=this.table.$("id="'NEC A/80<->NEC B/1080'""); - //var element=this.table.$("[id='"+"NEC A/80<->NEC B/1080"+"']"); - //var x = element.checked; - //var uuid=this.id.split("-"); - //var oTable=$('checkboxes__table').dataTable(); - //var oTable=$.fn.dataTable(); - //this.elts("table").unbind('click').click(this, this.fnButnext); - //var sData = $('input', oTable.fnGetNodes()).serialize(); - //$.fn.dataTable() - //sData="test"; - ///var self = e.data; - //self=self.options.query_uuid; - //var oTable=$("#querytable-"+self).dataTable(); - //var sData = $('input', oTable.fnGetNodes()).serialize(); - //e.stopPropagation(); - //var oTable=$('#myTable').dataTable(); - //var sData = $('input', $("#uob_form")).serialize(); - var sData=$("#uob_form").find("input").serialize(); - //alert("clicked: "+sData); - - //var url = "http://localhost:8000/login/"; - //$(location).attr('href',url); - //window.location.href = "http://localhost:8000/login/" - //window.location.replace("http://localhost:8000/login/"); - //UnivbrisFv(options,elements); - - //$("#next_link").click(); - - }, - - - - /** - * @brief Determine index of key in the table columns - * @param key - * @param cols - */ - getColIndex: function(key, cols) { - var tabIndex = $.map(cols, function(x, i) { if (x.sTitle == key) return i; }); - return (tabIndex.length > 0) ? tabIndex[0] : -1; - }, // getColIndex - - // create a checkbox tag - // computes 'id' attribute from canonical_key - // computes 'init_id' from init_key for initialization phase - // no need to used convoluted ids with plugin-uuid or others, since - // we search using table.$ which looks only in this table - checkbox_html : function (record) { - var result=""; - // Prefix id with plugin_uuid - result += " '+record['hrn']); - } else { - if (record[colnames[j]]) - line.push(record[colnames[j]]); - else - line.push(''); - }*/ - } - - // catch up with the last column if checkboxes were requested - if (this.options.checkboxes) { - // Use a key instead of hostname (hard coded...) - line.push(this.checkbox_html(record)); - } - - // adding an array in one call is *much* more efficient - alert("sending to table"); - $('#univbris_flowspace_selection__table').dataTable().fnAddData(['test']); - //$('#univbris_flowspace_selection__table').dataTable().fnDraw(); - this._querytable_draw_callback(); - alert("sent to table"); - //this.buffered_lines.push(line); - }, - - clear_table: function() - { - this.table.fnClearTable(); - }, - - redraw_table: function() - { - this.table.fnDraw(); - }, - - show_column: function(field) - { - var oSettings = this.table.fnSettings(); - var cols = oSettings.aoColumns; - var index = this.getColIndex(field,cols); - if (index != -1) - this.table.fnSetColumnVis(index, true); - }, - - hide_column: function(field) - { - var oSettings = this.table.fnSettings(); - var cols = oSettings.aoColumns; - var index = this.getColIndex(field,cols); - //index=-1; - //alert(field + ": index: " + index ); - if (index != -1) - //alert(field + ": hidden with index: " + index ); - this.table.fnSetColumnVis(index, false); - }, - - // this is used at init-time, at which point only init_key can make sense - // (because the argument record, if it comes from query, might not have canonical_key set - set_checkbox_from_record: function (record, checked) { - if (checked === undefined) checked = true; - var init_id = record[this.init_key]; - if (debug) messages.debug("univbrisfv.set_checkbox_from_record, init_id="+init_id); - // using table.$ to search inside elements that are not visible - var element = this.table.$('[init_id="'+init_id+'"]'); - element.attr('checked',checked); - }, - - // id relates to canonical_key - set_checkbox_from_data: function (id, checked) { - if (checked === undefined) checked = true; - if (debug) messages.debug("univbrisfv.set_checkbox_from_data, id="+id); - // using table.$ to search inside elements that are not visible - var element = this.table.$("[id='"+id+"']"); - element.attr('checked',checked); - }, - - /*************************** QUERY HANDLER ****************************/ - - on_filter_added: function(filter) - { - this.filters.push(filter); - this.redraw_table(); - }, - - on_filter_removed: function(filter) - { - // Remove corresponding filters - this.filters = $.grep(this.filters, function(x) { - return x != filter; - }); - this.redraw_table(); - }, - - on_filter_clear: function() - { - // XXX - this.redraw_table(); - }, - - on_field_added: function(field) - { - this.show_column(field); - }, - - on_field_removed: function(field) - { - this.hide_column(field); - }, - - on_field_clear: function() - { - alert('UnivbrisFv::clear_fields() not implemented'); - }, - - /* XXX TODO: make this generic a plugin has to subscribe to a set of Queries to avoid duplicated code ! */ - /*************************** ALL QUERY HANDLER ****************************/ - - on_all_filter_added: function(filter) - { - // XXX - this.redraw_table(); - }, - - on_all_filter_removed: function(filter) - { - // XXX - this.redraw_table(); - }, - - on_all_filter_clear: function() - { - // XXX - this.redraw_table(); - }, - - on_all_field_added: function(field) - { - this.show_column(field); - }, - - on_all_field_removed: function(field) - { - this.hide_column(field); - }, - - on_all_field_clear: function() - { - alert('UnivbrisFv::clear_fields() not implemented'); - }, - - - /*************************** RECORD HANDLER ***************************/ - - on_new_record: function(record) - { - if (this.received_all_query) { - // if the 'all' query has been dealt with already we may turn on the checkbox - this.set_checkbox_from_record(record, true); - } else { - this.buffered_records_to_check.push(record); - } - }, - - on_clear_records: function() - { - }, - - // Could be the default in parent - on_query_in_progress: function() - { - this.spin(); - }, - - on_query_done: function() - { - this.received_query = true; - // unspin once we have received both - if (this.received_all_query && this.received_query) this.unspin(); - }, - - on_field_state_changed: function(data) - { - switch(data.request) { - case FIELD_REQUEST_ADD: - case FIELD_REQUEST_ADD_RESET: - this.set_checkbox_from_data(data.value, true); - break; - case FIELD_REQUEST_REMOVE: - case FIELD_REQUEST_REMOVE_RESET: - this.set_checkbox_from_data(data.value, false); - break; - default: - break; - } - }, - - /* XXX TODO: make this generic a plugin has to subscribe to a set of Queries to avoid duplicated code ! */ - // all - on_all_field_state_changed: function(data) - { - switch(data.request) { - case FIELD_REQUEST_ADD: - case FIELD_REQUEST_ADD_RESET: - this.set_checkboxfrom_data(data.value, true); - break; - case FIELD_REQUEST_REMOVE: - case FIELD_REQUEST_REMOVE_RESET: - this.set_checkbox_from_data(data.value, false); - break; - default: - break; - } - }, - - on_all_new_record: function(record) - { - this.new_record(record); - }, - - on_all_clear_records: function() - { - this.clear_table(); - - }, - - on_all_query_in_progress: function() - { - // XXX parent - this.spin(); - }, // on_all_query_in_progress - - on_all_query_done: function() - { - if (debug) messages.debug("1-shot initializing dataTables content with " + this.buffered_lines.length + " lines"); - this.table.fnAddData (this.buffered_lines); - this.buffered_lines=[]; - - var self = this; - // if we've already received the slice query, we have not been able to set - // checkboxes on the fly at that time (dom not yet created) - $.each(this.buffered_records_to_check, function(i, record) { - if (debug) messages.debug ("querytable delayed turning on checkbox " + i + " record= " + record); - self.set_checkbox_from_record(record, true); - }); - this.buffered_records_to_check = []; - - this.received_all_query = true; - // unspin once we have received both - if (this.received_all_query && this.received_query) this.unspin(); - - }, // on_all_query_done - - /************************** PRIVATE METHODS ***************************/ - - /** - * @brief QueryTable filtering function - */ - _querytable_filter: function(oSettings, aData, iDataIndex) - { - var ret = true; - $.each (this.filters, function(index, filter) { - /* XXX How to manage checkbox ? */ - var key = filter[0]; - var op = filter[1]; - var value = filter[2]; - - /* Determine index of key in the table columns */ - var col = $.map(oSettings.aoColumns, function(x, i) {if (x.sTitle == key) return i;})[0]; - - /* Unknown key: no filtering */ - if (typeof(col) == 'undefined') - return; - - col_value=unfold.get_value(aData[col]); - /* Test whether current filter is compatible with the column */ - if (op == '=' || op == '==') { - if ( col_value != value || col_value==null || col_value=="" || col_value=="n/a") - ret = false; - }else if (op == '!=') { - if ( col_value == value || col_value==null || col_value=="" || col_value=="n/a") - ret = false; - } else if(op=='<') { - if ( parseFloat(col_value) >= value || col_value==null || col_value=="" || col_value=="n/a") - ret = false; - } else if(op=='>') { - if ( parseFloat(col_value) <= value || col_value==null || col_value=="" || col_value=="n/a") - ret = false; - } else if(op=='<=' || op=='≤') { - if ( parseFloat(col_value) > value || col_value==null || col_value=="" || col_value=="n/a") - ret = false; - } else if(op=='>=' || op=='≥') { - if ( parseFloat(col_value) < value || col_value==null || col_value=="" || col_value=="n/a") - ret = false; - }else{ - // How to break out of a loop ? - alert("filter not supported"); - return false; - } - - }); - return ret; - }, - - _querytable_draw_callback: function() - { - /* - * Handle clicks on checkboxes: reassociate checkbox click every time - * the table is redrawn - */ - this.elts('querytable-checkbox').unbind('click').click(this, this._check_click); - this.elts("next").unbind('click').click(this, this.fnButnext); - - - if (!this.table) - return; - - /* Remove pagination if we show only a few results */ - var wrapper = this.table; //.parent().parent().parent(); - var rowsPerPage = this.table.fnSettings()._iDisplayLength; - var rowsToShow = this.table.fnSettings().fnRecordsDisplay(); - var minRowsPerPage = this.table.fnSettings().aLengthMenu[0]; - - if ( rowsToShow <= rowsPerPage || rowsPerPage == -1 ) { - $('.querytable_paginate', wrapper).css('visibility', 'hidden'); - } else { - $('.querytable_paginate', wrapper).css('visibility', 'visible'); - } - - if ( rowsToShow <= minRowsPerPage ) { - $('.querytable_length', wrapper).css('visibility', 'hidden'); - } else { - $('.querytable_length', wrapper).css('visibility', 'visible'); - } - - }, - - - - _check_click: function(e) - { - e.stopPropagation(); - - var self = e.data; - var id=this.id; - - // this.id = key of object to be added... what about multiple keys ? - if (debug) messages.debug("querytable._check_click key="+this.canonical_key+"->"+id+" checked="+this.checked); - manifold.raise_event(self.options.query_uuid, this.checked?SET_ADD:SET_REMOVED, id); - //return false; // prevent checkbox to be checked, waiting response from manifold plugin api - - }, - - _selectAll: function() - { - // requires jQuery id - var uuid=this.id.split("-"); - var oTable=$("#querytable-"+uuid[1]).dataTable(); - // Function available in QueryTable 1.9.x - // Filter : displayed data only - var filterData = oTable._('tr', {"filter":"applied"}); - /* TODO: WARNING if too many nodes selected, use filters to reduce nuber of nodes */ - if(filterData.length<=100){ - $.each(filterData, function(index, obj) { - var last=$(obj).last(); - var key_value=unfold.get_value(last[0]); - if(typeof($(last[0]).attr('checked'))=="undefined"){ - $.publish('selected', 'add/'+key_value); - } - }); - } - }, - - }); - - $.plugin('UnivbrisFv', UnivbrisFv); - - /* define the 'dom-checkbox' type for sorting in datatables - http://datatables.net/examples/plug-ins/dom_sort.html - using trial and error I found that the actual column number - was in fact given as a third argument, and not second - as the various online resources had it - go figure */ - $.fn.dataTableExt.afnSortData['dom-checkbox'] = function ( oSettings, _, iColumn ) { - return $.map( oSettings.oApi._fnGetTrNodes(oSettings), function (tr, i) { - return result=$('td:eq('+iColumn+') input', tr).prop('checked') ? '1' : '0'; - } ); - } - -})(jQuery); - diff --git a/plugins/univbrisfv/static/js/univbrisfv2.js b/plugins/univbrisfv/static/js/univbrisfv2.js deleted file mode 100644 index 3048b1e0..00000000 --- a/plugins/univbrisfv/static/js/univbrisfv2.js +++ /dev/null @@ -1,695 +0,0 @@ -/** - * Description: display a query result in a datatables-powered
- * Copyright (c) 2012-2013 UPMC Sorbonne Universite - INRIA - * License: GPLv3 - */ - -(function($){ - - var debug=false; - debug=true - - var UnivbrisFv = Plugin.extend({ - - init: function(options, element) { - //alert("foam init called"); - this.classname="univbrisfv"; - this._super(options, element); - - //alert(this.options.hidden_columns); - /* Member variables */ - // in general we expect 2 queries here - // query_uuid refers to a single object (typically a slice) - // query_all_uuid refers to a list (typically resources or users) - // these can return in any order so we keep track of which has been received yet - //this.received_all_query = false; - //this.received_query = false; - - // We need to remember the active filter for datatables filtering - this.filters = Array(); - - // an internal buffer for records that are 'in' and thus need to be checked - this.buffered_records_to_check = []; - // an internal buffer for keeping lines and display them in one call to fnAddData - this.buffered_lines = []; - - /* Events */ - // xx somehow non of these triggers at all for now - //this.elmt().on('show', this, this.on_show); - //this.elmt().on('shown.bs.tab', this, this.on_show); - //this.elmt().on('resize', this, this.on_resize); - - //var query = manifold.query_store.find_analyzed_query(this.options.query_uuid); - //this.object = query.object; - - //// we need 2 different keys - // * canonical_key is the primary key as derived from metadata (typically: urn) - // and is used to communicate about a given record with the other plugins - // * init_key is a key that both kinds of records - // (i.e. records returned by both queries) must have (typically: hrn or hostname) - // in general query_all will return well populated records, but query - // returns records with only the fields displayed on startup - var keys = manifold.metadata.get_key(this.object); - this.canonical_key = (keys && keys.length == 1) ? keys[0] : undefined; - // - this.init_key = this.options.init_key; - // have init_key default to canonical_key - this.init_key = this.init_key || this.canonical_key; - // sanity check - if ( ! this.init_key ) messages.warning ("UnivbrisFv : cannot find init_key"); - if ( ! this.canonical_key ) messages.warning ("UnivbrisFv : cannot find canonical_key"); - if (debug) messages.debug("UnivbrisFv: canonical_key="+this.canonical_key+" init_key="+this.init_key); - - /* Setup query and record handlers */ - //this.listen_query(options.query_uuid); - //this.listen_query(options.query_all_uuid, 'all'); - - /* GUI setup and event binding */ - this.initialize_table(); - - }, - - /* PLUGIN EVENTS */ - - on_show: function(e) { - if (debug) messages.debug("univbrisfv.on_show"); - var self = e.data; - self.table.fnAdjustColumnSizing(); - }, - - on_resize: function(e) { - if (debug) messages.debug("univbrisfv.on_resize"); - var self = e.data; - self.table.fnAdjustColumnSizing(); - }, - - /* GUI EVENTS */ - - /* GUI MANIPULATION */ - - initialize_table: function() - { - /* Transforms the table into DataTable, and keep a pointer to it */ - var self = this; - var actual_options = { - // Customize the position of Datatables elements (length,filter,button,...) - // we use a fluid row on top and another on the bottom, making sure we take 12 grid elt's each time - //sDom: "<'row'<'col-xs-5'l><'col-xs-1'r><'col-xs-6'f>>t<'row'<'col-xs-5'i><'col-xs-7'p>>", - sDom: "<'row'<'col-xs-5'l><'col-xs-1'r><'col-xs-6'f>>t<'row'<'col-xs-5'i><'col-xs-7'p>><'buttons'>", - //sDom: "<'row'<'col-xs-9'r>t<'buttons'>", - // XXX as of sept. 2013, I cannot locate a bootstrap3-friendly mode for now - // hopefully this would come with dataTables v1.10 ? - // in any case, search for 'sPaginationType' all over the code for more comments - sPaginationType: 'bootstrap', - // Handle the null values & the error : Datatables warning Requested unknown parameter - // http://datatables.net/forums/discussion/5331/datatables-warning-...-requested-unknown-parameter/p2 - aoColumnDefs: [{sDefaultContent: '',aTargets: [ '_all' ]}], - // WARNING: this one causes tables in a 'tabs' that are not exposed at the time this is run to show up empty - // sScrollX: '100%', /* Horizontal scrolling */ - bProcessing: true, /* Loading */ - fnDrawCallback: function() { self._querytable_draw_callback.call(self);} - //fnFooterCallback: function() {self._univbrisfv_footer_callback.call(self,nFoot, aData, iStart, iEnd, aiDisplay)};} - // XXX use $.proxy here ! - }; - // the intention here is that options.datatables_options as coming from the python object take precedence - // xxx DISABLED by jordan: was causing errors in datatables.js - // xxx turned back on by Thierry - this is the code that takes python-provided options into account - // check your datatables_options tag instead - // however, we have to accumulate in aoColumnDefs from here (above) - // and from the python wrapper (checkboxes management, plus any user-provided aoColumnDefs) - if ( 'aoColumnDefs' in this.options.datatables_options) { - actual_options['aoColumnDefs']=this.options.datatables_options['aoColumnDefs'].concat(actual_options['aoColumnDefs']); - delete this.options.datatables_options['aoColumnDefs']; - } - $.extend(actual_options, this.options.datatables_options ); - this.table = $("#univbris_flowspace_selection__table").dataTable(actual_options); - - - //alert(this.table.$("name")); - - /* Setup the SelectAll button in the dataTable header */ - /* xxx not sure this is still working */ - var oSelectAll = $('#datatableSelectAll-'+ this.options.plugin_uuid); - oSelectAll.html("Select All"); - oSelectAll.button(); - oSelectAll.css('font-size','11px'); - oSelectAll.css('float','right'); - oSelectAll.css('margin-right','15px'); - oSelectAll.css('margin-bottom','5px'); - oSelectAll.unbind('click'); - oSelectAll.click(this._selectAll); - - /* Add a filtering function to the current table - * Note: we use closure to get access to the 'options' - */ - $.fn.dataTableExt.afnFiltering.push(function( oSettings, aData, iDataIndex ) { - /* No filtering if the table does not match */ - if (oSettings.nTable.id != self.options.plugin_uuid + '__table') - return true; - return self._querytable_filter.call(self, oSettings, aData, iDataIndex); - }); - - //alert(this.options.hidden_columns); - - /* Processing hidden_columns */ - $.each(this.options.hidden_columns, function(i, field) { - //manifold.raise_event(self.options.query_all_uuid, FIELD_REMOVED, field); - //alert (field); - self.hide_column(field); - //self.hide_column(field); - }); - - //document.getElementById('buttons').text-align='center'; - - /**$('
').appendTo('div.buttons'); - - $('
').appendTo('div.buttons'); - - $('
').appendTo('div.buttons'); - - $('').appendTo('div.buttons');**/ - - - jQuery( "#univbris_flowspace_selection" ).hide(); - - //$('next link').appendTo('div.submit'); - - //this.new_record("t"); - //this.new_record("t"); - //this.new_record("t"); - //this.new_record("t"); - //this.new_record("t"); - this._querytable_draw_callback(); - - - - }, // initialize_table - - - fnButsubmit:function(e){ - alert("submitting flowspaces to AM (TO BE IMPLEMENTED)"); - - - }, - - fnAddflowspace:function(e){ - this.table = $("#univbris_flowspace_selection__table").dataTable(); - //alert("table length" + this.table.fnGetNodes().length); - $("#flowspace_name").val("flowspace"+(this.table.fnGetNodes().length+1)); - jQuery( "#univbris_flowspace_selection" ).hide(); - jQuery("#uob_fv_table_form").show(); - }, - - - - - - /** - * @brief Determine index of key in the table columns - * @param key - * @param cols - */ - getColIndex: function(key, cols) { - var tabIndex = $.map(cols, function(x, i) { if (x.sTitle == key) return i; }); - return (tabIndex.length > 0) ? tabIndex[0] : -1; - }, // getColIndex - - // create a checkbox tag - // computes 'id' attribute from canonical_key - // computes 'init_id' from init_key for initialization phase - // no need to used convoluted ids with plugin-uuid or others, since - // we search using table.$ which looks only in this table - checkbox_html : function (record) { - var result=""; - // Prefix id with plugin_uuid - result += " '+record['hrn']); - } else { - if (record[colnames[j]]) - line.push(record[colnames[j]]); - else - line.push(''); - }*/ - } - - // catch up with the last column if checkboxes were requested - if (this.options.checkboxes) { - // Use a key instead of hostname (hard coded...) - line.push(this.checkbox_html(record)); - } - - // adding an array in one call is *much* more efficient - // this.table.fnAddData(line); - this.buffered_lines.push(line); - this.table.fnAddData(this.buffered_lines); - //this.table.redraw(); - //this._querytable_draw_callback(); - }, - - clear_table: function() - { - this.table.fnClearTable(); - }, - - redraw_table: function() - { - this.table.fnDraw(); - }, - - show_column: function(field) - { - var oSettings = this.table.fnSettings(); - var cols = oSettings.aoColumns; - var index = this.getColIndex(field,cols); - if (index != -1) - this.table.fnSetColumnVis(index, true); - }, - - hide_column: function(field) - { - var oSettings = this.table.fnSettings(); - var cols = oSettings.aoColumns; - var index = this.getColIndex(field,cols); - //index=-1; - //alert(field + ": index: " + index ); - if (index != -1) - //alert(field + ": hidden with index: " + index ); - this.table.fnSetColumnVis(index, false); - }, - - // this is used at init-time, at which point only init_key can make sense - // (because the argument record, if it comes from query, might not have canonical_key set - set_checkbox_from_record: function (record, checked) { - if (checked === undefined) checked = true; - var init_id = record[this.init_key]; - if (debug) messages.debug("univbrisfv.set_checkbox_from_record, init_id="+init_id); - // using table.$ to search inside elements that are not visible - var element = this.table.$('[init_id="'+init_id+'"]'); - element.attr('checked',checked); - }, - - // id relates to canonical_key - set_checkbox_from_data: function (id, checked) { - if (checked === undefined) checked = true; - if (debug) messages.debug("univbrisfv.set_checkbox_from_data, id="+id); - // using table.$ to search inside elements that are not visible - var element = this.table.$("[id='"+id+"']"); - element.attr('checked',checked); - }, - - /*************************** QUERY HANDLER ****************************/ - - on_filter_added: function(filter) - { - this.filters.push(filter); - this.redraw_table(); - }, - - on_filter_removed: function(filter) - { - // Remove corresponding filters - this.filters = $.grep(this.filters, function(x) { - return x != filter; - }); - this.redraw_table(); - }, - - on_filter_clear: function() - { - // XXX - this.redraw_table(); - }, - - on_field_added: function(field) - { - this.show_column(field); - }, - - on_field_removed: function(field) - { - this.hide_column(field); - }, - - on_field_clear: function() - { - alert('UnivbrisFv::clear_fields() not implemented'); - }, - - /* XXX TODO: make this generic a plugin has to subscribe to a set of Queries to avoid duplicated code ! */ - /*************************** ALL QUERY HANDLER ****************************/ - - on_all_filter_added: function(filter) - { - // XXX - this.redraw_table(); - }, - - on_all_filter_removed: function(filter) - { - // XXX - this.redraw_table(); - }, - - on_all_filter_clear: function() - { - // XXX - this.redraw_table(); - }, - - on_all_field_added: function(field) - { - this.show_column(field); - }, - - on_all_field_removed: function(field) - { - this.hide_column(field); - }, - - on_all_field_clear: function() - { - alert('UnivbrisFv::clear_fields() not implemented'); - }, - - - /*************************** RECORD HANDLER ***************************/ - - on_new_record: function(record) - { - if (this.received_all_query) { - // if the 'all' query has been dealt with already we may turn on the checkbox - this.set_checkbox_from_record(record, true); - } else { - this.buffered_records_to_check.push(record); - } - }, - - on_clear_records: function() - { - }, - - // Could be the default in parent - on_query_in_progress: function() - { - this.spin(); - }, - - on_query_done: function() - { - this.received_query = true; - // unspin once we have received both - if (this.received_all_query && this.received_query) this.unspin(); - }, - - on_field_state_changed: function(data) - { - switch(data.request) { - case FIELD_REQUEST_ADD: - case FIELD_REQUEST_ADD_RESET: - this.set_checkbox_from_data(data.value, true); - break; - case FIELD_REQUEST_REMOVE: - case FIELD_REQUEST_REMOVE_RESET: - this.set_checkbox_from_data(data.value, false); - break; - default: - break; - } - }, - - /* XXX TODO: make this generic a plugin has to subscribe to a set of Queries to avoid duplicated code ! */ - // all - on_all_field_state_changed: function(data) - { - switch(data.request) { - case FIELD_REQUEST_ADD: - case FIELD_REQUEST_ADD_RESET: - this.set_checkboxfrom_data(data.value, true); - break; - case FIELD_REQUEST_REMOVE: - case FIELD_REQUEST_REMOVE_RESET: - this.set_checkbox_from_data(data.value, false); - break; - default: - break; - } - }, - - on_all_new_record: function(record) - { - this.new_record(record); - }, - - on_all_clear_records: function() - { - this.clear_table(); - - }, - - on_all_query_in_progress: function() - { - // XXX parent - this.spin(); - }, // on_all_query_in_progress - - on_all_query_done: function() - { - if (debug) messages.debug("1-shot initializing dataTables content with " + this.buffered_lines.length + " lines"); - this.table.fnAddData (this.buffered_lines); - this.buffered_lines=[]; - - var self = this; - // if we've already received the slice query, we have not been able to set - // checkboxes on the fly at that time (dom not yet created) - $.each(this.buffered_records_to_check, function(i, record) { - if (debug) messages.debug ("querytable delayed turning on checkbox " + i + " record= " + record); - self.set_checkbox_from_record(record, true); - }); - this.buffered_records_to_check = []; - - this.received_all_query = true; - // unspin once we have received both - if (this.received_all_query && this.received_query) this.unspin(); - - }, // on_all_query_done - - /************************** PRIVATE METHODS ***************************/ - - /** - * @brief QueryTable filtering function - */ - _querytable_filter: function(oSettings, aData, iDataIndex) - { - var ret = true; - $.each (this.filters, function(index, filter) { - /* XXX How to manage checkbox ? */ - var key = filter[0]; - var op = filter[1]; - var value = filter[2]; - - /* Determine index of key in the table columns */ - var col = $.map(oSettings.aoColumns, function(x, i) {if (x.sTitle == key) return i;})[0]; - - /* Unknown key: no filtering */ - if (typeof(col) == 'undefined') - return; - - col_value=unfold.get_value(aData[col]); - /* Test whether current filter is compatible with the column */ - if (op == '=' || op == '==') { - if ( col_value != value || col_value==null || col_value=="" || col_value=="n/a") - ret = false; - }else if (op == '!=') { - if ( col_value == value || col_value==null || col_value=="" || col_value=="n/a") - ret = false; - } else if(op=='<') { - if ( parseFloat(col_value) >= value || col_value==null || col_value=="" || col_value=="n/a") - ret = false; - } else if(op=='>') { - if ( parseFloat(col_value) <= value || col_value==null || col_value=="" || col_value=="n/a") - ret = false; - } else if(op=='<=' || op=='≤') { - if ( parseFloat(col_value) > value || col_value==null || col_value=="" || col_value=="n/a") - ret = false; - } else if(op=='>=' || op=='≥') { - if ( parseFloat(col_value) < value || col_value==null || col_value=="" || col_value=="n/a") - ret = false; - }else{ - // How to break out of a loop ? - alert("filter not supported"); - return false; - } - - }); - return ret; - }, - - _querytable_draw_callback: function() - { - /* - * Handle clicks on checkboxes: reassociate checkbox click every time - * the table is redrawn - */ - this.elts('querytable-checkbox').unbind('click').click(this, this._check_click); - $("#submit_flowspace").unbind('click').click(this, this.fnButsubmit); - $("#add_flowspace").unbind('click').click(this, this.fnAddflowspace); - - if (!this.table) - return; - - /* Remove pagination if we show only a few results */ - var wrapper = this.table; //.parent().parent().parent(); - var rowsPerPage = this.table.fnSettings()._iDisplayLength; - var rowsToShow = this.table.fnSettings().fnRecordsDisplay(); - var minRowsPerPage = this.table.fnSettings().aLengthMenu[0]; - - if ( rowsToShow <= rowsPerPage || rowsPerPage == -1 ) { - $('.querytable_paginate', wrapper).css('visibility', 'hidden'); - } else { - $('.querytable_paginate', wrapper).css('visibility', 'visible'); - } - - if ( rowsToShow <= minRowsPerPage ) { - $('.querytable_length', wrapper).css('visibility', 'hidden'); - } else { - $('.querytable_length', wrapper).css('visibility', 'visible'); - } - - }, - - - - _check_click: function(e) - { - e.stopPropagation(); - - var self = e.data; - var id=this.id; - - // this.id = key of object to be added... what about multiple keys ? - if (debug) messages.debug("querytable._check_click key="+this.canonical_key+"->"+id+" checked="+this.checked); - //manifold.raise_event(self.options.query_uuid, this.checked?SET_ADD:SET_REMOVED, id); - //return false; // prevent checkbox to be checked, waiting response from manifold plugin api - - }, - - _selectAll: function() - { - // requires jQuery id - var uuid=this.id.split("-"); - var oTable=$("#querytable-"+uuid[1]).dataTable(); - // Function available in QueryTable 1.9.x - // Filter : displayed data only - var filterData = oTable._('tr', {"filter":"applied"}); - /* TODO: WARNING if too many nodes selected, use filters to reduce nuber of nodes */ - if(filterData.length<=100){ - $.each(filterData, function(index, obj) { - var last=$(obj).last(); - var key_value=unfold.get_value(last[0]); - if(typeof($(last[0]).attr('checked'))=="undefined"){ - $.publish('selected', 'add/'+key_value); - } - }); - } - }, - - }); - - $.plugin('UnivbrisFv', UnivbrisFv); - - /* define the 'dom-checkbox' type for sorting in datatables - http://datatables.net/examples/plug-ins/dom_sort.html - using trial and error I found that the actual column number - was in fact given as a third argument, and not second - as the various online resources had it - go figure */ - $.fn.dataTableExt.afnSortData['dom-checkbox'] = function ( oSettings, _, iColumn ) { - return $.map( oSettings.oApi._fnGetTrNodes(oSettings), function (tr, i) { - return result=$('td:eq('+iColumn+') input', tr).prop('checked') ? '1' : '0'; - } ); - } - -})(jQuery); - diff --git a/plugins/univbrisvtam/static/js/univbrisvtam.js b/plugins/univbrisvtam/static/js/univbrisvtam.js index 13bea949..86341ff8 100644 --- a/plugins/univbrisvtam/static/js/univbrisvtam.js +++ b/plugins/univbrisvtam/static/js/univbrisvtam.js @@ -153,8 +153,7 @@ fnCreateVms:function(e){ console.log("building json to send to backend"); - var testbeds=[]; - + var vms=[]; try{ var rows = $("#univbris_vtam__table").dataTable().fnGetNodes(); @@ -163,74 +162,46 @@ } else{ for(var i=0;i0){ + // add the current vm to vms + $.each( vms, function( i, s_vm ) { + // if the server is already listed in vms, add a new vm to the server + s = Object.keys(s_vm); + vm = s_vm[s[0]]; + + if(s[0] == current_server[0]){ + vm_exists = false; + // XXX We should also loop on the vm names + $.each( vm, function( i, vm_name ) { + if(vm_name == current_vm[0]){ + vm_exists = true; + return; + } + }); + if (vm_exists == false){ + vm.push(current_vm[0]); + } + // else add the server with the current vm + }else{ + vms.push(t_server_vm); + } + }); + }else{ + vms.push(t_server_vm); + } } - var rspecs = JSON.stringify(testbeds); + var rspecs = JSON.stringify(vms); console.log(rspecs); + // manifold.raise_event(self.options.query_uuid, ...); } } diff --git a/plugins/univbrisvtamform/static/js/univbrisvtamform.js b/plugins/univbrisvtamform/static/js/univbrisvtamform.js index 88d3ce74..ac0df1a9 100644 --- a/plugins/univbrisvtamform/static/js/univbrisvtamform.js +++ b/plugins/univbrisvtamform/static/js/univbrisvtamform.js @@ -72,7 +72,7 @@ if(vt_servers_list[i].testbed==$('#uob_testbed_name option:selected').text()){ $('#uob_virtualization_server') .append($("") - .attr("value",vt_servers_list[i].name) + .attr("value",vt_servers_list[i].urn) .text(vt_servers_list[i].name)); } } @@ -91,9 +91,13 @@ //console.log($("#uob_vm_name").val()); if (vmNameVal.test($("#uob_vm_name").val())){ //build form string - var vtam="testbed:"+$('#uob_testbed_name option:selected').text(); - vtam +=",vt_server:"+$('#uob_virtualization_server option:selected').text(); - vtam +=",vm_name:"+$("#uob_vm_name").val(); + //{"urn:publicid:IDN+vtam.univbris+node+uclalien":[{"name":"toto"}]} + var vtam='{"'+$('#uob_virtualization_server option:selected').val()+'":'; + vtam+='[{"name":"'+$('#uob_vm_name').val()+'"}]}'; + //var vtam="testbed="+$('#uob_testbed_name option:selected').text(); + // Use the URN instead of the hostname of the server + //vtam +=",vt_server="+$('#uob_virtualization_server option:selected').val(); + //vtam +=",vm_name="+$("#uob_vm_name").val(); var vm_name="

"+$("#uob_vm_name").val()+"

"; var vtamtable = $("#univbris_vtam__table").dataTable(); vtamtable.fnAddData([$('#uob_testbed_name option:selected').text(),$('#uob_virtualization_server option:selected').text(), vm_name,'Delete']); @@ -129,6 +133,7 @@ vt_server['name']=com_ay[com_ay.length-1]; var testbed_ay=com_ay[1].split(":"); vt_server['testbed']=testbed_ay[0]; + vt_server['urn']=urn; this.add_new_vt_server(vt_server); this.add_new_testbed(testbed_ay[0]); //this.vt_servers_list.push(vt_server); @@ -297,7 +302,7 @@ if(vt_servers_list[i].testbed==$('#uob_testbed_name option:selected').text()){ $('#uob_virtualization_server') .append($("") - .attr("value",vt_servers_list[i].name) + .attr("value",vt_servers_list[i].urn) .text(vt_servers_list[i].name)); } } diff --git a/portal/sliceresourceview.py b/portal/sliceresourceview.py index 985e775b..94c0fb41 100644 --- a/portal/sliceresourceview.py +++ b/portal/sliceresourceview.py @@ -79,6 +79,10 @@ class SliceResourceView (LoginRequiredView, ThemeView): 'lease.resource', 'lease.start_time', 'lease.end_time', + # FLOWSPACE + 'flowspace', + # VMS + 'vms', # - The lease_id is important for NITOS identify already existing # leases 'lease.lease_id', @@ -93,6 +97,8 @@ class SliceResourceView (LoginRequiredView, ThemeView): page.enqueue_query(main_query, analyzed_query=aq) sq_resource = aq.subquery('resource') sq_lease = aq.subquery('lease') + sq_flowspace = aq.subquery('flowspace') + sq_vms = aq.subquery('vms') query_resource_all = Query.get('resource').select(resource_fields) page.enqueue_query(query_resource_all) @@ -290,9 +296,8 @@ class SliceResourceView (LoginRequiredView, ThemeView): page = page, title = 'univbris_flowspace_selection', domid = 'univbris_flowspace_selection', - query = None, - query_all = None, - sync_query = query_resource_all, + query = sq_flowspace, + query_all = query_resource_all, datatables_options = { 'iDisplayLength': 5, 'bLengthChange' : True, @@ -341,19 +346,22 @@ class SliceResourceView (LoginRequiredView, ThemeView): # Bristol Plugin #plugin which display a table where an experimenter will add VMs to according to his needs + # responsible to send the data to Manifold univbrisvtamplugin = UnivbrisVtamPlugin( page = page, title = 'univbris_vtam', domid = 'univbris_vtam', - query = None, + query = sq_vms, + #query = sq_resource, ) - #plugin which display a form where an experimenter will specify where a + #plugin which display a form where an experimenter will specify + # in which testbed and which physical server to setup the VM univbrisvtamform = UnivbrisVtamForm( page = page, title = 'univbris_vtam_form', domid = 'univbris_vtam_form', - query = query_resource_all, + query = query_resource_all, query_all = None, datatables_options = { 'iDisplayLength': 3,