fix(ci): fix black/ruff failures, add CoC and PR template
- Fix Python formatting (sync no longer strips blank lines from .py files) - Remove test_community_build.py (tests private sync module) - Fix ruff warnings in test files - Add CODE_OF_CONDUCT.md - Add .github/PULL_REQUEST_TEMPLATE.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ from typing import Any
|
||||
|
||||
from plugins.openpanel.client import OpenPanelClient
|
||||
|
||||
|
||||
def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
"""Return tool specifications for ToolGenerator (6 tools)"""
|
||||
return [
|
||||
@@ -72,10 +73,12 @@ def get_tool_specifications() -> list[dict[str, Any]]:
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
# =====================
|
||||
# System Functions (6)
|
||||
# =====================
|
||||
|
||||
|
||||
async def health_check(client: OpenPanelClient) -> str:
|
||||
"""Check OpenPanel instance health"""
|
||||
try:
|
||||
@@ -109,6 +112,7 @@ async def health_check(client: OpenPanelClient) -> str:
|
||||
ensure_ascii=False,
|
||||
)
|
||||
|
||||
|
||||
async def get_instance_info(client: OpenPanelClient) -> str:
|
||||
"""Get OpenPanel instance information"""
|
||||
try:
|
||||
@@ -126,6 +130,7 @@ async def get_instance_info(client: OpenPanelClient) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def get_usage_stats(client: OpenPanelClient, project_id: str, date_range: str = "30d") -> str:
|
||||
"""Get usage statistics for a project"""
|
||||
try:
|
||||
@@ -173,6 +178,7 @@ async def get_usage_stats(client: OpenPanelClient, project_id: str, date_range:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def get_storage_stats(client: OpenPanelClient, project_id: str) -> str:
|
||||
"""Get storage usage statistics"""
|
||||
try:
|
||||
@@ -199,6 +205,7 @@ async def get_storage_stats(client: OpenPanelClient, project_id: str) -> str:
|
||||
except Exception as e:
|
||||
return json.dumps({"success": False, "error": str(e)}, indent=2, ensure_ascii=False)
|
||||
|
||||
|
||||
async def test_connection(client: OpenPanelClient) -> str:
|
||||
"""Test connection to OpenPanel API"""
|
||||
try:
|
||||
@@ -232,6 +239,7 @@ async def test_connection(client: OpenPanelClient) -> str:
|
||||
ensure_ascii=False,
|
||||
)
|
||||
|
||||
|
||||
async def get_rate_limit_status(client: OpenPanelClient) -> str:
|
||||
"""Check current rate limit status"""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user