-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
107 lines (107 loc) · 2.99 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Fsh PT</title>
<!-- Boiler plate------ -->
<link rel="icon" href="https://fsh.plus/fsh.png" type="image/png">
<meta name="description" content="A user and application api ui">
<!-- ------- -->
<link rel="stylesheet" href="https://fsh.plus/media/style.css">
<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 property="og:image" content="https://fsh.plus/fsh.png"/>
<meta name="theme-color" content="#a89c9b">
<!-- ------------------ -->
<link rel="stylesheet" href="/media/style.css">
<script src="/media/script.js"></script>
<style>
body {
width: 100vw;
width: 100dvw;
height: 100vh;
height: 100dvh;
display: flex;
justify-content: center;
align-items: center;
}
body > div {
padding: 15px;
border-radius: 1rem;
background-color: var(--bg-2);
}
body > div > div {
display: flex;
align-items: center;
justify-content: center;
}
body > div > div > label{
flex: 1;
}
input, select {
width: 70%;
box-sizing: border-box;
}
</style>
</head>
<body>
<div>
<div>
<label>Host:</label>
<input id="domain" placeholder="panel.domain.com">
</div>
<div>
<label>Api key:</label>
<input id="key" placeholder="ptlc_key">
</div>
<div>
<label>Type:</label>
<select id="type">
<option value="client">User</option>
<option value="application" disabled>App</option>
</select>
</div>
<div>
<button onclick="login()">Save and go to dashboard</button>
</div>
</div>
<script>
if (localStorage.getItem('key')) {
if (localStorage.getItem('type') == 'app') {
location.pathname = '/app';
} else {
location.pathname = '/user/servers';
}
}
function login() {
let domain = document.getElementById('domain').value;
let type = document.getElementById('type').value;
let key = document.getElementById('key').value;
if (!domain.length || !key.length) {
alert('Fill all the inputs');
return;
}
localStorage.setItem('domain', domain);
localStorage.setItem('type', type);
localStorage.setItem('key', key);
if (type === 'client') {
PT('', function(data){
if (data.err) {
alert('Could not log in')
} else {
location.pathname = '/user/servers';
}
})
} else {
PT('users', function(data){
if (data.err) {
alert('Could not log in')
} else {
location.pathname = '/app';
}
})
}
}
</script>
</body>
</html>