First draft of developer view
diff --git a/views/ngXosLib/xosHelpers/src/services/rest/Networks.js b/views/ngXosLib/xosHelpers/src/services/rest/Networks.js
new file mode 100644
index 0000000..74b73b6
--- /dev/null
+++ b/views/ngXosLib/xosHelpers/src/services/rest/Networks.js
@@ -0,0 +1,15 @@
+(function() {
+ 'use strict';
+
+ angular.module('xos.helpers')
+ /**
+ * @ngdoc service
+ * @name xos.helpers.Networks
+ * @description Angular resource to fetch /api/core/networks/:id/
+ **/
+ .service('Networks', function($resource){
+ return $resource('/api/core/networks/:id/', { id: '@id' }, {
+ update: { method: 'PUT' }
+ });
+ })
+})();
diff --git a/views/ngXosLib/xosHelpers/src/services/rest/Slices_plus.js b/views/ngXosLib/xosHelpers/src/services/rest/Slices_plus.js
new file mode 100644
index 0000000..e744caa
--- /dev/null
+++ b/views/ngXosLib/xosHelpers/src/services/rest/Slices_plus.js
@@ -0,0 +1,26 @@
+(function() {
+ 'use strict';
+
+ angular.module('xos.helpers')
+ /**
+ * @ngdoc service
+ * @name xos.helpers.SlicesPlus
+ * @description Angular resource to fetch /api/utility/slicesplus/
+ * This is a read-only API and only the `query` method is currently supported.
+ **/
+ .service('SlicesPlus', function($http, $q){
+ this.query = (params) => {
+ let deferred = $q.defer();
+
+ $http.get('/api/utility/slicesplus/', {params: params})
+ .then(res => {
+ deferred.resolve(res.data);
+ })
+ .catch(res => {
+ deferred.reject(res.data);
+ });
+
+ return {$promise: deferred.promise};
+ }
+ })
+})();
diff --git a/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/table/table.component.js b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/table/table.component.js
index 8b49932..a846bf5 100644
--- a/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/table/table.component.js
+++ b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/table/table.component.js
@@ -22,7 +22,10 @@
* columns: [
* {
* label: 'Human readable name',
- * prop: 'Property to read in the model object'
+ * prop: 'Property to read in the model object', // optional if type is custom
+ * type: 'object' | 'array' | 'boolean' | 'date' | 'custom',
+ * formatter: fn(), // receive the whole item if tipe is custom and return a string
+ * link: fn() // receive the whole item and return an url
* }
* ],
* classes: 'table table-striped table-bordered',
@@ -272,15 +275,14 @@
},
{
label: 'Features',
- prop: 'features',
type: 'custom',
formatter: (val) => {
- let cdnEnabled = val.cdn ? 'enabled' : 'disabled';
+ let cdnEnabled = val.features.cdn ? 'enabled' : 'disabled';
return `
Cdn is ${cdnEnabled},
- uplink speed is ${val.uplink_speed}
- and downlink speed is ${val.downlink_speed}
+ uplink speed is ${val.features.uplink_speed}
+ and downlink speed is ${val.features.downlink_speed}
`;
}
}
@@ -385,7 +387,7 @@
</dl>
</span>
<span ng-if="col.type === 'custom'">
- {{col.formatter(item[col.prop])}}
+ {{col.formatter(item)}}
</span>
</td>
<td ng-if="vm.config.actions">
diff --git a/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/table/table.scss b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/table/table.scss
index 70399a9..d9830d8 100644
--- a/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/table/table.scss
+++ b/views/ngXosLib/xosHelpers/src/ui_components/dumbComponents/table/table.scss
@@ -28,11 +28,17 @@
margin-bottom: 0;
dt {
- width: 50px !important;
+ width: auto !important;
+ margin-right: 10px;
+ }
+
+ dt:after {
+ /*display: block;*/
+ content: ':';
}
dd {
- margin-left: 60px !important;
+ margin-left: 0 !important;
}
}
}
\ No newline at end of file