xosDeveloper view working
diff --git a/planetstack/core/xoslib/static/js/xosDeveloper.js b/planetstack/core/xoslib/static/js/xosDeveloper.js
index 5e81d85..eb83efe 100644
--- a/planetstack/core/xoslib/static/js/xosDeveloper.js
+++ b/planetstack/core/xoslib/static/js/xosDeveloper.js
@@ -10,20 +10,30 @@
className: 'developer_slicedetail'
});
+/*
DeveloperApp.SliceListView = Marionette.CollectionView.extend({
tagName: "table",
+ className: "table table-hover",
+ template: "#developer-slicetable-template",
+ childView: DeveloperApp.SliceDetailView,
+});
+*/
+
+DeveloperApp.SliceListView = Marionette.CompositeView.extend({
+ tagName: "table",
className: "table-striped table-bordered",
template: "#developer-slicetable-template",
childView: DeveloperApp.SliceDetailView,
+ childViewContainer: "tbody",
});
DeveloperApp.on("start", function() {
var developerSliceListView = new DeveloperApp.SliceListView({
- collection: xos.slices
+ collection: xos.slicesPlus
});
console.log(developerSliceListView);
DeveloperApp.mainRegion.show(developerSliceListView);
- xos.slices.fetch();
+ xos.slicesPlus.fetch();
});
$(document).ready(function(){
diff --git a/planetstack/core/xoslib/static/js/xoslib/xos-backbone.js b/planetstack/core/xoslib/static/js/xoslib/xos-backbone.js
index b113535..59645e7 100644
--- a/planetstack/core/xoslib/static/js/xoslib/xos-backbone.js
+++ b/planetstack/core/xoslib/static/js/xoslib/xos-backbone.js
@@ -5,6 +5,8 @@
USER_API = "/plstackapi/users/";
DEPLOYMENT_API = "/plstackapi/deployments";
+SLICEPLUS_API = "/xoslib/slicesplus/";
+
XOSModel = Backbone.Model.extend({
/* from backbone-tastypie.js */
//idAttribute: 'resource_uri',
@@ -119,6 +121,7 @@
});
function xoslib() {
+ // basic REST
this.sliver = XOSModel.extend({ urlRoot: SLIVER_API });
this.sliverCollection = XOSCollection.extend({ urlRoot: SLIVER_API,
model: this.sliver});
@@ -149,6 +152,12 @@
model: this.deployment});
this.deployments = new this.deploymentCollection();
+ // enhanced REST
+ this.slicePlus = XOSModel.extend({ urlRoot: SLICEPLUS_API });
+ this.slicePlusCollection = XOSCollection.extend({ urlRoot: SLICEPLUS_API,
+ model: this.slicePlus});
+ this.slicesPlus = new this.slicePlusCollection();
+
this.listObjects = function() { return ["slivers", "slices", "nodes", "sites", "users", "deployments"]; };
};