Add files via upload

This commit is contained in:
Toyo
2017-05-18 15:51:34 +08:00
committed by GitHub
parent c96de4f8d9
commit bf29bd463a
11 changed files with 414 additions and 0 deletions
File diff suppressed because one or more lines are too long
+7
View File
File diff suppressed because one or more lines are too long
+49
View File
@@ -0,0 +1,49 @@
body { background: #ebebeb url('../img/light.png'); }
.announcement { color: #777; border-bottom: solid 3px #d0d0d0; background-color: #fff; padding: 10px 10px; text-align: center; transition: 0.3s; }
.announcement:hover { border-bottom: solid 3px #159e83; transition: 0.3s; }
.announcement p { display: inline-block;font-size: 15px;margin: 0;line-height: 1;text-indent: 5px; }
.announcement i { display: inline-block;font-size: 15px;margin: 0;line-height: 1;color: #444; }
.navbar { min-height: 50px; }
.navbar-top { background-color: #4a4a4a !important; border-bottom: 6px solid #159e83; -moz-box-shadow: 0 -4px 0 rgba(0,0,0,.1); box-shadow: 0 6px 0 rgba(0,0,0,.1); }
.navbar-brand { color: #fff; padding: 10px; font-size: 20px; }
.dropdown .dropdown-toggle { padding-bottom: 10px; padding-top: 10px; }
.navbar-inverse .navbar-brand { color: #fff; padding: 15px 20px 10px; font-size: 20px; }
.content { background: #ffffff; padding: 20px; border: 1px #cecece solid; -webkit-box-shadow: 0 1px 10px rgba(0, 0, 0, .1); -moz-box-shadow: 0 1px 10px rgba(0, 0, 0, .1); box-shadow: 0 1px 10px rgba(0, 0, 0, .1); margin-bottom: 20px; margin-top: 20px; }
.table { background: #ffffff; margin-bottom: 0; border-collapse: collapse; border-radius: 3px; }
.table th, .table td { text-align: center; }
.table-striped tbody > tr.even > td, .table-striped tbody > tr.even > th { background-color: #F9F9F9; }
.table-striped tbody > tr.odd > td, .table-striped tbody > tr.odd > th { background-color: #FFF; }
.progress { margin-bottom: 0; }
.progress-bar { color: #000; }
.table-hover > tbody > tr:hover > td { background: #E6E6E6; }
tr.even.expandRow > :hover { background: #F9F9F9 !important; }
tr.odd.expandRow > :hover { background: #FFF !important; }
.expandRow > td { padding: 0 !important; border-top: 0px !important; }
#cpu, #ram, #hdd, #network, #traffic { min-width: 55px; max-width: 100px; }
#type_1, tr td:nth-child(5) { display:none; }
@media only screen and (max-width: 720px) {
#type, tr td:nth-child(4) { display:none; }
#type_1, tr td:nth-child(5) { display:block; }
}
@media only screen and (max-width: 600px) {
#type, tr td:nth-child(4) { display:none; }
#type_1, tr td:nth-child(5) { display:block; }
#location, tr td:nth-child(6) { display:none; }
#time, tr td:nth-child(7) { display:none; }
}
@media only screen and (max-width: 533px) {
#type, tr td:nth-child(4) { display:none; }
#type_1, tr td:nth-child(5) { display:block; }
#location, tr td:nth-child(6) { display:none; }
#time, tr td:nth-child(7) { display:none; }
}
@media only screen and (max-width: 450px) {
body { font-size: 10px; }
.content { padding: 0; }
#name, tr td:nth-child(2) { min-width: 20px; max-width: 60px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
#type, tr td:nth-child(4) { display:none; }
#type_1, tr td:nth-child(5) { display:block; }
#location, tr td:nth-child(6) { display:none; }
#time, tr td:nth-child(7) { display:none; }
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 600 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

+94
View File
@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html>
<head>
<title>逗比云监控</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="云监控">
<meta name="author" content="BotoX">
<link rel="shortcut icon" href="favicon.ico"/>
<link rel="bookmark" href="favicon.ico"/>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/light.css">
<style>
body {
padding-top: 70px;
padding-bottom: 30px;
}
</style>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="//oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div role="navigation" class="navbar navbar-inverse navbar-fixed-top navbar-top">
<div class="navbar-inner">
<div class="container">
<div class="navbar-header">
<button data-target=".navbar-collapse" data-toggle="collapse" class="navbar-toggle" type="button">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a href="#" class="navbar-brand">逗比云监控</a>
</div>
<div class="navbar-collapse collapse">
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container announcement">
<i class="fa fa-volume-down"></i><p>Shadowsocks/ShadowsocksR 账号在线监控 —— <a target="_blank" href="https://doub.io">逗比根据地</a></p>
</div>
<div class="container content">
<div id="loading-notice">
<noscript>
<div class="alert alert-danger" style="text-align: center;">
<strong>Enable JavaScript</strong> you fucking autist neckbeard, it's not gonna hurt you.
</div>
</noscript>
<div class="progress progress-striped active">
<div class="progress-bar progress-bar-warning" style="width: 100%;">加载中...</div>
</div>
<div style="text-align: center;">
如果出现此消息,请确保您已启用Javascript! <br />否则云监控主服务(服务端) 未启动或已关闭.
</div>
<p></p>
</div>
<table class="table table-striped table-condensed table-hover">
<thead>
<tr>
<th id="status" style="text-align: center;">状态</th>
<th id="ip">IP</th>
<th id="name">名称</th>
<th id="type">类型</th>
<th id="type_1">类型</th>
<th id="location">位置</th>
<th id="time">测试时间</th>
</tr>
</thead>
<tbody id="servers">
<!-- Servers here \o/ -->
</tbody>
</table>
<br />
<div id="updated" style="margin-left: 5px;">Updating...</div>
</div>
<div class="container">
<p style="text-align: center; font-size: 10px;">
<a href="https://github.com/ToyoDAdoubi/SSRStatus">SSRStatus-Toyo</a>
</p>
</div>
<script src="js/jquery-1.10.2.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/ssrstatus.js?4"></script>
</body>
</html>
+7
View File
File diff suppressed because one or more lines are too long
+6
View File
File diff suppressed because one or more lines are too long
+234
View File
@@ -0,0 +1,234 @@
// ssrstatus.js
var error = 0;
var d = 0;
var server_status = new Array();
function timeSince(date) {
if(date == 0)
return "从未.";
var seconds = Math.floor((new Date() - date) / 1000);
var interval = Math.floor(seconds / 31536000);
if (interval > 1)
return interval + " 年前.";
interval = Math.floor(seconds / 2592000);
if (interval > 1)
return interval + " 月前.";
interval = Math.floor(seconds / 86400);
if (interval > 1)
return interval + " 日前.";
interval = Math.floor(seconds / 3600);
if (interval > 1)
return interval + " 小时前.";
interval = Math.floor(seconds / 60);
if (interval > 1)
return interval + " 分钟前.";
/*if(Math.floor(seconds) >= 5)
return Math.floor(seconds) + " seconds";*/
else
return "几秒前.";
}
function bytesToSize(bytes, precision, si){
var ret;
si = typeof si !== 'undefined' ? si : 0;
if(si != 0) {
var kilobyte = 1000;
var megabyte = kilobyte * 1000;
var gigabyte = megabyte * 1000;
var terabyte = gigabyte * 1000;
} else {
var kilobyte = 1024;
var megabyte = kilobyte * 1024;
var gigabyte = megabyte * 1024;
var terabyte = gigabyte * 1024;
}
if ((bytes >= 0) && (bytes < kilobyte)) {
return bytes + ' B';
} else if ((bytes >= kilobyte) && (bytes < megabyte)) {
ret = (bytes / kilobyte).toFixed(precision) + ' K';
} else if ((bytes >= megabyte) && (bytes < gigabyte)) {
ret = (bytes / megabyte).toFixed(precision) + ' M';
} else if ((bytes >= gigabyte) && (bytes < terabyte)) {
ret = (bytes / gigabyte).toFixed(precision) + ' G';
} else if (bytes >= terabyte) {
ret = (bytes / terabyte).toFixed(precision) + ' T';
} else {
return bytes + ' B';
}
if(si != 0) {
return ret + 'B';
} else {
return ret + 'iB';
}
}
function uptime() {
$.getJSON("json/stats.json", function(result) {
$("#loading-notice").remove();
if(result.reload)
setTimeout(function() { location.reload(true) }, 1000);
for (var i = 0; i < result.servers.length; i++) {
var TableRow = $("#servers tr#r" + i);
var ExpandRow = $("#servers #rt" + i);
var hack; // fuck CSS for making me do this
if(i%2) hack="odd"; else hack="even";
if (!TableRow.length) {
$("#servers").append(
"<tr id=\"r" + i + "\" data-toggle=\"collapse\" data-target=\"#rt" + i + "\" class=\"accordion-toggle " + hack + "\">" +
"<td id=\"status\"><div class=\"progress\"><div style=\"width: 100%;\" class=\"progress-bar progress-bar-warning\"><small>加载中</small></div></div></td>" +
"<td id=\"ip\">加载中</td>" +
"<td id=\"name\">加载中</td>" +
"<td id=\"type\">加载中</td>" +
"<td id=\"type_1\">加载中</td>" +
"<td id=\"location\">加载中</td>" +
"<td id=\"time\">加载中</td>" +
"</tr>"
);
TableRow = $("#servers tr#r" + i);
ExpandRow = $("#servers #rt" + i);
server_status[i] = true;
}
TableRow = TableRow[0];
if(error) {
TableRow.setAttribute("data-target", "#rt" + i);
server_status[i] = true;
}
// IP
TableRow.children["ip"].innerHTML = result.servers[i].ip;
// Name
TableRow.children["name"].innerHTML = result.servers[i].name;
// Type
TableRow.children["type"].innerHTML = result.servers[i].type;
// Type_1
TableRow.children["type_1"].innerHTML = result.servers[i].type_1;
// Location
TableRow.children["location"].innerHTML = result.servers[i].location;
// Status
if (result.servers[i].status) {
TableRow.children["status"].children[0].children[0].className = "progress-bar progress-bar-success";
TableRow.children["status"].children[0].children[0].innerHTML = "<small>可用</small>";
} else {
TableRow.children["status"].children[0].children[0].className = "progress-bar progress-bar-danger";
TableRow.children["status"].children[0].children[0].innerHTML = "<small>不可用</small>";
}
// time
TableRow.children["time"].innerHTML = result.servers[i].time;
};
d = new Date(result.updated*1000);
error = 0;
}).fail(function(update_error) {
if (!error) {
$("#servers > tr.accordion-toggle").each(function(i) {
var TableRow = $("#servers tr#r" + i)[0];
var ExpandRow = $("#servers #rt" + i);
TableRow.children["ip"].children[0].children[0].className = "progress-bar progress-bar-error";
TableRow.children["ip"].children[0].children[0].innerHTML = "<small>错误</small>";
TableRow.children["location"].innerHTML = "<div class=\"progress progress-striped active\"><div style=\"width: 100%;\" class=\"progress-bar progress-bar-error\"><small>错误</small></div></div>";
TableRow.children["status"].innerHTML = "<div class=\"progress progress-striped active\"><div style=\"width: 100%;\" class=\"progress-bar progress-bar-error\"><small>错误</small></div></div>";
TableRow.children["time"].innerHTML = "<div class=\"progress progress-striped active\"><div style=\"width: 100%;\" class=\"progress-bar progress-bar-error\"><small>错误</small></div></div>";
if(ExpandRow.hasClass("in")) {
ExpandRow.collapse("hide");
}
TableRow.setAttribute("data-target", "");
server_status[i] = false;
});
}
error = 1;
$("#updated").html("更新错误.");
});
}
function updateTime() {
if (!error)
$("#updated").html("最后更新: " + timeSince(d));
}
uptime();
updateTime();
setInterval(uptime, 2000);
setInterval(updateTime, 1000);
// styleswitcher.js
function setActiveStyleSheet(title) {
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
}
function getActiveStyleSheet() {
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled)
return a.getAttribute("title");
}
return null;
}
function getPreferredStyleSheet() {
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("rel").indexOf("alt") == -1 && a.getAttribute("title"))
return a.getAttribute("title");
}
return null;
}
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ')
c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0)
return c.substring(nameEQ.length,c.length);
}
return null;
}
window.onload = function(e) {
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
}
window.onunload = function(e) {
var title = getActiveStyleSheet();
createCookie("style", title, 365);
}
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
+10
View File
@@ -0,0 +1,10 @@
{
"servers": [
{ "ip": "216.189.158.147", "name": "Free LAG1", "type": "Shadowsocks", "type_1": "SS", "location": "Los Angeles", "status": true, "time": "2017-05-18 15:34:14" },
{ "ip": "104.160.173.141", "name": "Free LAG2", "type": "Shadowsocks", "type_1": "SS", "location": "Los Angeles", "status": true, "time": "2017-05-18 15:34:16" },
{ "ip": "64.137.208.113", "name": "Free JND1", "type": "ShadowsocksR", "type_1": "SSR", "location": "Canada", "status": false, "time": "2017-05-18 15:34:27" },
{ "ip": "45.62.245.70", "name": "Free JND2", "type": "ShadowsocksR", "type_1": "SSR", "location": "Canada", "status": true, "time": "2017-05-18 15:34:30" },
{ "ip": "64.137.243.186", "name": "Free JND3", "type": "ShadowsocksR", "type_1": "SSR", "location": "Canada", "status": true, "time": "2017-05-18 15:34:33" }
],
"updated": "1495092873"
}