tabbed layout

This commit is contained in:
Szekeres Bálint
2018-08-19 23:17:07 +02:00
parent 1a74a34576
commit e8825585e0
17 changed files with 759 additions and 568 deletions

View File

@@ -1 +0,0 @@
<svg height="14" viewBox="0 0 12 14" width="12" xmlns="http://www.w3.org/2000/svg"><path d="m11.805 8.25q0 .039-.008.055-.5 2.094-2.094 3.395t-3.734 1.301q-1.141 0-2.207-.43t-1.902-1.227l-1.008 1.008q-.148.148-.352.148t-.352-.148-.148-.352v-3.5q0-.203.148-.352t.352-.148h3.5q.203 0 .352.148t.148.352-.148.352l-1.07 1.07q.555.516 1.258.797t1.461.281q1.047 0 1.953-.508t1.453-1.398q.086-.133.414-.914.062-.18.234-.18h1.5q.102 0 .176.074t.074.176zm.195-6.25v3.5q0 .203-.148.352t-.352.148h-3.5q-.203 0-.352-.148t-.148-.352.148-.352l1.078-1.078q-1.156-1.07-2.727-1.07-1.047 0-1.953.508t-1.453 1.398q-.086.133-.414.914-.062.18-.234.18h-1.555q-.102 0-.176-.074t-.074-.176v-.055q.508-2.094 2.109-3.395t3.75-1.301q1.141 0 2.219.434t1.914 1.223l1.016-1.008q.148-.148.352-.148t.352.148.148.352z" fill="#fff"/></svg>

Before

Width:  |  Height:  |  Size: 804 B

View File

@@ -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, {

File diff suppressed because it is too large Load Diff

View File

@@ -64,5 +64,5 @@ http {
include /etc/nginx/sites-enabled/*;</span><span ng-if="data.file_structure === 'unified'">
# {{ !data.non_www ? 'www.' : '' }}{{ domain() }}
<ng-include ng-include-tabs="1" src="'templates/conf/example.com.conf.html?v=COMMIT_HASH'" sonload="refreshHighlighting()"></ng-include></span>
<ng-include ng-include-tabs="1" src="'templates/conf/sites-available/example.com.conf.html?v=COMMIT_HASH'" sonload="refreshHighlighting()"></ng-include></span>
}

View File

@@ -2,9 +2,9 @@ try_files $uri =404;
# fastcgi
fastcgi_pass {{
data.php === 'tcp' ? '127.0.0.1:9000' : (
data.php === '5.x' ? 'unix:/var/run/php5-fpm.sock' : (
'unix:/var/run/php/php' + data.php +'-fpm.sock'
data.php_connection === 'tcp' ? '127.0.0.1:9000' : (
data.php_connection === '5.x' ? 'unix:/var/run/php5-fpm.sock' : (
'unix:/var/run/php/php' + data.php_connection +'-fpm.sock'
)
)
}};

View File

@@ -1,6 +1,6 @@
# WordPress: allow TinyMCE
location = /wp-includes/js/tinymce/wp-tinymce.php {
include _php_fastcgi.conf;
include nginxconfig.io/php_fastcgi.conf;
}
# WordPress: deny wp-content, wp-includes php files
@@ -31,5 +31,5 @@ location ~* ^/(?:xmlrpc\.php|wp-links-opml\.php|wp-config\.php|wp-config-sample\
# WordPress: throttle wp-login.php
location = /wp-login.php {
limit_req zone=login burst=2 nodelay;
include _php_fastcgi.conf;
include nginxconfig.io/php_fastcgi.conf;
}</span>

View File

@@ -55,10 +55,10 @@ server {<!--
location ~ \.php$ {<!--
✔ modularized || ✔ WordPress --><span ng-if="isModularized() || isWordPress()">
include _php_fastcgi.conf;</span><!--
include nginxconfig.io/php_fastcgi.conf;</span><!--
✔ unified && ✘ WordPress --><span ng-if="isUnified() && !isWordPress()">
<ng-include ng-include-tabs="{{ isUnified() ? 3 : 1 }}" src="'templates/conf/_php_fastcgi.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span>
<ng-include ng-include-tabs="{{ isUnified() ? 3 : 1 }}" src="'templates/conf/nginxconfig.io/php_fastcgi.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span>
}</span><!--
✔ unified --><span ng-if="isModularized()">
@@ -67,27 +67,27 @@ server {<!--
✔ modularized --><span ng-if="isModularized()">
include _general.conf;</span><!--
include nginxconfig.io/general.conf;</span><!--
✔ modularized && ✔ WordPress --><span ng-if="isModularized() && isWordPress()">
include _wordpress.conf;</span><!--
include nginxconfig.io/wordpress.conf;</span><!--
✔ modularized && ✔ Drupal --><span ng-if="isModularized() && isDrupal()">
include _drupal.conf;</span><!--
include nginxconfig.io/drupal.conf;</span><!--
✔ unified --><span ng-if="isUnified()">
<!-- --><ng-include ng-include-tabs="2" src="'templates/conf/_general.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span><!--
<!-- --><ng-include ng-include-tabs="2" src="'templates/conf/nginxconfig.io/general.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span><!--
✔ unified && ✔ WordPress --><span ng-if="isUnified() && isWordPress()">
<!-- --><ng-include ng-include-tabs="2" src="'templates/conf/_wordpress.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span><!--
<!-- --><ng-include ng-include-tabs="2" src="'templates/conf/nginxconfig.io/wordpress.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span><!--
✔ unified && ✔ Drupal --><span ng-if="isUnified() && isDrupal()">
<!-- --><ng-include ng-include-tabs="2" src="'templates/conf/_drupal.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span>
<!-- --><ng-include ng-include-tabs="2" src="'templates/conf/nginxconfig.io/drupal.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span>
}<!--
@@ -180,11 +180,11 @@ server {
✔ modularized && ✔ Let's Encrypt --><span ng-if="isModularized() && isCertLetsEncrypt()">
include _letsencrypt.conf;</span><!--
include nginxconfig.io/letsencrypt.conf;</span><!--
✔ unified && ✔ Let's Encrypt --><span ng-if="isUnified() && isCertLetsEncrypt()">
<ng-include ng-include-tabs="2" src="'templates/conf/_letsencrypt.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span><!--
<ng-include ng-include-tabs="2" src="'templates/conf/nginxconfig.io/letsencrypt.conf.html?v=COMMIT_HASH'" onload="refreshHighlighting()"></ng-include></span><!--
✔ Let's Encrypt --><span ng-if="isCertLetsEncrypt()">