-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.html
More file actions
282 lines (260 loc) Β· 8.58 KB
/
Copy pathdashboard.html
File metadata and controls
282 lines (260 loc) Β· 8.58 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dev Utilities Dashboard</title>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
background: #0f172a;
color: #e2e8f0;
min-height: 100vh;
padding: 2rem 1rem;
}
.container { max-width: 1200px; margin: 0 auto; }
h1 {
font-size: 2rem;
font-weight: 700;
text-align: center;
margin-bottom: 0.5rem;
background: linear-gradient(135deg, #38bdf8, #818cf8);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
.subtitle {
text-align: center;
color: #94a3b8;
margin-bottom: 2rem;
font-size: 0.95rem;
}
.search {
width: 100%;
max-width: 480px;
display: block;
margin: 0 auto 2rem;
padding: 0.75rem 1rem;
border-radius: 10px;
border: 1px solid #334155;
background: #1e293b;
color: #e2e8f0;
font-size: 1rem;
outline: none;
transition: border-color 0.2s;
}
.search:focus { border-color: #38bdf8; }
.search::placeholder { color: #64748b; }
.category { margin-bottom: 2rem; }
.category-title {
font-size: 1.1rem;
font-weight: 600;
color: #38bdf8;
margin-bottom: 0.75rem;
padding-bottom: 0.4rem;
border-bottom: 1px solid #1e293b;
}
.toast {
position: fixed;
bottom: 2rem;
left: 50%;
transform: translateX(-50%);
background: #1e293b;
border: 1px solid #38bdf8;
color: #e2e8f0;
padding: 0.75rem 1.5rem;
border-radius: 10px;
font-size: 0.9rem;
opacity: 0;
transition: opacity 0.3s;
pointer-events: none;
z-index: 100;
}
.toast.show { opacity: 1; }
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 0.75rem;
}
.card {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.85rem 1rem;
border-radius: 10px;
background: #1e293b;
border: 1px solid #334155;
text-decoration: none;
color: #e2e8f0;
transition: all 0.15s;
cursor: pointer;
}
.card:hover {
background: #334155;
border-color: #38bdf8;
transform: translateY(-1px);
}
.icon {
font-size: 1.4rem;
flex-shrink: 0;
width: 2rem;
text-align: center;
}
.info { min-width: 0; }
.name {
font-weight: 600;
font-size: 0.9rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.desc {
font-size: 0.78rem;
color: #94a3b8;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.badge {
display: inline-block;
font-size: 0.65rem;
padding: 0.1rem 0.45rem;
border-radius: 4px;
margin-left: 0.4rem;
font-weight: 600;
vertical-align: middle;
}
.badge-web { background: #1e3a5f; color: #60a5fa; }
.badge-cli { background: #1e3a2f; color: #4ade80; }
.footer {
text-align: center;
color: #475569;
font-size: 0.8rem;
margin-top: 3rem;
padding-top: 1.5rem;
border-top: 1px solid #1e293b;
}
.no-result {
text-align: center;
color: #64748b;
padding: 2rem;
display: none;
}
@media (max-width: 640px) {
.grid { grid-template-columns: 1fr; }
body { padding: 1rem; }
}
</style>
</head>
<body>
<div class="container">
<h1>π§° Dev Utilities</h1>
<p class="subtitle" id="subtitle">~/Develop/utilities — click a tool to launch</p>
<input class="search" type="text" id="search" placeholder="Search tools..." autofocus>
<div id="noResult" class="no-result">No tools match your search.</div>
<div id="categories"></div>
<div class="footer">~/Develop/utilities/dashboard.html</div>
</div>
<div id="toast" class="toast"></div>
<script>
const tools = [
{ name: "dev-tool", desc: "Unified launcher for all tools", icon: "π", cat: "Launcher", cli: true },
{ name: "json-forge.html", desc: "Web JSON formatter (basic)", icon: "π", cat: "JSON", web: true },
{ name: "json-forge-pro.html", desc: "Web JSON tool (CSV/XML)", icon: "π§", cat: "JSON", web: true },
{ name: "base64-tool", desc: "Base64 encode / decode", icon: "π", cat: "Encoding", cli: true },
{ name: "hash", desc: "Hash text (md5/sha1/sha256/sha512)", icon: "π", cat: "Encoding", cli: true },
{ name: "uuid-gen", desc: "UUID v4 generator", icon: "π", cat: "Generators", cli: true },
{ name: "timestamp", desc: "Unix timestamp β date converter", icon: "β±οΈ", cat: "Generators", cli: true },
{ name: "gen-pass", desc: "Password generator (simple/strong/ultra)", icon: "π", cat: "Generators", cli: true },
{ name: "color-tool", desc: "Color format converter", icon: "π¨", cat: "Generators", cli: true },
{ name: "jwt-tool", desc: "JWT encode / decode / inspect", icon: "πͺͺ", cat: "Generators", cli: true },
{ name: "api-test", desc: "HTTP API tester (GET/POST/etc)", icon: "π", cat: "HTTP", cli: true },
{ name: "http-server", desc: "Simple static HTTP server", icon: "π", cat: "HTTP", cli: true },
{ name: "net-tool", desc: "Network utils: DNS / port / IP", icon: "π‘", cat: "HTTP", cli: true },
{ name: "template", desc: "Project template generator", icon: "π", cat: "Templates", cli: true },
{ name: "ai-prompt", desc: "AI prompt manager (list/add/use)", icon: "π€", cat: "Templates", cli: true },
{ name: "regex-tester.html", desc: "Web regex tester", icon: "π", cat: "Validation", web: true },
{ name: "qr-tool", desc: "QR code generator", icon: "π±", cat: "Utils", cli: true },
{ name: "cron-parser", desc: "Cron expression parser", icon: "β°", cat: "Utils", cli: true },
];
const catOrder = ["Launcher", "JSON", "Encoding", "Generators", "HTTP", "Templates", "Validation", "Utils"];
const basePath = new URL('.', window.location.href).pathname;
const toast = document.getElementById('toast');
const subtitle = document.getElementById('subtitle');
let toastTimer;
let serverMode = window.location.protocol === 'http:' || window.location.protocol === 'https:';
if (serverMode) {
subtitle.textContent = '~/Develop/utilities β click a CLI tool to launch in terminal';
}
function showToast(msg) {
clearTimeout(toastTimer);
toast.textContent = msg;
toast.classList.add('show');
toastTimer = setTimeout(() => toast.classList.remove('show'), 2500);
}
function launch(tool) {
if (tool.web) {
const path = serverMode
? tool.name
: basePath + tool.name;
window.open(path, '_blank');
} else if (serverMode) {
fetch('/api/run/' + tool.name).then(r => {
if (r.ok) showToast(`βΆ Launched ${tool.name} in terminal`);
else showToast('Failed to launch ' + tool.name);
}).catch(() => showToast('Server unreachable'));
} else {
const path = basePath + tool.name;
navigator.clipboard.writeText(path).then(() => {
showToast(`β Copied: ${tool.name} β paste in terminal`);
}).catch(() => {
showToast(`Run: ${path}`);
});
}
}
function render(filter) {
const container = document.getElementById('categories');
container.innerHTML = '';
let hasAny = false;
const lowered = (filter || '').toLowerCase();
for (const cat of catOrder) {
const items = tools.filter(t => t.cat === cat);
const filtered = lowered
? items.filter(t => t.name.toLowerCase().includes(lowered) || t.desc.toLowerCase().includes(lowered))
: items;
if (!filtered.length) continue;
hasAny = true;
const section = document.createElement('div');
section.className = 'category';
const title = document.createElement('div');
title.className = 'category-title';
title.textContent = cat;
section.appendChild(title);
const grid = document.createElement('div');
grid.className = 'grid';
for (const t of filtered) {
const card = document.createElement('a');
card.className = 'card';
card.href = '#';
card.addEventListener('click', e => { e.preventDefault(); launch(t); });
const badge = t.web
? '<span class="badge badge-web">web</span>'
: '<span class="badge badge-cli">cli</span>';
card.innerHTML = `
<div class="icon">${t.icon}</div>
<div class="info">
<div class="name">${t.name}${badge}</div>
<div class="desc">${t.desc}</div>
</div>`;
grid.appendChild(card);
}
section.appendChild(grid);
container.appendChild(section);
}
document.getElementById('noResult').style.display = hasAny ? 'none' : 'block';
}
document.getElementById('search').addEventListener('input', e => render(e.target.value));
render();
</script>
</body>
</html>