新增简易的8080面板😊
This commit is contained in:
17
store/@{FutureOSS}/webui/frontend/views/dashboard.php
Normal file
17
store/@{FutureOSS}/webui/frontend/views/dashboard.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* 仪表盘页面视图
|
||||
*/
|
||||
|
||||
$pageTitle = 'FutureOSS - 仪表盘';
|
||||
$currentPage = 'dashboard';
|
||||
|
||||
// 内容区直接包含仪表盘内容
|
||||
if (isset($dashboardContent)) {
|
||||
$content = $dashboardContent;
|
||||
} else {
|
||||
$content = '<div class="empty-state"><p>仪表盘内容加载中...</p></div>';
|
||||
}
|
||||
|
||||
// 复用 layout
|
||||
include __DIR__ . '/layout.php';
|
||||
17
store/@{FutureOSS}/webui/frontend/views/index.php
Normal file
17
store/@{FutureOSS}/webui/frontend/views/index.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
/**
|
||||
* 首页视图
|
||||
* 这是 webui 插件的默认首页
|
||||
* 其他插件可以替换或扩展此页面
|
||||
*/
|
||||
|
||||
$pageTitle = $config['title'] ?? 'FutureOSS';
|
||||
$currentPage = 'home';
|
||||
|
||||
// 默认导航项(其他插件可以添加更多)
|
||||
$navItems = [];
|
||||
|
||||
// 内容区(其他插件可以注入内容)
|
||||
$content = '<div class="empty-state"><p>暂无内容</p></div>';
|
||||
|
||||
include __DIR__ . '/layout.php';
|
||||
64
store/@{FutureOSS}/webui/frontend/views/layout.php
Normal file
64
store/@{FutureOSS}/webui/frontend/views/layout.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?= htmlspecialchars($pageTitle ?? 'FutureOSS') ?></title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/remixicon/4.1.0/remixicon.min.css">
|
||||
<link rel="stylesheet" href="/static/css/main.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.13.3/dist/cdn.min.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app">
|
||||
<aside class="sidebar">
|
||||
<nav class="sidebar-nav">
|
||||
<?php if (!empty($navItems)): ?>
|
||||
<?php foreach ($navItems as $item): ?>
|
||||
<?php
|
||||
$url = $item['url'] ?? '#';
|
||||
$isActive = ($currentPage ?? '') === $url;
|
||||
$icon = $item['icon'] ?? 'ri-dashboard-line';
|
||||
// 如果图标是 emoji,转换为 remixicon 类名
|
||||
$iconMap = [
|
||||
'🏠' => 'ri-home-4-line',
|
||||
'📊' => 'ri-dashboard-line',
|
||||
'📋' => 'ri-file-list-3-line',
|
||||
'🧩' => 'ri-puzzle-line',
|
||||
'⚙️' => 'ri-settings-3-line',
|
||||
'🔌' => 'ri-plug-line',
|
||||
'📦' => 'ri-box-3-line',
|
||||
'🌐' => 'ri-global-line',
|
||||
];
|
||||
$riIcon = $iconMap[$icon] ?? $icon;
|
||||
?>
|
||||
<a href="<?= htmlspecialchars($url) ?>"
|
||||
class="nav-item <?= $isActive ? 'active' : '' ?>"
|
||||
title="<?= htmlspecialchars($item['text'] ?? '') ?>">
|
||||
<i class="<?= htmlspecialchars($riIcon) ?>"></i>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</nav>
|
||||
<div class="sidebar-footer">
|
||||
<button class="settings-btn" title="设置">
|
||||
<i class="ri-settings-3-line"></i>
|
||||
</button>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<main class="content">
|
||||
<div class="content-body">
|
||||
<?php if (isset($content)): ?>
|
||||
<?= $content ?>
|
||||
<?php else: ?>
|
||||
<div class="empty-state">
|
||||
<p>暂无内容</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script src="/static/js/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user