generated from Caknoooo/go-gin-clean-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogs.html
More file actions
200 lines (177 loc) · 7.55 KB
/
logs.html
File metadata and controls
200 lines (177 loc) · 7.55 KB
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Logs</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://kit.fontawesome.com/a82697a287.js" crossorigin="anonymous"></script>
<style>
body {
background: linear-gradient(135deg, #f6f8fc 0%, #e9ecef 100%);
min-height: 100vh;
}
.glass-effect {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
}
.log-item {
position: relative;
max-height: 10rem;
overflow: hidden;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
border: 1px solid rgba(226, 232, 240, 0.7);
}
.log-text {
display: block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
color: #4a5568;
}
.log-item:hover {
max-height: none;
transform: translateY(-2px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.log-item:hover .log-text {
white-space: normal;
}
.custom-select {
background: rgba(255, 255, 255, 0.9);
color: #4f46e5;
border: 2px solid rgba(79, 70, 229, 0.2);
font-weight: 600;
padding-right: 2.5rem;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234f46e5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 0.75rem center;
background-size: 1.25rem;
}
.custom-select:hover {
border-color: #4f46e5;
background-color: rgba(79, 70, 229, 0.05);
transform: translateY(-1px);
}
.custom-select:focus {
outline: none;
border-color: #4f46e5;
box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}
.refresh-button {
background: rgba(255, 255, 255, 0.9);
color: #4f46e5;
width: 48px;
height: 48px;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.4s ease;
border: 2px solid rgba(79, 70, 229, 0.2);
font-size: 1.25rem;
position: relative;
overflow: hidden;
}
.refresh-button::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(45deg,
rgba(79, 70, 229, 0.1) 0%,
rgba(79, 70, 229, 0) 100%);
opacity: 0;
transition: opacity 0.3s ease;
}
.refresh-button:hover {
border-color: #4f46e5;
transform: translateY(-2px);
box-shadow: 0 8px 16px rgba(79, 70, 229, 0.15);
}
.refresh-button:hover::before {
opacity: 1;
}
.refresh-button:hover i {
transform: rotate(180deg);
}
.refresh-button i {
transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.controls-wrapper {
display: flex;
gap: 1rem;
align-items: center;
background: rgba(255, 255, 255, 0.5);
padding: 0.5rem;
border-radius: 20px;
backdrop-filter: blur(8px);
}
</style>
</head>
<body class="font-sans">
<div class="max-w-5xl mx-auto p-8 glass-effect rounded-3xl shadow-2xl mt-12 mb-12">
<div class="flex items-center justify-between mb-12">
<div>
<h1 class="text-4xl font-bold bg-gradient-to-r from-indigo-600 to-purple-600 bg-clip-text text-transparent">Query Logs</h1>
<p class="text-gray-500 mt-2">Monitor and track system queries</p>
</div>
<div class="controls-wrapper">
<button onclick="location.reload()" class="refresh-button" title="Refresh logs">
<i class="fa-solid fa-arrows-rotate"></i>
</button>
<div class="relative">
<select id="month" onchange="changeMonth()" class="custom-select w-48 px-6 py-3 rounded-xl text-sm font-medium">
<option value="january" {{ if eq .Month "january" }}selected{{ end }}>January</option>
<option value="february" {{ if eq .Month "february" }}selected{{ end }}>February</option>
<option value="march" {{ if eq .Month "march" }}selected{{ end }}>March</option>
<option value="april" {{ if eq .Month "april" }}selected{{ end }}>April</option>
<option value="may" {{ if eq .Month "may" }}selected{{ end }}>May</option>
<option value="june" {{ if eq .Month "june" }}selected{{ end }}>June</option>
<option value="july" {{ if eq .Month "july" }}selected{{ end }}>July</option>
<option value="august" {{ if eq .Month "august" }}selected{{ end }}>August</option>
<option value="september" {{ if eq .Month "september" }}selected{{ end }}>September</option>
<option value="october" {{ if eq .Month "october" }}selected{{ end }}>October</option>
<option value="november" {{ if eq .Month "november" }}selected{{ end }}>November</option>
<option value="december" {{ if eq .Month "december" }}selected{{ end }}>December</option>
</select>
</div>
</div>
</div>
<ul class="space-y-6">
{{ range .Logs }}
<li class="log-item p-6 glass-effect rounded-2xl hover:bg-gradient-to-r hover:from-indigo-50 hover:to-purple-50 transition-all">
<div class="flex items-center gap-2 text-indigo-600 mb-3">
<i class="fa-solid fa-terminal text-sm"></i>
<span class="font-semibold">Log Entry</span>
</div>
<pre class="text-sm whitespace-pre-wrap break-words log-text">{{ . }}</pre>
</li>
{{ else }}
<li class="p-8 glass-effect rounded-2xl text-center">
<i class="fa-solid fa-inbox text-4xl text-gray-300 mb-3"></i>
<p class="text-gray-500">No logs found for this month.</p>
</li>
{{ end }}
</ul>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const monthSelect = document.getElementById("month");
if (!monthSelect.value) {
const currentMonthIndex = new Date().getMonth();
const months = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'];
monthSelect.value = months[currentMonthIndex];
}
});
function changeMonth() {
const selectedMonth = document.getElementById("month").value;
window.location.href = `/logs/${selectedMonth}`;
}
</script>
</body>
</html>