1 /* This is an example that uses xoslib + datatables to display the developer
4 \r For an example that uses xoslib + marionette, see xosDeveloper.js
7 \rfunction updateSliceTable(data) {
8 \r $('#developerView').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="dynamicusersliceinfo"></table>' );
9 var actualEntries = [];
11 for (rowkey in data.models) {
12 row = data.models[rowkey];
13 slicename = row.get("name");
14 sliceid = row.get("id");
15 role = row.get("sliceInfo").roles[0];
16 slivercount = row.get("sliceInfo").sliverCount;
17 sitecount = row.get("sliceInfo").siteCount;
23 actualEntries.push(['<a href="/admin/core/slice/' + sliceid + '">' + slicename + '</a>',
24 role, slivercount, sitecount]);
26 oTable = $('#dynamicusersliceinfo').dataTable( {
28 "aaData": actualEntries ,
31 { "sTitle": "Slice" },
32 { "sTitle": "Privilege" , sClass: "alignCenter"},
33 { "sTitle": "Number of Slivers" , sClass: "alignCenter"},
34 { "sTitle": "Number of Sites" , sClass: "alignCenter"},
39 $(document).ready(function(){
40 xos.slicesPlus.on("change", function() { console.log("change"); updateSliceTable(xos.slicesPlus); });
41 xos.slicesPlus.on("remove", function() { console.log("sort"); updateSliceTable(xos.slicesPlus); });
42 xos.slicesPlus.on("sort", function() { console.log("sort"); updateSliceTable(xos.slicesPlus); });
44 xos.slicesPlus.startPolling();