Zhofang commited on
Commit
adc96fd
·
verified ·
1 Parent(s): 696f055

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +92 -81
index.html CHANGED
@@ -1,89 +1,100 @@
1
  <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>Layer7 - DSTAT</title>
7
- <style>
8
- html,
9
- body {
10
- height: 100%;
11
- margin: 0;
12
- }
13
-
14
- body {
15
- display: flex;
16
- align-items: center;
17
- justify-content: center;
18
- flex-direction: column;
19
- }
20
-
21
- body > div {
22
- width: 100%;
23
- }
24
-
25
- #chart {
26
- width: 80%;
27
- margin: auto;
28
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
 
30
- #info {
31
- margin-top: 2em;
32
- text-align: center;
33
- font-family: Arial, Helvetica, sans-serif;
34
- }
35
- </style>
36
- </head>
37
 
38
- <body>
39
- <div>
40
- <h2 id="info"></h2>
41
- <div id="chart"></div>
42
- </div>
43
- <script src="https://code.highcharts.com/highcharts.js"></script>
44
- <script src="https://code.highcharts.com/modules/exporting.js"></script>
45
- <script>
46
- window.onload = () => {
47
- let info = document.getElementById("info");
48
 
49
- let chart = Highcharts.chart("chart", {
50
- exporting: {
51
- enabled: true,
52
- },
53
- chart: {
54
- type: "area",
55
- },
56
- title: {
57
- text: "Layer7 DSTAT",
58
- },
59
- xAxis: {
60
- type: "datetime",
61
- },
62
- yAxis: {
63
- title: {
64
- text: "",
65
- },
66
- },
67
- series: [
68
- {
69
- name: "Requests",
70
- data: [],
71
- },
72
- ],
73
- });
74
 
75
- info.innerText = "Capturing requests from " + location.host + "/dstat";
 
 
 
 
 
 
 
 
 
76
 
77
- let ws = new WebSocket(
78
- (location.protocol === "https:" ? "wss" : "ws") + "://" + location.host + "/"
79
- );
80
 
81
- ws.onmessage = (event) => {
82
- let requests = Number(event.data);
83
- let time = new Date().getTime();
84
- chart.series[0].addPoint([time, requests], true, chart.series[0].points.length > 60);
85
- };
86
- };
87
- </script>
88
- </body>
89
  </html>
 
1
  <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Custom Dstat By @Vano_Ganzzz</title>
6
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
7
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.css" rel="stylesheet">
8
+ </head>
9
+ <body>
10
+ <div class="container">
11
+ <div class="row">
12
+ <div class="col-12">
13
+ <div class="card" style="border-radius: 50px;">
14
+ <div class="card-body">
15
+ <canvas id="canvas"></canvas>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ <!--suppress JSUnresolvedLibraryURL -->
22
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
23
+ <!--suppress JSUnresolvedLibraryURL -->
24
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
25
+ <!--suppress JSUnresolvedLibraryURL -->
26
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js"></script>
27
+ <script>
28
+ $(document).ready(function () {
29
+ const config = {
30
+ type: 'line',
31
+ data: {
32
+ labels: [],
33
+ datasets: [{
34
+ label: "requests",
35
+ backgroundColor: 'rgb(255, 99, 132)',
36
+ borderColor: 'rgb(255, 99, 132)',
37
+ data: [],
38
+ fill: false,
39
+ }],
40
+ },
41
+ options: {
42
+ responsive: true,
43
+ title: {
44
+ display: true,
45
+ text: 'custom rule /attack'
46
+ },
47
+ tooltips: {
48
+ mode: 'index',
49
+ intersect: false,
50
+ },
51
+ hover: {
52
+ mode: 'nearest',
53
+ intersect: true
54
+ },
55
+ scales: {
56
+ xAxes: [{
57
+ display: true,
58
+ scaleLabel: {
59
+ display: true
60
+ }
61
+ }],
62
+ yAxes: [{
63
+ display: true,
64
+ scaleLabel: {
65
+ display: true
66
+ }
67
+ }]
68
+ }
69
+ }
70
+ };
71
 
72
+ const context = document.getElementById('canvas').getContext('2d');
 
 
 
 
 
 
73
 
74
+ const lineChart = new Chart(context, config);
 
 
 
 
 
 
 
 
 
75
 
76
+ const source = new EventSource("/chart-data");
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
 
78
+ source.onmessage = function (event) {
79
+ const data = JSON.parse(event.data);
80
+ if (config.data.labels.length === 20) {
81
+ config.data.labels.shift();
82
+ config.data.datasets[0].data.shift();
83
+ }
84
+ config.data.labels.push(data.time);
85
+ config.data.datasets[0].data.push(data.value);
86
+ lineChart.update();
87
+ }
88
 
89
+ // Kenapa tuh kira²? wkwkwk
90
+ let titleIndex = 0;
91
+ const titles = ["Custom Dstat By @Vano_Ganzzz", "TELEGRAM @CANTDOWN", "No Chaptha DSTAT", "CUSTOM HTML BY @VANO_GANZZZ"];
92
 
93
+ setInterval(() => {
94
+ document.title = titles[titleIndex];
95
+ titleIndex = (titleIndex + 1) % titles.length;
96
+ }, 3000);
97
+ });
98
+ </script>
99
+ </body>
 
100
  </html>