mirror of
https://github.com/hansjone/netx.git
synced 2026-10-11 02:53:17 +08:00
feat(ne): batch apply jump proxy on selected NEs
Add POST /v1/managed-ne/batch-hop, shared HopProxyFields form, and toolbar button next to connectivity test. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
4575fef523
commit
d395aa7174
8 changed files with 329 additions and 82 deletions
|
|
@ -8,8 +8,9 @@ from .db import get_db
|
|||
from .device_types import SUPPORTED_DEVICE_TYPES, SUPPORTED_VENDORS
|
||||
from .ne_connect import schedule_connect_tests
|
||||
from .ne_crypto import credentials_configured
|
||||
from .ne_schemas import ConnectTestRequest, ManagedNeCreate, ManagedNeUpdate
|
||||
from .ne_schemas import BatchHopApplyRequest, ConnectTestRequest, ManagedNeCreate, ManagedNeUpdate
|
||||
from .ne_service import (
|
||||
batch_apply_hop_proxy,
|
||||
build_managed_ne_import_template,
|
||||
create_managed_ne,
|
||||
delete_managed_ne,
|
||||
|
|
@ -90,6 +91,11 @@ async def api_import_managed_ne(file: UploadFile = File(...), db: Session = Depe
|
|||
return import_managed_ne(db, content, file.filename or "import.xlsx").model_dump()
|
||||
|
||||
|
||||
@router.post("/batch-hop")
|
||||
def api_batch_apply_hop(body: BatchHopApplyRequest, db: Session = Depends(get_db)):
|
||||
return batch_apply_hop_proxy(db, body.ids, body.hop)
|
||||
|
||||
|
||||
@router.post("/connect-test")
|
||||
def api_connect_test(body: ConnectTestRequest, db: Session = Depends(get_db)):
|
||||
ids = [str(x).strip() for x in body.ids if str(x).strip()]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue