forked from nagarjuna993/PlexRedirect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·140 lines (133 loc) · 5.02 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="shortcut icon" type="image/x-icon" href="plexlanding.ico" />`
<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="">
<style>
body.offline #link-bar {
display:none;
}
body.offline #headerwrap {
margin: 0 auto;
float: none;
}
body.online #link-bar{
display:block;
}
</style>
<script src="assets/js/ping.js"></script>
<script type='text/javascript'>
HTMLElement.prototype.hasClass = function (className) {
if (this.classList) {
return this.classList.contains(className);
} else {
return (-1 < this.className.indexOf(className));
}
};
HTMLElement.prototype.addClass = function (className) {
if (this.classList) {
this.classList.add(className);
} else if (!this.hasClass(className)) {
var classes = this.className.split(" ");
classes.push(className);
this.className = classes.join(" ");
}
return this;
};
HTMLElement.prototype.removeClass = function (className) {
if (this.classList) {
this.classList.remove(className);
} else {
var classes = this.className.split(" ");
classes.splice(classes.indexOf(className), 1);
this.className = classes.join(" ");
}
return this;
};
function checkServer() {
var p = new Ping();
var server = document.domain; //Try to get it automagically, but you can manually specify this
var timeout = 2000; //Milliseconds
var body = document.getElementsByTagName("body")[0];
p.ping(server+":32400", function(data) {
var serverMsg = document.getElementById( "server-status-msg" );
var serverImg = document.getElementById( "server-status-img" );
if (data < 1000){
serverMsg.innerHTML = 'Disponible';
serverImg.src = "assets/img/server_up.png";
body.addClass('online').removeClass("offline");
}else{
serverMsg.innerHTML = 'Indisponible';
serverImg.src = "assets/img/server_down.png";
}
}, timeout);
}
</script>
<title>YOUR SERVER NAME HERE</title>
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles -->
<link href="assets/css/main.css" rel="stylesheet">
<!-- Fonts from Google Fonts -->
<link href='//fonts.googleapis.com/css?family=Open+Sans:400,300,600' rel='stylesheet' type='text/css'>
</head>
<body onload="checkServer()" class="offline">
<!-- Fixed navbar -->
<div class="navbar navbar-default">
<div class="container">
<a href="http://YOURSERVERURLHERE.com" class="navbar-brand" href="#"><img style="float:left;" src="assets/img/server_img.svg" width="40"><b style="float:left;line-height:40px;margin-left:10px;">YOUR SERVER NAME HERE</b></a>
</div>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container-fluid">
<div class="row mt centered">
<div class="col-lg-6 col-lg-offset-3">
</div>
</div><!-- /row -->
<div class="row mt centered">
<div id="link-bar">
<div class="col-md-6 card">
<div class="col-lg-12">
<a class="link-card" href="http://app.plex.tv/web/app" target="_top">
<span class="link-cnt">
<img src="assets/img/s01.png" width="60" alt="">
<h4>Accéder à YOUR SERVER NAME HERE</h4>
</span>
</a>
</div><!--/col-lg-12 -->
<div class="col-lg-12">
<a class="link-card" href="PLEXREQUESTS LINK HERE" target="_top">
<span class="link-cnt">
<img src="assets/img/s02.png" width="60" alt="">
<h4>Demander un Film ou une Série</h4>
</span>
</a>
</div><!--/col-lg-12 -->
<div class="col-lg-12">
<a class="link-card" href="PLEXEMAIL LINK HERE" target="_top">
<span class="link-cnt">
<img src="assets/img/s03.png" width="60" alt="">
<h4>Nouveautés</h4>
</span>
</a>
</div><!--/col-lg-12 -->
</div><!--/col-lg-6 -->
</div>
<div id="headerwrap" class="col-md-6 card">
<div class="col-lg-12 server-stats">
<h1>YOUR SERVER NAME HERE Status :</h1>
<h4 id="server-status-msg"><img src="assets/img/puff.svg">Checking...</h4>
</div><!-- /col-lg-12 -->
<div class="col-lg-12">
<img id="server-status-img" class="img-responsive" src="assets/img/server_chk.png" alt="">
</div><!-- /col-lg-12 -->
</div><!--/col-lg-6 -->
</div><!-- /row -->
</div><!-- /container -->
</body>
</html>