Exporting Tosca from UI
Change-Id: Ie7e58ac5bd51a56d028daa1c1e2577e7723a8297
diff --git a/views/ngXosViews/serviceGrid/src/js/main.js b/views/ngXosViews/serviceGrid/src/js/main.js
index 88a0f95..fc75b2f 100644
--- a/views/ngXosViews/serviceGrid/src/js/main.js
+++ b/views/ngXosViews/serviceGrid/src/js/main.js
@@ -27,7 +27,7 @@
bindToController: true,
controllerAs: 'vm',
templateUrl: 'templates/service-grid.tpl.html',
- controller: function(Services, _){
+ controller: function(Services, ToscaEncoder, _){
this.tableConfig = {
columns: [
@@ -65,7 +65,21 @@
filter: 'field',
order: {
field: 'name'
- }
+ },
+ actions: [
+ {
+ label: 'export',
+ icon: 'export',
+ cb: service => {
+ this.tosca = '';
+ ToscaEncoder.serviceToTosca(service)
+ .then(tosca => {
+ this.showFeedback = true;
+ this.tosca = tosca;
+ });
+ }
+ }
+ ]
};
// retrieving user list