Init
This commit is contained in:
55
backend/resources/plugins/fritzbox/public_html/css/style.css
Normal file
55
backend/resources/plugins/fritzbox/public_html/css/style.css
Normal file
@@ -0,0 +1,55 @@
|
||||
@charset "utf-8";
|
||||
/* CSS Document */
|
||||
|
||||
.refresh {
|
||||
width: 100%;
|
||||
display: table;
|
||||
}
|
||||
|
||||
.refresh > div {
|
||||
display: table-cell;
|
||||
width: 100%;
|
||||
vertical-align: middle;
|
||||
padding-right: 15px;
|
||||
}
|
||||
|
||||
.refresh .refresh-bar {
|
||||
height: 2px;
|
||||
overflow: hidden;
|
||||
width: 0%;
|
||||
}
|
||||
|
||||
.refresh > a {
|
||||
text-decoration: none;
|
||||
display: table-cell;
|
||||
font-size: 0px;
|
||||
}
|
||||
|
||||
.refresh > a > img {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
.custom-progressbar {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
height: 17px;
|
||||
background: #DDDDDD;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.custom-progressbar > div {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.custom-progressbar::after {
|
||||
content: attr(data-text);
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
line-height: 17px;
|
||||
font-size: 11px;
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
var is_loding = false;
|
||||
|
||||
function statusRefreshEffect(element)
|
||||
{
|
||||
var background = element.css('background-color');
|
||||
|
||||
element.css({'transition': 'background-color 0.5s', 'background-color': 'rgba(243, 255, 164, 1)'});
|
||||
setTimeout(function()
|
||||
{
|
||||
element.css({'background-color': background});
|
||||
}, 800);
|
||||
}
|
||||
|
||||
function showError()
|
||||
{
|
||||
jQuery('.error-msg-refresh-bar').remove();
|
||||
jQuery('.refresh div:eq(0)').after('<div class="red error-msg-refresh-bar" style="vertical-align: bottom; font-weight: bold;">' + _t('Fehler!') + '</div>');
|
||||
jQuery('.refresh-bar').stop(false, true).css('width', 0);
|
||||
jQuery('a[href=#refresh] img').removeClass('rotate-icon');
|
||||
|
||||
setTimeout('statusRefresh()', 3000);
|
||||
}
|
||||
|
||||
function statusRefresh()
|
||||
{
|
||||
jQuery('.error-msg-refresh-bar').remove();
|
||||
jQuery('.refresh-bar').animate({width: '100%'}, 30000, 'linear', function(e)
|
||||
{
|
||||
var this_ = jQuery(this);
|
||||
var connection = jQuery('.table tr:eq(1)');
|
||||
var uptime = jQuery('.table tr:eq(2)');
|
||||
var publicIP = jQuery('.table tr:eq(3)');
|
||||
var totalReceived = jQuery('.table tr:eq(4)');
|
||||
var totalSent = jQuery('.table tr:eq(5)');
|
||||
var bandwidthDown = jQuery('.table tr:eq(6)');
|
||||
var bandwidthUp = jQuery('.table tr:eq(7)');
|
||||
|
||||
jQuery('a[href=#refresh] img').addClass('rotate-icon');
|
||||
|
||||
this_.animate({width: '87.5%'}, 300, 'linear');
|
||||
jQuery.post('api/v1/plugins.php', { id: 'fritzbox', action: 'v1/status', data: 'connection' }, function(data)
|
||||
{
|
||||
if (connection.find('td:eq(1)').html() != data.data.connection)
|
||||
{
|
||||
statusRefreshEffect(connection);
|
||||
connection.find('td:eq(1)').html(data.data.connection);
|
||||
}
|
||||
|
||||
this_.animate({width: '75%'}, 300, 'linear');
|
||||
jQuery.post('api/v1/plugins.php', { id: 'fritzbox', action: 'v1/status', data: 'uptime' }, function(data)
|
||||
{
|
||||
if (uptime.find('td:eq(1)').html() != data.data.uptime)
|
||||
{
|
||||
statusRefreshEffect(uptime);
|
||||
uptime.find('td:eq(1)').html(data.data.uptime);
|
||||
}
|
||||
|
||||
this_.animate({width: '62.5%'}, 300, 'linear');
|
||||
jQuery.post('api/v1/plugins.php', { id: 'fritzbox', action: 'v1/status', data: 'publicIP' }, function(data)
|
||||
{
|
||||
if (publicIP.find('td:eq(1) a').text() != data.data.publicIP)
|
||||
{
|
||||
statusRefreshEffect(publicIP);
|
||||
publicIP.find('td:eq(1) a').text(data.data.publicIP).attr('href', 'http://'+data.data.publicIP);
|
||||
}
|
||||
|
||||
this_.animate({width: '50%'}, 300, 'linear');
|
||||
jQuery.post('api/v1/plugins.php', { id: 'fritzbox', action: 'v1/status', data: 'totalReceived' }, function(data)
|
||||
{
|
||||
if (totalReceived.find('td:eq(1)').html() != data.data.totalReceived)
|
||||
{
|
||||
statusRefreshEffect(totalReceived);
|
||||
totalReceived.find('td:eq(1)').html(data.data.totalReceived);
|
||||
}
|
||||
|
||||
this_.animate({width: '37.5%'}, 300, 'linear');
|
||||
jQuery.post('api/v1/plugins.php', { id: 'fritzbox', action: 'v1/status', data: 'totalSent' }, function(data)
|
||||
{
|
||||
if (totalSent.find('td:eq(1)').html() != data.data.totalSent)
|
||||
{
|
||||
statusRefreshEffect(totalSent);
|
||||
totalSent.find('td:eq(1)').html(data.data.totalSent);
|
||||
}
|
||||
|
||||
this_.animate({width: '25%'}, 300, 'linear');
|
||||
jQuery.post('api/v1/plugins.php', { id: 'fritzbox', action: 'v1/status', data: 'bandwidthDown' }, function(data)
|
||||
{
|
||||
if (bandwidthDown.find('td:eq(1) .custom-progressbar').attr('data-text') != data.data.current + ' / ' + data.data.max)
|
||||
{
|
||||
statusRefreshEffect(bandwidthDown);
|
||||
bandwidthDown.find('td:eq(1) .custom-progressbar').attr('data-text', data.data.current + ' / ' + data.data.max).find('div').css('width', data.data.percentage);
|
||||
}
|
||||
|
||||
this_.animate({width: '12.5%'}, 300, 'linear');
|
||||
jQuery.post('api/v1/plugins.php', { id: 'fritzbox', action: 'v1/status', data: 'bandwidthUp' }, function(data)
|
||||
{
|
||||
if (bandwidthUp.find('td:eq(1) .custom-progressbar').attr('data-text') != data.data.current + ' / ' + data.data.max)
|
||||
{
|
||||
statusRefreshEffect(bandwidthUp);
|
||||
bandwidthUp.find('td:eq(1) .custom-progressbar').attr('data-text', data.data.current + ' / ' + data.data.max).find('div').css('width', data.data.percentage);
|
||||
}
|
||||
|
||||
this_.animate({width: '0%'}, 300, 'linear', function(e)
|
||||
{
|
||||
is_loding = false;
|
||||
jQuery('a[href=#refresh] img').removeClass('rotate-icon');
|
||||
});
|
||||
|
||||
statusRefresh();
|
||||
}).fail(function(e) { showError(); });
|
||||
}).fail(function(e) { showError(); });
|
||||
}).fail(function(e) { showError(); });
|
||||
}).fail(function(e) { showError(); });
|
||||
}).fail(function(e) { showError(); });
|
||||
}).fail(function(e) { showError(); });
|
||||
}).fail(function(e) { showError(); });
|
||||
});
|
||||
}
|
||||
|
||||
jQuery(document).on('click', 'a[href=#refresh]', function(e)
|
||||
{
|
||||
if (is_loding == false)
|
||||
jQuery('.refresh-bar').stop(false, true);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
jQuery(document).ready(function(e)
|
||||
{
|
||||
statusRefresh();
|
||||
});
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php if (!defined('PICONTROL')) exit(); ?>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo PLUGIN_PUBLIC_PATH; ?>public_html/css/style.css" />
|
||||
<script type="text/javascript" src="<?php echo PLUGIN_PUBLIC_PATH; ?>public_html/js/status_refresh.js"></script>
|
||||
<div class="sidebar">
|
||||
<div class="box">
|
||||
<div class="inner-header">
|
||||
<span><?php _e('Benutzeroberfläche'); ?></span>
|
||||
</div>
|
||||
<div class="inner">
|
||||
<a href="<?php echo $data['address']; ?>" target="_blank" class="button" style="width: 100%; box-sizing: border-box; text-align: center;"><?php _e('Zur Benutzeroberfläche'); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-600">
|
||||
<div class="box">
|
||||
<div class="inner-header">
|
||||
<span><?php _e('Fritz!Box'); ?></span>
|
||||
<?php showSettingsIcon('?s=plugins&id=fritzbox&settings'); ?>
|
||||
</div>
|
||||
<?php if ($data['connectionFritzbox'] == true) { ?>
|
||||
<div class="inner-table">
|
||||
<div>
|
||||
<div class="refresh">
|
||||
<div>
|
||||
<div class="refresh-bar background-color-7"></div>
|
||||
</div>
|
||||
<a href="#refresh"><img src="public_html/img/refresh-icon.svg" title="<?php _e('Aktualisieren'); ?>" /></a>
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-borderless table-form">
|
||||
<tr>
|
||||
<td style="width: 40%;"><?php _e('Modell'); ?></td>
|
||||
<td><?php echo $data['model']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Status'); ?></td>
|
||||
<td><?php echo $data['connection']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Verbunden seit'); ?></td>
|
||||
<td><?php echo $data['uptime']; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Öffentliche IP-Adresse'); ?></td>
|
||||
<td><a href="http://<?php echo $data['publicIP']; ?>" target="_blank"><?php echo $data['publicIP']; ?></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Datenvolumen empfangen'); ?></td>
|
||||
<td><?php echo sizeUnit($data['totalReceived']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Datenvolumen gesendet'); ?></td>
|
||||
<td><?php echo sizeUnit($data['totalSent']); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Auslastung Download'); ?></td>
|
||||
<td><div class="custom-progressbar" data-text="<?php echo $data['currentBandwidthDown']; ?> / <?php echo $data['maxBandwidthDown']; ?>">
|
||||
<div class="background-color-3" style="width: <?php echo $data['percentageBandwidthDown']; ?>%;"></div>
|
||||
</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Auslastung Upload'); ?></td>
|
||||
<td><div class="custom-progressbar" data-text="<?php echo $data['currentBandwidthUp']; ?> / <?php echo $data['maxBandwidthUp']; ?>">
|
||||
<div class="background-color-3" style="width: <?php echo $data['percentageBandwidthUp']; ?>%;"></div>
|
||||
</div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="inner-info">
|
||||
<div><?php _e('Momentan besteht keine Verbindung zu einer Fritz!Box!'); ?></div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear-both"></div>
|
||||
<div>
|
||||
<?php foreach ($data['statistics'] as $statistic) { ?>
|
||||
<div class="box google-controls" id="dashboard_log_<?php echo $statistic['array']['id']; ?>">
|
||||
<div class="inner-header">
|
||||
<span><?php _e($statistic['array']['title']); ?></span>
|
||||
</div>
|
||||
<div class="inner text-center padding-0" id="chart_log_<?php echo $statistic['array']['id']; ?>">
|
||||
<img src="public_html/img/loader.svg" style="margin: 20px;" />
|
||||
</div>
|
||||
<div class="inner text-center" id="chart_control_log_<?php echo $statistic['array']['id']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
|
||||
<script type="text/javascript" src="public_html/js/statistic_builder.js"></script>
|
||||
<script type="text/javascript">
|
||||
google.load('visualization', '1', {packages:['controls']});
|
||||
google.setOnLoadCallback(createTable);
|
||||
|
||||
function createTable()
|
||||
{
|
||||
<?php foreach ($data['statistics'] as $statistic) { ?>
|
||||
statisticBuilder(<?php echo $statistic['json']; ?>, 'fritzbox');
|
||||
<?php } ?>
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php if (!defined('PICONTROL')) exit(); ?>
|
||||
<div>
|
||||
<div class="box">
|
||||
<div class="inner-header">
|
||||
<span><?php _e('Einstellungen zu Fritz!Box'); ?></span>
|
||||
<?php showGoBackIcon('?s=plugins&id=fritzbox'); ?>
|
||||
</div>
|
||||
<form action="?s=plugins&id=fritzbox&settings" method="post">
|
||||
<div class="inner-table">
|
||||
<table class="table table-borderless table-form">
|
||||
<tr>
|
||||
<td><?php _e('Adresse zur Fritz!Box'); ?></td>
|
||||
<td><input type="text" name="address" value="<?php echo $data['address']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Fritz!OS'); ?></td>
|
||||
<td><input type="radio" name="version" value="5" id="rb-5"<?php if ($data['version'] == '5') echo ' checked="checked"'; ?> /><label for="rb-5" class="radio"><?php _e('5 und niedriger'); ?></label><br />
|
||||
<input type="radio" name="version" value="6" id="rb-6"<?php if ($data['version'] == '6') echo ' checked="checked"'; ?> /><label for="rb-6" class="radio"><?php _e('6 und höher'); ?></label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php _e('Geschwindigkeitsangaben'); ?></td>
|
||||
<td><select name="unit">
|
||||
<option value="mbit"<?php if ($data['unit'] == 'mbit') echo ' selected="selected"'; ?>>MBit/s</option>
|
||||
<option value="mbyte"<?php if ($data['unit'] == 'mbyte') echo ' selected="selected"'; ?>>MByte/s</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="inner-end">
|
||||
<input type="submit" name="submit-main" value="<?php _e('Speichern'); ?>" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="inner-header">
|
||||
<span><?php _e('Statistik'); ?></span>
|
||||
</div>
|
||||
<form action="?s=plugins&id=fritzbox&settings" method="post">
|
||||
<div class="inner-table">
|
||||
<table class="table table-borderless table-form">
|
||||
<tr>
|
||||
<td><?php _e('Aktivieren'); ?></td>
|
||||
<td><input type="checkbox" name="activation" value="checked" id="cb-activiation"<?php if ($data['activation'] == true) echo ' checked="checked"'; ?>><label for="cb-activiation" class="checkbox only-checkbox"> </label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="inner-table">
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<th style="width: 80%;"><?php _e('Name'); ?></th>
|
||||
<th style="width: 10%;" class="table-center"><?php _e('Download'); ?></th>
|
||||
<th style="width: 10%;"></th>
|
||||
</tr>
|
||||
<?php foreach ($data['statistics'] as $id => $statistic) { ?>
|
||||
<tr>
|
||||
<td><?php echo $statistic['array']['title'] ?></td>
|
||||
<td class="table-center"><a href="api/v1/statistic_download.php?id=<?php echo $id; ?>&plugin=fritzbox" class="text-decoration-none"><span class="button button-small">CSV</span></a></td>
|
||||
<td class="table-right"><a href="?s=plugins&id=fritzbox&settings&reset=<?php echo $id; ?>" class="text-decoration-none"><span class="button button-small"><?php _e('Zurücksetzen'); ?></span></a></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="inner-end">
|
||||
<input type="submit" name="submit-statistic" value="<?php _e('Speichern'); ?>" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php if (!defined('PICONTROL')) exit(); ?>
|
||||
<div>
|
||||
<div class="box">
|
||||
<div class="inner-header">
|
||||
<span><?php _e('Einstellungen zu Fritz!Box - Verlauf zurücksetzen'); ?></span>
|
||||
<?php showGoBackIcon('?s=plugins&id=fritzbox&settings'); ?>
|
||||
</div>
|
||||
<form action="?s=plugins&id=fritzbox&settings&reset=<?php echo $data['log']; ?>&confirm" method="post">
|
||||
<div class="inner">
|
||||
<?php _e('Möchtest du den Verlauf von %s wirklich zurücksetzen?', '<strong>'.$data['label'].'</strong>'); ?>
|
||||
</div>
|
||||
<div class="inner-end">
|
||||
<input type="submit" name="submit" value="<?php _e('Zurücksetzen'); ?>" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user