From e8825585e0118a3c2c80e6651122268209d29d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szekeres=20Ba=CC=81lint?= Date: Sun, 19 Aug 2018 23:17:07 +0200 Subject: [PATCH] tabbed layout --- package.json | 9 +- public/assets/img/refresh.svg | 1 - public/assets/js/app.js | 29 +- public/index.html | 1064 ++++++++++------- public/templates/conf/nginx.conf.html | 2 +- .../drupal.conf.html} | 0 .../general.conf.html} | 0 .../letsencrypt.conf.html} | 0 .../php_fastcgi.conf.html} | 6 +- .../wordpress.conf.html} | 4 +- .../example.com.conf.html | 20 +- resources/scss/_ads.scss | 3 +- resources/scss/_main.scss | 79 +- resources/scss/_sidebar.scss | 100 +- resources/scss/_variables.scss | 6 + resources/scss/app.scss | 2 + resources/scss/vendor/_bootstrap.scss | 2 +- 17 files changed, 759 insertions(+), 568 deletions(-) delete mode 100644 public/assets/img/refresh.svg rename public/templates/conf/{_drupal.conf.html => nginxconfig.io/drupal.conf.html} (100%) rename public/templates/conf/{_general.conf.html => nginxconfig.io/general.conf.html} (100%) rename public/templates/conf/{_letsencrypt.conf.html => nginxconfig.io/letsencrypt.conf.html} (100%) rename public/templates/conf/{_php_fastcgi.conf.html => nginxconfig.io/php_fastcgi.conf.html} (72%) rename public/templates/conf/{_wordpress.conf.html => nginxconfig.io/wordpress.conf.html} (92%) rename public/templates/conf/{ => sites-available}/example.com.conf.html (84%) create mode 100644 resources/scss/_variables.scss diff --git a/package.json b/package.json index 9d58a14..843b969 100644 --- a/package.json +++ b/package.json @@ -33,14 +33,19 @@ }, "scripts": { "start": "npm run build && http-server", + "build": "npm run build:scss", "build:prod": "npm run build:scss:prod && npm run autoprefixer", + "build:scss": "node-sass --source-map=public/assets/css/app.min.css.map resources/scss/app.scss public/assets/css/app.min.css", "build:scss:prod": "node-sass --output-style=compressed resources/scss/app.scss public/assets/css/app.min.css", + + "autoprefixer": "postcss public/assets/css/app.min.css --use autoprefixer --no-map --replace --verbose", + "test": "start-server-and-test start http://localhost:8080 cypress:run", "test:debug": "start-server-and-test start http://localhost:8080 cypress:open", + "cypress:run": "cypress run", - "cypress:open": "cypress open", - "autoprefixer": "postcss public/assets/css/app.min.css --use autoprefixer --no-map --replace --verbose" + "cypress:open": "cypress open" } } diff --git a/public/assets/img/refresh.svg b/public/assets/img/refresh.svg deleted file mode 100644 index 6aca427..0000000 --- a/public/assets/img/refresh.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/public/assets/js/app.js b/public/assets/js/app.js index e4c1585..bb027eb 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -19,7 +19,7 @@ .html5Mode(true) .hashPrefix('!'); }) - .controller('NginxConfigIoController', function NginxConfigIoController($scope, $location, $timeout) { + .controller('NginxConfigIoController', function NginxConfigIoController($scope, $window, $location, $timeout) { /////////////////////// // PRIVATE VARIABLES // /////////////////////// @@ -38,7 +38,7 @@ path: '', document_root: '/public', - https: false, + https: true, http2: true, redirect: true, @@ -59,11 +59,12 @@ fallback_php: true, fallback_php_path: '/api/', - php: '7.2', + php: true, + php_connection: '7.2', wordpress: false, drupal: false, - file_structure: 'unified', + file_structure: 'modularized', referrer_policy: 'no-referrer-when-downgrade', content_security_policy: 'default-src * data: \'unsafe-eval\' \'unsafe-inline\'', @@ -89,6 +90,7 @@ $scope.data = angular.copy($scope.defaultData); $scope.dataInit = false; $scope.isDirty = false; + $scope.tab = 'site'; $scope.sslCertificateChanged = false; $scope.sslCertificateKeyChanged = false; @@ -276,6 +278,10 @@ }); }; + $scope.setTab = function(tab) { + $scope.tab = tab; + }; + $scope.setPreset = function(preset) { $scope.data.php = $scope.defaultData.php; $scope.data.wordpress = $scope.defaultData.wordpress; @@ -285,7 +291,7 @@ switch(preset) { case 'frontend': - $scope.data.php = 'off'; + $scope.data.php = false; $scope.data.index = 'index.html'; $scope.data.fallback_html = true; break; @@ -306,6 +312,10 @@ }); }; + $scope.getChangesForTab = function(tab) { + return $window.document.querySelectorAll('section.tabs .tab-content .tab-' + tab + ' .input-changed').length; + }; + /////////////////////////// @@ -392,7 +402,7 @@ }; $scope.isPHP = function() { - return $scope.data.php !== 'off'; + return $scope.data.php; }; $scope.isWordPress = function() { @@ -438,6 +448,13 @@ $scope.refreshHighlighting(); $scope.updateHash(); + if (!$scope.data.php) { + $scope.defaultData.index = 'index.html'; + $scope.data.index = 'index.html'; + } else { + $scope.defaultData.index = 'index.php'; + } + for (var key in $scope.data) { if (!angular.equals(newValue[key], oldValue[key])) { gtag('event', key, { diff --git a/public/index.html b/public/index.html index 49dffd9..fa93f49 100644 --- a/public/index.html +++ b/public/index.html @@ -22,170 +22,122 @@
- - - - - +
+ + + + + +
-
-
-
- -
-
-
-
-
-
-
-
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+ +
+
+
+ +
+ +
-
- /etc/nginx/nginx.conf - - Copied! -
-
-
-
-
- /etc/nginx/sites-enabled/{{ domain() }}.conf - - Copied! -
-
-
-
-
- /etc/nginx/_letsencrypt.conf - - Copied! -
-
-
-
-
- /etc/nginx/_general.conf - - Copied! -
-
-
-
-
- /etc/nginx/_php_fastcgi.conf - - Copied! -
-
-
-
-
- /etc/nginx/_wordpress.conf - - Copied! -
-
-
-
-
- /etc/nginx/_drupal.conf - - Copied! -
-
-
-
-
-
- +
+ +
- + +
+
+
+
+
+
+
+
+
+
+ /etc/nginx/nginx.conf + + Copied! +
+
+
+
+
+ /etc/nginx/sites-enabled/{{ domain() }}.conf + + Copied! +
+
+
+
+
+ /etc/nginx/nginxconfig.io/letsencrypt.conf + + Copied! +
+
+
+
+
+ /etc/nginx/nginxconfig.io/general.conf + + Copied! +
+
+
+
+
+ /etc/nginx/nginxconfig.io/php_fastcgi.conf + + Copied! +
+
+
+
+
+ /etc/nginx/nginxconfig.io/wordpress.conf + + Copied! +
+
+
+
+
+ /etc/nginx/nginxconfig.io/drupal.conf + + Copied! +
+
+
+
+
+
+