forked from inklbot/celestia-ITN-PayForBlob-Transactions
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
76 lines (69 loc) · 1.97 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Execute PayForBlob transactions</title>
<style>
h1
{
font-size: 2.5rem;
text-align: center;
margin-top: 3rem;
margin-bottom: 3rem;
}
button
{
display: block;
margin: 2rem auto;
padding: 1rem 2rem;
background-color: #4CAF50;
color: white;
font-size: 1.2rem;
border: none;
border-radius: 4px;
cursor: pointer;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
button:hover
{
background-color: #3e8e41;
}
pre
{
background-color: #f7f7f7;
border: 1px solid #ccc;
padding: 1rem;
margin: 2rem auto;
max-width: 80%;
font-size: 1.2rem;
}
</style>
<script>
async function executeCommand()
{
alert("The PFB transaction is in progress. Please wait for the result.");
const executeResponse = await fetch('/run_command', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: 'command=sudo /bin/bash blob.sh'
});
const outputElement = document.getElementById('output');
if (executeResponse.ok)
{
const output = await executeResponse.text();
outputElement.textContent = '\n' + output;
} else {
outputElement.textContent = 'Error occurred';
}
}
</script>
</head>
<body>
<h1>Execute PayForBlob transactions</h1>
<button onclick="executeCommand()">Execution</button>
<pre id="output"></pre>
</body>
</html>