mirror of
https://github.com/eduardogsilva/routerfleet.git
synced 2025-08-13 22:50:34 +02:00
improved backup list, details and compare.
This commit is contained in:
parent
24906b197d
commit
48dc45f19c
4 changed files with 70 additions and 36 deletions
|
@ -12,11 +12,13 @@
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
</h3>
|
</h3>
|
||||||
|
{% comment %}
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
<a href="/router/manage/?uuid={{ backup.router.uuid }}" >
|
<a href="/router/manage/?uuid={{ backup.router.uuid }}" >
|
||||||
<i class="fas fa-edit"></i>
|
<i class="fas fa-edit"></i>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
|
{% endcomment %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card-body row">
|
<div class="card-body row">
|
||||||
|
@ -29,6 +31,12 @@
|
||||||
<span class="float-right">{{ backup }}</span>
|
<span class="float-right">{{ backup }}</span>
|
||||||
</li>
|
</li>
|
||||||
{% endcomment %}
|
{% endcomment %}
|
||||||
|
<li class="list-group-item">
|
||||||
|
<b>Backup ID</b>
|
||||||
|
<span class="float-right">
|
||||||
|
{{ backup.id }}
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<b>Schedule Type</b>
|
<b>Schedule Type</b>
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
|
@ -97,12 +105,20 @@
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Compare</th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for compare_backup in backup_list %}
|
{% for compare_backup in backup_list %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td class="min-width">
|
||||||
|
<a href="/backup/backup_details/?uuid={{ compare_backup.uuid }}">
|
||||||
|
{{ compare_backup.id }}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if compare_backup.finish_time %}
|
{% if compare_backup.finish_time %}
|
||||||
{{ compare_backup.finish_time }}
|
{{ compare_backup.finish_time }}
|
||||||
|
|
|
@ -15,22 +15,62 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="min-width">ID</th>
|
||||||
|
<th>Router</th>
|
||||||
|
<th>Address</th>
|
||||||
|
<th>Schedule Type</th>
|
||||||
|
<th>Schedule Time</th>
|
||||||
|
<th>Finish Time</th>
|
||||||
|
<th class="min-width">Hash</th>
|
||||||
|
<th class="min-width"><i class="fas fa-code-branch" title="Configuration has changed"></i></th>
|
||||||
|
<th class="min-width">Status</th>
|
||||||
|
</thead>
|
||||||
|
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for backup in backup_list %}
|
{% for backup in backup_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td class="min-width">
|
||||||
<a href="/backup/backup_details/?uuid={{ backup.uuid }}">
|
<a href="/backup/backup_details/?uuid={{ backup.uuid }}">
|
||||||
|
{{ backup.id }}
|
||||||
{{ backup.router }}
|
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<a href="/router/details/?uuid={{ backup.router.uuid }}">
|
||||||
|
{{ backup.router.name }}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>{{ backup.router.address }}</td>
|
||||||
|
<td>{{ backup.get_schedule_type_display }}</td>
|
||||||
|
<td>{{ backup.schedule_time|default_if_none:"" }}</td>
|
||||||
|
<td>{% if backup.finish_time %}{{ backup.finish_time }}{% else %}
|
||||||
|
<i class="far fa-clock text-warning"></i>{% endif %}</td>
|
||||||
|
|
||||||
|
<td class="min-width">
|
||||||
|
{% if backup.backup_text_hash %}
|
||||||
|
<a href="#" title="{{ backup.backup_text_hash }}">{{ backup.backup_text_hash|slice:":12" }}...</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td class="min-width">
|
||||||
|
{% if backup.config_change_detected %}
|
||||||
|
<i class="fas fa-code-branch text-info"
|
||||||
|
title="Configuration has changed since last backup"></i>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td class="min-width" style="text-align: center;">
|
||||||
|
{% if backup.success %}
|
||||||
|
<i class="far fa-check-circle text-success"></i>
|
||||||
|
{% elif backup.error %}
|
||||||
|
<i class="far fa-times-circle text-danger"
|
||||||
|
title="{{ backup.error_message }}"></i>
|
||||||
|
{% elif backup.backup_pending_retrieval %}
|
||||||
|
<i class="fas fa-cloud-download-alt text-info"
|
||||||
|
title="Backup pending Retrieval"></i>
|
||||||
|
{% else %}
|
||||||
|
<i class="far fa-clock text-warning"></i>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -23,21 +23,11 @@
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title">
|
<h3 class="card-title">
|
||||||
|
|
||||||
<a href="/router/details/?uuid={{ backup1.router.uuid }}">{{ backup1.router }}</a> -
|
<a href="/router/details/?uuid={{ backup1.router.uuid }}">{{ backup1.router }}</a> -
|
||||||
Comparing backup:
|
Comparing backup
|
||||||
<a href="/backup/backup_details/?uuid={{ backup1.uuid }}"
|
<a href="/backup/backup_details/?uuid={{ backup1.uuid }}" title="hash: {{ backup1.backup_text_hash }}">{{ backup1.id }}</a>
|
||||||
title="{{ backup1.backup_text_hash }}">
|
with
|
||||||
{% if backup1.finish_time %}{{ backup1.finish_time }}{% else %}
|
<a href="/backup/backup_details/?uuid={{ backup2.uuid }}" title="hash: {{ backup2.backup_text_hash }}">{{ backup2.id }}</a>
|
||||||
{{ backup1.created }}{% endif %}
|
|
||||||
</a>
|
|
||||||
with:
|
|
||||||
<a href="/backup/backup_details/?uuid={{ backup2.uuid }}"
|
|
||||||
title="{{ backup2.backup_text_hash }}">
|
|
||||||
{% if backup2.finish_time %}{{ backup2.finish_time }}{% else %}
|
|
||||||
{{ backup2.created }}{% endif %}
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body row">
|
<div class="card-body row">
|
||||||
|
@ -62,7 +52,6 @@
|
||||||
{% block custom_page_scripts %}
|
{% block custom_page_scripts %}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var diffString = `{{ diff_str|safe }}`;
|
var diffString = `{{ diff_str|safe }}`;
|
||||||
|
|
||||||
function renderDiff(viewType) {
|
function renderDiff(viewType) {
|
||||||
var targetElement = document.getElementById('diff-container');
|
var targetElement = document.getElementById('diff-container');
|
||||||
var processedDiffString = diffString.split('\n').filter(line => {
|
var processedDiffString = diffString.split('\n').filter(line => {
|
||||||
|
@ -78,12 +67,7 @@
|
||||||
var diffHtml = Diff2Html.html(processedDiffString, configuration);
|
var diffHtml = Diff2Html.html(processedDiffString, configuration);
|
||||||
targetElement.innerHTML = diffHtml;
|
targetElement.innerHTML = diffHtml;
|
||||||
}
|
}
|
||||||
|
|
||||||
//renderDiff('inline');
|
//renderDiff('inline');
|
||||||
renderDiff('side-by-side');
|
renderDiff('side-by-side');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
|
@ -5,10 +5,8 @@
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class='col-xl-5'>
|
<div class='col-xl-5'>
|
||||||
<div class="card card-primary card-outline">
|
<div class="card card-primary card-outline">
|
||||||
|
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title">{{ router.name }}
|
<h3 class="card-title">{{ router.name }}
|
||||||
|
|
||||||
</h3>
|
</h3>
|
||||||
<span class="float-right">
|
<span class="float-right">
|
||||||
<a href="/router/manage/?uuid={{ router.uuid }}" >
|
<a href="/router/manage/?uuid={{ router.uuid }}" >
|
||||||
|
@ -123,23 +121,19 @@
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th></th>
|
<th>ID</th>
|
||||||
<th>Schedule</th>
|
<th>Schedule</th>
|
||||||
<th>Time</th>
|
<th>Time</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th><i class="fas fa-code-branch" title="Configuration has changed"></i></th>
|
<th><i class="fas fa-code-branch" title="Configuration has changed"></i></th>
|
||||||
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for backup in router_backup_list %}
|
{% for backup in router_backup_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="min-width">
|
<td class="min-width">
|
||||||
<a href="/backup/backup_details/?uuid={{ backup.uuid }}">
|
<a href="/backup/backup_details/?uuid={{ backup.uuid }}">
|
||||||
<i class="far fa-eye"></i>
|
{% comment %}<i class="far fa-eye"></i>{% endcomment %}{{ backup.id }}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue