Spaces:
Sleeping
Sleeping
DmitrMakeev
commited on
Commit
•
cdb7807
1
Parent(s):
739886f
Rename up_ad.html to monitor.html
Browse files- monitor.html +27 -0
- up_ad.html +0 -126
monitor.html
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Server Monitor</title>
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
<h1>Server Monitor</h1>
|
10 |
+
<h2>Uploaded Files</h2>
|
11 |
+
<ul>
|
12 |
+
{% for file in uploaded_files %}
|
13 |
+
<li>{{ file }}</li>
|
14 |
+
{% endfor %}
|
15 |
+
</ul>
|
16 |
+
<h2>Uploaded HTML Files</h2>
|
17 |
+
<ul>
|
18 |
+
{% for file in uploaded_html_files %}
|
19 |
+
<li>{{ file }}</li>
|
20 |
+
{% endfor %}
|
21 |
+
</ul>
|
22 |
+
<h2>Disk Space</h2>
|
23 |
+
<p>Total: {{ disk_space.total }}</p>
|
24 |
+
<p>Used: {{ disk_space.used }}</p>
|
25 |
+
<p>Free: {{ disk_space.free }}</p>
|
26 |
+
</body>
|
27 |
+
</html>
|
up_ad.html
DELETED
@@ -1,126 +0,0 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
-
<html lang="en">
|
3 |
-
<head>
|
4 |
-
<meta charset="UTF-8">
|
5 |
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
-
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/toastify-js/src/toastify.min.css">
|
7 |
-
<title>Manage Group Admin</title>
|
8 |
-
<style>
|
9 |
-
body {
|
10 |
-
font-family: Arial, sans-serif;
|
11 |
-
text-align: center;
|
12 |
-
background-color: #f0f0f0;
|
13 |
-
margin: 0;
|
14 |
-
padding: 0;
|
15 |
-
}
|
16 |
-
h1 {
|
17 |
-
background-color: #4CAF50;
|
18 |
-
color: white;
|
19 |
-
padding: 20px;
|
20 |
-
margin: 0;
|
21 |
-
border-bottom: 2px solid #388E3C;
|
22 |
-
}
|
23 |
-
.input-row {
|
24 |
-
display: flex;
|
25 |
-
justify-content: center;
|
26 |
-
gap: 10px;
|
27 |
-
margin-top: 20px;
|
28 |
-
}
|
29 |
-
.input-row input {
|
30 |
-
padding: 10px;
|
31 |
-
font-size: 16px;
|
32 |
-
border: 1px solid #ccc;
|
33 |
-
border-radius: 5px;
|
34 |
-
}
|
35 |
-
#setAdminButton {
|
36 |
-
color: white;
|
37 |
-
background-color: #4CAF50;
|
38 |
-
border: none;
|
39 |
-
cursor: pointer;
|
40 |
-
padding: 10px 20px;
|
41 |
-
font-size: 16px;
|
42 |
-
border-radius: 5px;
|
43 |
-
margin-top: 20px;
|
44 |
-
}
|
45 |
-
#setAdminButton:hover {
|
46 |
-
background-color: #388E3C;
|
47 |
-
}
|
48 |
-
</style>
|
49 |
-
</head>
|
50 |
-
<body>
|
51 |
-
<h1>Добавления администратора закрытой группы</h1>
|
52 |
-
<div class="input-row">
|
53 |
-
<input type="text" id="apiKeyInput" placeholder="Вставьте API ключ">
|
54 |
-
<input type="text" id="groupIdInput" placeholder="Вставьте ID группы">
|
55 |
-
<input type="text" id="participantChatIdInput" placeholder="Телефон администратора">
|
56 |
-
</div>
|
57 |
-
<button id="setAdminButton">Добавить администратора</button>
|
58 |
-
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/toastify-js"></script>
|
59 |
-
<script>
|
60 |
-
document.getElementById('setAdminButton').addEventListener('click', function() {
|
61 |
-
const apiKey = document.getElementById('apiKeyInput').value;
|
62 |
-
const groupId = document.getElementById('groupIdInput').value;
|
63 |
-
let participantChatId = document.getElementById('participantChatIdInput').value;
|
64 |
-
if (!apiKey || !groupId || !participantChatId) {
|
65 |
-
|
66 |
-
Toastify({
|
67 |
-
text: "Пожалуйста заполните все поля!",
|
68 |
-
duration: 3000,
|
69 |
-
gravity: "top",
|
70 |
-
position: "right",
|
71 |
-
backgroundColor: "#fc0303",
|
72 |
-
}).showToast();
|
73 |
-
return;
|
74 |
-
}
|
75 |
-
// Add the @c.us suffix if it's not already present
|
76 |
-
if (!participantChatId.includes('@c.us')) {
|
77 |
-
participantChatId = participantChatId + '@c.us';
|
78 |
-
}
|
79 |
-
setGroupAdmin(apiKey, groupId, participantChatId);
|
80 |
-
});
|
81 |
-
async function setGroupAdmin(apiKey, groupId, participantChatId) {
|
82 |
-
const url = `https://api.green-api.com/waInstance1101952913/setGroupAdmin/${apiKey}`;
|
83 |
-
const payload = {
|
84 |
-
groupId: groupId,
|
85 |
-
participantChatId: participantChatId
|
86 |
-
};
|
87 |
-
const headers = {
|
88 |
-
'Content-Type': 'application/json'
|
89 |
-
};
|
90 |
-
try {
|
91 |
-
const response = await fetch(url, {
|
92 |
-
method: 'POST',
|
93 |
-
headers: headers,
|
94 |
-
body: JSON.stringify(payload)
|
95 |
-
});
|
96 |
-
if (!response.ok) {
|
97 |
-
throw new Error(`HTTP error! status: ${response.status}`);
|
98 |
-
}
|
99 |
-
const data = await response.json();
|
100 |
-
if (data.setGroupAdmin === false && data.error === "participant not found") {
|
101 |
-
alert('Добавьте пользователя в группу');
|
102 |
-
Toastify({
|
103 |
-
text: "Пользователь должен быть в группе!",
|
104 |
-
duration: 3000,
|
105 |
-
gravity: "top",
|
106 |
-
position: "right",
|
107 |
-
backgroundColor: "#fc0303",
|
108 |
-
}).showToast();
|
109 |
-
} else {
|
110 |
-
console.log('Admin set successfully:', data);
|
111 |
-
Toastify({
|
112 |
-
text: "Администратор добавлен!",
|
113 |
-
duration: 3000,
|
114 |
-
gravity: "top",
|
115 |
-
position: "right",
|
116 |
-
backgroundColor: "#05b334",
|
117 |
-
}).showToast();
|
118 |
-
}
|
119 |
-
} catch (error) {
|
120 |
-
console.error('Error setting admin:', error);
|
121 |
-
|
122 |
-
}
|
123 |
-
}
|
124 |
-
</script>
|
125 |
-
</body>
|
126 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|