install-finish-magic
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -42,7 +42,7 @@ return [
|
|||||||
'settinggroup' => 'system',
|
'settinggroup' => 'system',
|
||||||
'varname' => 'froxlordirectlyviahostname',
|
'varname' => 'froxlordirectlyviahostname',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'default' => false,
|
'default' => true,
|
||||||
'save_method' => 'storeSettingField'
|
'save_method' => 'storeSettingField'
|
||||||
],
|
],
|
||||||
'system_froxloraliases' => [
|
'system_froxloraliases' => [
|
||||||
|
|||||||
@@ -598,7 +598,7 @@ opcache.validate_timestamps'),
|
|||||||
('system', 'ftpserver', 'proftpd'),
|
('system', 'ftpserver', 'proftpd'),
|
||||||
('system', 'dns_createmailentry', '0'),
|
('system', 'dns_createmailentry', '0'),
|
||||||
('system', 'dns_createcaaentry', '1'),
|
('system', 'dns_createcaaentry', '1'),
|
||||||
('system', 'froxlordirectlyviahostname', '0'),
|
('system', 'froxlordirectlyviahostname', '1'),
|
||||||
('system', 'report_enable', '1'),
|
('system', 'report_enable', '1'),
|
||||||
('system', 'report_webmax', '90'),
|
('system', 'report_webmax', '90'),
|
||||||
('system', 'report_trafficmax', '90'),
|
('system', 'report_trafficmax', '90'),
|
||||||
|
|||||||
@@ -163,11 +163,14 @@ class UI
|
|||||||
self::$install_mode = $install_mode;
|
self::$install_mode = $install_mode;
|
||||||
// init twig template engine
|
// init twig template engine
|
||||||
$loader = new FilesystemLoader(Froxlor::getInstallDir() . '/templates/');
|
$loader = new FilesystemLoader(Froxlor::getInstallDir() . '/templates/');
|
||||||
self::$twig = new Environment($loader, [
|
$twig_params = [
|
||||||
'debug' => true,
|
'auto_reload' => true,
|
||||||
'cache' => Froxlor::getInstallDir() . '/cache',
|
'debug' => false,
|
||||||
'auto_reload' => true
|
];
|
||||||
]);
|
if (is_writable(Froxlor::getInstallDir() . '/cache')) {
|
||||||
|
$twig_params['cache'] = Froxlor::getInstallDir() . '/cache';
|
||||||
|
}
|
||||||
|
self::$twig = new Environment($loader, $twig_params);
|
||||||
self::$twig->addExtension(new DebugExtension());
|
self::$twig->addExtension(new DebugExtension());
|
||||||
self::$twig->addExtension(new CustomReflection());
|
self::$twig->addExtension(new CustomReflection());
|
||||||
self::$twig->addExtension(new FroxlorTwig());
|
self::$twig->addExtension(new FroxlorTwig());
|
||||||
|
|||||||
@@ -231,7 +231,11 @@ return [
|
|||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'value' => '1',
|
'value' => '1',
|
||||||
'checked' => old('manual_config', '0', 'installation'),
|
'checked' => old('manual_config', '0', 'installation'),
|
||||||
]
|
],
|
||||||
|
'target_servername' => [
|
||||||
|
'type' => 'hidden',
|
||||||
|
'value' => $_SESSION['installation']['servername'] ?? "",
|
||||||
|
],
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -2169,6 +2169,7 @@ Vielen Dank, Ihr Administrator',
|
|||||||
'description' => 'Der untenstehende Befehl lädt, installiert und konfiguriert die benötigten Dienste auf dem System aufgrund der Angaben die während des Installationsprozessen gesammelt wurden.',
|
'description' => 'Der untenstehende Befehl lädt, installiert und konfiguriert die benötigten Dienste auf dem System aufgrund der Angaben die während des Installationsprozessen gesammelt wurden.',
|
||||||
'runcmd' => 'Folgenden Befehl als root-Benutzer in der Shell auf dem Server ausführen:',
|
'runcmd' => 'Folgenden Befehl als root-Benutzer in der Shell auf dem Server ausführen:',
|
||||||
'manual_config' => 'Ich werden die Dienste manuell konfigurieren, direkt zum Login umleiten',
|
'manual_config' => 'Ich werden die Dienste manuell konfigurieren, direkt zum Login umleiten',
|
||||||
|
'waitforconfig' => 'Warte auf Abschluss der Dienstkonfiguration...',
|
||||||
],
|
],
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'wrong_ownership' => 'Die froxlor Dateien gehören nicht vollständig dem Benutzer %s:%s',
|
'wrong_ownership' => 'Die froxlor Dateien gehören nicht vollständig dem Benutzer %s:%s',
|
||||||
|
|||||||
@@ -2555,6 +2555,7 @@ Yours sincerely, your administrator',
|
|||||||
'description' => 'The command below will download, install and configure required services on your system according to the data you have given in this installation process.',
|
'description' => 'The command below will download, install and configure required services on your system according to the data you have given in this installation process.',
|
||||||
'runcmd' => 'Run the following command as root-user in your shell on this server:',
|
'runcmd' => 'Run the following command as root-user in your shell on this server:',
|
||||||
'manual_config' => 'I will manually configure the services, just take me to the login',
|
'manual_config' => 'I will manually configure the services, just take me to the login',
|
||||||
|
'waitforconfig' => 'Waiting for services to be configured...',
|
||||||
],
|
],
|
||||||
'errors' => [
|
'errors' => [
|
||||||
'wrong_ownership' => 'Make sure the froxlor files are owned by %s:%s',
|
'wrong_ownership' => 'Make sure the froxlor files are owned by %s:%s',
|
||||||
|
|||||||
@@ -60,7 +60,8 @@
|
|||||||
<a href="?step={{ setup.step - 1 }}" class="btn btn-secondary">« {{ lng('panel.back') }}</a>
|
<a href="?step={{ setup.step - 1 }}" class="btn btn-secondary">« {{ lng('panel.back') }}</a>
|
||||||
<button type="submit" name="submit" class="btn btn-primary">{{ lng('panel.next') }} »</button>
|
<button type="submit" name="submit" class="btn btn-primary">{{ lng('panel.next') }} »</button>
|
||||||
{% else %}
|
{% else %}
|
||||||
<button type="submit" name="submit" class="btn btn-success">{{ lng('install.install.top') }} »</button>
|
<span id="submitAuto"><i class="fas fa-spinner fa-pulse"></i> {{ lng('install.install.waitforconfig') }}</span>
|
||||||
|
<button id="submitManual" type="submit" name="submit" class="btn btn-success d-none">{{ lng('install.install.top') }} »</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
<pre>chown -R {{ user }}:{{ group }} {{ installdir }}</pre>
|
<pre>chown -R {{ user }}:{{ group }} {{ installdir }}</pre>
|
||||||
<hr>
|
<hr>
|
||||||
<p class="mt-1 text-center">
|
<p class="mt-1 text-center">
|
||||||
<a href="./install/install.php" class="btn btn-primary" title="Click to start the install process">Start install</a>
|
<a href="" class="btn btn-primary" title="Reload page">Reload</a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ $(function () {
|
|||||||
*/
|
*/
|
||||||
$('#switchInstallMode').on('click', function () {
|
$('#switchInstallMode').on('click', function () {
|
||||||
var checked = $(this).prop('checked');
|
var checked = $(this).prop('checked');
|
||||||
window.location = '/install/install.php' + replaceQueryParam('extended', +checked, window.location.search);
|
window.location = window.location.pathname + replaceQueryParam('extended', +checked, window.location.search);
|
||||||
});
|
});
|
||||||
|
|
||||||
function replaceQueryParam(param, newval, search) {
|
function replaceQueryParam(param, newval, search) {
|
||||||
@@ -14,4 +14,49 @@ $(function () {
|
|||||||
}
|
}
|
||||||
return search + '&' + param + '=' + newval;
|
return search + '&' + param + '=' + newval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkConfigState() {
|
||||||
|
$.ajax({
|
||||||
|
url: window.location.href,
|
||||||
|
type: "GET",
|
||||||
|
success: function (data, textStatus, request) {
|
||||||
|
if (request.status >= 300) {
|
||||||
|
window.location = "http://" + srvName;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (request, textStatus, errorThrown) {
|
||||||
|
// continue
|
||||||
|
if (request.status >= 300) {
|
||||||
|
window.location = "http://" + srvName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
var cTimer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* check manual-config switch
|
||||||
|
*/
|
||||||
|
$('#manual_config').on('click', function () {
|
||||||
|
clearInterval(cTimer);
|
||||||
|
var checked = $(this).prop('checked');
|
||||||
|
if (checked) {
|
||||||
|
// button zum login
|
||||||
|
$('#submitAuto').addClass('d-none');
|
||||||
|
$('#submitManual').removeClass('d-none');
|
||||||
|
} else {
|
||||||
|
cTimer = setInterval(checkConfigState, 1000);
|
||||||
|
// spinner fürs warten
|
||||||
|
$('#submitAuto').removeClass('d-none');
|
||||||
|
$('#submitManual').addClass('d-none');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if ($('#manual_config').length > 0) {
|
||||||
|
var srvName = $('#target_servername').val();
|
||||||
|
clearInterval(cTimer);
|
||||||
|
cTimer = setInterval(checkConfigState, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user