-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
94 lines (82 loc) · 3.92 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
<title>Docker Controller</title>
</head>
<body>
<div class="container">
<h1>Docker Management Platform</h1>
<div class="col">
<a class="btn btn-primary" id="create" href="./create.html?ip=127.0.0.1">Create</a>
<a type="button" class="btn btn-dark" href="./config/config.html">Server Operations</a>
</div>
<table id="instance-list" class="table table-striped table-hover">
<tbody>
<tr>
<th>ID</th>
<th>Name</th>
<th>State</th>
<th id="action">Action</th>
</tr>
</tbody>
</table>
<div class="spinner-border text-primary" role="status" id="loadingIcon">
<span class="visually-hidden">Loading...</span>
</div>
<!-- Modal -->
<div class="modal fade" id="modal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="modal-title">Error</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body" id="modal-text">
An error occured while retrieving the list of instances. Please make sure that the Docker server
is on.<br>Please refresh to try again.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<script src="api.js"></script>
<script>
const modal = new bootstrap.Modal(document.getElementById('modal'));
const loadingIcon = document.getElementById("loadingIcon");
if (window.location.search.substr(1) == "pleasework" || list("127.0.0.1")) {
if (window.location.search.substr(1)) {
const instanceList = document.getElementById("instance-list");
const row = instanceList.insertRow();
let idCell = row.insertCell();
let nameCell = row.insertCell();
let statusCell = row.insertCell();
let actionCell = row.insertCell();
idCell.innerText = 69420;
nameCell.innerText = "Your mother";
statusCell.innerText = "Running";
ipInt = ipToInt("127.0.0.1");
actionCell.innerHTML = `<button class="btn btn-success" onclick="start(` + ipInt + `, 69420)">Start</button>
<button class="btn btn-danger" onclick="stop(` + ipInt + `, 69420)">Stop</button>
<a class="btn btn-primary" href='./client/index.html'>SSH</a>
<a class="btn btn-dark" href="/advanced.html?ip=` + ipInt + `&id=69420">Advanced</a>
<button class="btn btn-danger" onclick="deleteInstance(` + ipInt + `, 69420)">Delete</button>`;
}
loadingIcon.style.display = "none";
} else {
modal.show();
}
</script>
</body>
</html>