yumoqing 3c9fdcf444 feat: UI pages, build.sh, deployment scripts, model uitype fixes
- Add SDLC dashboard, pipeline editor, ops center UI
- build.sh: clone business modules to pkgs/, xls2ui CRUD, fix created_by
- global_func.py: password_encode None-safe wrapper
- pipeline_app.py: permission cache warmup removed
- load_path.py: RBAC permission registration for all modules
- scripts/merge_i18n.py: i18n merge tool
- bin/init_perms.py, bin/init_data.py: init scripts
- set_role_perm.py: single permission registration
- Model uitype fields set for form editing
- pipeline_core/pipeline_ops load_path.py scripts
2026-07-18 22:44:34 +08:00

63 lines
2.3 KiB
Python

#!/usr/bin/env python3
"""RBAC path registration for pipeline_ops module."""
import os, sys, subprocess
MOD = "pipeline_ops"
PATHS_ANY = [
f"/{MOD}/index.ui",
]
PATHS_LOGINED = [
f"/{MOD}",
f"/{MOD}/api/ops_dashboard_data.dspy",
# Pricing
f"/{MOD}/pipeline_pricing/index.ui",
f"/{MOD}/pipeline_pricing/get_pipeline_pricing.dspy",
f"/{MOD}/pipeline_pricing/add_pipeline_pricing.dspy",
f"/{MOD}/pipeline_pricing/update_pipeline_pricing.dspy",
f"/{MOD}/pipeline_pricing/delete_pipeline_pricing.dspy",
# Capacity
f"/{MOD}/pipeline_capacity/index.ui",
f"/{MOD}/pipeline_capacity/get_pipeline_capacity.dspy",
f"/{MOD}/pipeline_capacity/add_pipeline_capacity.dspy",
f"/{MOD}/pipeline_capacity/update_pipeline_capacity.dspy",
f"/{MOD}/pipeline_capacity/delete_pipeline_capacity.dspy",
# Usage Log
f"/{MOD}/pipeline_usage_log/index.ui",
f"/{MOD}/pipeline_usage_log/get_pipeline_usage_log.dspy",
f"/{MOD}/pipeline_usage_log/add_pipeline_usage_log.dspy",
f"/{MOD}/pipeline_usage_log/update_pipeline_usage_log.dspy",
f"/{MOD}/pipeline_usage_log/delete_pipeline_usage_log.dspy",
# API
f"/{MOD}/api/pipeline_pricing_create.dspy",
f"/{MOD}/api/pipeline_pricing_update.dspy",
f"/{MOD}/api/pipeline_pricing_delete.dspy",
f"/{MOD}/api/pipeline_capacity_create.dspy",
f"/{MOD}/api/pipeline_capacity_update.dspy",
f"/{MOD}/api/pipeline_capacity_delete.dspy",
f"/{MOD}/api/pipeline_usage_log_create.dspy",
f"/{MOD}/api/pipeline_usage_log_update.dspy",
f"/{MOD}/api/pipeline_usage_log_delete.dspy",
f"/{MOD}/api/get_search_pipeline_id.dspy",
]
def main():
root = os.path.expanduser("~/pipeline")
set_perm = os.path.join(root, "set_role_perm.py")
if not os.path.isfile(set_perm):
print("ERROR: pipeline root not found"); sys.exit(1)
py = sys.executable
count = 0
for role, paths in [("any", PATHS_ANY), ("logined", PATHS_LOGINED)]:
for path in paths:
r = subprocess.run([py, set_perm, role, path], capture_output=True, text=True, cwd=root)
if r.returncode == 0: count += 1
else: print(f" WARN: {path}")
print(f"Registered {count}/{len(PATHS_ANY)+len(PATHS_LOGINED)} paths for {MOD}")
if __name__ == "__main__":
main()