Started serviceGrid view
diff --git a/views/ngXosViews/serviceGrid/src/css/main.css b/views/ngXosViews/serviceGrid/src/css/main.css
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/css/main.css
diff --git a/views/ngXosViews/serviceGrid/src/index.html b/views/ngXosViews/serviceGrid/src/index.html
new file mode 100644
index 0000000..2e7f92e
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/index.html
@@ -0,0 +1,34 @@
+<!-- browserSync -->
+<!-- bower:css -->
+<link rel="stylesheet" href="vendor/bootstrap-css/css/bootstrap.min.css" />
+<link rel="stylesheet" href="vendor/angular-chart.js/dist/angular-chart.css" />
+<!-- endbower -->
+<!-- endcss -->
+<!-- inject:css -->
+<link rel="stylesheet" href="/css/main.css">
+<link rel="stylesheet" href="/../../../xos/core/static/xosNgLib.css">
+<!-- endinject -->
+
+<div ng-app="xos.serviceGrid" id="xosServiceGrid" class="container-fluid">
+ <div ui-view></div>
+</div>
+
+<!-- bower:js -->
+<script src="vendor/jquery/dist/jquery.js"></script>
+<script src="vendor/angular/angular.js"></script>
+<script src="vendor/angular-mocks/angular-mocks.js"></script>
+<script src="vendor/angular-ui-router/release/angular-ui-router.js"></script>
+<script src="vendor/angular-cookies/angular-cookies.js"></script>
+<script src="vendor/angular-animate/angular-animate.js"></script>
+<script src="vendor/angular-resource/angular-resource.js"></script>
+<script src="vendor/lodash/lodash.js"></script>
+<script src="vendor/bootstrap-css/js/bootstrap.min.js"></script>
+<script src="vendor/Chart.js/Chart.js"></script>
+<script src="vendor/angular-chart.js/dist/angular-chart.js"></script>
+<!-- endbower -->
+<!-- endjs -->
+<!-- inject:js -->
+<script src="/../../../xos/core/xoslib/static/js/vendor/ngXosHelpers.js"></script>
+<script src="/.tmp/main.js"></script>
+<script src="/.tmp/service-graph.js"></script>
+<!-- endinject -->
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/js/main.js b/views/ngXosViews/serviceGrid/src/js/main.js
new file mode 100644
index 0000000..5c41bd4
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/js/main.js
@@ -0,0 +1,72 @@
+'use strict';
+
+angular.module('xos.serviceGrid', [
+ 'ngResource',
+ 'ngCookies',
+ 'ui.router',
+ 'xos.helpers'
+])
+.config(($stateProvider) => {
+ $stateProvider
+ .state('serviceGrid', {
+ url: '/',
+ template: '<service-grid></service-grid>'
+ })
+ .state('serviceGraph', {
+ url: '/graph',
+ template: '<service-graph></service-graph>'
+ });
+})
+.config(function($httpProvider){
+ $httpProvider.interceptors.push('NoHyperlinks');
+})
+.directive('serviceGrid', function(){
+ return {
+ restrict: 'E',
+ scope: {},
+ bindToController: true,
+ controllerAs: 'vm',
+ templateUrl: 'templates/service-grid.tpl.html',
+ controller: function(Services, _){
+
+ this.tableConfig = {
+ columns: [
+ {
+ label: 'Status',
+ prop: 'status',
+ type: 'boolean',
+ },
+ {
+ label: 'Name',
+ prop: 'name',
+ link: item => `${item.view_url.replace(/\$[a-z]+\$/, item.id)}`
+ },
+ {
+ label: 'Kind',
+ prop: 'kind'
+ },
+ {
+ label: 'Enabled',
+ prop: 'enabled',
+ type: 'boolean'
+ }
+ ],
+ filter: 'field',
+ order: true
+ };
+
+ // retrieving user list
+ Services.query().$promise
+ .then((services) => {
+ this.services = _.map(services, s => {
+ // parse backend_status string in a boolean for display
+ s.status = parseInt(s.backend_status.match(/^[0-9]/)[0]) === 0 ? false : true;
+ return s;
+ })
+ })
+ .catch((e) => {
+ throw new Error(e);
+ });
+ }
+ };
+});
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/js/service-graph.js b/views/ngXosViews/serviceGrid/src/js/service-graph.js
new file mode 100644
index 0000000..0f9c05c
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/js/service-graph.js
@@ -0,0 +1,17 @@
+(function () {
+ 'use strict';
+
+ angular.module('xos.serviceGrid')
+ .directive('serviceGraph', function(){
+ return {
+ restrict: 'E',
+ scope: {},
+ bindToController: true,
+ controllerAs: 'vm',
+ templateUrl: 'templates/service-graph.tpl.html',
+ controller: function(){
+
+ }
+ };
+ })
+})();
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/sass/main.scss b/views/ngXosViews/serviceGrid/src/sass/main.scss
new file mode 100644
index 0000000..6f4bfe1
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/sass/main.scss
@@ -0,0 +1,5 @@
+@import '../../../../style/sass/lib/_variables.scss';
+
+#xosServiceGrid {
+
+}
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/templates/service-graph.tpl.html b/views/ngXosViews/serviceGrid/src/templates/service-graph.tpl.html
new file mode 100644
index 0000000..15be8a0
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/templates/service-graph.tpl.html
@@ -0,0 +1,14 @@
+<div class="row">
+ <div class="col-sm-10">
+ <h1>Graph</h1>
+ </div>
+ <div class="col-sm-2">
+ <a href="/admin/core/service/add" class="btn btn-success btn-block">
+ <i class="glyphicon glyphicon-plus"></i>
+ Add Service
+ </a>
+ <a href="#/" class="btn btn-default btn-block">
+ Service List
+ </a>
+ </div>
+</div>
\ No newline at end of file
diff --git a/views/ngXosViews/serviceGrid/src/templates/service-grid.tpl.html b/views/ngXosViews/serviceGrid/src/templates/service-grid.tpl.html
new file mode 100644
index 0000000..c371d37
--- /dev/null
+++ b/views/ngXosViews/serviceGrid/src/templates/service-grid.tpl.html
@@ -0,0 +1,14 @@
+<div class="row">
+ <div class="col-sm-10">
+ <xos-table config="vm.tableConfig" data="vm.services"></xos-table>
+ </div>
+ <div class="col-sm-2">
+ <a href="/admin/core/service/add" class="btn btn-success btn-block">
+ <i class="glyphicon glyphicon-plus"></i>
+ Add Service
+ </a>
+ <a href="#/graph" class="btn btn-default btn-block">
+ Tenancy Graph
+ </a>
+ </div>
+</div>
\ No newline at end of file