ability to skip dxcc update (advanced settings)

This commit is contained in:
HB9HIL
2024-07-21 21:41:02 +02:00
parent eeaf54c6ee
commit ae60f7ef96
3 changed files with 1440 additions and 1415 deletions

View File

@@ -10,6 +10,7 @@ if ($_POST['database_check'] ?? false == true) {
$result = $database->database_check($_POST);
echo $result;
exit;
}
/**
@@ -22,7 +23,7 @@ if ($_POST['database_check'] ?? false == true) {
if ($_POST['run_config_file'] ?? false == true) {
sleep(1);
$data = json_decode($_POST['data'], true);
$data = $_POST['data'];
if ($core->validate_post($data)) {
if($core->write_configfile($data)) {
$result = 'success';
@@ -38,7 +39,7 @@ if ($_POST['run_config_file'] ?? false == true) {
if ($_POST['run_database_file'] ?? false == true) {
sleep(1);
$data = json_decode($_POST['data'], true);
$data = $_POST['data'];
if ($core->validate_post($data)) {
if($core->write_config($data)) {
$result = 'success';
@@ -53,7 +54,7 @@ if ($_POST['run_database_file'] ?? false == true) {
}
if ($_POST['run_database_tables'] ?? false == true) {
$data = json_decode($_POST['data'], true);
$data = $_POST['data'];
if ($core->validate_post($data)) {
$result = $database->create_tables($data);
} else {

File diff suppressed because it is too large Load Diff

View File

@@ -24,7 +24,7 @@
<i id="database_migrations_spinner" class="ld-ext-right"><?= __("Running database migrations") ?><div class="ld ld-ring ld-spin"></div></i><i id="database_migrations_check" class="ms-2 fas fa-check-circle" style="display: none;"></i>
</div>
<div class="mb-3" id="update_dxcc" style="opacity: 50%;">
<i id="update_dxcc_spinner" class="ld-ext-right"><?= __("Updating DXCC data") ?><div class="ld ld-ring ld-spin"></div></i><i id="update_dxcc_check" class="ms-2 fas fa-check-circle" style="display: none;"></i>
<i id="update_dxcc_spinner" class="ld-ext-right"><?= __("Updating DXCC data") ?><i id="skip_dxcc_update_message"></i><div class="ld ld-ring ld-spin"></div></i><i id="update_dxcc_check" class="ms-2 fas fa-check-circle" style="display: none;"></i>
</div>
<?php
@@ -45,6 +45,9 @@
</body>
<script>
let _POST = <?php echo json_encode($_POST); ?>;
$(document).ready(async function() {
try {
await config_file();
@@ -72,8 +75,6 @@
}
});
let _POST = '<?php echo json_encode($_POST); ?>';
async function config_file() {
var field = '#config_file';
@@ -193,26 +194,32 @@
async function update_dxcc() {
var field = '#update_dxcc';
running(field, true);
return new Promise((resolve, reject) => {
$.ajax({
url: "<?php echo $_POST['websiteurl']; ?>" + "index.php/update/dxcc",
success: function(response) {
if (response == 'success') {
running(field, false);
resolve();
} else {
if(_POST.skip_dxcc_update == 0) {
running(field, true);
$.ajax({
url: "<?php echo $_POST['websiteurl']; ?>" + "index.php/update/dxcc",
success: function(response) {
if (response == 'success') {
running(field, false);
resolve();
} else {
running(field, false, true);
reject("<?= __("Could not update DXCC data"); ?>");
}
},
error: function(error) {
running(field, false, true);
reject("<?= __("Could not update DXCC data"); ?>");
reject(error);
}
},
error: function(error) {
running(field, false, true);
reject(error);
}
});
});
} else {
$('#skip_dxcc_update_message').text(" "+"<?= __("(skipped)"); ?>");
resolve();
}
});
}