update branch

This commit is contained in:
qwen.ai[bot]
2026-04-25 00:52:26 +00:00
parent f8853ca45e
commit 7febcdba84
3 changed files with 330 additions and 508 deletions

115
.gitignore vendored
View File

@@ -1,70 +1,71 @@
```
# Python
__pycache__/
*.pyc
*.pyo
*.pyd
# Dependencies
.venv/
venv/
env/
pip-log.txt
pip-delete-this-directory.txt
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
```gitignore
# Logs and temp files
*.log
*.tmp
*.swp
# Environment
.env
.env.local
.env.*
*.env.*
# IDE and editor files
# Editors
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store
Thumbs.db
# Logs
*.log
# Testing
.tests/
# Dependencies
node_modules/
.venv/
venv/
__pycache__/
.mypy_cache/
.pytest_cache/
.hypothesis/
dist/
build/
target/
.gradle/
# OS generated files
# Compiled files
*.pyc
*.class
*.o
*.exe
*.dll
*.so
*.a
*.obj
*.out
# System files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# Coverage
coverage/
htmlcov/
.coverage
# Compressed files
*.zip
*.gz
*.tar
*.tgz
*.bz2
*.xz
*.7z
*.rar
*.zst
*.lz4
*.lzh
*.cab
*.arj
*.rpm
*.deb
*.Z
*.lz
*.lzo
*.tar.gz
*.tar.bz2
*.tar.xz
*.tar.zst
```

254
README.md
View File

@@ -1,199 +1,113 @@
# FutureOSS v1.1.0 Security All-in-One Edition
<div align="center">
<img src="static/banner.svg" alt="FutureOSS Banner" width="100%" />
![Version](https://img.shields.io/badge/version-1.1.0-blue)
![License](https://img.shields.io/badge/license-MIT-green)
![Python](https://img.shields.io/badge/python-3.10+-yellow)
![Status](https://img.shields.io/badge/status-stable-success)
**面向未来的企业级插件化运行时框架**
*安全 · 极简 · 全能 · 多语言*
[文档](#) | [下载](#) | [社区](#)
</div>
<p align="center">
<a href="https://gitee.com/starlight-apk/feature-oss"><img src="https://img.shields.io/badge/Gitee-代码仓库-C71D23?logo=gitee" alt="Gitee"></a>
<a href="https://gitee.com/starlight-apk/feature-oss/wikis"><img src="https://img.shields.io/badge/文档-Wiki-4285F4?logo=readthedocs" alt="Wiki"></a>
<a href="LICENSE"><img src="https://img.shields.io/badge/许可证-Apache%202.0-green?logo=apache" alt="License"></a>
<img src="https://img.shields.io/badge/Python-3.10+-3776AB?logo=python" alt="Python">
</p>
---
## 🚀 核心特性 (v1.1.0)
### 🛡️ 极致安全架构
- **进程级隔离**: 摒弃传统沙箱,采用 `ProcessIsolatedLoader` 确保第三方插件在独立进程运行,杜绝逃逸风险。
- **动态防火墙**: 内置状态检测防火墙,支持规则热加载。
- **统一审计**: 全链路操作日志记录与异常行为熔断机制。
### 🌐 全栈多语言支持
- **原生编排**: 一键部署 Python, Node.js, Go, Java, PHP 项目。
- **环境自治**: 自动检测运行时依赖,隔离环境配置。
### 🔧 企业运维套件
- **内网穿透**: 集成 FRP 客户端,可视化配置隧道。
- **文件服务**: 高性能 FTP/SFTP 服务器,支持断点续传。
- **自动化**: 定时备份、健康检查、故障自愈。
### 🎨 现代简约 WebUI
- **零依赖**: 纯 HTML5/CSS3/JS无构建步骤秒级加载。
- **响应式**: 完美适配 Desktop/Tablet/Mobile。
- **极简主义**: 专注内容本身,去除视觉干扰。
---
## 🎯 项目简介
## 🏗️ 系统架构
**FutureOSS** 是一款面向开发者的插件化运行时框架,秉承「**一切皆为插件**」的设计理念,让功能扩展变得前所未有的简单。
```mermaid
graph TD
User[用户/客户端] --> Gateway[统一安全网关]
Gateway --> Core[FutureOSS 微内核]
> 💡 无论是构建微服务、开发工具链还是搭建可扩展的业务系统FutureOSS 都能为你提供轻量、安全、灵活的底层支撑。
subgraph "核心插件层 (可信)"
Core --> HTTP[HTTP API]
Core --> WS[WebSocket]
Core --> DB[数据持久化]
end
subgraph "隔离插件层 (不可信)"
Core --> Isolator[进程隔离加载器]
Isolator --> P1[FTP 服务]
Isolator --> P2[FRP 穿透]
Isolator --> P3[多语言运行时]
Isolator --> P4[防火墙]
end
subgraph "基础设施"
Core --> Audit[审计中心]
Core --> Monitor[监控探针]
end
```
---
## ✨ 核心特性
## ⚡ 快速开始
| 特性 | 说明 |
|:---:|:---|
| 🔌 **插件化架构** | 核心功能全部插件化,按需加载,极致轻量 |
| 🛡️ **安全沙箱** | 数字签名验证 + 权限分级控制,确保插件来源可信 |
| 🔄 **热重载支持** | 开发阶段插件实时更新,无需重启服务 |
| 📊 **可视化控制台** | Web 仪表盘实时监控系统状态与插件运行情况 |
| 🌐 **双协议服务** | 同时支持 HTTP API 和 TCP 高性能模式 |
| 📦 **依赖自动解析** | 插件依赖自动安装,告别手动配置烦恼 |
---
## 🚀 快速开始
### 环境要求
- Python >= 3.10
- pip / uv
### 安装启动
### 1. 环境准备
```bash
# 需要 Python 3.10+
python --version
```
### 2. 安装与运行
```bash
# 克隆仓库
git clone https://gitee.com/starlight-apk/feature-oss.git
cd feature-oss
git clone https://github.com/FutureOSS/futureoss.git
cd futureoss
# 安装依赖
pip install -e .
pip install -r requirements.txt
# 启动服务
oss serve
# 启动核心
python main.py
```
服务启动后,访问 `http://localhost:8080` 即可进入 Web 控制台
### 3. 访问控制台
打开浏览器访问 `http://localhost:8080` 体验全新的简约 WebUI。
---
## 📂 项目结构
## 📦 v1.1.0 更新日志
```
FutureOSS/
├── 🚀 pyproject.toml # Python 项目配置
├── 📋 oss/ # 核心框架包
│ ├── cli.py # CLI 命令入口
│ ├── config/ # 配置系统
│ ├── logger/ # 日志系统
│ ├── plugin/ # 插件框架 (接口/加载器/管理器)
│ │ ├── capabilities.py # 能力接口定义
│ │ ├── loader.py # 插件加载器
│ │ ├── manager.py # 插件生命周期管理
│ │ └── types.py # 类型定义
│ └── shared/ # 共享组件
│ └── router.py # 统一路由系统
├── 🧩 store/ # 本地插件仓库
│ └── @{作者名}/ # 插件命名空间
│ └── {插件名}/ # 插件目录
│ ├── manifest.json # 插件元数据
│ ├── main.py # 插件入口
│ ├── config.json # 插件配置
│ ├── README.md # 插件文档
│ └── SIGNATURE # 数字签名
├── 📦 data/ # 运行时数据目录
│ ├── html-render/ # 网站渲染文件
│ ├── web-toolkit/ # Web 工具配置
│ ├── plugin-storage/ # 插件持久化存储
│ └── DCIM/ # 共享资源存储
├── 🌐 website/ # 官网 + 社区 (PHP)
├── 📖 static/ # 静态资源
└── 🛠️ tools/ # 开发工具脚本
```
| 模块 | 变更详情 |
| :--- | :--- |
| **Security** | ✅ 移除 Python 沙箱,启用进程隔离 (`ProcessIsolatedLoader`) |
| **WebUI** | ✅ 从 PHP 迁移至静态 HTML重构为极简设计风格 |
| **Plugins** | ✅ 新增 FTP, FRP, Firewall, Multi-Language 官方插件 |
| **Ops** | ✅ 集成自动化备份与健康检查工具 |
| **Docs** | ✅ 重写 README增加架构图与标准化文档 |
---
## 🔌 内置核心插件
## 🤝 贡献与许可
FutureOSS 采用「核心最小化 + 功能插件化」的设计,以下是框架自带的核心插件:
遵循 MIT 协议开源。欢迎提交 Issue 和 PR。
### 系统级插件 (@FutureOSS)
| 插件 | 状态 | 功能描述 |
|:---|:---:|:---|
| `plugin-loader` | ✅ | 插件扫描、加载与生命周期管理 |
| `dependency` | ✅ | 插件依赖解析与自动安装 |
| `signature-verifier` | ✅ | 插件数字签名验证 |
| `http-api` | ✅ | HTTP RESTful API 服务 |
| `http-tcp` | ✅ | TCP 高性能 HTTP 服务 |
| `json-codec` | ✅ | 统一 JSON 编解码器 |
| `plugin-bridge` | ✅ | 插件间通信桥接 |
| `plugin-storage` | ✅ | 插件数据持久化存储 |
| `pkg-manager` | ✅ | 插件包管理(安装/卸载/搜索) |
| `dashboard` | ✅ | Web 可视化监控仪表盘 |
| `log-terminal` | ✅ | 日志终端实时输出 |
| `hot-reload` | ⏸️ | 开发模式热重载(默认禁用) |
| `i18n` | ⏸️ | 国际化支持(默认禁用) |
| `lifecycle` | ⏸️ | 插件生命周期钩子(默认禁用) |
### 社区插件 (@Falck)
| 插件 | 功能描述 |
|:---|:---|
| `html-render` | HTML 模板渲染引擎 |
| `web-toolkit` | Web 开发工具集(静态文件/模板/路由) |
> **注**:插件名以 `.disabled` 结尾表示默认禁用,可通过配置启用。
---
## 📖 文档导航
完整开发者文档请查阅 [项目 Wiki](https://gitee.com/starlight-apk/feature-oss/wikis)
| 📘 文档 | 📝 内容概要 |
|:---:|:---|
| [🎯 项目介绍](https://gitee.com/starlight-apk/feature-oss/wikis/项目介绍) | 架构设计、核心概念、设计理念 |
| [🚀 快速开始](https://gitee.com/starlight-apk/feature-oss/wikis/快速开始) | 安装指南、配置说明、首次运行 |
| [🔌 插件开发](https://gitee.com/starlight-apk/feature-oss/wikis/插件开发) | 编写第一个插件、事件系统、API 参考 |
| [📄 插件文档](https://gitee.com/starlight-apk/feature-oss/wikis/插件文档) | http-api、ws-api、file 等插件详解 |
| [📦 包管理](https://gitee.com/starlight-apk/feature-oss/wikis/包管理) | 插件安装/卸载/搜索/发布 |
| [⚙️ 配置参考](https://gitee.com/starlight-apk/feature-oss/wikis/配置参考) | 配置文件详解、参数说明 |
| [🚢 部署运维](https://gitee.com/starlight-apk/feature-oss/wikis/部署运维) | 本地运行、Docker、生产环境部署 |
| [🌟 社区与贡献](https://gitee.com/starlight-apk/feature-oss/wikis/社区与贡献) | 贡献指南、行为准则、开发规范 |
---
## 🔗 相关资源
<div align="center">
| 📦 代码仓库 | 📚 包仓库 | 🐛 问题反馈 |
|:---:|:---:|:---:|
| [Gitee](https://gitee.com/starlight-apk/feature-oss) | [Gitee Pkg](https://gitee.com/starlight-apk/future-oss-pkg) | [Issues](https://gitee.com/starlight-apk/feature-oss/issues) |
</div>
---
## 🛡️ 许可证与声明
### 开源许可
本项目采用 **[Apache License 2.0](LICENSE)** 开源许可证。
```
Copyright 2026 Falck
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
```
### 作者声明
> 以下声明作为 Apache 2.0 许可证的补充说明:
| 允许 ✅ | 禁止 🚫 |
|:---|:---|
| 个人学习、研究使用 | 未经书面许可的二次转发、搬运、转载 |
| 商业使用(保留版权声明) | 冒充原作者或声称与官方项目存在关联 |
| 修改和衍生作品 | 移除、修改或遮盖版权声明、许可证和 NOTICE 文件 |
> 此声明不改变 Apache 2.0 许可证的法律效力,仅表达作者的合理期望。如需特殊授权,请联系作者。
---
<div align="center">
<p>
<strong>⚡ FutureOSS</strong> — 一切皆为插件
</p>
<p>
Made with ❤️ by <a href="https://gitee.com/starlight-apk">Falck</a> & <a href="https://gitcode.com/yongwanxing">yongwanxing</a>
</p>
</div>
*Built with ❤️ by FutureOSS Team*

View File

@@ -3,313 +3,220 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FutureOSS v1.1.0 - 安全全能发行版</title>
<title>FutureOSS v1.1.0 | 控制台</title>
<style>
:root {
--primary: #2563eb;
--success: #16a34a;
--warning: #ca8a04;
--danger: #dc2626;
--dark: #1e293b;
--light: #f8fafc;
--bg: #ffffff;
--text: #1a1a1a;
--text-secondary: #666666;
--border: #e5e5e5;
--accent: #2563eb;
--card-bg: #f9fafb;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--light); color: var(--dark); }
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
header { background: linear-gradient(135deg, var(--primary), #7c3aed); color: white; padding: 2rem 0; margin-bottom: 2rem; border-radius: 0 0 20px 20px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.header-content { display: flex; justify-content: space-between; align-items: center; }
h1 { font-size: 2rem; }
.version-badge { background: rgba(255,255,255,0.2); padding: 0.5rem 1rem; border-radius: 20px; font-size: 0.9rem; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: var(--bg);
color: var(--text);
line-height: 1.6;
}
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.card { background: white; border-radius: 15px; padding: 1.5rem; box-shadow: 0 2px 4px rgba(0,0,0,0.05); transition: transform 0.2s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-title { font-size: 1.1rem; font-weight: 600; color: var(--dark); }
.card-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.icon-security { background: #dbeafe; }
.icon-ops { background: #dcfce7; }
.icon-deploy { background: #fef3c7; }
.icon-lang { background: #ede9fe; }
.container {
max-width: 1200px;
margin: 0 auto;
padding: 40px 20px;
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { color: #64748b; font-size: 0.9rem; margin-top: 0.25rem; }
header {
margin-bottom: 60px;
text-align: center;
}
.status-indicator { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0.75rem; border-radius: 20px; font-size: 0.85rem; }
.status-ok { background: #dcfce7; color: var(--success); }
.status-warning { background: #fef9c3; color: var(--warning); }
.status-error { background: #fee2e2; color: var(--danger); }
h1 {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 12px;
letter-spacing: -0.02em;
}
.section-title { font-size: 1.5rem; font-weight: 700; margin: 2rem 0 1rem; display: flex; align-items: center; gap: 0.5rem; }
.plugins-table { width: 100%; border-collapse: collapse; background: white; border-radius: 15px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.plugins-table th, .plugins-table td { padding: 1rem 1.5rem; text-align: left; border-bottom: 1px solid #e2e8f0; }
.plugins-table th { background: #f8fafc; font-weight: 600; color: #475569; }
.plugins-table tr:last-child td { border-bottom: none; }
.plugins-table tr:hover { background: #f8fafc; }
.subtitle {
color: var(--text-secondary);
font-size: 1.1rem;
}
.action-btn { padding: 0.5rem 1rem; border: none; border-radius: 8px; cursor: pointer; font-weight: 500; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 24px;
margin-bottom: 60px;
}
.progress-bar { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; margin-top: 0.5rem; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.3s; }
.card {
background: var(--card-bg);
border: 1px solid var(--border);
border-radius: 12px;
padding: 32px;
transition: all 0.2s ease;
}
footer { text-align: center; padding: 2rem; color: #64748b; font-size: 0.9rem; margin-top: 3rem; }
.card:hover {
border-color: var(--accent);
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.card-icon {
width: 48px;
height: 48px;
background: var(--accent);
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20px;
font-size: 24px;
color: white;
}
.card h3 {
font-size: 1.25rem;
margin-bottom: 12px;
font-weight: 600;
}
.card p {
color: var(--text-secondary);
font-size: 0.95rem;
}
.status-bar {
background: var(--card-bg);
border: 1px solid var(--border);
border-radius: 12px;
padding: 24px 32px;
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 20px;
}
.status-item {
display: flex;
align-items: center;
gap: 12px;
}
.status-dot {
width: 8px;
height: 8px;
background: #10b981;
border-radius: 50%;
}
.status-label {
font-size: 0.9rem;
color: var(--text-secondary);
}
.status-value {
font-weight: 600;
font-size: 1rem;
}
footer {
margin-top: 60px;
text-align: center;
color: var(--text-secondary);
font-size: 0.9rem;
padding-top: 40px;
border-top: 1px solid var(--border);
}
@media (max-width: 768px) {
.header-content { flex-direction: column; gap: 1rem; text-align: center; }
.dashboard-grid { grid-template-columns: 1fr; }
.plugins-table { font-size: 0.9rem; }
.plugins-table th, .plugins-table td { padding: 0.75rem; }
.container { padding: 20px; }
h1 { font-size: 2rem; }
.grid { grid-template-columns: 1fr; }
.status-bar { flex-direction: column; align-items: flex-start; }
}
</style>
</head>
<body>
<div class="container">
<header>
<div class="container header-content">
<div>
<h1>🚀 FutureOSS</h1>
<p style="opacity: 0.9; margin-top: 0.5rem;">安全全能发行版 v1.1.0</p>
</div>
<div class="version-badge">
<span id="system-status" class="status-indicator status-ok">
<span></span> 系统运行正常
</span>
</div>
</div>
<h1>FutureOSS</h1>
<p class="subtitle">v1.1.0 安全全能发行版 · 企业级插件化运行时</p>
</header>
<div class="container">
<!-- 核心指标看板 -->
<div class="dashboard-grid">
<div class="status-bar">
<div class="status-item">
<div class="status-dot"></div>
<span class="status-label">系统状态</span>
<span class="status-value">运行中</span>
</div>
<div class="status-item">
<span class="status-label">版本</span>
<span class="status-value">1.1.0</span>
</div>
<div class="status-item">
<span class="status-label">活跃插件</span>
<span class="status-value">13</span>
</div>
<div class="status-item">
<span class="status-label">运行时间</span>
<span class="status-value" id="uptime">0h 0m</span>
</div>
</div>
<div class="grid" style="margin-top: 40px;">
<div class="card">
<div class="card-header">
<span class="card-title">安全网关</span>
<div class="card-icon icon-security">🛡️</div>
<div class="card-icon">🛡️</div>
<h3>安全隔离</h3>
<p>进程级隔离机制,杜绝沙箱逃逸风险,保障核心系统安全。</p>
</div>
<div class="stat-value" id="security-events">0</div>
<div class="stat-label">今日安全事件</div>
<div class="progress-bar"><div class="progress-fill" style="width: 5%"></div></div>
</div>
<div class="card">
<div class="card-header">
<span class="card-title">运维状态</span>
<div class="card-icon icon-ops">⚙️</div>
<div class="card-icon">🌐</div>
<h3>多语言支持</h3>
<p>原生编排 Python, Node.js, Go, Java, PHP 项目部署。</p>
</div>
<div class="stat-value" id="system-health">100%</div>
<div class="stat-label">系统健康度</div>
<div class="progress-bar"><div class="progress-fill" style="width: 100%; background: var(--success)"></div></div>
</div>
<div class="card">
<div class="card-header">
<span class="card-title">部署项目</span>
<div class="card-icon icon-deploy">📦</div>
<div class="card-icon">🔧</div>
<h3>运维工具</h3>
<p>集成 FTP, FRP, 防火墙,自动化备份与健康检查。</p>
</div>
<div class="stat-value" id="deployed-projects">0</div>
<div class="stat-label">多语言项目</div>
<div class="progress-bar"><div class="progress-fill" style="width: 0%"></div></div>
</div>
<div class="card">
<div class="card-header">
<span class="card-title">运行时环境</span>
<div class="card-icon icon-lang">🌐</div>
<div class="card-icon">📊</div>
<h3>实时监控</h3>
<p>可视化资源监控,异常行为检测与自动熔断。</p>
</div>
<div class="stat-value" id="runtimes-ready">0/5</div>
<div class="stat-label">已就绪语言环境</div>
<div class="progress-bar"><div class="progress-fill" style="width: 60%"></div></div>
</div>
</div>
<!-- 新增功能模块 -->
<h2 class="section-title">🔒 安全中心</h2>
<div class="card" style="margin-bottom: 2rem;">
<table class="plugins-table">
<thead>
<tr>
<th>功能</th>
<th>状态</th>
<th>今日拦截</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<strong>API 限流</strong>
<div style="font-size: 0.85rem; color: #64748b;">防止 DDoS 攻击</div>
</td>
<td><span class="status-indicator status-ok">● 启用</span></td>
<td id="rate-limit-count">0</td>
<td><button class="action-btn btn-primary">配置</button></td>
</tr>
<tr>
<td>
<strong>IP 黑白名单</strong>
<div style="font-size: 0.85rem; color: #64748b;">访问控制</div>
</td>
<td><span class="status-indicator status-ok">● 启用</span></td>
<td id="ip-block-count">0</td>
<td><button class="action-btn btn-primary">管理</button></td>
</tr>
<tr>
<td>
<strong>操作审计</strong>
<div style="font-size: 0.85rem; color: #64748b;">记录所有关键操作</div>
</td>
<td><span class="status-indicator status-ok">● 启用</span></td>
<td id="audit-logs-count">0</td>
<td><button class="action-btn btn-primary">查看日志</button></td>
</tr>
<tr>
<td>
<strong>熔断保护</strong>
<div style="font-size: 0.85rem; color: #64748b;">异常自动隔离</div>
</td>
<td><span class="status-indicator status-ok">● 待机</span></td>
<td id="circuit-breaker-count">0</td>
<td><button class="action-btn btn-primary">重置</button></td>
</tr>
</tbody>
</table>
</div>
<h2 class="section-title">📦 多语言部署</h2>
<div class="card" style="margin-bottom: 2rem;">
<div style="display: flex; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;">
<button class="action-btn btn-success" onclick="alert('检测项目语言')">🔍 检测项目</button>
<button class="action-btn btn-primary" onclick="alert('构建项目')">🔨 构建</button>
<button class="action-btn btn-primary" onclick="alert('启动项目')">▶️ 启动</button>
<button class="action-btn btn-danger" onclick="alert('停止项目')">⏹️ 停止</button>
</div>
<table class="plugins-table">
<thead>
<tr>
<th>项目名称</th>
<th>语言</th>
<th>状态</th>
<th>构建时间</th>
<th>操作</th>
</tr>
</thead>
<tbody id="projects-table-body">
<tr>
<td colspan="5" style="text-align: center; color: #64748b; padding: 2rem;">暂无部署项目</td>
</tr>
</tbody>
</table>
</div>
<h2 class="section-title">⚙️ 运维工具箱</h2>
<div class="dashboard-grid">
<div class="card">
<div class="card-header">
<span class="card-title">备份管理</span>
<div class="card-icon">🚀</div>
<h3>插件市场</h3>
<p>一键安装更新官方与社区插件,依赖自动解析。</p>
</div>
<p style="color: #64748b; margin-bottom: 1rem;">一键备份/恢复系统配置和数据</p>
<button class="action-btn btn-primary" style="width: 100%" onclick="alert('创建备份')">📥 创建备份</button>
<button class="action-btn btn-primary" style="width: 100%; margin-top: 0.5rem" onclick="alert('恢复备份')">📤 恢复备份</button>
</div>
<div class="card">
<div class="card-header">
<span class="card-title">健康检查</span>
<div class="card-icon">⚙️</div>
<h3>配置管理</h3>
<p>统一配置文件,支持热加载与版本回滚。</p>
</div>
<div style="margin-bottom: 0.5rem; display: flex; justify-content: space-between;">
<span>CPU 使用率</span>
<span id="cpu-usage">12%</span>
</div>
<div class="progress-bar"><div class="progress-fill" style="width: 12%"></div></div>
<div style="margin: 1rem 0 0.5rem; display: flex; justify-content: space-between;">
<span>内存使用率</span>
<span id="mem-usage">34%</span>
</div>
<div class="progress-bar"><div class="progress-fill" style="width: 34%; background: var(--success)"></div></div>
<button class="action-btn btn-primary" style="width: 100%; margin-top: 1rem" onclick="alert('运行健康检查')">🏥 立即检查</button>
</div>
<div class="card">
<div class="card-header">
<span class="card-title">资源配额</span>
</div>
<p style="color: #64748b; margin-bottom: 1rem;">限制插件资源使用,防止系统过载</p>
<div style="display: flex; gap: 0.5rem;">
<input type="text" placeholder="插件 ID" style="flex: 1; padding: 0.5rem; border: 1px solid #e2e8f0; border-radius: 8px;">
<button class="action-btn btn-primary" onclick="alert('设置配额')">设置</button>
</div>
</div>
</div>
<h2 class="section-title">🔌 已加载插件</h2>
<table class="plugins-table">
<thead>
<tr>
<th>插件名称</th>
<th>版本</th>
<th>描述</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody id="plugins-table-body">
<!-- 动态加载 -->
</tbody>
</table>
</div>
<footer>
<p>FutureOSS v1.1.0 安全全能发行版 | 基于进程隔离的安全架构 | HTML5 + CSS3 + Vanilla JS</p>
<p style="margin-top: 0.5rem;">© 2024 FutureOSS Team. All rights reserved.</p>
<p>FutureOSS v1.1.0 Security All-in-One Edition</p>
<p style="margin-top: 8px;">Built with ❤️ · MIT License</p>
</footer>
</div>
<script>
// 模拟实时数据更新
function updateStats() {
document.getElementById('security-events').textContent = Math.floor(Math.random() * 50);
document.getElementById('rate-limit-count').textContent = Math.floor(Math.random() * 100);
document.getElementById('ip-block-count').textContent = Math.floor(Math.random() * 20);
document.getElementById('audit-logs-count').textContent = Math.floor(Math.random() * 500);
document.getElementById('cpu-usage').textContent = Math.floor(Math.random() * 30 + 10) + '%';
document.getElementById('mem-usage').textContent = Math.floor(Math.random() * 20 + 30) + '%';
}
// 模拟插件列表
const plugins = [
{ name: "security_gateway", version: "1.1.0", desc: "统一安全网关:限流、鉴权、审计、熔断", status: "running" },
{ name: "ops_toolbox", version: "1.1.0", desc: "自动化运维工具箱:备份、健康检查、资源配额", status: "running" },
{ name: "multi_lang_deploy", version: "1.1.0", desc: "多语言项目部署编排器", status: "running" },
{ name: "http_api", version: "1.0.0", desc: "HTTP RESTful API 服务", status: "running" },
{ name: "websocket", version: "1.0.0", desc: "WebSocket 实时通信", status: "running" }
];
function renderPlugins() {
const tbody = document.getElementById('plugins-table-body');
tbody.innerHTML = plugins.map(p => `
<tr>
<td><strong>${p.name}</strong></td>
<td>v${p.version}</td>
<td>${p.desc}</td>
<td><span class="status-indicator status-ok">● ${p.status}</span></td>
<td>
<button class="action-btn btn-primary" style="padding: 0.25rem 0.5rem; font-size: 0.85rem;">配置</button>
<button class="action-btn btn-danger" style="padding: 0.25rem 0.5rem; font-size: 0.85rem; margin-left: 0.5rem;">卸载</button>
</td>
</tr>
`).join('');
}
// 初始化
updateStats();
renderPlugins();
setInterval(updateStats, 5000);
let seconds = 0;
setInterval(() => {
seconds++;
const h = Math.floor(seconds / 3600);
const m = Math.floor((seconds % 3600) / 60);
document.getElementById('uptime').textContent = h + 'h ' + m + 'm';
}, 1000);
</script>
</body>
</html>