Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4440054fce | |||
| 367b18fedc | |||
| 69c6d39a7b | |||
| 1ae9e64ea3 |
@@ -40,6 +40,10 @@ jobs:
|
||||
with:
|
||||
path: ./dist
|
||||
|
||||
- name: Flatten all artifacts into ./dist
|
||||
run: |
|
||||
find ./dist -type f -name 'app-*' -exec mv {} ./dist/ \;
|
||||
|
||||
- name: Create Release & Attach Files
|
||||
uses: rosven9856/gitea_creating_release_action@master
|
||||
with:
|
||||
|
||||
@@ -6,3 +6,7 @@ A self-contained Go application that:
|
||||
- Tracks uploads/downloads with timestamps
|
||||
- Displays an admin dashboard with a Bootstrap UI and Chart.js graphs
|
||||
- Serves all frontend files locally (no CDN)
|
||||
|
||||

|
||||

|
||||

|
||||
@@ -2,45 +2,85 @@
|
||||
<html lang="en" data-bs-theme="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Dashboard</title>
|
||||
<title>Admin Dashboard</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link href="/static/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body class="bg-dark text-light">
|
||||
<div class="container py-4">
|
||||
<h1>🧠 Admin Dashboard</h1>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item"><a class="nav-link active" data-bs-toggle="tab" href="#uploads">Uploads</a></li>
|
||||
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#downloads">Downloads</a></li>
|
||||
<li class="nav-item"><a class="nav-link" data-bs-toggle="tab" href="#chart">Chart</a></li>
|
||||
<body class="bg-dark text-light d-flex flex-column min-vh-100">
|
||||
<div class="container py-5 flex-grow-1">
|
||||
<h1 class="mb-4 text-center">🧠 Admin Dashboard</h1>
|
||||
<ul class="nav nav-tabs mb-4" id="dashboardTabs" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="uploads-tab" data-bs-toggle="tab" data-bs-target="#uploads" type="button" role="tab">Uploads</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="downloads-tab" data-bs-toggle="tab" data-bs-target="#downloads" type="button" role="tab">Downloads</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" id="chart-tab" data-bs-toggle="tab" data-bs-target="#chart" type="button" role="tab">Chart</button>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content mt-3">
|
||||
<div class="tab-pane fade show active" id="uploads">
|
||||
<table class="table table-dark table-bordered">
|
||||
<thead><tr><th>IP</th><th>File</th><th>Time</th></tr></thead>
|
||||
<div class="tab-content bg-dark p-3 rounded shadow">
|
||||
<div class="tab-pane fade show active" id="uploads" role="tabpanel">
|
||||
<h4 class="mb-3">Uploads</h4>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-dark table-hover mb-0 align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>IP</th>
|
||||
<th>File</th>
|
||||
<th>Time</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Events}} {{if eq .Action "upload"}}
|
||||
<tr><td>{{.IP}}</td><td>{{.File}}</td><td>{{.Timestamp.Format "2006-01-02 15:04:05"}}</td></tr>
|
||||
<tr>
|
||||
<td>{{.IP}}</td>
|
||||
<td>{{.File}}</td>
|
||||
<td>{{.Timestamp.Format "2006-01-02 15:04:05"}}</td>
|
||||
</tr>
|
||||
{{end}} {{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="downloads">
|
||||
<table class="table table-dark table-bordered">
|
||||
<thead><tr><th>IP</th><th>File</th><th>Time</th></tr></thead>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="downloads" role="tabpanel">
|
||||
<h4 class="mb-3">Downloads</h4>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-dark table-hover mb-0 align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>IP</th>
|
||||
<th>File</th>
|
||||
<th>Time</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .Events}} {{if eq .Action "download"}}
|
||||
<tr><td>{{.IP}}</td><td>{{.File}}</td><td>{{.Timestamp.Format "2006-01-02 15:04:05"}}</td></tr>
|
||||
<tr>
|
||||
<td>{{.IP}}</td>
|
||||
<td>{{.File}}</td>
|
||||
<td>{{.Timestamp.Format "2006-01-02 15:04:05"}}</td>
|
||||
</tr>
|
||||
{{end}} {{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="chart">
|
||||
</div>
|
||||
<div class="tab-pane fade" id="chart" role="tabpanel">
|
||||
<h4 class="mb-3">Downloads Chart</h4>
|
||||
<div class="bg-light p-3 rounded text-dark">
|
||||
<canvas id="downloadChart" height="120"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-center mt-5">
|
||||
<a href="/" class="btn btn-outline-info">Go Back</a>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="text-center py-3 bg-black text-muted border-top border-secondary mt-auto">
|
||||
Powered by <strong>Golang</strong>
|
||||
</footer>
|
||||
<script src="/static/bootstrap.bundle.min.js"></script>
|
||||
<script src="/static/chart.min.js"></script>
|
||||
<script>
|
||||
@@ -56,8 +96,8 @@
|
||||
},
|
||||
options: {
|
||||
scales: {
|
||||
x: { ticks: { color: "white" } },
|
||||
y: { ticks: { color: "white" }, beginAtZero: true }
|
||||
x: { ticks: { color: "#000" } },
|
||||
y: { ticks: { color: "#000" }, beginAtZero: true }
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
BIN
screenshots/go-fileserver-dashboard-chart.png
Normal file
BIN
screenshots/go-fileserver-dashboard-chart.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
BIN
screenshots/go-fileserver-dashboard-upload.png
Normal file
BIN
screenshots/go-fileserver-dashboard-upload.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
screenshots/go-fileserver-dashboard.png
Normal file
BIN
screenshots/go-fileserver-dashboard.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
BIN
screenshots/go-fileserver-index.png
Normal file
BIN
screenshots/go-fileserver-index.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
Reference in New Issue
Block a user