|
|
-
+
|
-
+
|
-
+
|
-
+
|
-
+
|
-
+
|
-
+
|
@@ -99,7 +99,12 @@ $listDirn = $this->escape($this->state->get('list.direction'));
id); ?>
|
- escape($item->description); ?>
+
+ escape($item->description); ?>
+
+ checksum)) : ?>
+ : checksum, 0, 16); ?>...
+
|
escape($item->profile_title ?? 'Profile #' . $item->profile_id); ?>
@@ -130,13 +135,18 @@ $listDirn = $this->escape($this->state->get('list.direction'));
|
backupstart, Text::_('DATE_FORMAT_LC4')); ?>
|
-
+ |
status === 'complete' && $item->filesexist) : ?>
-
+
+
|
id; ?>
@@ -158,7 +168,7 @@ $listDirn = $this->escape($this->state->get('list.direction'));
-
+
Backup in Progress
@@ -188,12 +198,25 @@ $listDirn = $this->escape($this->state->get('list.direction'));
}
});
+ var backupRunning = false;
+
+ function warnBeforeClose(e) {
+ if (backupRunning) {
+ e.preventDefault();
+ e.returnValue = '';
+ }
+ }
+
+ window.addEventListener('beforeunload', warnBeforeClose);
+
function showModal() {
- document.getElementById('mokobackup-modal').style.display = 'block';
+ backupRunning = true;
+ document.getElementById('mokojoombackup-modal').style.display = 'block';
}
function hideModal() {
- document.getElementById('mokobackup-modal').style.display = 'none';
+ backupRunning = false;
+ document.getElementById('mokojoombackup-modal').style.display = 'none';
}
function updateProgress(progress, message, phase) {
@@ -273,6 +296,59 @@ $listDirn = $this->escape($this->state->get('list.direction'));
}
// Expose for toolbar button
- window.mokobackupStart = startSteppedBackup;
+ window.mokojoombackupStart = startSteppedBackup;
+
+ // View Log modal handler
+ document.addEventListener('click', function(e) {
+ var btn = e.target.closest('.mb-view-log');
+ if (!btn) return;
+ e.preventDefault();
+ var recordId = btn.getAttribute('data-id');
+ var modal = document.getElementById('mb-log-modal');
+ var body = document.getElementById('mb-log-body');
+ body.textContent = 'Loading...';
+ modal.style.display = 'block';
+
+ var form = new URLSearchParams();
+ form.append('task', 'ajax.viewLog');
+ form.append('id', recordId);
+ form.append(TOKEN_NAME, '1');
+
+ fetch(AJAX_URL, {
+ method: 'POST',
+ body: form,
+ headers: { 'X-Requested-With': 'XMLHttpRequest' }
+ })
+ .then(function(r) { return r.json(); })
+ .then(function(data) {
+ if (data.error) {
+ body.textContent = data.message || 'Error loading log';
+ } else {
+ body.textContent = data.log;
+ }
+ })
+ .catch(function(err) {
+ body.textContent = 'Error: ' + err.message;
+ });
+ });
+
+ document.addEventListener('click', function(e) {
+ if (e.target.id === 'mb-log-modal' || e.target.classList.contains('mb-log-close')) {
+ document.getElementById('mb-log-modal').style.display = 'none';
+ }
+ });
})();
+
+
+
diff --git a/src/packages/com_mokobackup/tmpl/backups/index.html b/source/packages/com_mokojoombackup/tmpl/backups/index.html
similarity index 100%
rename from src/packages/com_mokobackup/tmpl/backups/index.html
rename to source/packages/com_mokojoombackup/tmpl/backups/index.html
diff --git a/source/packages/com_mokojoombackup/tmpl/dashboard/default.php b/source/packages/com_mokojoombackup/tmpl/dashboard/default.php
new file mode 100644
index 0000000..cde9eeb
--- /dev/null
+++ b/source/packages/com_mokojoombackup/tmpl/dashboard/default.php
@@ -0,0 +1,296 @@
+
+ * @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
+ * @license GNU General Public License version 3 or later; see LICENSE
+ */
+
+defined('_JEXEC') or die;
+
+use Joomla\CMS\HTML\HTMLHelper;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Router\Route;
+use Joomla\CMS\Session\Session;
+
+$ajaxToken = Session::getFormToken();
+$ajaxUrl = Route::_('index.php?option=com_mokojoombackup&format=json', false);
+?>
+defaultDirWarning) : ?>
+
+
+
+
+
+
+
+
+
+
+ lastBackup) : ?>
+
+ lastBackup->backupend, Text::_('DATE_FORMAT_LC4')); ?>
+
+
+ escape($this->lastBackup->profile_title); ?>
+ —
+ lastBackup->total_size); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ nextScheduled) : ?>
+
+ nextScheduled->next_execution, Text::_('DATE_FORMAT_LC4')); ?>
+
+ escape($this->nextScheduled->title); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+ stats->total_count; ?>
+
+
+
+
+
+
+
+
+
+
+ stats->total_size); ?>
+
+ stats->fail_count_7d > 0) : ?>
+
+ stats->fail_count_7d); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ profiles)) : ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ systemHealth as $check) : ?>
+
+ |
+ status) : ?>
+
+
+
+
+ |
+ escape($check->label); ?> |
+ escape($check->detail); ?> |
+
+
+
+
+
+
+
+
+
+
+
+
+ Backup in Progress
+
+ Initializing...
+ Phase: init
+
+
+
+
diff --git a/src/packages/com_mokobackup/tmpl/index.html b/source/packages/com_mokojoombackup/tmpl/index.html
similarity index 100%
rename from src/packages/com_mokobackup/tmpl/index.html
rename to source/packages/com_mokojoombackup/tmpl/index.html
diff --git a/src/packages/com_mokobackup/tmpl/profile/edit.php b/source/packages/com_mokojoombackup/tmpl/profile/edit.php
similarity index 84%
rename from src/packages/com_mokobackup/tmpl/profile/edit.php
rename to source/packages/com_mokojoombackup/tmpl/profile/edit.php
index d208ed9..f2ea845 100644
--- a/src/packages/com_mokobackup/tmpl/profile/edit.php
+++ b/source/packages/com_mokojoombackup/tmpl/profile/edit.php
@@ -2,7 +2,7 @@
/**
* @package MokoJoomBackup
- * @subpackage com_mokobackup
+ * @subpackage com_mokojoombackup
* @author Moko Consulting
* @copyright Copyright (C) 2026 Moko Consulting. All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE
@@ -17,13 +17,13 @@ use Joomla\CMS\Router\Route;
HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('behavior.keepalive');
?>
- |