Enhance API error handling, add lastError tracking, and implement admin home template
This commit is contained in:
1 parent
ce0777bb33
commit
205f2e2f73
9 files changed
+257
-33
No files matched your search
@@ -0,0 +1,150 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
|
||||
<script type="importmap">
|
||||
{
|
||||
"imports": {
|
||||
"@material/web/": "https://esm.run/@material/web/"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script type="module">
|
||||
import '@material/web/all.js';
|
||||
import { styles as typescaleStyles } from '@material/web/typography/md-typescale-styles.js';
|
||||
|
||||
document.adoptedStyleSheets.push(typescaleStyles.styleSheet);
|
||||
</script>
|
||||
<style>
|
||||
:root {
|
||||
--md-sys-color-primary: rgb(58, 58, 255);
|
||||
--active-menu-point-color: rgb(116, 148, 250);
|
||||
--md-sys-color-surface-container: rgb(223, 228, 255);
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.layout {
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
flex: 0 0 280px;
|
||||
width: 280px;
|
||||
overflow: hidden;
|
||||
background: var(--md-sys-color-surface-container);
|
||||
border-right: 1px solid var(--md-sys-color-outline-variant);
|
||||
transition: flex-basis .2s ease, width .2s ease;
|
||||
padding: 10px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.sidebar-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 12px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.sidebar md-list {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
md-list-item.active {
|
||||
background-color: var(--active-menu-point-color);
|
||||
border-radius: 28px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
md-list-item {
|
||||
border-radius: 28px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.sidebar.collapsed {
|
||||
flex-basis: 58px;
|
||||
width: 58x;
|
||||
}
|
||||
|
||||
.sidebar.collapsed .title,
|
||||
.sidebar.collapsed .label {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 24px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
body {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="layout">
|
||||
<aside class="sidebar" id="sidebar">
|
||||
<div class="sidebar-header">
|
||||
<md-icon-button id="toggle" aria-label="Menü ein-/ausklappen">
|
||||
<md-icon>menu</md-icon>
|
||||
</md-icon-button>
|
||||
<span class="title">Dashboard</span>
|
||||
</div>
|
||||
|
||||
<md-list>
|
||||
<md-list-item type="link" href="/admin/" class="active">
|
||||
<md-icon slot="start">dashboard</md-icon>
|
||||
<span class="label">Overview</span>
|
||||
</md-list-item>
|
||||
<md-list-item type="link" href="/admin/settings.php">
|
||||
<md-icon slot="start">settings</md-icon>
|
||||
<span class="label">Settings</span>
|
||||
</md-list-item>
|
||||
</md-list>
|
||||
</aside>
|
||||
|
||||
<main class="content">
|
||||
<h1>Dashboard</h1>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script type="module">
|
||||
const sidebar = document.getElementById('sidebar');
|
||||
const items = sidebar.querySelectorAll('md-list-item');
|
||||
|
||||
const mq = window.matchMedia('(max-width: 720px)');
|
||||
|
||||
const applyBreakpoint = () => {
|
||||
sidebar.classList.toggle('collapsed', mq.matches);
|
||||
};
|
||||
|
||||
applyBreakpoint();
|
||||
mq.addEventListener('change', applyBreakpoint);
|
||||
|
||||
document.getElementById('toggle').addEventListener('click', () => {
|
||||
sidebar.classList.toggle('collapsed');
|
||||
});
|
||||
|
||||
items.forEach(item => {
|
||||
item.addEventListener('click', () => {
|
||||
items.forEach(i => i.classList.remove('active'));
|
||||
item.classList.add('active');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -7,22 +7,32 @@
|
||||
"error.css"
|
||||
]
|
||||
},
|
||||
|
||||
"setup":{
|
||||
"name":"setup",
|
||||
"dir_name":"setup",
|
||||
"html_file":"setup.html",
|
||||
"css_files":[]
|
||||
},
|
||||
|
||||
"entrys_frontend":{
|
||||
"name":"entrys_frontend",
|
||||
"dir_name":"entrys_frontend",
|
||||
"html_file":"entrys_frontend.html",
|
||||
"css_files":[]
|
||||
},
|
||||
|
||||
"login":{
|
||||
"name":"login",
|
||||
"dir_name":"login",
|
||||
"html_file":"login.html",
|
||||
"css_files":[]
|
||||
},
|
||||
|
||||
"admin_home":{
|
||||
"name":"admin_home",
|
||||
"dir_name":"admin_home",
|
||||
"html_file":"home.html",
|
||||
"css_files":[]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user