Skip to content

Commit

Permalink
🔥 : clean-up stack screen
Browse files Browse the repository at this point in the history
settings are not needed anymore
prism and ace-editor are not needed anymore
  • Loading branch information
juwit committed Jul 12, 2019
1 parent 10718cb commit 1f61458
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
6 changes: 1 addition & 5 deletions src/main/java/io/codeka/gaia/controller/StackController.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,13 @@ public class StackController {

private TerraformModuleRepository terraformModuleRepository;

private Settings settings;

private JobRepository jobRepository;

@Autowired
public StackController(StackRepository stackRepository, StackRunner stackRunner, TerraformModuleRepository terraformModuleRepository, Settings settings, JobRepository jobRepository) {
public StackController(StackRepository stackRepository, StackRunner stackRunner, TerraformModuleRepository terraformModuleRepository, JobRepository jobRepository) {
this.stackRepository = stackRepository;
this.stackRunner = stackRunner;
this.terraformModuleRepository = terraformModuleRepository;
this.settings = settings;
this.jobRepository = jobRepository;
}

Expand All @@ -56,7 +53,6 @@ public String editStack(@PathVariable String stackId, Model model){
// TODO throw an exception (404) if not
if(stackRepository.existsById(stackId)){
model.addAttribute("stackId", stackId);
model.addAttribute("settings", settings);
}
return "stack";
}
Expand Down
23 changes: 3 additions & 20 deletions src/main/resources/templates/stack.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
<script src="/webjars/jquery/3.0.0/jquery.min.js"></script>
<script src="/webjars/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="/webjars/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="/js/prism.js"></script>
<script src="/webjars/ace-builds/1.4.4/src-min/ace.js"></script>
<script src="/webjars/ace-builds/1.4.4/src-min/mode-hjson.js"></script>

<script src="/webjars/vue/2.5.16/vue.js"></script>

Expand Down Expand Up @@ -168,14 +165,9 @@ <h2><span><i class="fas fa-history"></i> Job history</span></h2>
</script>



<script th:inline="javascript" type="application/ecmascript">
const settings = [[${settings}]];

let stack;

let providerEditor;

console.log("loadStack");
$.get(`/api/stacks/${stackId}`)
.then(data => stack = data)
Expand Down Expand Up @@ -216,8 +208,7 @@ <h2><span><i class="fas fa-history"></i> Job history</span></h2>
new Vue({
el: "#app",
data: {
stack,
settings
stack
},
template: "#template",
methods: {
Expand All @@ -242,8 +233,8 @@ <h2><span><i class="fas fa-history"></i> Job history</span></h2>
template: "#stack-controls",
methods: {
save: function(){
// getting custom provider data
// stack.providerSpec = providerEditor.getValue();
const message = Messenger().post({
type: "info",
stack.state = 'TO_UPDATE';
$.ajax({
url: `/api/stacks/${stackId}`,
Expand All @@ -254,14 +245,6 @@ <h2><span><i class="fas fa-history"></i> Job history</span></h2>
}
}
});

// highlight code !
Prism.highlightAll();

// activating code editor
providerEditor = ace.edit("provider-editor");
let jsonMode = ace.require("ace/mode/hjson").Mode;
providerEditor.session.setMode(new jsonMode());
}
</script>

Expand Down

0 comments on commit 1f61458

Please sign in to comment.