diff --git a/app/scripts/controllers/account.box.edit.script.js b/app/scripts/controllers/account.box.edit.script.js index bc634d05..232b1675 100644 --- a/app/scripts/controllers/account.box.edit.script.js +++ b/app/scripts/controllers/account.box.edit.script.js @@ -9,14 +9,36 @@ function EditBoxScriptController (boxData, AccountService) { var vm = this; + vm.box = boxData; + + vm.serialPort = 'Serial1'; vm.boxScript = ''; + vm.showConfiguration = false; + + vm.changeSerialPort = changeSerialPort; activate(); //// function activate () { - return AccountService.getScript(boxData._id) + if (boxData.model.startsWith('homeV2')) { + vm.showConfiguration = true; + } + + return getScript(); + } + + function changeSerialPort () { + vm.boxScript = 'Neuer Sketch wird generiert...'; + + return getScript(); + } + + function getScript () { + return AccountService.getScript(boxData._id, { + serialPort: vm.serialPort + }) .then(function (response) { vm.boxScript = response; }) diff --git a/app/views/account.box.edit.script.html b/app/views/account.box.edit.script.html index 5bd1a056..baf5a65a 100644 --- a/app/views/account.box.edit.script.html +++ b/app/views/account.box.edit.script.html @@ -1,6 +1,22 @@