| 1 | export type ServerStatus = "running" | "stopped" | "starting" | "stopping"; |
| 2 | |
| 3 | export type GameServer |
| 4 | id: string |
| 5 | name: string |
| 6 | game: "minecraft |
| 7 | status: ServerStatus |
| 8 | node: string |
| 9 | ip: string |
| 10 | port: number |
| 11 | players: { |
| 12 | resources: { |
| 13 | cpu: number |
| 14 | ram: { |
| 15 | disk: { |
| 16 | }; |
| 17 | uptime: string |
| 18 | }; |
| 19 | |
| 20 | export const mockServers: |
| 21 | { |
| 22 | id: "srv-001", |
| 23 | name: "WaffleSMP", |
| 24 | game: "minecraft", |
| 25 | status: "running", |
| 26 | node: "eu-west-1a", |
| 27 | ip: "82.23.170.72", |
| 28 | port: 27011, |
| 29 | players: { current: 12 |
| 30 | resources: { cpu: 34 |
| 31 | uptime: "2d 4h 17m", |
| 32 | }, |
| 33 | { |
| 34 | id: "srv-002", |
| 35 | name: "RustIsland", |
| 36 | game: "rust", |
| 37 | status: "running", |
| 38 | node: "eu-central-2b", |
| 39 | ip: "45.77.12.8", |
| 40 | port: 28015, |
| 41 | players: { current: 47 |
| 42 | resources: { cpu: 72 |
| 43 | uptime: "5d 11h 3m", |
| 44 | }, |
| 45 | { |
| 46 | id: "srv-003", |
| 47 | name: "CounterStrike", |
| 48 | game: "cs2", |
| 49 | status: "stopped", |
| 50 | node: "eu-west-1a", |
| 51 | ip: "82.23.170.15", |
| 52 | port: 27015, |
| 53 | players: { current: 0 |
| 54 | resources: { cpu: 0 |
| 55 | uptime: null, |
| 56 | }, |
| 57 | { |
| 58 | id: "srv-004", |
| 59 | name: "ArkSurvival", |
| 60 | game: "ark", |
| 61 | status: "starting", |
| 62 | node: "na-east-1c", |
| 63 | ip: "104.200.31.44", |
| 64 | port: 7777, |
| 65 | players: { current: 0 |
| 66 | resources: { cpu: 15 |
| 67 | uptime: null, |
| 68 | }, |
| 69 | { |
| 70 | id: "srv-005", |
| 71 | name: "TF2 Classic", |
| 72 | game: "tf2", |
| 73 | status: "running", |
| 74 | node: "eu-central-2b", |
| 75 | ip: "45.77.12.33", |
| 76 | port: 27015, |
| 77 | players: { current: 8 |
| 78 | resources: { cpu: 18 |
| 79 | uptime: "1d 2h 44m", |
| 80 | }, |
| 81 | ]; |
| 82 | |
| 83 | export type ConsoleLineType |
| 84 | |
| 85 | export interface ConsoleLine |
| 86 | time: string; |
| 87 | type: ConsoleLineType |
| 88 | text: string; |
| 89 | } |
| 90 | |
| 91 | export const mockConsoleLines: |
| 92 | { time: "", type |
| 93 | { time: "16:33:14", |
| 94 | { time: "16:33:14", |
| 95 | { time: "16:33:14", |
| 96 | { |
| 97 | time: "16:33:14", |
| 98 | type: "output", |
| 99 | text: "OpenJDK Runtime Environment Temurin-21.0.9+10 (build 21.0.9+10-LTS)", |
| 100 | }, |
| 101 | { |
| 102 | time: "16:33:14", |
| 103 | type: "output", |
| 104 | text: "OpenJDK 64-Bit Server VM Temurin-21.0.9+10 (build 21.0.9+10-LTS, mixed mode, sharing)", |
| 105 | }, |
| 106 | { time: "16:33:14", |
| 107 | { |
| 108 | time: "16:33:17", |
| 109 | type: "output", |
| 110 | text: "Ignoring hosts properties. All need to be set: minecraft.api.session.host", |
| 111 | }, |
| 112 | { time: "16:33:19", |
| 113 | { time: "16:33:19", |
| 114 | { time: "16:33:19", |
| 115 | { time: "16:33:20", |
| 116 | { time: "16:33:20", |
| 117 | { time: "16:33:21", |
| 118 | { |
| 119 | time: "16:33:21", |
| 120 | type: "output", |
| 121 | text: "Paper: Using libdeflate (Linux x86_64) compression from Velocity.", |
| 122 | }, |
| 123 | { |
| 124 | time: "16:33:21", |
| 125 | type: "output", |
| 126 | text: "Server permissions file permissions.yml is empty, ignoring it", |
| 127 | }, |
| 128 | { time: "16:33:21", |
| 129 | { |
| 130 | time: "16:33:21", |
| 131 | type: "output", |
| 132 | text: "Loading 0 persistent chunks for world 'minecraft:overworld'...", |
| 133 | }, |
| 134 | { |
| 135 | time: "16:33:21", |
| 136 | type: "output", |
| 137 | text: "Loading 0 persistent chunks for world 'minecraft:the_nether'...", |
| 138 | }, |
| 139 | { |
| 140 | time: "16:33:21", |
| 141 | type: "output", |
| 142 | text: "Loading 0 persistent chunks for world 'minecraft:the_end'...", |
| 143 | }, |
| 144 | { time: "16:33:21", |
| 145 | { time: "16:33:21", |
| 146 | ]; |
| 147 | |
| 148 | export const mockNetworkIn: |
| 149 | 0, 0, 2, |
| 150 | ]; |
| 151 | export const mockNetworkOut: |
| 152 | 0, 1, 3, |
| 153 | ]; |
| 154 | export const mockCpuHistory: |
| 155 | 28, 32, 45, |
| 156 | 36, 38, 34, |
| 157 | ]; |
| 158 | export const mockRamHistory: |
| 159 | 920, 935, 940, |
| 160 | 945, 944, 946, |
| 161 | ]; |
| 162 | export const mockDiskHistory: |
| 163 | 240, 241, 243, |
| 164 | 252, 252, 252, |
| 165 | ]; |
| 166 | |
| 167 | export type FileItemType |
| 168 | |
| 169 | export interface FileItem |
| 170 | name: string; |
| 171 | type: FileItemType |
| 172 | size?: number |
| 173 | modified: string; |
| 174 | path: string; |
| 175 | content?: string |
| 176 | mimeType?: string |
| 177 | children?: FileItem |
| 178 | } |
| 179 | |
| 180 | export const mockFileTree: |
| 181 | { |
| 182 | name: "plugins", |
| 183 | type: "directory", |
| 184 | modified: "Jan 30, 2026", |
| 185 | path: "/plugins", |
| 186 | children: [ |
| 187 | { |
| 188 | name: "EssentialsX.jar", |
| 189 | type: "file", |
| 190 | size: 1843200, |
| 191 | modified: "Jan 12, 2026", |
| 192 | path: "/plugins/EssentialsX.jar", |
| 193 | mimeType: "application/java-archive", |
| 194 | }, |
| 195 | { |
| 196 | name: "LuckPerms.jar", |
| 197 | type: "file", |
| 198 | size: 2097152, |
| 199 | modified: "Jan 15, 2026", |
| 200 | path: "/plugins/LuckPerms.jar", |
| 201 | mimeType: "application/java-archive", |
| 202 | }, |
| 203 | ], |
| 204 | }, |
| 205 | { |
| 206 | name: "world", |
| 207 | type: "directory", |
| 208 | modified: "Jan 30, 2026", |
| 209 | path: "/world", |
| 210 | children: [ |
| 211 | { |
| 212 | name: "level.dat", |
| 213 | type: "file", |
| 214 | size: 8192, |
| 215 | modified: "Jan 30, 2026", |
| 216 | path: "/world/level.dat", |
| 217 | mimeType: "application/octet-stream", |
| 218 | }, |
| 219 | ], |
| 220 | }, |
| 221 | { |
| 222 | name: "logs", |
| 223 | type: "directory", |
| 224 | modified: "Jan 30, 2026", |
| 225 | path: "/logs", |
| 226 | children: [ |
| 227 | { |
| 228 | name: "latest.log", |
| 229 | type: "file", |
| 230 | size: 45312, |
| 231 | modified: "Jan 30, 2026", |
| 232 | path: "/logs/latest.log", |
| 233 | mimeType: "text/plain", |
| 234 | content: `[16:33:14 INFO]: Starting minecraft server version 1.21.11 |
| 235 | [16:33:14 INFO]: Loading properties |
| 236 | [16:33:14 INFO]: Default game type: SURVIVAL |
| 237 | [16:33:15 INFO]: Preparing level "world" |
| 238 | [16:33:21 INFO]: Done (7.340s)! For help, type "help"`, |
| 239 | }, |
| 240 | ], |
| 241 | }, |
| 242 | { |
| 243 | name: "server.properties", |
| 244 | type: "file", |
| 245 | size: 1024, |
| 246 | modified: "Jan 28, 2026", |
| 247 | path: "/server.properties", |
| 248 | mimeType: "text/plain", |
| 249 | content: `#Minecraft server properties |
| 250 | #Thu Jan 30 2026 |
| 251 | enable-jmx-monitoring=false |
| 252 | rcon.port=25575 |
| 253 | level-seed= |
| 254 | gamemode=survival |
| 255 | enable-command-block=false |
| 256 | enable-query=false |
| 257 | generator-settings={} |
| 258 | enforce-secure-profile=true |
| 259 | level-name=world |
| 260 | motd=A Minecraft Server |
| 261 | query.port=25565 |
| 262 | pvp=true |
| 263 | generate-structures=true |
| 264 | max-chained-neighbor-updates=1000000 |
| 265 | difficulty=easy |
| 266 | network-compression-threshold=256 |
| 267 | max-tick-time=60000 |
| 268 | require-resource-pack=false |
| 269 | use-native-transport=true |
| 270 | max-players=20 |
| 271 | online-mode=true |
| 272 | enable-status=true |
| 273 | allow-flight=false |
| 274 | initial-disabled-packs= |
| 275 | broadcast-rcon-to-ops=true |
| 276 | view-distance=10 |
| 277 | server-ip= |
| 278 | resource-pack-prompt= |
| 279 | allow-nether=true |
| 280 | server-port=25565 |
| 281 | enable-rcon=false |
| 282 | sync-chunk-writes=true |
| 283 | op-permission-level=4 |
| 284 | prevent-proxy-connections=false |
| 285 | hide-online-players=false |
| 286 | resource-pack= |
| 287 | entity-broadcast-range-percentage=100 |
| 288 | simulation-distance=10 |
| 289 | rcon.password= |
| 290 | player-idle-timeout=0 |
| 291 | debug=false |
| 292 | force-gamemode=false |
| 293 | rate-limit=0 |
| 294 | hardcore=false |
| 295 | white-list=false |
| 296 | broadcast-console-to-ops=true |
| 297 | spawn-npcs=true |
| 298 | spawn-animals=true |
| 299 | log-ips=true |
| 300 | function-permission-level=2 |
| 301 | level-type=minecraft\\:normal |
| 302 | text-filtering-config= |
| 303 | spawn-monsters=true |
| 304 | enforce-whitelist=false |
| 305 | spawn-protection=16 |
| 306 | max-world-size=29999984`, |
| 307 | }, |
| 308 | { |
| 309 | name: "ops.json", |
| 310 | type: "file", |
| 311 | size: 256, |
| 312 | modified: "Jan 20, 2026", |
| 313 | path: "/ops.json", |
| 314 | mimeType: "application/json", |
| 315 | content: `[ |
| 316 | { |
| 317 | "uuid": "069a79f4-44e9-4726-a5be-fca90e38aaf5", |
| 318 | "name": "Notch", |
| 319 | "level": 4, |
| 320 | "bypassesPlayerLimit": false |
| 321 | } |
| 322 | ]`, |
| 323 | }, |
| 324 | { |
| 325 | name: "eula.txt", |
| 326 | type: "file", |
| 327 | size: 512, |
| 328 | modified: "Jan 10, 2026", |
| 329 | path: "/eula.txt", |
| 330 | mimeType: "text/plain", |
| 331 | content: `#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://aka.ms/MinecraftEULA). |
| 332 | #Thu Jan 10 2026 |
| 333 | eula=true`, |
| 334 | }, |
| 335 | { |
| 336 | name: "banner.png", |
| 337 | type: "file", |
| 338 | size: 204800, |
| 339 | modified: "Jan 15, 2026", |
| 340 | path: "/banner.png", |
| 341 | mimeType: "image/png", |
| 342 | }, |
| 343 | ]; |
| 344 | |
| 345 | // ── Databases ────────────────────────────────────────────────────────────── |
| 346 | |
| 347 | export interface MockDatabase |
| 348 | id: string; |
| 349 | name: string; |
| 350 | username: string; |
| 351 | password: string; |
| 352 | host: string; |
| 353 | port: number; |
| 354 | } |
| 355 | |
| 356 | export const mockDatabases: |
| 357 | { |
| 358 | id: "db-001", |
| 359 | name: "s1_luckperms", |
| 360 | username: "u1_luckperms", |
| 361 | password: "Xk9#mPqR2vL7", |
| 362 | host: "db.eu-west-1a.struxa.host", |
| 363 | port: 3306, |
| 364 | }, |
| 365 | { |
| 366 | id: "db-002", |
| 367 | name: "s1_economy", |
| 368 | username: "u1_economy", |
| 369 | password: "Tz4!nWjY8cF1", |
| 370 | host: "db.eu-west-1a.struxa.host", |
| 371 | port: 3306, |
| 372 | }, |
| 373 | { |
| 374 | id: "db-003", |
| 375 | name: "s1_playerstats", |
| 376 | username: "u1_playerstats", |
| 377 | password: "Rq6@kHsD3bG5", |
| 378 | host: "db.eu-west-1a.struxa.host", |
| 379 | port: 3306, |
| 380 | }, |
| 381 | ]; |
| 382 | |
| 383 | // ── Schedules ────────────────────────────────────────────────────────────── |
| 384 | |
| 385 | export interface MockSchedule |
| 386 | id: string; |
| 387 | name: string; |
| 388 | cron: string; |
| 389 | enabled: boolean; |
| 390 | lastRun: string |
| 391 | nextRun: string; |
| 392 | action: string; |
| 393 | } |
| 394 | |
| 395 | export const mockSchedules: |
| 396 | { |
| 397 | id: "sch-001", |
| 398 | name: "Daily Restart", |
| 399 | cron: "0 6 * * *", |
| 400 | enabled: true, |
| 401 | lastRun: "May 15, 2026 06:00", |
| 402 | nextRun: "May 16, 2026 06:00", |
| 403 | action: "Restart server", |
| 404 | }, |
| 405 | { |
| 406 | id: "sch-002", |
| 407 | name: "Hourly Backup", |
| 408 | cron: "0 * * * *", |
| 409 | enabled: true, |
| 410 | lastRun: "May 16, 2026 04:00", |
| 411 | nextRun: "May 16, 2026 05:00", |
| 412 | action: "Create backup", |
| 413 | }, |
| 414 | { |
| 415 | id: "sch-003", |
| 416 | name: "Weekly Cleanup", |
| 417 | cron: "0 3 * * 0", |
| 418 | enabled: false, |
| 419 | lastRun: "May 11, 2026 03:00", |
| 420 | nextRun: "May 18, 2026 03:00", |
| 421 | action: "Run command: /cleanup", |
| 422 | }, |
| 423 | { |
| 424 | id: "sch-004", |
| 425 | name: "Save World", |
| 426 | cron: "*/15 * * * *", |
| 427 | enabled: true, |
| 428 | lastRun: "May 16, 2026 04:45", |
| 429 | nextRun: "May 16, 2026 05:00", |
| 430 | action: "Run command: /save-all", |
| 431 | }, |
| 432 | ]; |
| 433 | |
| 434 | // ── Subusers ─────────────────────────────────────────────────────────────── |
| 435 | |
| 436 | export type SubuserPermission |
| 437 | | "console" |
| 438 | | "files" |
| 439 | | "backups" |
| 440 | | "databases" |
| 441 | | "schedules" |
| 442 | | "users" |
| 443 | | "network" |
| 444 | | "startup" |
| 445 | | "settings" |
| 446 | |
| 447 | export interface MockSubuser |
| 448 | id: string; |
| 449 | email: string; |
| 450 | username: string; |
| 451 | twoFactor: boolean; |
| 452 | createdAt: string; |
| 453 | permissions: SubuserPermission |
| 454 | } |
| 455 | |
| 456 | export const mockSubusers: |
| 457 | { |
| 458 | id: "sub-001", |
| 459 | email: "jakubkrzyz.kontakt@gmail.com", |
| 460 | username: "jakub", |
| 461 | twoFactor: true, |
| 462 | createdAt: "Jan 10, 2026", |
| 463 | permissions: [ |
| 464 | "console", "files", |
| 465 | "schedules", "users", |
| 466 | ], |
| 467 | }, |
| 468 | { |
| 469 | id: "sub-002", |
| 470 | email: "alex@example.com", |
| 471 | username: "alexdev", |
| 472 | twoFactor: false, |
| 473 | createdAt: "Feb 3, 2026", |
| 474 | permissions: ["console", |
| 475 | }, |
| 476 | { |
| 477 | id: "sub-003", |
| 478 | email: "mod@wafflesmp.net", |
| 479 | username: "wafflemod", |
| 480 | twoFactor: true, |
| 481 | createdAt: "Mar 18, 2026", |
| 482 | permissions: ["console", |
| 483 | }, |
| 484 | ]; |
| 485 | |
| 486 | // ── Backups ──────────────────────────────────────────────────────────────── |
| 487 | |
| 488 | export type BackupStatus |
| 489 | |
| 490 | export interface MockBackup |
| 491 | id: string; |
| 492 | name: string; |
| 493 | sizeMb: number; |
| 494 | createdAt: string; |
| 495 | status: BackupStatus |
| 496 | } |
| 497 | |
| 498 | export const mockBackups: |
| 499 | { |
| 500 | id: "bak-001", |
| 501 | name: "backup-2026-05-16-04-00.tar.gz", |
| 502 | sizeMb: 267, |
| 503 | createdAt: "May 16, 2026 04:00", |
| 504 | status: "complete", |
| 505 | }, |
| 506 | { |
| 507 | id: "bak-002", |
| 508 | name: "backup-2026-05-15-04-00.tar.gz", |
| 509 | sizeMb: 264, |
| 510 | createdAt: "May 15, 2026 04:00", |
| 511 | status: "complete", |
| 512 | }, |
| 513 | { |
| 514 | id: "bak-003", |
| 515 | name: "backup-2026-05-14-04-00.tar.gz", |
| 516 | sizeMb: 261, |
| 517 | createdAt: "May 14, 2026 04:00", |
| 518 | status: "complete", |
| 519 | }, |
| 520 | { |
| 521 | id: "bak-004", |
| 522 | name: "backup-2026-05-13-04-00.tar.gz", |
| 523 | sizeMb: 0, |
| 524 | createdAt: "May 13, 2026 04:00", |
| 525 | status: "failed", |
| 526 | }, |
| 527 | { |
| 528 | id: "bak-005", |
| 529 | name: "backup-2026-05-12-04-00.tar.gz", |
| 530 | sizeMb: 258, |
| 531 | createdAt: "May 12, 2026 04:00", |
| 532 | status: "complete", |
| 533 | }, |
| 534 | ]; |
| 535 | |
| 536 | // ── Allocations ──────────────────────────────────────────────────────────── |
| 537 | |
| 538 | export interface MockAllocation |
| 539 | id: string; |
| 540 | ip: string; |
| 541 | port: number; |
| 542 | alias: string |
| 543 | primary: boolean; |
| 544 | } |
| 545 | |
| 546 | export const mockAllocations: |
| 547 | { id: "alloc-001", |
| 548 | { id: "alloc-002", |
| 549 | { id: "alloc-003", |
| 550 | ]; |
| 551 | |
| 552 | // ── Activity log (panel audit) ───────────────────────────────────────────── |
| 553 | |
| 554 | export interface MockActivity |
| 555 | id: string; |
| 556 | ts: string; |
| 557 | event: string; |
| 558 | actor: string; |
| 559 | ip: string; |
| 560 | } |
| 561 | |
| 562 | export const mockActivityLog: |
| 563 | { |
| 564 | id: "act-001", |
| 565 | ts: "May 16, 2026 04:02", |
| 566 | event: "server:backup.complete", |
| 567 | actor: "system", |
| 568 | ip: "-", |
| 569 | }, |
| 570 | { |
| 571 | id: "act-002", |
| 572 | ts: "May 16, 2026 04:00", |
| 573 | event: "server:backup.start", |
| 574 | actor: "system", |
| 575 | ip: "-", |
| 576 | }, |
| 577 | { |
| 578 | id: "act-003", |
| 579 | ts: "May 16, 2026 03:12", |
| 580 | event: "server:console.command", |
| 581 | actor: "jakubkrzyz.kontakt@gmail.com", |
| 582 | ip: "89.64.12.33", |
| 583 | }, |
| 584 | { |
| 585 | id: "act-004", |
| 586 | ts: "May 16, 2026 01:44", |
| 587 | event: "server:files.write", |
| 588 | actor: "alexdev", |
| 589 | ip: "212.77.100.5", |
| 590 | }, |
| 591 | { |
| 592 | id: "act-005", |
| 593 | ts: "May 15, 2026 22:30", |
| 594 | event: "server:files.write", |
| 595 | actor: "jakubkrzyz.kontakt@gmail.com", |
| 596 | ip: "89.64.12.33", |
| 597 | }, |
| 598 | { |
| 599 | id: "act-006", |
| 600 | ts: "May 15, 2026 18:01", |
| 601 | event: "server:power.stop", |
| 602 | actor: "jakubkrzyz.kontakt@gmail.com", |
| 603 | ip: "89.64.12.33", |
| 604 | }, |
| 605 | { |
| 606 | id: "act-007", |
| 607 | ts: "May 15, 2026 06:00", |
| 608 | event: "server:power.restart", |
| 609 | actor: "system", |
| 610 | ip: "-", |
| 611 | }, |
| 612 | { |
| 613 | id: "act-008", |
| 614 | ts: "May 15, 2026 04:01", |
| 615 | event: "server:backup.complete", |
| 616 | actor: "system", |
| 617 | ip: "-", |
| 618 | }, |
| 619 | { |
| 620 | id: "act-009", |
| 621 | ts: "May 14, 2026 20:17", |
| 622 | event: "server:power.start", |
| 623 | actor: "jakubkrzyz.kontakt@gmail.com", |
| 624 | ip: "89.64.12.33", |
| 625 | }, |
| 626 | { |
| 627 | id: "act-010", |
| 628 | ts: "May 14, 2026 20:15", |
| 629 | event: "user:login", |
| 630 | actor: "jakubkrzyz.kontakt@gmail.com", |
| 631 | ip: "89.64.12.33", |
| 632 | }, |
| 633 | ]; |
| 634 | |
| 635 | // ── Server startup variables ─────────────────────────────────────────────── |
| 636 | |
| 637 | export interface MockServerVariable |
| 638 | name: string; |
| 639 | envVar: string; |
| 640 | description: string; |
| 641 | value: string; |
| 642 | rules: string; |
| 643 | } |
| 644 | |
| 645 | export const mockServerVariables: |
| 646 | { |
| 647 | name: "Server Version", |
| 648 | envVar: "MINECRAFT_VERSION", |
| 649 | description: "The version of Minecraft to download and run.", |
| 650 | value: "1.21.11", |
| 651 | rules: "required|string|max:20", |
| 652 | }, |
| 653 | { |
| 654 | name: "Server Jar URL", |
| 655 | envVar: "SERVER_JARFILE", |
| 656 | description: "The name of the server jarfile to run.", |
| 657 | value: "server.jar", |
| 658 | rules: "required|string|ends_with:.jar", |
| 659 | }, |
| 660 | { |
| 661 | name: "Build Number", |
| 662 | envVar: "BUILD_NUMBER", |
| 663 | description: "The Paper build number. Use 'latest' for the newest build.", |
| 664 | value: "latest", |
| 665 | rules: "required|string|max:20", |
| 666 | }, |
| 667 | ]; |