Fist commit

This commit is contained in:
ssamson-tis
2013-05-23 10:19:43 +02:00
parent cd150a78f2
commit bd05ae8f25
60 changed files with 18864 additions and 3 deletions
+161
View File
@@ -0,0 +1,161 @@
{% extends "layout.html" %}
{% block content %}
{% if backup_list['rsync_ssh_list']|count != 0 %}
<h2 class="title">Rsync+ssh</h2>
<table id="table-design">
<thead>
<th>Server</th>
<th>Backup</th>
<th>Directory</th>
</thead>
</tbody>
{% for entry in backup_list['rsync_ssh_list'] %}
<tr>
<td>{{ entry[0] }}</td>
<td>{{ entry[1] }}</td>
<td>{{ entry[3] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if backup_list['rsync_list']|count != 0 %}
<h2 class="title">Rsync</h2>
<table id="table-design">
<thead>
<th>Server</th>
<th>Backup</th>
<th>Directory</th>
</thead>
</tbody>
{% for entry in backup_list['rsync_list'] %}
<tr>
<td>{{ entry[0] }}</td>
<td>{{ entry[1] }}</td>
<td>{{ entry[3] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if backup_list['pgsql_list']|count != 0 %}
<h2 class="title">pgSQL</h2>
<table id="table-design">
<thead>
<th>Server</th>
<th>Backup</th>
<th>Database</th>
</thead>
<tbody>
{% for entry in backup_list['pgsql_list'] %}
<tr>
<td>{{ entry[0] }}</td>
<td>{{ entry[1] }}</td>
<td>{{ entry[3] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if backup_list['mysql_list']|count != 0 %}
<h2 class="title">MySQL</h2>
<table id="table-design">
<thead>
<th>Server</th>
<th>Backup</th>
<th>Database</th>
</thead>
<tbody>
{% for entry in backup_list['mysql_list'] %}
<tr>
<td>{{ entry[0] }}</td>
<td>{{ entry[1] }}</td>
<td>{{ entry[3] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if backup_list['xva_list']|count != 0 %}
<h2 class="title">XVA</h2>
<table id="table-design">
<thead>
<th>Server</th>
<th>Backup</th>
</thead>
<tbody>
{% for entry in backup_list['xva_list'] %}
<tr>
<td>{{ entry[0] }}</td>
<td>{{ entry[1] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if backup_list['metadata_list']|count != 0 %}
<h2 class="title">XCP Metadata</h2>
<table id="table-design">
<thead>
<th>Server</th>
<th>Backup</th>
</thead>
<tbody>
{% for entry in backup_list['metadata_list'] %}
<tr>
<td>{{ entry[0] }}</td>
<td>{{ entry[1] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if backup_list['switch_list']|count != 0 %}
<h2 class="title">Switchs</h2>
<table id="table-design">
<thead>
<th>Server</th>
<th>Backup</th>
</thead>
<tbody>
{% for entry in backup_list['switch_list'] %}
<tr>
<td>{{ entry[0] }}</td>
<td>{{ entry[1] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if backup_list['null_list']|count != 0 %}
<h2 class="title">Null</h2>
<table id="table-design">
<thead>
<th>Server</th>
<th>Backup</th>
</thead>
<tbody>
{% for entry in backup_list['null_list'] %}
<tr>
<td>{{ entry[0] }}</td>
<td>{{ entry[1] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}
+78
View File
@@ -0,0 +1,78 @@
{% extends "layout.html" %}
{% block content %}
<h2 class="title">Hard drive verifications:</h2>
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<h4>{{ message }} <img src="/static/images/check.png" width="15" height="15"/></h4>
{% endfor %}
{% endif %}
{% endwith %}
{% if error %}
<p>
<div class=error><img class="center-img" src='/static/images/important.gif' title="Notice" width="24" height="24"/> <strong>Error:</strong> {{ error }}</div>
<div class=info><img class="center-img" src='/static/images/info.gif' title="Notice" width="24" height="24"/> <strong>Notice:</strong> {{ info }}</div>
<h4>Also, you can contact your <a href="mailto:{{ email }}?Subject=TISBACKUP%20Export"> System Administrator</a> for more details </h4>
</p>
{% elif not start %}
<script>
$(document).ready( function() {
$("#confirm_button").click( function() {
jConfirm('Do you want to proced backup now ?', 'Confirmation Dialog', function(r) {
if(r == true ){
$("#backup").submit();
};
});
});
});
</script>
<form id="backup" action='/export_backup'>
<input type="hidden" name="start" value="true" />
<input type="button" id="confirm_button" value="Launch Backup" style="margin-left: 400px;" />
</form>
{% else %}
<h2 class="title">Backups is running: </h2>
<table id="table-design">
<thead>
<th>Server</th>
<th>Backup</th>
<th>Status</th>
</thead>
<tbody>
</tbody>
</table>
<script>
//Refresh periode in seconds
var refresh = 10;
var done = false;
function status(){
$.getJSON("/status.json", function(data) {
$("#table-design tbody").remove();
$.each(data.data, function(key,val){
$('#table-design').append('<tr>');
$('tbody').append('<td>'+val.server_name+'</td>');
$('tbody').append('<td>'+val.backup_name+'</td>');
if(val.status == 'Running'){
$('tbody').append('<td class=loading><img src="/static/images/loader.gif" width="15" height="15"/></td>');
done = false;
}else{
$('tbody').append('<td>'+val.status+'</td>');
done = true;
}
$('#table-design').append('</tr>');
});
});
if (done){
jAlert('Backup finished', 'TIS Backup');
window.clearInterval(timer);
};
};
var timer = window.setInterval(function(){
status();
}, refresh * 1000);
status();
</script>
{% endif %}
{% endblock %}
+121
View File
@@ -0,0 +1,121 @@
{% extends "layout.html" %}
{% block content %}
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var oTable = $('#table-design').dataTable( {
"bProcessing": true,
"sAjaxDataProp": "data",
"sAjaxSource": "/backups.json",
"iDisplayLength": 25,
"aLengthMenu": [[25, 50, 100, 200, 500, -1], [25, 50, 100, 200, 500, "All"]],
"aaSorting": [[ 0, "desc" ]],
"aoColumnDefs": [
{
"aTargets": [ 4 ],
"mData": "backup_duration",
"mRender": function ( data, type, full ) {
return secondsToHms(data * 3600);
}
},
{
"aTargets": [ 0 ],
"mData": "backup_start",
"mRender": function ( data, type, full ) {
var d = new Date(data);
return d.getFullYear()+"/"+(d.getMonth()+1)+"/"+d.getDate()+" "+d.toLocaleTimeString();
}
},
{
"aTargets": [ 1 ],
"mData": "backup_start",
"mRender": function ( data, type, full ) {
var d = new Date(data);
return d.getFullYear()+"/"+(d.getMonth()+1)+"/"+d.getDate()+" "+d.toLocaleTimeString();
}
}
],
"aoColumns": [
{ "mData":"backup_start"},
{ "mData":"backup_end" , "bVisible": false },
{ "mData":"server_name" },
{ "mData":"backup_name" },
{ "mData":"backup_duration"},
{ "mData":"status" },
{ "mData":"written_bytes" , "bVisible": false},
{ "mData":"written_files_count" , "bVisible": false},
{ "mData":"total_files_count" , "bVisible": false},
{ "mData":"total_bytes" , "bVisible": false },
{ "mData":"backup_location" , "bVisible": false },
{ "mData":"description" , "bVisible": false },
{ "mData":"log" , "bVisible": false },
{ "mData":"TYPE" , "bVisible": false }
]
} );
} );
function fnShowHide( iCol )
{
/* Get the DataTables object again - this is not a recreation, just a get of the object */
var oTable = $('#table-design').dataTable();
var bVis = oTable.fnSettings().aoColumns[iCol].bVisible;
oTable.fnSetColumnVis( iCol, bVis ? false : true );
}
function secondsToHms(d) {
d = Number(d);
var h = Math.floor(d / 3600);
var m = Math.floor(d % 3600 / 60);
var s = Math.floor(d % 3600 % 60);
return ((h > 0 ? h + ":" : "0:") + (m > 0 ? (m < 10 ? "0" : "") + m + ":" : "00:") + (s < 10 ? "0" : "") + s);
}
</script>
<table style='text-align: center;' cellpadding="0" cellspacing="0" border="0" class="display" id="table-design">
<thead style='text-align: center;'>
<tr>
<th>Backup start</th>
<th>Backup end</th>
<th>Server name</th>
<th>Backup name</th>
<th>Backup duration</th>
<th>Status</th>
<th>Written bytes</th>
<th>Written files count</th>
<th>Total files count</th>
<th>Total bytes </th>
<th>Backup location</th>
<th>Description</th>
<th>Log</th>
<th>Type</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<br />
<p>
Backup start<input type="checkbox" onclick="fnShowHide( 0 );"/>
Backup end<input type="checkbox" onclick="fnShowHide( 1 );"/>
Server name<input type="checkbox" onclick="fnShowHide( 2 );"/>
Backup name<input type="checkbox" onclick="fnShowHide( 3 );"/>
Backup duration<input type="checkbox" onclick="fnShowHide( 4 );"/>
Status<input type="checkbox" onclick="fnShowHide( 5 );"/>
<br />
Written bytes<input type="checkbox" onclick="fnShowHide( 6 );"/>
Written files count<input type="checkbox" onclick="fnShowHide( 7 );"/>
Total files count<input type="checkbox" onclick="fnShowHide( 8 );"/>
Total bytes <input type="checkbox" onclick="fnShowHide( 9 );"/>
<br />
Backup location<input type="checkbox" onclick="fnShowHide( 10 );"/>
Description<input type="checkbox" onclick="fnShowHide( 11 );"/>
Log<input type="checkbox" onclick="fnShowHide( 12 );"/>
Type<input type="checkbox" onclick="fnShowHide( 13 );"/>
</p>
<script>
$('input:checkbox').attr('checked', false);
$('input:checkbox:eq(0)').attr('checked', true);
$('input:checkbox:eq(2)').attr('checked', true);
$('input:checkbox:eq(3)').attr('checked', true);
$('input:checkbox:eq(4)').attr('checked', true);
$('input:checkbox:eq(5)').attr('checked', true);
</script>
{% endblock %}
+77
View File
@@ -0,0 +1,77 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
Name : Indication
Description: A two-column, fixed-width design with dark color scheme.
Version : 1.0
Released : 20090910
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Tisbackup GUI</title>
<!-- Styles -->
<link rel="stylesheet" type="text/css" href="/static/styles/datatables.css">
<link rel="stylesheet" type="text/css" href="/static/styles/style.css">
<link rel="stylesheet" type="text/css" href="/static/styles/jquery.alerts.css">
<!-- Scripts -->
<script type=text/javascript src="/static/js/jquery.min.js"></script>
<script type=text/javascript src="/static/js/jquery.dataTables.js"></script>
<script type=text/javascript src="/static/js/jquery.alerts.js"></script>
<script type=text/javascript src="/static/js/jquery.ui.draggable.js"></script>
</head>
<body background='/static/images/bg_body.gif'>
<div id="wrapper">
<div id="header">
<div id="logo">
<h1><a href="/">TIS Backup GUI</a></h1>
<p> design by Hübert</p>
</div>
</div>
<!-- end #header -->
<div id="menu">
<ul>
<li><a href="/">Backups</a></li>
<li><a href="/export_backup">Export Backup</a></li>
<li><a href="/last_backups">Last Backups</a></li>
</ul>
</div>
<!-- end #menu -->
<div id="page">
<div id="page-bgtop">
<div id="page-bgbtm">
<div id="content">
<div class="post">
{% block content %}
<div id="mouter">
<div id="minner">
<p>Hello World</p>
</div>
</div>
{% endblock %}
</div>
<div style="clear: both;">&nbsp;</div>
</div>
<div style="clear: both;">&nbsp;</div>
</div>
<!-- end #page -->
</div>
</div>
<!-- end #footer -->
</div>
<div id="footer">
<p>Copyright (c) 2012 Tranquil IT Systems. All rights reserved. Design by <a href="http://www.tranquil-it-systems.fr/">TIS</a>.</p>
</div>
</body>
</html>