backup extension shows alerts on check and repair inconsistency actions

This commit is contained in:
maxpozdeev 2023-12-26 12:36:04 +03:00
parent 39ba94e303
commit 9191031140
3 changed files with 11 additions and 4 deletions

View file

@ -118,12 +118,17 @@ class Controller extends \ApiController
];
return;
}
$html = "<pre>". htmlspecialchars($check->report). "</pre>";
$this->response->data = [
'total' => 1,
'ok' => true,
'msg' => __("backup.done"),
'html' => $html,
];
if ($check->report == 'OK') {
$this->response->data['alertText'] = "OK";
}
else {
$this->response->data['html'] = "<pre>". htmlspecialchars($check->report). "</pre>";
}
}
function postRepairInconsistency()
@ -141,7 +146,9 @@ class Controller extends \ApiController
}
$this->response->data = [
'total' => 1,
'ok' => true,
'msg' => __("backup.done"),
'alertText' => __("backup.done"),
];
}

View file

@ -1,6 +1,6 @@
{
"bundleId": "backup",
"name": "Backup",
"version": "0.9",
"version": "1.0",
"description": "Backup"
}

View file

@ -95,7 +95,7 @@ function onBackupFileChange(el) {
<div class="descr">{$e('backup.d_inconsistency')}</div>
</div>
<div class="td">
<button type=button data-ext-settings-action="post:checkInconsistency:file" data-ext="$ext"> {$e('backup.check')} </button> &nbsp;
<button type=button data-ext-settings-action="post:checkInconsistency" data-ext="$ext"> {$e('backup.check')} </button> &nbsp;
<button type=button data-ext-settings-action="post:repairInconsistency" data-ext="$ext"> {$e('backup.repair')} </button> <br>
</div>
</div>