first commit
This commit is contained in:
297
admininistrator/view/template/tool/backup.twig
Normal file
297
admininistrator/view/template/tool/backup.twig
Normal file
@ -0,0 +1,297 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end"><button type="button" id="button-upload" data-bs-toggle="tooltip" title="{{ button_upload }}" class="btn btn-primary"><i class="fa-solid fa-upload"></i></button></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-exchange-alt"></i> {{ heading_title }}</div>
|
||||
<div class="card-body">
|
||||
<fieldset>
|
||||
<legend>{{ text_progress }}</legend>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_progress }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div id="progress-backup" class="progress">
|
||||
<div id="progress-bar" class="progress-bar"></div>
|
||||
</div>
|
||||
<div id="progress-text"></div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_option }}</legend>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_export }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-control" style="height: 150px; overflow: auto;">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" class="form-check-input" id="input-backup-all" onchange="$(this).parent().parent().find(':checkbox').not(this).prop('checked', $(this).prop('checked'));"/>
|
||||
<label for="input-backup-all" class="form-check-label">{{ text_all }}</label>
|
||||
</div>
|
||||
{% set table_row = 0 %}
|
||||
{% for table in tables %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" name="backup[]" value="{{ table }}" id="input-backup-{{ table_row }}" class="form-check-input" checked/> <label for="input-backup-{{ table_row }}" class="form-check-label">{{ table }}</label>
|
||||
</div>
|
||||
{% set table_row = table_row + 1 %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="offset-sm-2 col-sm-10 text-end">
|
||||
<button type="button" id="button-backup" class="btn btn-success"><i class="fa-solid fa-download"></i> {{ button_backup }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_history }}</legend>
|
||||
<div class="alert alert-info"><i class="fa-solid fa-circle-exclamation"></i> {{ text_import }}</div>
|
||||
<div id="history">{{ history }}</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-backup').on('click', function () {
|
||||
var element = this;
|
||||
|
||||
$(element).button('loading');
|
||||
|
||||
$('#button-upload, #history .btn').prop('disabled', true);
|
||||
|
||||
$('#progress-bar').css('width', '0%');
|
||||
$('#progress-bar').removeClass('bg-danger bg-success');
|
||||
|
||||
var next = 'index.php?route=tool/backup.backup&user_token={{ user_token }}&table=' + $('input[name^=\'backup\']:checked').first().val();
|
||||
|
||||
var backup = function () {
|
||||
return $.ajax({
|
||||
url: next,
|
||||
type: 'post',
|
||||
data: $('input[name^=\'backup\']:checked'),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#progress-bar').addClass('bg-danger');
|
||||
$('#progress-text').html('<div class="text-danger">' + json['error'] + '</div>');
|
||||
|
||||
$('#history').load('index.php?route=tool/backup.history&user_token={{ user_token }}');
|
||||
|
||||
$(element).button('reset');
|
||||
$('#button-upload, #history .btn').prop('disabled', false);
|
||||
}
|
||||
|
||||
if (json['text']) {
|
||||
$('#progress-text').html(json['text']);
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#progress-bar').css('width', '100%').addClass('bg-success');
|
||||
$('#progress-text').html('<div class="text-success">' + json['success'] + '</div>');
|
||||
|
||||
$('#history').load('index.php?route=tool/backup.history&user_token={{ user_token }}');
|
||||
|
||||
$(element).button('reset');
|
||||
$('#button-upload, #history .btn').prop('disabled', false);
|
||||
}
|
||||
|
||||
if (json['progress']) {
|
||||
$('#progress-bar').css('width', json['progress'] + '%');
|
||||
}
|
||||
|
||||
if (json['next']) {
|
||||
next = json['next'];
|
||||
|
||||
chain.attach(backup);
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
|
||||
$(element).button('reset');
|
||||
$('#button-upload, #history .btn').prop('disabled', false);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
chain.attach(backup);
|
||||
});
|
||||
|
||||
// Restore
|
||||
$('#history').on('click', '.btn-warning', function () {
|
||||
var element = this;
|
||||
|
||||
$(element).button('loading');
|
||||
|
||||
$('#button-upload, #button-backup, #history .btn').not(element).prop('disabled', true);
|
||||
|
||||
$('#progress-bar').css('width', '0%');
|
||||
$('#progress-bar').removeClass('bg-danger bg-success');
|
||||
|
||||
var next = 'index.php?route=tool/backup.restore&user_token={{ user_token }}&filename=' + encodeURIComponent($(this).val());
|
||||
|
||||
var restore = function () {
|
||||
return $.ajax({
|
||||
url: next,
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
console.log(json);
|
||||
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#progress-bar').addClass('bg-danger');
|
||||
$('#progress-text').html('<div class="text-danger">' + json['error'] + '</div>');
|
||||
|
||||
$('#history').load('index.php?route=tool/backup.history&user_token={{ user_token }}');
|
||||
|
||||
$(element).button('reset');
|
||||
|
||||
$('#button-upload, #button-backup, #history .btn').not(element).prop('disabled', false);
|
||||
}
|
||||
|
||||
if (json['progress']) {
|
||||
$('#progress-bar').css('width', json['progress'] + '%');
|
||||
}
|
||||
|
||||
if (json['text']) {
|
||||
$('#progress-text').html(json['text']);
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#progress-bar').css('width', '100%').addClass('bg-success');
|
||||
$('#progress-text').html('<div class="text-success">' + json['success'] + '</div>');
|
||||
|
||||
$('#history').load('index.php?route=tool/backup.history&user_token={{ user_token }}');
|
||||
|
||||
$(element).button('reset');
|
||||
|
||||
$('#button-upload, #button-backup, #history .btn').not(element).prop('disabled', false);
|
||||
}
|
||||
|
||||
if (json['next']) {
|
||||
next = json['next'];
|
||||
|
||||
chain.attach(restore);
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
|
||||
$(element).button('reset');
|
||||
|
||||
$('#button-upload, #button-backup, #history .btn').not(element).prop('disabled', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
chain.attach(restore);
|
||||
});
|
||||
|
||||
// Upload
|
||||
$('#button-upload').on('click', function () {
|
||||
$('#form-upload').remove();
|
||||
|
||||
$('body').prepend('<form enctype="multipart/form-data" id="form-upload" style="display: none;"><input type="file" name="upload" /></form>');
|
||||
|
||||
$('#form-upload input[name=\'upload\']').trigger('click');
|
||||
|
||||
$('#form-upload input[name=\'upload\']').on('change', function () {
|
||||
if ((this.files[0].size / 1024) > {{ config_file_max_size }}) {
|
||||
$(this).val('');
|
||||
|
||||
alert('{{ error_upload_size }}');
|
||||
}
|
||||
});
|
||||
|
||||
if (typeof timer != 'undefined') {
|
||||
clearInterval(timer);
|
||||
}
|
||||
|
||||
timer = setInterval(function () {
|
||||
if ($('#form-upload input[name=\'upload\']').val() !== '') {
|
||||
clearInterval(timer);
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=tool/backup.upload&user_token={{ user_token }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: new FormData($('#form-upload')[0]),
|
||||
cache: false,
|
||||
contentType: false,
|
||||
processData: false,
|
||||
beforeSend: function () {
|
||||
$('#button-upload').button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$('#button-upload').button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#history').load('index.php?route=tool/backup.history&user_token={{ user_token }}');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 500);
|
||||
});
|
||||
|
||||
// Delete
|
||||
$('#history').on('click', '.btn-danger', function () {
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=tool/backup.delete&user_token={{ user_token }}&filename=' + encodeURIComponent($(element).val()),
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#history').load('index.php?route=tool/backup.history&user_token={{ user_token }}');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
36
admininistrator/view/template/tool/backup_history.twig
Normal file
36
admininistrator/view/template/tool/backup_history.twig
Normal file
@ -0,0 +1,36 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ column_filename }}</td>
|
||||
<td>{{ column_size }}</td>
|
||||
<td class="d-none d-lg-table-cell">{{ column_date_added }}</td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if histories %}
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td>{{ history.filename }}</td>
|
||||
<td>{{ history.size }}</td>
|
||||
<td class="d-none d-lg-table-cell">{{ history.date_added }}</td>
|
||||
<td class="text-end">
|
||||
<button type="button" value="{{ history.filename }}" data-bs-toggle="tooltip" title="{{ button_restore }}" class="btn btn-warning"><i class="fa-solid fa-rotate"></i></button>
|
||||
<button type="button" onclick="location = '{{ history.download }}';" data-bs-toggle="tooltip" title="{{ button_download }}" class="btn btn-info"><i class="fa-solid fa-download"></i></button>
|
||||
<button type="button" value="{{ history.filename }}" data-bs-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="4" class="text-center">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
86
admininistrator/view/template/tool/log.twig
Normal file
86
admininistrator/view/template/tool/log.twig
Normal file
@ -0,0 +1,86 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> {{ error_warning }} <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>
|
||||
{% endif %}
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-triangle-exclamation"></i> {{ text_list }}</div>
|
||||
<div class="card-body">
|
||||
<ul class="nav nav-tabs">
|
||||
{% set i = 0 %}
|
||||
{% for log in logs %}
|
||||
<li class="nav-item"><a href="#tab-log-{{ i }}" data-bs-toggle="tab" class="nav-link{% if i == 0 %} active{% endif %}">{{ log.name }}</a></li>
|
||||
{% set i = i + 1 %}
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
{% set i = 0 %}
|
||||
{% for log in logs %}
|
||||
<div id="tab-log-{{ i }}" class="tab-pane{% if i == 0 %} active{% endif %}">
|
||||
{% if log.error %}
|
||||
<div class="alert alert-danger">{{ log.error }}</div>
|
||||
{% endif %}
|
||||
<textarea name="log" wrap="off" rows="15" id="input-log-{{ i }}" class="form-control" readonly>{{ log.output }}</textarea>
|
||||
<br/>
|
||||
<div class="row row-cols-2">
|
||||
<div class="col">
|
||||
<a href="{{ log.download }}" class="btn btn-primary w-100"{% if not log.download %} disabled{% endif %}><i class="fa-solid fa-download"></i> {{ button_download }}</a>
|
||||
</div>
|
||||
<div class="col">
|
||||
<button type="button" value="{{ log.clear }}" data-oc-target="input-log-{{ i }}" class="btn btn-danger w-100"><i class="fa-solid fa-eraser"></i> {{ button_clear }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% set i = i + 1 %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('.tab-content .btn-danger').on('click', function () {
|
||||
var element = this;
|
||||
|
||||
if (confirm('{{ text_confirm }}')) {
|
||||
$.ajax({
|
||||
url: $(element).attr('value'),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#' + $(element).attr('data-oc-target')).val('');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
125
admininistrator/view/template/tool/notification.twig
Normal file
125
admininistrator/view/template/tool/notification.twig
Normal file
@ -0,0 +1,125 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end"><button type="button" id="button-delete" data-bs-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-regular fa-bell"></i> {{ text_list }}</div>
|
||||
<div class="card-body">
|
||||
<div id="notification">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#notification').on('click', '.pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#notification').load(this.href);
|
||||
});
|
||||
|
||||
// View
|
||||
$('#notification').on('click', 'table a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
$('#modal-notification').remove();
|
||||
|
||||
$.ajax({
|
||||
url: $(element).attr('href'),
|
||||
dataType: 'html',
|
||||
success: function (html) {
|
||||
$('body').append(html);
|
||||
|
||||
$('#modal-notification').modal('show');
|
||||
|
||||
$(element).parent().parent().removeClass('table-primary');
|
||||
$(element).parent().parent().find('.fa-bell').removeClass('fas').addClass('far');
|
||||
$(element).removeClass('font-weight-bold');
|
||||
$(element).parent().parent().find('.btn-primary').removeClass('btn-primary').addClass('btn-outline-primary');
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#notification').on('click', '.btn', function (e) {
|
||||
var element = this;
|
||||
|
||||
$('#modal-notification').remove();
|
||||
|
||||
$.ajax({
|
||||
url: $(element).attr('value'),
|
||||
dataType: 'html',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (html) {
|
||||
$('body').append(html);
|
||||
|
||||
$('#modal-notification').modal('show');
|
||||
|
||||
$(element).parent().parent().removeClass('table-primary');
|
||||
$(element).parent().parent().find('.fa-bell').removeClass('fas').addClass('far');
|
||||
$(element).parent().parent().find('a').removeClass('font-weight-bold');
|
||||
$(element).removeClass('btn-primary').addClass('btn-outline-primary');
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Delete
|
||||
$('#button-delete').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
if (confirm('{{ text_confirm }}')) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=tool/notification.delete&user_token={{ user_token }}',
|
||||
type: 'post',
|
||||
data: $('#notification input[name^=\'selected\']:checked').serialize(),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button</div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button</div>');
|
||||
|
||||
$('#notification').load('index.php?route=tool/notification.list&user_token={{ user_token }}');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
11
admininistrator/view/template/tool/notification_info.twig
Normal file
11
admininistrator/view/template/tool/notification_info.twig
Normal file
@ -0,0 +1,11 @@
|
||||
<div id="modal-notification" class="modal">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa-regular fa-bell"></i> {{ heading_title }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">{{ message }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
38
admininistrator/view/template/tool/notification_list.twig
Normal file
38
admininistrator/view/template/tool/notification_list.twig
Normal file
@ -0,0 +1,38 @@
|
||||
<form id="form-notification" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#notification">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ column_message }}</td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if notifications %}
|
||||
{% set notification_row = 0 %}
|
||||
{% for notification in notifications %}
|
||||
<tr id="notification-row-{{ notification_row }}"{% if not notification.status %} class="table-primary"{% endif %}>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ notification.notification_id }}" class="form-check-input"/></td>
|
||||
<td class="text-primary" style="width: 1px;"><i class="fa-regular fa-bell fa-3x"></i></td>
|
||||
<td class="text-start"><a href="{{ notification.view }}" class="text-primary{% if not notification.status %} font-weight-bold{% endif %}">{{ notification.title }}</a>
|
||||
<br/>
|
||||
<div class="text-muted">{{ notification.date_added }}</div>
|
||||
</td>
|
||||
<td class="text-end"><button value="{{ notification.view }}" data-bs-toggle="tooltip" title="{{ button_view }}" id="button-view-{{ notification.notification_id }}" class="btn btn-primary"><i class="fa-solid fa-eye"></i></button></td>
|
||||
</tr>
|
||||
{% set notification_row = notification_row + 1 %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="3">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
115
admininistrator/view/template/tool/upgrade.twig
Normal file
115
admininistrator/view/template/tool/upgrade.twig
Normal file
@ -0,0 +1,115 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-rotate"></i> {{ text_upgrade }}</div>
|
||||
<div class="card-body">
|
||||
<fieldset>
|
||||
<legend>{{ text_information }}</legend>
|
||||
<div class="row mb-3">
|
||||
<div class="col">
|
||||
<div class="form-control border rounded-start">
|
||||
<div class="lead"><strong>{{ text_current_version }}</strong>
|
||||
<br/>
|
||||
<span{% if upgrade %} class="text-danger"{% endif %}>{{ current_version }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-control border rounded-start">
|
||||
<div class="lead"><strong>{{ text_latest_version }}</strong>
|
||||
<br/>
|
||||
{{ latest_version }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-control border rounded-start">
|
||||
<div class="lead"><strong>{{ text_date_added }}</strong>
|
||||
<br/>
|
||||
{{ date_added }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-control border rounded-start">
|
||||
<div class="lead"><strong>{{ text_change }}</strong>
|
||||
<br/>
|
||||
{{ log }}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_status }}</legend>
|
||||
<div class="input-group input-group-lg">
|
||||
<button type="button" id="button-upgrade" class="btn btn-warning btn-lg"{% if not upgrade %} disabled{% endif %}><i class="fa-solid fa-level-up-alt"></i> {{ button_upgrade }}</button>
|
||||
<input type="text" id="input-upgrade" value="{{ text_ready }}" class="form-control bg-white" readonly/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-upgrade').on('click', function () {
|
||||
var element = this;
|
||||
|
||||
$(element).button('loading');
|
||||
|
||||
$('#progress').html('{{ text_download|escape('js') }}');
|
||||
|
||||
var next = 'index.php?route=tool/upgrade.download&user_token={{ user_token }}&version={{ latest_version }}';
|
||||
|
||||
var upgrade = function () {
|
||||
return $.ajax({
|
||||
url: next,
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
$('#input-upgrade').removeClass('is-valid is-invalid');
|
||||
|
||||
if (json['error']) {
|
||||
$('#input-upgrade').val(json['error']);
|
||||
$('#input-upgrade').addClass('is-invalid');
|
||||
|
||||
$(element).button('reset');
|
||||
}
|
||||
|
||||
if (json['text']) {
|
||||
$('#input-upgrade').val(json['text']);
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#input-upgrade').val(json['success']);
|
||||
$('#input-upgrade').addClass('is-valid');
|
||||
|
||||
$(element).button('reset');
|
||||
}
|
||||
|
||||
if (json['next']) {
|
||||
next = json['next'];
|
||||
|
||||
chain.attach(upgrade);
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
|
||||
$(element).button('reset');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
chain.attach(upgrade);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
92
admininistrator/view/template/tool/upload.twig
Normal file
92
admininistrator/view/template/tool/upload.twig
Normal file
@ -0,0 +1,92 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="button" data-bs-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-upload').toggleClass('d-none');" class="btn btn-light d-md-none"><i class="fa-solid fa-filter"></i></button>
|
||||
<button type="submit" form="form-upload" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div id="filter-upload" class="col-lg-3 col-md-12 order-lg-last d-none d-lg-block mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-filter"></i> {{ text_filter }}</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label for="input-name" class="form-label">{{ entry_name }}</label> <input type="text" name="filter_name" value="{{ filter_name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-date-from" class="form-label">{{ entry_date_from }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="filter_date_from" value="{{ filter_date_from }}" placeholder="{{ entry_date_from }}" id="input-date-from" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-date-to" class="form-label">{{ entry_date_to }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="filter_date_to" value="{{ filter_date_to }}" placeholder="{{ entry_date_to }}" id="input-date-to" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-filter" class="btn btn-light"><i class="fa-solid fa-filter"></i> {{ button_filter }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="upload" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#upload').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#upload').load(this.href);
|
||||
});
|
||||
|
||||
$('#button-filter').on('click', function () {
|
||||
url = '';
|
||||
|
||||
var filter_name = $('#input-name').val();
|
||||
|
||||
if (filter_name) {
|
||||
url += '&filter_name=' + encodeURIComponent(filter_name);
|
||||
}
|
||||
|
||||
var filter_filename = $('#input-filename').val();
|
||||
|
||||
if (filter_filename) {
|
||||
url += '&filter_filename=' + encodeURIComponent(filter_filename);
|
||||
}
|
||||
|
||||
var filter_date_from = $('#input-date-from').val();
|
||||
|
||||
if (filter_date_from) {
|
||||
url += '&filter_date_from=' + encodeURIComponent(filter_date_from);
|
||||
}
|
||||
|
||||
var filter_date_to = $('#input-date-to').val();
|
||||
|
||||
if (filter_date_to) {
|
||||
url += '&filter_date_to=' + encodeURIComponent(filter_date_to);
|
||||
}
|
||||
|
||||
$('#upload').load('index.php?route=tool/upload.list&user_token={{ user_token }}' + url);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
36
admininistrator/view/template/tool/upload_list.twig
Normal file
36
admininistrator/view/template/tool/upload_list.twig
Normal file
@ -0,0 +1,36 @@
|
||||
<form id="form-upload" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#upload">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_name }}"{% if sort == 'name' %} class="{{ order|lower }}"{% endif %}>{{ column_name }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_code }}"{% if sort == 'code' %} class="{{ order|lower }}"{% endif %}>{{ column_code }}</a></td>
|
||||
<td class="text-end"><a href="{{ sort_date_added }}"{% if sort == 'date_added' %} class="{{ order|lower }}"{% endif %}>{{ column_date_added }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if uploads %}
|
||||
{% for upload in uploads %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ upload.upload_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ upload.name }}</td>
|
||||
<td class="text-start">{{ upload.code }}</td>
|
||||
<td class="text-end">{{ upload.date_added }}</td>
|
||||
<td class="text-end"><a href="{{ upload.download }}" data-bs-toggle="tooltip" title="{{ button_download }}" class="btn btn-info"><i class="fa-solid fa-download"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="5">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
Reference in New Issue
Block a user