signing for extension deployment, tuning for download crawl depth, and dependency version visibility in settings view
This commit is contained in:
@@ -266,3 +266,58 @@ async def get_logs():
|
||||
})
|
||||
|
||||
return jsonify({"logs": logs, "count": len(logs)})
|
||||
|
||||
|
||||
@bp.route("/system-info", methods=["GET"])
|
||||
async def get_system_info():
|
||||
"""Get system information including dependency versions."""
|
||||
import sys
|
||||
import importlib.metadata
|
||||
|
||||
config = get_settings()
|
||||
|
||||
# Get all installed packages (preserve original names for display)
|
||||
all_packages = {}
|
||||
# Also build a normalized lookup (lowercase, underscores normalized to hyphens)
|
||||
normalized_lookup = {}
|
||||
for dist in importlib.metadata.distributions():
|
||||
name = dist.metadata["Name"]
|
||||
if name:
|
||||
all_packages[name] = dist.version
|
||||
# Normalize: lowercase and replace underscores with hyphens
|
||||
normalized = name.lower().replace("_", "-")
|
||||
normalized_lookup[normalized] = dist.version
|
||||
|
||||
def get_version(name):
|
||||
"""Get version with case-insensitive and underscore/hyphen-insensitive lookup."""
|
||||
normalized = name.lower().replace("_", "-")
|
||||
return normalized_lookup.get(normalized, "not installed")
|
||||
|
||||
# Key packages to highlight (sorted alphabetically)
|
||||
key_package_names = [
|
||||
"alembic",
|
||||
"asyncpg",
|
||||
"celery",
|
||||
"gallery-dl",
|
||||
"hypercorn",
|
||||
"pydantic",
|
||||
"quart",
|
||||
"redis",
|
||||
"sqlalchemy",
|
||||
]
|
||||
|
||||
key_packages = {
|
||||
name: get_version(name)
|
||||
for name in key_package_names
|
||||
}
|
||||
|
||||
return jsonify({
|
||||
"version": "1.0.0",
|
||||
"python_version": f"{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}",
|
||||
"python_full": sys.version,
|
||||
"gallery_dl_version": get_version("gallery-dl"),
|
||||
"key_packages": key_packages,
|
||||
"all_packages": all_packages,
|
||||
"download_path": config.download_path,
|
||||
"config_path": config.config_path,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user