@@ -192,7 +198,7 @@
Job history
});
Vue.filter('dateTime', function (value) {
- if (!value) return ''
+ if (!value) return '';
return new Date(value).toLocaleString();
})
@@ -247,6 +253,26 @@ Job history
}
});
+ new Vue({
+ el: "#controls",
+ data: {
+ stack
+ },
+ template: "#stack-controls",
+ methods: {
+ save: function(){
+ // getting custom provider data
+ stackData.providerSpec = providerEditor.getValue();
+ $.ajax({
+ url: `/api/stacks/${stackId}`,
+ data: JSON.stringify(stackData),
+ contentType: "application/json",
+ method: "PUT"
+ });
+ }
+ }
+ });
+
// highlight code !
Prism.highlightAll();
@@ -255,17 +281,6 @@ Job history
let jsonMode = ace.require("ace/mode/hjson").Mode;
providerEditor.session.setMode(new jsonMode());
}
-
- function saveStack(){
- // getting custom provider data
- stackData.providerSpec = providerEditor.getValue();
- $.ajax({
- url: `/api/stacks/${stackId}`,
- data: JSON.stringify(stackData),
- contentType: "application/json",
- method: "PUT"
- })
- }