feat: IPAM improvements - server/node subnet binding, theme color fixes
- IPAM link-allocations: filter networks by proxmox_server_id and proxmox_node to prevent cross-server/cross-node IP assignment - IPAM link-allocations: add manual server+network selection modal before linking - IPAM add-network forms: add Proxmox server and node selectors with dynamic cluster-info loading (ipam_dashboard.html, ipam_networks.html) - models.py / schemas.py: add proxmox_node field to IPAMNetwork - migrations: migration #16 adds proxmox_node column to ipam_networks table - Theme fixes: replace all hardcoded rgba/color:#fff/color:white with CSS vars across base.html, virtual_machines.html, instance_detail.html, os_templates.html, proxmox_vms.html, ipam_network_detail.html, ipam_allocations.html - i18n: add proxmox_node, node selector, link-allocations modal keys (ru/en) - Version bump: 1.0.4 -> 1.0.5
This commit is contained in:
@@ -1035,6 +1035,20 @@ def migrate_backup_jobs(conn):
|
||||
logger.info("✓ backup_jobs table created")
|
||||
|
||||
|
||||
# ==================== Migration 16: IPAM Network Node ====================
|
||||
|
||||
def migrate_ipam_network_node(conn):
|
||||
"""Add proxmox_node column to ipam_networks table"""
|
||||
if not table_exists(conn, 'ipam_networks'):
|
||||
logger.info("Table ipam_networks does not exist, skipping")
|
||||
return
|
||||
|
||||
if add_column_if_not_exists(conn, 'ipam_networks', 'proxmox_node', 'VARCHAR(100)'):
|
||||
logger.info("✓ Added proxmox_node column to ipam_networks")
|
||||
else:
|
||||
logger.info("✓ ipam_networks.proxmox_node already exists")
|
||||
|
||||
|
||||
def run_all_migrations(engine, db_session=None):
|
||||
"""
|
||||
Run all migrations in order.
|
||||
@@ -1169,6 +1183,14 @@ def run_all_migrations(engine, db_session=None):
|
||||
logger.warning(f"Backup jobs migration: {e}")
|
||||
conn.rollback()
|
||||
|
||||
# Migration 16: IPAM Network Node
|
||||
try:
|
||||
migrate_ipam_network_node(conn)
|
||||
conn.commit()
|
||||
except Exception as e:
|
||||
logger.warning(f"IPAM network node migration: {e}")
|
||||
conn.rollback()
|
||||
|
||||
logger.info("=" * 50)
|
||||
logger.info("✓ All migrations completed successfully")
|
||||
logger.info("=" * 50)
|
||||
|
||||
Reference in New Issue
Block a user