[INITIAL] First commit for Uptime Robot API Feature
This commit is contained in:
parent
c6dd4086ff
commit
60688bb4dc
@ -33,6 +33,7 @@
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=blocks">Block Stats</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=graphs">Hashrate Graphs</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round">Round Stats</a></li>
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=uptime">Uptime Stats</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
{else}
|
||||
@ -46,6 +47,9 @@
|
||||
{/if}
|
||||
{if $GLOBAL.acl.round.statistics}
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round">Round Stats</a></li>
|
||||
{/if}
|
||||
{if $GLOBAL.acl.uptime.statistics}
|
||||
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=uptime">Uptime Stats</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
{/if}
|
||||
|
||||
55
public/templates/mmcFE/statistics/uptime/default.tpl
Normal file
55
public/templates/mmcFE/statistics/uptime/default.tpl
Normal file
@ -0,0 +1,55 @@
|
||||
<script type="text/javascript" src="{$GLOBALASSETS}/js/jquery.easypiechart.min.js"></script>
|
||||
|
||||
{include file="global/block_header.tpl" BLOCK_HEADER="Uptime Statistics"}
|
||||
<table class="tablesorter" width="80%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">Location</th>
|
||||
<th align="center">Service</th>
|
||||
<th align="center">State Since</th>
|
||||
<th align="center">Status</th>
|
||||
<th align="center" style="padding-right: 10px">Uptime</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach key=key item=item from=$STATUS.monitors.monitor}
|
||||
{assign var=node value="."|explode:$item.friendlyname}
|
||||
<tr>
|
||||
<td align="center"><img src="{$GLOBALASSETS}/images/flags/{$node.0}.png"/></td>
|
||||
<td align="center">{$node.1}</td>
|
||||
<td align="center">{$item.log.1.datetime|date_format:"%b %d, %Y %H:%M"}</td>
|
||||
<td align="center"><span class="ur-status-{$CODES[$item.status]|lower}">{$CODES[$item.status]}</span></td>
|
||||
<td align="center"><span class="chart-{$item.id}" data-percent="{$item.customuptimeratio}"><span class="percent"></span></span></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
{literal}
|
||||
$(document).ready(function(){
|
||||
{/literal}
|
||||
{foreach key=key item=item from=$STATUS.monitors.monitor}
|
||||
{literal}
|
||||
$('.chart-{/literal}{$item.id}{literal}').easyPieChart({
|
||||
easing: 'easeOutBounce',
|
||||
size: 26,
|
||||
scaleColor: false,
|
||||
lineWidth: 13,
|
||||
lineCap: 'butt',
|
||||
barColor: '#92CCA6',
|
||||
trackColor: '#FF7878',
|
||||
animate: false,
|
||||
onStep: function(from, to, percent) {
|
||||
$(this.el).find('.percent-{/literal}{$item.id}{literal}').text(Math.round(percent));
|
||||
}
|
||||
});
|
||||
{/literal}
|
||||
{/foreach}
|
||||
{literal}
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
|
||||
{if !$GLOBAL.website.api.disabled}<li>These stats are also available in JSON format <a href="{$smarty.server.PHP_SELF}?page=api&action=public" target="_api">HERE</a></li>{/if}
|
||||
{include file="global/block_footer.tpl"}
|
||||
@ -1,4 +1,4 @@
|
||||
<article class="module width_3_quarter">
|
||||
<article class="module width_full">
|
||||
<form method="POST">
|
||||
<input type="hidden" name="page" value="{$smarty.request.page}" />
|
||||
<input type="hidden" name="action" value="{$smarty.request.action}" />
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
<li class="icon-th-large"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=blocks">Blocks</a></li>
|
||||
<li class="icon-chart"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=graphs">Graphs</a></li>
|
||||
<li class="icon-record"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round">Round</a></li>
|
||||
<li class="icon-bell"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=uptime">Uptime</a></li>
|
||||
</ul>
|
||||
{else}
|
||||
<h3>Statistics</h3>
|
||||
@ -47,7 +48,10 @@
|
||||
{/if}
|
||||
{if $GLOBAL.acl.round.statistics}
|
||||
<li class="icon-chart"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=round">Round</a></li>
|
||||
{/if}
|
||||
{/if}
|
||||
{if $GLOBAL.acl.uptime.statistics}
|
||||
<li class="icon-bell"><a href="{$smarty.server.PHP_SELF}?page=statistics&action=uptime">Uptime</a></li>
|
||||
{/if}
|
||||
</ul>
|
||||
{/if}
|
||||
<h3>Help</h3>
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
<script type="text/javascript" src="{$PATH}/js/raphael.2.1.0.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/justgage.1.0.1.min.js"></script>
|
||||
<script type="text/javascript" src="{$PATH}/js/custom.js"></script>
|
||||
<link rel="stylesheet" href="{$PATH}/css/piecharts.css"/>
|
||||
<!--[if IE]><script type="text/javascript" src="{$PATH}/js/excanvas.js"></script><![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
|
||||
54
public/templates/mpos/statistics/uptime/default.tpl
Normal file
54
public/templates/mpos/statistics/uptime/default.tpl
Normal file
@ -0,0 +1,54 @@
|
||||
<script type="text/javascript" src="{$GLOBALASSETS}/js/jquery.easypiechart.min.js"></script>
|
||||
|
||||
<article class="module width_half">
|
||||
<header><h3>UptimeRobot Status</h3></header>
|
||||
<table class="tablesorter" width="80%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center">Location</th>
|
||||
<th align="center">Service</th>
|
||||
<th align="center">State Since</th>
|
||||
<th align="center">Status</th>
|
||||
<th align="center" style="padding-right: 10px">Uptime</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach key=key item=item from=$STATUS.monitors.monitor}
|
||||
{assign var=node value="."|explode:$item.friendlyname}
|
||||
<tr>
|
||||
<td align="center"><img src="{$GLOBALASSETS}/images/flags/{$node.0}.png"/></td>
|
||||
<td align="center">{$node.1}</td>
|
||||
<td align="center">{$item.log.1.datetime|date_format:"%b %d, %Y %H:%M"}</td>
|
||||
<td align="center"><span class="ur-status-{$CODES[$item.status]|lower}">{$CODES[$item.status]}</span></td>
|
||||
<td align="center"><span class="chart-{$item.id}" data-percent="{$item.customuptimeratio}"><span class="percent"></span></span></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</article>
|
||||
|
||||
<script>
|
||||
{literal}
|
||||
$(document).ready(function(){
|
||||
{/literal}
|
||||
{foreach key=key item=item from=$STATUS.monitors.monitor}
|
||||
{literal}
|
||||
$('.chart-{/literal}{$item.id}{literal}').easyPieChart({
|
||||
easing: 'easeOutBounce',
|
||||
size: 26,
|
||||
scaleColor: false,
|
||||
lineWidth: 13,
|
||||
lineCap: 'butt',
|
||||
barColor: '#92CCA6',
|
||||
trackColor: '#FF7878',
|
||||
animate: false,
|
||||
onStep: function(from, to, percent) {
|
||||
$(this.el).find('.percent-{/literal}{$item.id}{literal}').text(Math.round(percent));
|
||||
}
|
||||
});
|
||||
{/literal}
|
||||
{/foreach}
|
||||
{literal}
|
||||
});
|
||||
{/literal}
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user