Files
hnh-map/webapp/templates/admin/index.tmpl
Nikolay Tatarinov 605a31567e Add initial project structure with backend and frontend setup
- Created backend structure with Go, including main application logic and API endpoints.
- Added Docker support for both development and production environments.
- Introduced frontend using Nuxt 3 with Tailwind CSS for styling.
- Included configuration files for Docker and environment variables.
- Established basic documentation for contributing, development, and deployment processes.
- Set up .gitignore and .dockerignore files to manage ignored files in the repository.
2026-02-24 22:27:05 +03:00

152 lines
7.0 KiB
Cheetah

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="/js/zepto.min.js"></script>
<script src="/js/intercooler-1.2.1.min.js"></script>
<style>
</style>
<title>{{.Page.Title}} - Admin</title>
</head>
<body>
<div class="container">
<table>
<thead>
<tr>
<th>User</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{{range .Users}}
<tr>
<td>{{.}}</td>
<td><a href="/admin/user?user={{.}}" class="waves-effect waves-light btn">Edit</a></td>
</tr>
{{end}}
</tbody>
</table>
<a href="/admin/user" class="waves-effect waves-light btn">Add user</a>
<br>
<table>
<thead>
<tr>
<th>Map</th>
<th colspan="2">Actions</th>
</tr>
</thead>
<tbody>
{{range .Maps}}
<tr>
<td>{{.Name}}</td>
<td><a ic-post-to="/admin/mapic?map={{.ID}}&action=toggle-hidden" class="waves-effect waves-light btn">{{block "admin/index.tmpl:toggle-hidden" .}}{{if .Hidden}}Show{{else}}Hide{{end}}{{end}}</a></td>
<td><a href="/admin/map?map={{.ID}}" class="waves-effect waves-light btn">Edit</a></td>
</tr>
{{end}}
</tbody>
</table>
<div class="card">
<div class="card-content">
<h5>Default maps to hidden</h5>
<p>This makes new map layers hidden by default</p>
<form action="/admin/setDefaultHide" method="POST">
<div class="row">
<label>
<input type="checkbox" name="defaultHide" value="true"{{if .DefaultHide}} checked="checked"{{end}}/>
<span>Default Hidden</span>
</label>
<div class="input-field col s6">
<button class="btn waves-effect waves-light" type="submit" name="action">Save</button>
</div>
</form>
</div>
</div>
<div class="card">
<div class="card-content">
<h5>Set prefix for tokens</h5>
<p>This is used for making the client tokens a "copy/paste" straight into client</p>
<form action="/admin/setPrefix" method="POST">
<div class="row">
<div class="input-field col s6">
<input id="prefix" type="text" class="validate" name="prefix" value="{{.Prefix}}">
<label for="prefix">Prefix</label>
</div>
<div class="input-field col s6">
<button class="btn waves-effect waves-light" type="submit" name="action">Save</button>
</div>
</form>
</div>
</div>
<div class="card">
<div class="card-content">
<h5>Set title for pages</h5>
<form action="/admin/setTitle" method="POST">
<div class="row">
<div class="input-field col s6">
<input id="title" type="text" class="validate" name="title" value="{{.Page.Title}}">
<label for="title">Title</label>
</div>
<div class="input-field col s6">
<button class="btn waves-effect waves-light" type="submit" name="action">Save</button>
</div>
</form>
</div>
</div>
<div class="card">
<div class="card-content">
<h5>Wipe all data</h5>
<a class="waves-effect waves-light red btn modal-trigger" href="#wipe">Wipe!</a>
<div id="wipe" class="modal">
<div class="modal-content">
<h4>Wipe</h4>
<p>This will remove all grids and markers, and reset the 0,0 grid</p>
<h5>THIS CANNOT BE UNDONE!</h5>
</div>
<div class="modal-footer">
<a href="#!" class="modal-close waves-effect waves-light green btn">Cancel</a>
<a href="/admin/wipe" class="waves-effect waves-light red btn">WIPE</a>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-content">
<h5>Rebuild zooms</h5>
<a href="/admin/rebuildZooms" class="waves-effect waves-light red btn">Rebuild Zooms</a>
</div>
</div>
<div class="card">
<div class="card-content">
<h5>Export</h5>
<p>Export grids and markers</p>
<a href="/admin/export" class="waves-effect waves-light blue btn">Download export</a>
</div>
</div>
<div class="card">
<div class="card-content">
<h5>Merge</h5>
<p>Note, merge is experimental at this time, use at your own risk!</p>
<form action="/admin/merge" method="post" enctype="multipart/form-data">
<div class="file-field input-field">
<div class="btn">
<span>File</span>
<input type="file" name="merge">
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text">
</div>
</div>
<button class="btn waves-effect waves-light" type="submit" name="action">Merge</button>
</form>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script>M.AutoInit();</script>
</body>
</html>