...
This commit is contained in:
1
pkg/servers/ui/views/components/.gitkeep
Normal file
1
pkg/servers/ui/views/components/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
# This file is intentionally left blank to ensure the directory is tracked by Git.
|
24
pkg/servers/ui/views/components/navbar.jet
Normal file
24
pkg/servers/ui/views/components/navbar.jet
Normal file
@@ -0,0 +1,24 @@
|
||||
{{ block navbar() }}
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">HeroApp UI</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<!-- Authentication status will determine which buttons to show -->
|
||||
<!-- For now, showing placeholder login/logout -->
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/login">Login</a> <!-- Placeholder Link -->
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/logout">Logout</a> <!-- Placeholder Link -->
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<!-- Add some padding to the body to account for the fixed-top navbar -->
|
||||
<div style="padding-top: 56px;"></div>
|
||||
{{ end }}
|
17
pkg/servers/ui/views/components/sidebar.jet
Normal file
17
pkg/servers/ui/views/components/sidebar.jet
Normal file
@@ -0,0 +1,17 @@
|
||||
{{ block sidebar() }}
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="/">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>
|
||||
Dashboard
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/processes">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-activity"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline></svg>
|
||||
Process Manager
|
||||
</a>
|
||||
</li>
|
||||
<!-- Add more menu items here as needed -->
|
||||
</ul>
|
||||
{{ end }}
|
1
pkg/servers/ui/views/layouts/.gitkeep
Normal file
1
pkg/servers/ui/views/layouts/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
# This file is intentionally left blank to ensure the directory is tracked by Git.
|
37
pkg/servers/ui/views/layouts/base.jet
Normal file
37
pkg/servers/ui/views/layouts/base.jet
Normal file
@@ -0,0 +1,37 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{{ block "title" . }}My App{{ end }}</title>
|
||||
<!-- Bootstrap CSS from CDN -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4Q6Gf2aSP4eDXB8Miphtr37CMZZQ5oXLH2yaXMJ2w8e2ZtHTl7GptT4jmndRuHDT" crossorigin="anonymous">
|
||||
<!-- Custom CSS -->
|
||||
<link rel="stylesheet" href="/static/css/custom.css">
|
||||
</head>
|
||||
<body>
|
||||
{{ import "pkg/servers/ui/views/components/navbar.jet" }}
|
||||
{{ yield navbar() }}
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
|
||||
<div class="position-sticky pt-3">
|
||||
{{ import "pkg/servers/ui/views/components/sidebar.jet" }}
|
||||
{{ yield sidebar() }}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
|
||||
{{ yield body() }}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap JS Bundle from CDN -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/js/bootstrap.bundle.min.js" integrity="sha384-j1CDi7MgGQ12Z7Qab0qlWQ/Qqz24Gc6BM0thvEMVjHnfYGF0rmFCozFSxQBxwHKO" crossorigin="anonymous"></script>
|
||||
<!-- Custom JS -->
|
||||
<script src="/static/js/custom.js"></script>
|
||||
{{ yield scripts() }}
|
||||
</body>
|
||||
</html>
|
1
pkg/servers/ui/views/pages/.gitkeep
Normal file
1
pkg/servers/ui/views/pages/.gitkeep
Normal file
@@ -0,0 +1 @@
|
||||
# This file is intentionally left blank to ensure the directory is tracked by Git.
|
22
pkg/servers/ui/views/pages/dashboard.jet
Normal file
22
pkg/servers/ui/views/pages/dashboard.jet
Normal file
@@ -0,0 +1,22 @@
|
||||
{{ extends "pkg/servers/ui/views/layouts/base.jet" }}
|
||||
|
||||
{{ block title() }}Dashboard - HeroApp UI{{ end }}
|
||||
|
||||
{{ block body() }}
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Dashboard</h1>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<p>Welcome to the HeroApp UI Dashboard!</p>
|
||||
<p>This is a placeholder page. More content will be added here.</p>
|
||||
<!-- Example of using a Bootstrap component -->
|
||||
<div class="alert alert-info" role="alert">
|
||||
System status: All systems nominal.
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ block scripts() }}
|
||||
<!-- Add any page-specific scripts here if needed -->
|
||||
{{ end }}
|
39
pkg/servers/ui/views/pages/login.jet
Normal file
39
pkg/servers/ui/views/pages/login.jet
Normal file
@@ -0,0 +1,39 @@
|
||||
{{ extends "pkg/servers/ui/views/layouts/base.jet" }}
|
||||
|
||||
{{ block title() }}Login - HeroApp UI{{ end }}
|
||||
|
||||
{{ block body() }}
|
||||
<div class="container mt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-6 col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="text-center">Login</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form action="/login" method="POST">
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-primary">Login</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<small>© 2025 HeroApp</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ block scripts() }}
|
||||
<!-- Add any page-specific scripts here if needed -->
|
||||
{{ end }}
|
54
pkg/servers/ui/views/pages/process_manager.jet
Normal file
54
pkg/servers/ui/views/pages/process_manager.jet
Normal file
@@ -0,0 +1,54 @@
|
||||
{{ extends "pkg/servers/ui/views/layouts/base.jet" }}
|
||||
|
||||
{{ block title() }}Process Manager - HeroApp UI{{ end }}
|
||||
|
||||
{{ block body() }}
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Process Manager</h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<button type="button" class="btn btn-sm btn-outline-secondary" onclick="location.reload()">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-refresh-cw"><polyline points="23 4 23 10 17 10"></polyline><polyline points="1 20 1 14 7 14"></polyline><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path></svg>
|
||||
Refresh
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-sm table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">PID</th>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">CPU (%)</th>
|
||||
<th scope="col">Memory (MB)</th>
|
||||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ if len(Processes) > 0 }}
|
||||
{{ range process := Processes }}
|
||||
<tr>
|
||||
<td>{{ process.PID }}</td>
|
||||
<td>{{ process.Name }}</td>
|
||||
<td>{{ printf "%.2f" process.CPU }}</td>
|
||||
<td>{{ printf "%.2f" process.Memory }}</td>
|
||||
<td>
|
||||
<form action="/processes/kill/{{ process.PID }}" method="POST" style="display:inline;">
|
||||
<button type="submit" class="btn btn-danger btn-sm" onclick="return confirm('Are you sure you want to kill process {{ process.PID }}?');">Kill</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<tr>
|
||||
<td colspan="5" class="text-center">No processes found or unable to retrieve process list.</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ block scripts() }}
|
||||
<!-- Add any page-specific scripts here if needed -->
|
||||
{{ end }}
|
Reference in New Issue
Block a user