Title: Upgrade to FutureOSS v1.1.0 with enterprise-grade security and deployment features
Key features implemented: - New RELEASE_v1.1.0.md with comprehensive release notes for security upgrades and new features - New firewall.py plugin implementing dynamic IP filtering, port management, and attack detection - New frp_proxy.py plugin for FRP-based internal network tunneling and proxy services - New ftp_server.py plugin providing secure file transfer with user management and access control - New multi_lang_deploy.py orchestrator supporting automated detection and deployment of Python/Node.js/Go/Java/PHP projects - New ops_toolbox.py with backup/recovery, health checks, and resource quota management - New security_gateway.py with API rate limiting, JWT authentication, audit logging, and circuit breaker protection - New HTML5/CSS3/JS-based webui replacing PHP templates with modern responsive design and real-time metrics - New manifest.json files for all plugins adding configuration schemas and dependency declarations - Updated .gitignore with refined ignore patterns for development environments - Modified core plugin manifests to include internationalization dependencies and enhanced configurations - Removed legacy PHP template files from webui frontend views - Enhanced plugin bridge, storage, signature verification with multilingual support and security improvements
This commit is contained in:
@@ -36,29 +36,54 @@ class WebUIServer:
|
||||
self.router.get(path, lambda req: self._render_page(path, req))
|
||||
|
||||
def _render_page(self, path: str, request):
|
||||
"""渲染页面布局+内容"""
|
||||
"""渲染页面布局 + 内容"""
|
||||
provider = self.pages.get(path)
|
||||
content = provider() if provider else ""
|
||||
|
||||
# 排序导航项(首页在前)
|
||||
sorted_nav = sorted(self.nav_items, key=lambda x: 0 if x.get('url') == '/' else 1)
|
||||
|
||||
variables = {
|
||||
"pageTitle": self.config.get("title", "FutureOSS"),
|
||||
"currentPage": path,
|
||||
"navItems": sorted_nav,
|
||||
"content": content
|
||||
# 构建导航项 HTML
|
||||
nav_html = ""
|
||||
icon_map = {
|
||||
'🏠': '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',
|
||||
}
|
||||
for item in sorted_nav:
|
||||
url = item.get('url', '#')
|
||||
is_active = 'active' if url == path else ''
|
||||
icon = item.get('icon', 'ri-dashboard-line')
|
||||
text = item.get('text', '')
|
||||
ri_icon = icon_map.get(icon, icon)
|
||||
title = text
|
||||
nav_html += f'''
|
||||
<a href="{url}" class="nav-item {is_active}" title="{title}">
|
||||
<i class="{ri_icon}"></i>
|
||||
</a>
|
||||
'''
|
||||
|
||||
php_file = self.frontend_dir / "views" / "layout.php"
|
||||
html = self._execute_php(str(php_file), variables)
|
||||
page_title = self.config.get("title", "FutureOSS")
|
||||
|
||||
# 读取 HTML 模板
|
||||
template_file = self.frontend_dir / "views" / "layout.html"
|
||||
with open(template_file, 'r', encoding='utf-8') as f:
|
||||
html_template = f.read()
|
||||
|
||||
html = html_template.replace('{{ pageTitle }}', page_title)
|
||||
html = html.replace('{{ navItems }}', nav_html)
|
||||
html = html.replace('{{ content }}', content)
|
||||
|
||||
return Response(
|
||||
status=200,
|
||||
headers={"Content-Type": "text/html; charset=utf-8"},
|
||||
body=html
|
||||
)
|
||||
|
||||
def _default_home_content(self) -> str:
|
||||
"""默认首页内容"""
|
||||
return """
|
||||
|
||||
Reference in New Issue
Block a user