diff --git a/plugins/univbris/__init__.py b/plugins/univbris/__init__.py
index ca96b6f6..89b3ec5e 100644
--- a/plugins/univbris/__init__.py
+++ b/plugins/univbris/__init__.py
@@ -5,14 +5,21 @@ class Univbris(Plugin):
def __init__ (self, query=None, **settings):
Plugin.__init__ (self, **settings)
self.query=query
+ self.query_uuid = query.query_uuid if query else None
+ print "called univbris plugin"
def template_file (self):
- return "univbris.html"
+ try:
+ return "univbris_welcome.html"
+ except Exception:
+ print "error template"
def requirements (self):
reqs = {
- 'js_files' : [
- 'js/univbris.js'
+ 'js_files' : [ "js/spin-presets.js", "js/spin.min.js", "js/jquery.spin.js",
+ "js/manifold.js", "js/manifold-query.js",
+ "js/unfold-helper.js",
+ 'js/univbris.js',
],
'css_files': [
'css/univbris.css',
@@ -24,7 +31,7 @@ class Univbris(Plugin):
# query_uuid will pass self.query results to the javascript
# and will be available as "record" in :
# on_new_record: function(record)
- return ['plugin_uuid', 'domid', 'query_uuid']
+ return ['plugin_uuid', 'domid', 'query_uuid','init_key',]
def export_json_settings (self):
return True
diff --git a/plugins/univbris/static/js/univbris.js b/plugins/univbris/static/js/univbris.js
index 4c84a90c..a22201e9 100644
--- a/plugins/univbris/static/js/univbris.js
+++ b/plugins/univbris/static/js/univbris.js
@@ -1,6 +1,6 @@
/**
- * univbris: test plugin for Bristol University
- * Version: 0.1
+ * univbris: test ofam plugin for Bristol University
+ * Version: 0.2
* Description: just testing plugin in myslice
* Requires: js/plugin.js
* URL: http://www.myslice.info
@@ -13,94 +13,21 @@
var Univbris = Plugin.extend({
- /** XXX to check
- * @brief Plugin constructor
- * @param options : an associative array of setting values
- * @param element :
- * @return : a jQuery collection of objects on which the plugin is
- * applied, which allows to maintain chainability of calls
- */
init: function(options, element) {
- // Call the parent constructor, see FAQ when forgotten
this._super(options, element);
-
- /* Member variables */
-
- /* Plugin events */
-
- /* Setup query and record handlers */
-
- // Explain this will allow query events to be handled
- // What happens when we don't define some events ?
- // Some can be less efficient
this.listen_query(options.query_uuid);
- this.listen_query(options.query_uuid, 'all');
-
- /* GUI setup and event binding */
- // call function
-
- alert("univbris plugin 2");
},
- /* PLUGIN EVENTS */
- // on_show like in querytable
-
-
- /* GUI EVENTS */
-
- // a function to bind events here: click change
- // how to raise manifold events
-
-
- /* GUI MANIPULATION */
-
- // We advise you to write function to change behaviour of the GUI
- // Will use naming helpers to access content _inside_ the plugin
- // always refer to these functions in the remaining of the code
-
- show_hide_button: function()
- {
- // this.id, this.el, this.cl, this.elts
- // same output as a jquery selector with some guarantees
- },
+ on_query_done: function()
+ {
+ $("#univbris_welcome").hide();
+ jQuery("#univbris_flowspace_selection").show();
+ },
- /* TEMPLATES */
-
- // see in the html template
- // How to load a template, use of mustache
-
- /* QUERY HANDLERS */
-
- // How to make sure the plugin is not desynchronized
- // He should manifest its interest in filters, fields or records
- // functions triggered only if the proper listen is done
-
- // no prefix
-
- on_filter_added: function(filter)
- {
-
- },
-
- // ... be sure to list all events here
-
- /* RECORD HANDLERS */
- on_all_new_record: function(record)
- {
- //
- },
-
- /* INTERNAL FUNCTIONS */
- _dummy: function() {
- // only convention, not strictly enforced at the moment
- },
});
- /* Plugin registration */
$.plugin('Univbris', Univbris);
- // TODO Here use cases for instanciating plugins in different ways like in the pastie.
-
})(jQuery);
diff --git a/plugins/univbris/templates/univbris.html b/plugins/univbris/templates/univbris.html
index f8aec26c..64e50d11 100644
--- a/plugins/univbris/templates/univbris.html
+++ b/plugins/univbris/templates/univbris.html
@@ -1,4 +1,2 @@
-
-
Bristol University Island Infrastructure Monitoring
-
information to follow
-
+
gathering information from testbeds
+
diff --git a/plugins/univbris/templates/univbris_welcome.html b/plugins/univbris/templates/univbris_welcome.html
new file mode 100644
index 00000000..09cc7b7a
--- /dev/null
+++ b/plugins/univbris/templates/univbris_welcome.html
@@ -0,0 +1,2 @@
+
...gathering information from testbeds...
+
diff --git a/plugins/univbrisfoam/__init__.py b/plugins/univbrisfoam/__init__.py
index b732618b..254fda21 100644
--- a/plugins/univbrisfoam/__init__.py
+++ b/plugins/univbrisfoam/__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,
+ def __init__ (self, query=None, query_all=None, sync_query=None,
checkboxes=False, columns=None,
init_key=None,
datatables_options={}, **settings):
@@ -49,6 +49,7 @@ 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:
@@ -115,6 +116,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',
+ 'query_uuid', 'query_all_uuid', 'sync_query_uuid',
'checkboxes', 'datatables_options',
'hidden_columns', 'init_key',]
diff --git a/plugins/univbrisfoam/static/js/univbrisfoam.js b/plugins/univbrisfoam/static/js/univbrisfoam.js
index 22ba431b..cbf72ae8 100644
--- a/plugins/univbrisfoam/static/js/univbrisfoam.js
+++ b/plugins/univbrisfoam/static/js/univbrisfoam.js
@@ -7,8 +7,12 @@
(function($){
var debug=false;
+ window.query_itr2=0;
+ table_links=[];
//debug=true
+ regex_filter="((packet)|(compute))";
+
var UnivbrisFoam = Plugin.extend({
init: function(options, element) {
@@ -62,9 +66,12 @@
/* Setup query and record handlers */
this.listen_query(options.query_uuid);
this.listen_query(options.query_all_uuid, 'all');
+ this.listen_query(options.sync_query_uuid,'sync');
/* GUI setup and event binding */
this.initialize_table();
+
+ jQuery( "#univbris_foam_ports_selection" ).hide();
},
@@ -95,7 +102,7 @@
// 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-2'l><'col-xs-9'r><'col-xs-2'f>>t<'row'<'col-xs-5'i><'col-xs-5'p>><'next'>",
+ sDom: "<'row'<'col-xs-5'l><'col-xs-1'r><'col-xs-6'f>>t<'row'<'col-xs-5'i><'col-xs-5'p>>",
// 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
@@ -158,7 +165,7 @@
//self.hide_column(field);
});
- $('').appendTo('div.next');
+ //$('').appendTo('div.next');
//type="submit"
@@ -197,14 +204,14 @@
jQuery( "#univbris_flowspace_selection" ).show();
//$("#multi_flowpspace_ports_selected").append('');
- $("form#uob_form :input[type=checkbox]").each(function(){
- var input = $(this); // This is the jquery object of the input, do what you will
- //alert("id: "+ input.attr('id') + " checked: "+ input.is(':checked'));
- if(input.is(':checked')==true){
- //alert("got true");
- $("#multi_flowpspace_ports_selected").append('');
- }
- });
+ //$("form#uob_form :input[type=checkbox]").each(function(){
+ // var input = $(this); // This is the jquery object of the input, do what you will
+ // //alert("id: "+ input.attr('id') + " checked: "+ input.is(':checked'));
+ // if(input.is(':checked')==true){
+ // //alert("got true");
+ // $("#multi_flowpspace_ports_selected").append('');
+ // }
+ //});
jQuery( "#univbris_foam_ports_selection" ).hide();
//jQuery( "#univbris_flowspace_selection" ).hide();
@@ -256,6 +263,32 @@
return result;
},
+ fnLinkClick:function(link){
+ //console.log("link has been clicked: ");
+ //console.log(link.target.id);
+
+ var svg_links = svg.selectAll(".link");
+ for(var i=0;i
-
+
diff --git a/plugins/univbrisfoam/templates/univbrisfoam.html b/plugins/univbrisfoam/templates/univbrisfoam.html
index 77493974..89a65db6 100644
--- a/plugins/univbrisfoam/templates/univbrisfoam.html
+++ b/plugins/univbrisfoam/templates/univbrisfoam.html
@@ -19,4 +19,5 @@
+
diff --git a/plugins/univbrisfv/__init__.py b/plugins/univbrisfv/__init__.py
index a44a0ab7..6c9aef2f 100644
--- a/plugins/univbrisfv/__init__.py
+++ b/plugins/univbrisfv/__init__.py
@@ -118,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',
+ '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 73cd5520..00000000
--- a/plugins/univbrisfv/__init__1.py
+++ /dev/null
@@ -1,41 +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 82581ab2..672a674c 100644
--- a/plugins/univbrisfv/static/js/univbrisfv.js
+++ b/plugins/univbrisfv/static/js/univbrisfv.js
@@ -11,8 +11,10 @@
pk_flowspace_index=0;
opt_flowspace_index=0;
+ pk_mode=0;
fvf_add=1;
fvf_nrow=0;
+
var UnivbrisFv = Plugin.extend({
@@ -95,8 +97,11 @@
initialize_table: function()
{
+
+
/* Transforms the table into DataTable, and keep a pointer to it */
var self = this;
+ //alert(self.options);
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
@@ -179,7 +184,7 @@
$('
').appendTo('div.buttons');**/
- jQuery( "#univbris_flowspace_selection" ).hide();
+ //jQuery( "#univbris_flowspace_selection" ).hide();
//$('next link').appendTo('div.submit');
@@ -189,121 +194,354 @@
//this.new_record("t");
//this.new_record("t");
this._querytable_draw_callback();
-
+ jQuery("#univbris_flowspace_selection").hide();
}, // initialize_table
fnButsubmit:function(e){
- alert("submitting");
- var rows = $("#univbris_flowspace_selection__table").dataTable().fnGetNodes();
- var cells=[];
- for(var i=0;i=7){
+ //alert(controller.substring(0,4))
+ if(controller.substring(0,4)=="tcp:" | controller.substring(0,4)=="ssl:"){
+ var controller_ip=controller.substring(4,controller.length);
+ //alert(controller_ip)
+ var index=controller_ip.indexOf(":")
+ if (index!=-1){
+ var controller_ip1=controller_ip.substring(0,index);
+ //alert(controller_ip1);
+ var ip_validator= /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
+ if (!controller_ip1.match(ip_validator)){
+ throw "Incorrect IP format";
+ }
+ //else{
+ // throw "incorrect ip";
+ //}
+
+ var controller_port=controller_ip.substring(index+1,controller_ip.length);
+ if(!isNaN(controller_port)){
+ controller_port=parseInt(controller_port,10);
+ if (!((controller_port >0) & (controller_port <65536))){
+ //if(controller_port >0){
+ throw "Incorrect controller port";
+ }
+ //else{
+ // throw "correct port";
+ //}
+ }
+ else{
+ throw "Incorrect controller port";
+ }
+ }
+ else{
+ throw "Incorrect controller specified";
+ }
+ }
+ else{
+ throw "Controller must start with tcp: or ssl:";
+ }
+
+ }
+ else{
+ throw "Incorrect controller specified";
+ }
+ //end of validation of controller field
+
+ var rows = $("#univbris_flowspace_selection__table").dataTable().fnGetNodes();
+ var cells=[];
+
+ var json_rspec={};
+ json_rspec["controller"]=controller;
+ var groups_rspec=[];
+ var matches_rspec=[];
+
+ if (rows.length <=0) {
+ throw "No Flowspace defined"
+ }
+
+
+ var queryStringToJSON = function (url) {
+ if (url === '') return '';
+ var pairs = (url || location.search).slice(1).split('&');
+ var result = {};
+ for (var idx in pairs) {
+ if ($.isNumeric(idx)) {
+ var pair = pairs[idx].split('=');
+ if (!!pair[0]){
+ result[pair[0].toLowerCase()] = decodeURIComponent(pair[1].replace(/\+/g, " ") || '');
+ }
+ }
+ }
+ return result;
}
- }
- var controller= $('#controller_loc').val();
+ for(var i=0;i"+$("#flowspace_name").val()+"
";
- this.table.fnDeleteRow(fvf_nrow);
- this.table.fnAddData([string, 'Edit', 'Delete']);
- jQuery( "#univbris_flowspace_selection" ).show();
- },
-
/**
* @brief Determine index of key in the table columns
* @param key
@@ -311,24 +380,6 @@
line.push("first");
}
-
- /*if (typeof colnames[j] == 'undefined') {
- line.push('...');
- } else if (colnames[j] == 'hostname') {
- if (record['type'] == 'resource,link')
- //TODO: we need to add source/destination for links
- line.push('');
- else
- line.push(record['hostname']);
-
- } else if (colnames[j] == 'hrn' && typeof(record) != 'undefined') {
- line.push(' '+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
@@ -635,9 +686,9 @@
$("#addflowspaceform").unbind('click').click(this, this.fnAddflowspace);
}
else{
- $("[id='addflowspaceform'").unbind('click').click(this, this.fnModflowspace);
+ $("[id='addflowspaceform']").unbind('click').click(this, this.fnModflowspace);
}
- $("#cancel_addflowspaceform").unbind('click').click(this,this.fnCancel);
+ $("#cancel_addflowspaceform").unbind('click').click(this,this.fnCancel);
if (!this.table)
return;
@@ -717,38 +768,521 @@
})(jQuery);
+function deserializeDT(d){
-function fnPopTable(e){
- //alert("e: "+e);
- //this.table = $("#univbris_flowspace_selection__table").dataTable();
- //alert(this.table);
- /**var rows = $("#univbris_flowspace_selection__table").dataTable().fnGetNodes();
- for(var i=0;i= 19) {
+ status=true;
+ }
+
+ if (port_selected==false & checked == 18){
+ alert("you need to select at least one port");
+ }
+ else if (port_selected==false & checked <= 18){
+ alert("you need to select at least one port and correct other flowspace parameter errors");
+ }
+ else if (port_selected==true & checked <= 18){
+ alert("you need to correct other flowspace parameter errors");
+ }
+
+ //alert("validator status:"+status+" checked:"+checked);
+ return status;
+}
+
+function validateoFvfForm(){
+ var status = false;
+ var checked =0;
+
+ //row 1 validation
+ if (wavelengthValidator($('#uob_ofv_table_wavelength').val())==false){
+ $("#uob_ofv_table_wavelength").addClass('error');
+ $("#uob_ofv_table_wavelength_error").show();
+ }
+ else {
+ checked++;
+ }
+
+
+
+ //validate that at least one port is selected
+ var port_table=$("#univbris_foam_ports_selection__table").dataTable();
+ var nodes = $('input',port_table.fnGetNodes());
+
+ var port_selected=false;
+ for(var i=0;i= 2) {
+ status=true;
+ }
+
+ if (port_selected==false & checked == 1){
+ alert("you need to select at least one port");
+ }
+ else if (port_selected==false & checked <= 1){
+ alert("you need to select at least one port and correct other flowspace parameter errors");
+ }
+ else if (port_selected==true & checked <= 1){
+ alert("you need to correct other flowspace parameter errors");
+ }
+
+ //alert("validator status:"+status+" checked:"+checked);
+ return status;
+}
+
+
function fnGetSelected( oTableLocal )
{
@@ -777,7 +1311,28 @@ function serializeAnything (form){
});
return toReturn.join("&").replace(/%20/g, "+");
+}
+
+function hideFvfError(){
+ $("[id*=_error]").hide();
+ console
+ $("#uob_fv_table_form :input").each(function(){
+ try{
+ $(this).removeClass('error');
+ }
+ catch (err){
+ }
+
+ });
+
+ $("#uob_ofv_table_form :input").each(function(){
+ try{
+ $(this).removeClass('error');
+ }
+ catch (err){
+ }
+ });
}
diff --git a/plugins/univbrisfvf/templates/univbrisfv.html b/plugins/univbrisfvf/templates/univbrisfv.html
index 44d51af8..d6900f63 100644
--- a/plugins/univbrisfvf/templates/univbrisfv.html
+++ b/plugins/univbrisfvf/templates/univbrisfv.html
@@ -21,7 +21,7 @@
-
'
+
'
diff --git a/plugins/univbrisfvf/templates/univbrisfvf.html b/plugins/univbrisfvf/templates/univbrisfvf.html
index 63973cb3..bb531c5f 100644
--- a/plugins/univbrisfvf/templates/univbrisfvf.html
+++ b/plugins/univbrisfvf/templates/univbrisfvf.html
@@ -9,22 +9,37 @@
.multiselect label {
display:block;
}
- l
+
.multiselect-on {
color:#ffffff;
background-color:#000099;
}
+
+.error{
+border:2px solid red;
+}
+
diff --git a/plugins/univbrisfvfo/__init__.py b/plugins/univbrisfvfo/__init__.py
new file mode 100644
index 00000000..b774faee
--- /dev/null
+++ b/plugins/univbrisfvfo/__init__.py
@@ -0,0 +1,87 @@
+from unfold.plugin import Plugin
+
+class UnivbrisFvfo (Plugin):
+
+ """
+
+////////////////////////////////////////
+
+modified querytable for univbris foam
+///////////////////////////////////////
+
+A plugin for displaying a query as a list
+
+More accurately, we consider a subject entity (say, a slice)
+that can be linked to any number of related entities (say, resources, or users)
+The 'query' argument will correspond to the subject, while
+'query_all' will fetch the complete list of
+possible candidates for the relationship.
+
+Current implementation makes the following assumptions
+* query will only retrieve for the related items a list of fields
+ that corresponds to the initial set of fields displayed in the table
+* query_all on the contrary is expected to return the complete set of
+ available attributes that may be of interest, so that using a QueryEditor
+ one can easily extend this table without having to query the backend
+* checkboxes is a boolean flag, set to true if a rightmost column
+ with checkboxes is desired
+* optionally pass columns as the initial set of columns
+ if None then this is taken from the query's fields
+* init_key is the name of a column that should appear in both queries
+ and used internally in the plugin for checkboxes initialization.
+ If not specified, metadata will be used to find out a primary key.
+ However in the case of nodes & slice for example, the default key
+ as returned by the metadata would be 'urn', but 'urn' could only
+ be used for this purpose if it gets displayed initially, which is
+ not necessarily a good idea.
+ This is why a slice view would use 'hrn' here instead.
+* datatables_options are passed to dataTables as-is;
+ however please refrain from passing an 'aoColumns'
+ as we use 'aoColumnDefs' instead.
+"""
+
+ def __init__ (self, query=None, query_all=None,
+ checkboxes=False, columns=None,
+ init_key=None,
+ datatables_options={}, **settings):
+ Plugin.__init__ (self, **settings)
+ self.query = query
+ # 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
+
+
+ def template_file (self):
+ return "univbrisfvfo.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",
+ # querytable.js needs to be loaded after dataTables.js as it extends
+ # dataTableExt.afnSortData
+ "js/univbrisfvfo.js",
+ ] ,
+ 'css_files': [ "css/dataTables.bootstrap.css",
+ # hopefully temporary, when/if datatables supports sPaginationType=bootstrap3
+ # for now we use full_numbers, with our own ad hoc css
+ "css/dataTables.full_numbers.css",
+ "css/univbrisfvfo.css",
+ ],
+ }
+ return reqs
+
+ # the list of things passed to the js plugin
+ def json_settings_list (self):
+ return ['plugin_uuid', 'domid',
+ 'query_uuid', 'query_all_uuid',
+ 'checkboxes', 'datatables_options',
+ 'hidden_columns', 'init_key',]
diff --git a/plugins/univbrisfvfo/static/css/univbrisfvfo.css b/plugins/univbrisfvfo/static/css/univbrisfvfo.css
new file mode 100644
index 00000000..4b518d3c
--- /dev/null
+++ b/plugins/univbrisfvfo/static/css/univbrisfvfo.css
@@ -0,0 +1,65 @@
+
+/* the bottom of the datatable needs more space */
+div.univbrisfvf-spacer { padding: 8px 4px 15px 4px; }
+
+div.UnivbrisFv table.dataTable th {
+ font: bold 12px/22px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
+ color: #4f6b72;
+ border-right: 1px solid #C1DAD7;
+ border-bottom: 1px solid #C1DAD7;
+ border-top: 1px solid #C1DAD7;
+ letter-spacing: 1px;
+ text-transform: uppercase;
+ text-align: left;
+ padding: 8px 12px 4px 20px;
+ vertical-align:middle;
+/* background: #CAE8EA url(../img/tablesort-header.jpg) no-repeat; */
+}
+
+div.UnivbrisFv table.dataTable th.checkbox {
+ padding-left: 14px;
+}
+
+div.UnivbrisFv table.dataTable td, div.UnivbrisFv table.dataTable textarea, div.UnivbrisFv table.dataTable input [type="text"] {
+ font: bold 12px "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
+ color: #660099;
+ border-right: 1px solid #C1DAD7;
+ border-bottom: 1px solid #C1DAD7;
+}
+div.UnivbrisFv table.dataTable td {
+ padding: 4px 8px 4px 8px;
+ /* this applies on even rows only, odd ones have a setting in bootstrap of rbg 249.249.249 */
+ background-color: #f4f4f4;
+ color: #660099;
+}
+div.UnivbrisFv table.dataTable td a {
+ font-weight:normal;
+}
+/* these come from bootstrap */
+div.UnivbrisFv div.dataTables_info {
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
+}
+
+/* one could think or using repeat-x here but that's not working because of the arrows
+ * we might need to make these wider some day
+ * and/or to add background-color: #caebea
+ * which would look less conspicuous in case of overflow
+*/
+
+div.UnivbrisFv table.dataTable thead .sorting { background: url('../img/tablesort-header-sortable.png') no-repeat; }
+div.UnivbrisFv table.dataTable thead .sorting_asc { background: url('../img/tablesort-header-up.png') no-repeat; }
+div.UnivbrisFv table.dataTable thead .sorting_desc { background: url('../img/tablesort-header-down.png') no-repeat; }
+/* this icons set does not have that exact equivalent - using an approximation for now */
+div.UnivbrisFv table.dataTable thead .sorting_asc_disabled { background: url('../img/tablesort-header.png') repeat-x; }
+div.UnivbrisFv table.dataTable thead .sorting_desc_disabled { background: url('../img/tablesort-header.png') repeat-x; }
+
+/* the footers are not active */
+div.UnivbrisFv table.dataTable tfoot {
+ background: url('../img/tablesort-header.png') repeat-x;
+ background-color: #caebea;
+}
+/* and when sorting is turned off it's useful to set this on header too */
+div.UnivbrisFv table.dataTable thead {
+ background: url('../img/tablesort-header.png') repeat-x;
+ background-color: #caebea;
+}
diff --git a/plugins/univbrisfvfo/static/img/README b/plugins/univbrisfvfo/static/img/README
new file mode 100644
index 00000000..5df2d69b
--- /dev/null
+++ b/plugins/univbrisfvfo/static/img/README
@@ -0,0 +1,2 @@
+these styling elements come from plekit with a simple transition to png
+they're currently not all used in myslice
diff --git a/plugins/univbrisfvfo/static/img/tablesort-bullet1.png b/plugins/univbrisfvfo/static/img/tablesort-bullet1.png
new file mode 100644
index 00000000..4304f360
Binary files /dev/null and b/plugins/univbrisfvfo/static/img/tablesort-bullet1.png differ
diff --git a/plugins/univbrisfvfo/static/img/tablesort-bullet2.png b/plugins/univbrisfvfo/static/img/tablesort-bullet2.png
new file mode 100644
index 00000000..4f181e19
Binary files /dev/null and b/plugins/univbrisfvfo/static/img/tablesort-bullet2.png differ
diff --git a/plugins/univbrisfvfo/static/img/tablesort-col-alt.png b/plugins/univbrisfvfo/static/img/tablesort-col-alt.png
new file mode 100644
index 00000000..8179f830
Binary files /dev/null and b/plugins/univbrisfvfo/static/img/tablesort-col-alt.png differ
diff --git a/plugins/univbrisfvfo/static/img/tablesort-gradient.png b/plugins/univbrisfvfo/static/img/tablesort-gradient.png
new file mode 100644
index 00000000..26558a49
Binary files /dev/null and b/plugins/univbrisfvfo/static/img/tablesort-gradient.png differ
diff --git a/plugins/univbrisfvfo/static/img/tablesort-header-down.png b/plugins/univbrisfvfo/static/img/tablesort-header-down.png
new file mode 100644
index 00000000..c8ed6576
Binary files /dev/null and b/plugins/univbrisfvfo/static/img/tablesort-header-down.png differ
diff --git a/plugins/univbrisfvfo/static/img/tablesort-header-sortable.png b/plugins/univbrisfvfo/static/img/tablesort-header-sortable.png
new file mode 100644
index 00000000..0c169040
Binary files /dev/null and b/plugins/univbrisfvfo/static/img/tablesort-header-sortable.png differ
diff --git a/plugins/univbrisfvfo/static/img/tablesort-header-up.png b/plugins/univbrisfvfo/static/img/tablesort-header-up.png
new file mode 100644
index 00000000..d12fe2a5
Binary files /dev/null and b/plugins/univbrisfvfo/static/img/tablesort-header-up.png differ
diff --git a/plugins/univbrisfvfo/static/img/tablesort-header.png b/plugins/univbrisfvfo/static/img/tablesort-header.png
new file mode 100644
index 00000000..cff526f9
Binary files /dev/null and b/plugins/univbrisfvfo/static/img/tablesort-header.png differ
diff --git a/plugins/univbrisfvfo/static/img/tablesort-td-alt.png b/plugins/univbrisfvfo/static/img/tablesort-td-alt.png
new file mode 100644
index 00000000..ef5ab358
Binary files /dev/null and b/plugins/univbrisfvfo/static/img/tablesort-td-alt.png differ
diff --git a/plugins/univbrisfvfo/static/img/toggle-hidden.png b/plugins/univbrisfvfo/static/img/toggle-hidden.png
new file mode 100755
index 00000000..023f22a8
Binary files /dev/null and b/plugins/univbrisfvfo/static/img/toggle-hidden.png differ
diff --git a/plugins/univbrisfvfo/static/img/toggle-visible.png b/plugins/univbrisfvfo/static/img/toggle-visible.png
new file mode 100755
index 00000000..baf6c286
Binary files /dev/null and b/plugins/univbrisfvfo/static/img/toggle-visible.png differ
diff --git a/plugins/univbrisfv/static/js/univbrisfv1.js b/plugins/univbrisfvfo/static/js/univbrisfvfo.js
similarity index 52%
rename from plugins/univbrisfv/static/js/univbrisfv1.js
rename to plugins/univbrisfvfo/static/js/univbrisfvfo.js
index 90ca0e8c..7d502a85 100644
--- a/plugins/univbrisfv/static/js/univbrisfv1.js
+++ b/plugins/univbrisfvfo/static/js/univbrisfvfo.js
@@ -2,18 +2,19 @@
* 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
+ debug=true;
- var UnivbrisFv = Plugin.extend({
+
+ var UnivbrisFvfo = Plugin.extend({
init: function(options, element) {
- //alert("fv init called");
- this.classname="univbrisfv";
+ //alert("foam init called");
+ this.classname="univbrisfvfo";
this._super(options, element);
//alert(this.options.hidden_columns);
@@ -22,12 +23,12 @@
// 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;
+ //this.received_all_query = false;
+ //this.received_query = false;
// We need to remember the active filter for datatables filtering
- // this.filters = Array();
- alert("after super");
+ 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
@@ -49,37 +50,43 @@
// (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");
+ 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);
+ if ( ! this.init_key ) messages.warning ("UnivbrisFvfo : cannot find init_key");
+ if ( ! this.canonical_key ) messages.warning ("UnivbrisFvfo : cannot find canonical_key");
+ if (debug) messages.debug("UnivbrisFvfo: 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();
-
+ //this.initialize_table();
+ //alert("init fvf");
+ jQuery("#uob_ofv_table_form").hide();
+
+ //$('').appendTo('#fvf_table_button');
+
+ //$('').appendTo('#fvf_table_button');
+
+ this._querytable_draw_callback();
},
/* PLUGIN EVENTS */
on_show: function(e) {
- if (debug) messages.debug("univbrisfv.on_show");
+ if (debug) messages.debug("univbrisfvfo.on_show");
var self = e.data;
self.table.fnAdjustColumnSizing();
},
on_resize: function(e) {
- if (debug) messages.debug("univbrisfv.on_resize");
+ if (debug) messages.debug("univbrisfvfo.on_resize");
var self = e.data;
self.table.fnAdjustColumnSizing();
},
@@ -90,14 +97,14 @@
initialize_table: function()
{
- alert("init table fnc");
- /* Transforms the table into DataTable, and keep a pointer to it */
+ /* 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'>",
+ //sDom: "<'row'<'col-xs-2'l><'col-xs-9'r><'col-xs-2'f>>t<'row'<'col-xs-5'i><'col-xs-5'p>><'next'>",
+ 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
@@ -107,9 +114,9 @@
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 */
+ bProcessing: false, /* Loading */
fnDrawCallback: function() { self._querytable_draw_callback.call(self);}
- //fnFooterCallback: function() {self._univbrisfv_footer_callback.call(self,nFoot, aData, iStart, iEnd, aiDisplay)};}
+ //fnFooterCallback: function() {self._univbrisfvf_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
@@ -118,17 +125,14 @@
// 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) {
+ 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);
+ this.table = $("#univbris_flowspace_form__table").dataTable(actual_options);
+
+ //alert(this.table);
/* Setup the SelectAll button in the dataTable header */
/* xxx not sure this is still working */
@@ -146,9 +150,9 @@
* 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;
+ /* 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);
});
@@ -162,57 +166,91 @@
//self.hide_column(field);
});
- $('').appendTo('div.next');
+ }, // initialize_table
- $('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()
-
+
+ fnCancel:function(e){
+ //var sData=$("#uob_fv_table_form").find("input").serialize();
+ //alert("add flowspace:" + sData);
+ //alert("cancel");
- }, // initialize_table
+ jQuery("#uob_ofv_table_form").hide();
+ jQuery( "#univbris_foam_ports_selection" ).hide();
+ jQuery( "#univbris_flowspace_selection" ).show();
+ jQuery('#topo_plugin').hide();
+ /*var port_table=$("#univbris_foam_ports_selection__table").dataTable();
+ var nodes = $('input',port_table.fnGetNodes());
+ for(var i=0;iNEC 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();
+ if(fvf_add==1){
+ pk_flowspace_index=1+pk_flowspace_index;
+ jQuery("#uob_fv_table_form").hide();
+ var sData=$("#uob_fv_table_form").find("input").serialize();
+ var form =serializeAnything("#uob_fv_table_form");
+ //alert(form);
+ //var form2=serializeAnything("#uob_form");
+ //alert(form2);
+ var port_table=$("#univbris_foam_ports_selection__table").dataTable();
+ var form2=$('input',port_table.fnGetNodes()).serialize();
+ //console.log(form2);
+ //alert($('input',port_table.fnGetNodes()).serialize());
+ var nodes = $('input',port_table.fnGetNodes());
+ //console.log(nodes[1]);
+ //console.log(nodes);
+ //alert($("#uob_form").serialize());
+ //var pos = form.search("&urn");
+ //form2=form2.substring(pos+1);
+ //alert(form2[1]);
+ //console.log(form2);
+ this.table = $("#univbris_flowspace_selection__table").dataTable();
- },
+ var val_status=validateFvfForm();
+ //val_status=true;
+ if (val_status == true){
+ flowspace=sData;
+ var m_form=form+","+form2;
+ var string = "