From 0f8d62a9abf8140e65d0322387a089c1a98c6a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ba=CC=81lint=20Szekeres?= Date: Sun, 10 Nov 2019 22:52:55 +0100 Subject: [PATCH] optimalization --- public/partials/config-global.html | 4 +-- public/partials/config-site.html | 2 +- resources/js/app.js | 48 ++++++++++++++---------------- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/public/partials/config-global.html b/public/partials/config-global.html index db4a06d..2bab5c2 100644 --- a/public/partials/config-global.html +++ b/public/partials/config-global.html @@ -3,13 +3,13 @@ Global:
diff --git a/public/partials/config-site.html b/public/partials/config-site.html index 0d076fe..1537bfb 100644 --- a/public/partials/config-site.html +++ b/public/partials/config-site.html @@ -7,7 +7,7 @@
diff --git a/resources/js/app.js b/resources/js/app.js index 8f6bd2b..1294bac 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -190,37 +190,16 @@ } function calculateChanges() { - var siteTabs = [ - 'server', - 'https', - 'php', - 'python', - 'proxy', - 'routing', - 'logging', - ]; - - var commonTabs = [ - 'https', - 'security', - 'php', - 'python', - 'performance', - 'logging', - 'nginx', - 'tools', - ]; - if ($scope.siteChanges[$scope.site] === undefined) { $scope.siteChanges[$scope.site] = {}; } - for (var i in siteTabs) { - $scope.siteChanges[$scope.site][siteTabs[i]] = $window.document.querySelectorAll('section.tabs .tab-content.site-content .tab-' + siteTabs[i] + ' .form-group:not(.disabled) .input-changed').length; + for (var i in $scope.tabs_site) { + $scope.siteChanges[$scope.site][$scope.tabs_site[i].slug] = $window.document.querySelectorAll('section.tabs .tab-content.site-content .tab-' + $scope.tabs_site[i].slug + ' .form-group:not(.disabled) .input-changed').length; } - for (var j in commonTabs) { - $scope.commonChanges[commonTabs[j]] = $window.document.querySelectorAll('section.tabs .tab-content.common-content .tab-' + commonTabs[j] + ' .form-group:not(.disabled) .input-changed').length; + for (var j in $scope.tabs_common) { + $scope.commonChanges[$scope.tabs_common[j].slug] = $window.document.querySelectorAll('section.tabs .tab-content.common-content .tab-' + $scope.tabs_common[j].slug + ' .form-group:not(.disabled) .input-changed').length; } } @@ -462,6 +441,25 @@ }, ]; + $scope.steps = [ + { + name: 'Download', + slug: 'download', + }, + { + name: 'SSL init', + slug: 'ssl', + }, + { + name: 'Cerbot', + slug: 'certbot', + }, + { + name: 'Go Live!', + slug: 'live', + }, + ]; + $scope.siteChanges = {}; $scope.commonChanges = {};