-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.php
149 lines (127 loc) · 4.11 KB
/
main.php
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<!DOCTYPE html>
<html>
<head>
<title>LOG ANALYSER</title>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
body {
background-color: #f4f4f4;
font-family: Arial, sans-serif;
}
h1 {
text-align: center;
margin-top: 30px;
}
.container {
height: 100vh;
width: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.container form {
margin-top: 20px;
text-align: center;
}
.container form input[type="file"] {
display: none;
}
.container form .custom-file-upload {
display: inline-block;
padding: 10px 20px;
cursor: pointer;
background-color: #4caf50;
color: #fff;
border-radius: 4px;
font-size: 16px;
transition: background-color 0.3s ease;
}
.container form .custom-file-upload:hover {
background-color: #45a049;
}
.container form input[type="submit"] {
margin-top: 10px;
padding: 10px 20px;
cursor: pointer;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 4px;
font-size: 16px;
transition: background-color 0.3s ease;
}
.container form input[type="submit"]:hover {
background-color: #0056b3;
}
footer {
margin-top: 30px;
text-align: right;
}
</style>
</head>
<body>
<div class="container">
<h1>LOG ANALYSER</h1>
<form method="POST" action="parse.php" enctype="multipart/form-data">
<label for="logFile" class="custom-file-upload">
Choose File
<input type="file" name="logFile" id="logFile" required>
</label>
<span id="fileNameLabel"></span>
<input type="submit" value="PARSE">
</form>
<hr/>
<form method="post" action="clear.php">
<input type="submit" name="run_query2" value="EMPTY LOGS">
</form>
<hr/>
<form method="post" action="TCP_DENIED_graph_source.php">
<input type="submit" name="run_query2" value="TCP_DENIED/407 GRAPH FROM SOURCE">
</form>
<br>
<form method="post" action="TCP_DENIED_graph_destination.php">
<input type="submit" name="run_query2" value="TCP_DENIED/407 GRAPH TO DESTINATION">
</form>
<hr/>
<form method="post" action="query.php">
<input type="submit" name="run_query2" value="QUERY RUNNER">
</form>
<hr/>
<footer>
<p><i>RAJYA VARDHAN</i></p>
</footer>
</div>
<script>
const fileInput = document.getElementById('logFile');
const fileNameLabel = document.getElementById('fileNameLabel');
fileInput.addEventListener('change', function() {
const fileName = this.value.split('\\').pop();
fileNameLabel.textContent = fileName;
localStorage.setItem('selectedFileName', fileName);
});
// Retrieve and display the file name when the page loads
window.addEventListener('load', function() {
const selectedFileName = localStorage.getItem('selectedFileName');
if (selectedFileName) {
fileNameLabel.textContent = selectedFileName;
}
});
</script>
</body>
</html>
<!-- <form method="POST" action="php.php" enctype="multipart/form-data">
<input type="file" name="logFile" required>
<br>
<label for="timestamp">Timestamp:</label>
<input type="datetime-local" id="timestamp" name="timestamp" required>
<br>
<input type="submit" value="Upload">
</form> -->