mirror of
https://github.com/digitalocean/nginxconfig.io.git
synced 2025-08-09 18:05:12 +08:00
tabbed layout
This commit is contained in:
@@ -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 |
@@ -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, {
|
||||
|
Reference in New Issue
Block a user