index.html 301 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636
  1. <!DOCTYPE html>
  2. <html lang="el" class="dark">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Proxmox RouterOS | Network Appliance</title>
  7. <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'><path d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5'/></svg>">
  8. <script src="https://cdn.tailwindcss.com"></script>
  9. <script>
  10. tailwind.config = {
  11. darkMode: 'class',
  12. theme: {
  13. extend: {
  14. colors: {
  15. brand: {
  16. 50: '#ecfdf5',
  17. 100: '#d1fae5',
  18. 400: '#34d399',
  19. 500: '#10b981',
  20. 600: '#059669',
  21. 700: '#047857',
  22. 800: '#065f46',
  23. 900: '#064e3b',
  24. }
  25. }
  26. }
  27. }
  28. }
  29. </script>
  30. <link rel="stylesheet" href="style.css">
  31. </head>
  32. <body class="bg-[#0b101e] text-slate-100 min-h-screen flex flex-col font-sans antialiased selection:bg-brand-500 selection:text-white">
  33. <!-- Toast Notification Container -->
  34. <div id="toast-container" class="fixed top-5 right-5 z-50 flex flex-col space-y-2 pointer-events-none"></div>
  35. <!-- Main Layout -->
  36. <div class="flex flex-1 overflow-hidden h-screen">
  37. <!-- Sidebar -->
  38. <aside id="sidebar" class="w-64 bg-[#0f172a]/95 border-r border-slate-800 flex flex-col flex-shrink-0 transition-all duration-300 z-30">
  39. <!-- Brand Header -->
  40. <div class="h-16 flex items-center px-5 border-b border-slate-800 justify-between">
  41. <div class="flex items-center space-x-3">
  42. <div class="w-9 h-9 rounded-xl bg-gradient-to-tr from-brand-600 to-cyan-500 flex items-center justify-center shadow-lg shadow-brand-500/20 text-white font-bold">
  43. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  44. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
  45. </svg>
  46. </div>
  47. <div>
  48. <div class="font-bold text-sm tracking-wide text-white flex items-center gap-1.5">
  49. <span>RouterOS</span>
  50. <span class="text-[10px] bg-brand-500/20 text-brand-400 font-mono px-1.5 py-0.5 rounded border border-brand-500/30">LXC</span>
  51. </div>
  52. <div class="text-[11px] text-slate-400">Proxmox Gateway</div>
  53. </div>
  54. </div>
  55. </div>
  56. <!-- Live Health Pill -->
  57. <div class="px-4 py-3 border-b border-slate-800/60 bg-slate-900/40">
  58. <div class="flex items-center justify-between text-xs mb-1.5">
  59. <span class="text-slate-400 font-medium">Gateway Status</span>
  60. <span class="flex items-center text-emerald-400 font-medium text-[11px]">
  61. <span class="relative flex h-2 w-2 mr-1.5">
  62. <span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
  63. <span class="relative inline-flex rounded-full h-2 w-2 bg-emerald-500"></span>
  64. </span>
  65. Online
  66. </span>
  67. </div>
  68. <div class="text-[11px] text-slate-400 font-mono truncate" id="side-gateway-ip">GW: Scanning...</div>
  69. </div>
  70. <!-- Navigation Menu -->
  71. <nav class="flex-1 px-3 py-3 space-y-1 overflow-y-auto">
  72. <!-- CATEGORY: OVERVIEW -->
  73. <div class="px-3 pt-2 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">Overview</div>
  74. <a href="#dashboard" onclick="navigate('dashboard')" id="nav-dashboard"
  75. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group bg-brand-500/10 text-brand-400 border border-brand-500/20">
  76. <div class="flex items-center space-x-2.5">
  77. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  78. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z" />
  79. </svg>
  80. <span>Dashboard</span>
  81. </div>
  82. </a>
  83. <!-- CATEGORY: NETWORKING -->
  84. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">Networking</div>
  85. <a href="#interfaces" onclick="navigate('interfaces')" id="nav-interfaces"
  86. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  87. <div class="flex items-center space-x-2.5">
  88. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  89. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
  90. </svg>
  91. <span>Interfaces</span>
  92. </div>
  93. <span id="badge-ifaces-count" class="text-[10px] bg-slate-800 text-slate-300 px-1.5 py-0.2 rounded-full font-mono">0</span>
  94. </a>
  95. <a href="#bridge" onclick="navigate('bridge')" id="nav-bridge"
  96. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  97. <div class="flex items-center space-x-2.5">
  98. <svg class="w-4 h-4 text-sky-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  99. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M3 14h18M5 14v4a2 2 0 002 2h2a2 2 0 002-2v-4m6 0v4a2 2 0 002 2h2a2 2 0 002-2v-4M4 10V6a2 2 0 012-2h12a2 2 0 012 2v4" />
  100. </svg>
  101. <span>Bridge</span>
  102. </div>
  103. <span id="badge-bridge-count" class="text-[10px] bg-sky-950 text-sky-300 border border-sky-800/40 px-1.5 py-0.2 rounded-full font-mono">0</span>
  104. </a>
  105. <a href="#vlans" onclick="navigate('vlans')" id="nav-vlans"
  106. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  107. <div class="flex items-center space-x-2.5">
  108. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  109. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z" />
  110. </svg>
  111. <span>VLANs (802.1Q)</span>
  112. </div>
  113. <span id="badge-vlans-count" class="text-[10px] bg-cyan-950 text-cyan-400 border border-cyan-800/50 px-1.5 py-0.2 rounded-full font-mono">0</span>
  114. </a>
  115. <a href="#firewall" onclick="navigate('firewall')" id="nav-firewall"
  116. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  117. <div class="flex items-center space-x-2.5">
  118. <svg class="w-4 h-4 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  119. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
  120. </svg>
  121. <span>Firewall</span>
  122. </div>
  123. <span id="badge-firewall-count" class="text-[10px] bg-emerald-950 text-emerald-400 border border-emerald-800/50 px-1.5 py-0.2 rounded-full font-mono">0</span>
  124. </a>
  125. <!-- CATEGORY: ROUTING -->
  126. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">Routing</div>
  127. <a href="#routes" onclick="navigate('routes')" id="nav-routes"
  128. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  129. <div class="flex items-center space-x-2.5">
  130. <svg class="w-4 h-4 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  131. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7" />
  132. </svg>
  133. <span>Routes & Policy</span>
  134. </div>
  135. <span id="badge-routes-count" class="text-[10px] bg-slate-800 text-slate-300 px-1.5 py-0.2 rounded-full font-mono">0</span>
  136. </a>
  137. <a href="#bgp" onclick="navigate('bgp')" id="nav-bgp"
  138. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  139. <div class="flex items-center space-x-2.5">
  140. <svg class="w-4 h-4 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  141. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  142. </svg>
  143. <span>BGP (/routing bgp)</span>
  144. </div>
  145. <div class="flex items-center gap-1.5">
  146. <span id="badge-bgp-dot" class="w-2 h-2 rounded-full bg-slate-600" title="BGP Status"></span>
  147. <span id="badge-bgp-count" class="text-[10px] bg-purple-950 text-purple-300 border border-purple-800/40 px-1.5 py-0.2 rounded-full font-mono">0</span>
  148. </div>
  149. </a>
  150. <a href="#ospf" onclick="navigate('ospf')" id="nav-ospf"
  151. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  152. <div class="flex items-center space-x-2.5">
  153. <svg class="w-4 h-4 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  154. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
  155. </svg>
  156. <span>OSPF (/routing ospf)</span>
  157. </div>
  158. <div class="flex items-center gap-1.5">
  159. <span id="badge-ospf-dot" class="w-2 h-2 rounded-full bg-slate-600" title="OSPF Status"></span>
  160. <span id="badge-ospf-count" class="text-[10px] bg-indigo-950 text-indigo-300 border border-indigo-800/40 px-1.5 py-0.2 rounded-full font-mono">0</span>
  161. </div>
  162. </a>
  163. <a href="#routing-filters" onclick="navigate('routing-filters')" id="nav-routing-filters"
  164. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  165. <div class="flex items-center space-x-2.5">
  166. <svg class="w-4 h-4 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  167. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" />
  168. </svg>
  169. <span>Routing Filters</span>
  170. </div>
  171. <span id="badge-filters-count" class="text-[10px] bg-slate-800 text-slate-300 px-1.5 py-0.2 rounded-full font-mono">0</span>
  172. </a>
  173. <!-- CATEGORY: WAN & ACCESS -->
  174. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">WAN & Access</div>
  175. <a href="#pppoe" onclick="navigate('pppoe')" id="nav-pppoe"
  176. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  177. <div class="flex items-center space-x-2.5">
  178. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  179. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
  180. </svg>
  181. <span>PPPoE Client</span>
  182. </div>
  183. <span id="badge-pppoe-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  184. </a>
  185. <!-- CATEGORY: VPN & TUNNELS -->
  186. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">VPN & Tunnels</div>
  187. <a href="#wireguard" onclick="navigate('wireguard')" id="nav-wireguard"
  188. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  189. <div class="flex items-center space-x-2.5">
  190. <svg class="w-4 h-4 text-rose-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  191. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
  192. </svg>
  193. <span>WireGuard</span>
  194. </div>
  195. <span id="badge-wg-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  196. </a>
  197. <a href="#ipsec" onclick="navigate('ipsec')" id="nav-ipsec"
  198. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  199. <div class="flex items-center space-x-2.5">
  200. <svg class="w-4 h-4 text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  201. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
  202. </svg>
  203. <span>IPSec (IKEv2)</span>
  204. </div>
  205. <span id="badge-ipsec-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  206. </a>
  207. <a href="#l2tp" onclick="navigate('l2tp')" id="nav-l2tp"
  208. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  209. <div class="flex items-center space-x-2.5">
  210. <svg class="w-4 h-4 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  211. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9" />
  212. </svg>
  213. <span>L2TP Client</span>
  214. </div>
  215. <span id="badge-l2tp-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  216. </a>
  217. <a href="#pptp" onclick="navigate('pptp')" id="nav-pptp"
  218. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  219. <div class="flex items-center space-x-2.5">
  220. <svg class="w-4 h-4 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  221. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
  222. </svg>
  223. <span>PPTP Client</span>
  224. </div>
  225. <span id="badge-pptp-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  226. </a>
  227. <a href="#ppp" onclick="navigate('ppp')" id="nav-ppp"
  228. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  229. <div class="flex items-center space-x-2.5">
  230. <svg class="w-4 h-4 text-violet-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  231. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" />
  232. </svg>
  233. <span>PPP (Servers & Users)</span>
  234. </div>
  235. <span id="badge-ppp-sessions" class="text-[10px] bg-violet-950 text-violet-300 border border-violet-800/40 px-1.5 py-0.2 rounded-full font-mono">0</span>
  236. </a>
  237. <a href="#eoip" onclick="navigate('eoip')" id="nav-eoip"
  238. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  239. <div class="flex items-center space-x-2.5">
  240. <svg class="w-4 h-4 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  241. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" />
  242. </svg>
  243. <span>EoIP Tunnels</span>
  244. </div>
  245. <span id="badge-eoip-count" class="text-[10px] bg-slate-800 text-slate-300 px-1.5 py-0.2 rounded-full font-mono">0</span>
  246. </a>
  247. <!-- CATEGORY: SYSTEM -->
  248. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">System</div>
  249. <a href="#persistence" onclick="navigate('persistence')" id="nav-persistence"
  250. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  251. <div class="flex items-center space-x-2.5">
  252. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  253. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4" />
  254. </svg>
  255. <span>Debian Config</span>
  256. </div>
  257. <span class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.2 rounded">.cfg</span>
  258. </a>
  259. </nav>
  260. <!-- Sidebar Footer: Host System Metrics -->
  261. <div class="p-4 border-t border-slate-800/80 bg-slate-900/60">
  262. <div class="flex items-center justify-between text-xs text-slate-400 mb-2">
  263. <span class="truncate font-mono" id="side-hostname">debian-lxc</span>
  264. <span class="text-[11px] text-slate-500" id="side-uptime">0h 0m</span>
  265. </div>
  266. <div class="mb-2">
  267. <div class="flex justify-between text-[11px] text-slate-400 mb-1">
  268. <span>CPU Usage</span>
  269. <span id="side-cpu-val" class="font-mono text-slate-300">0.0%</span>
  270. </div>
  271. <div class="w-full bg-slate-800 h-1.5 rounded-full overflow-hidden">
  272. <div id="side-cpu-bar" class="bg-brand-500 h-full rounded-full transition-all duration-500" style="width: 5%"></div>
  273. </div>
  274. </div>
  275. <div>
  276. <div class="flex justify-between text-[11px] text-slate-400 mb-1">
  277. <span>RAM Usage</span>
  278. <span id="side-ram-val" class="font-mono text-slate-300">0%</span>
  279. </div>
  280. <div class="w-full bg-slate-800 h-1.5 rounded-full overflow-hidden">
  281. <div id="side-ram-bar" class="bg-cyan-500 h-full rounded-full transition-all duration-500" style="width: 25%"></div>
  282. </div>
  283. </div>
  284. </div>
  285. </aside>
  286. <!-- Main Content Area -->
  287. <div class="flex-1 flex flex-col min-w-0 overflow-hidden">
  288. <!-- Top Navbar -->
  289. <header class="h-16 bg-[#0f172a]/80 backdrop-blur border-b border-slate-800 flex items-center justify-between px-6 z-20">
  290. <div class="flex items-center space-x-4">
  291. <button onclick="toggleSidebar()" class="lg:hidden p-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800">
  292. <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  293. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
  294. </svg>
  295. </button>
  296. <div>
  297. <h1 id="page-title" class="text-lg font-bold text-white tracking-tight">Dashboard Overview</h1>
  298. <p id="page-subtitle" class="text-xs text-slate-400">Live router performance and interface management</p>
  299. </div>
  300. </div>
  301. <div class="flex items-center space-x-3">
  302. <!-- Active Tunnels Pill -->
  303. <div class="flex items-center bg-slate-800/80 border border-slate-700/60 rounded-full px-3 py-1 text-xs text-slate-300 space-x-2">
  304. <span id="tunnels-dot" class="w-2 h-2 rounded-full bg-slate-500"></span>
  305. <span id="tunnels-label" class="font-mono text-[11px]">0 Active VPN Tunnels</span>
  306. </div>
  307. <!-- Quick Actions -->
  308. <button onclick="openVlanModal()" class="flex items-center space-x-2 bg-gradient-to-r from-brand-600 to-cyan-600 hover:from-brand-500 hover:to-cyan-500 text-white font-medium text-xs px-3.5 py-2 rounded-lg shadow-lg shadow-brand-500/20 transition-all">
  309. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  310. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
  311. </svg>
  312. <span>+ Create VLAN</span>
  313. </button>
  314. <button onclick="fetchData(true)" title="Manual Refresh" class="p-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 hover:text-white border border-slate-700 transition">
  315. <svg id="refresh-spinner" class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  316. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
  317. </svg>
  318. </button>
  319. </div>
  320. </header>
  321. <!-- Scrollable Main Viewport -->
  322. <main class="flex-1 overflow-y-auto p-6 space-y-6">
  323. <!-- ================= SECTION: DASHBOARD ================= -->
  324. <section id="section-dashboard" class="space-y-6">
  325. <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
  326. <div class="bg-slate-900/80 border border-slate-800 rounded-xl p-5 relative overflow-hidden group hover:border-slate-700 transition">
  327. <div class="flex items-center justify-between mb-3">
  328. <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">Interfaces</span>
  329. <div class="p-2 bg-brand-500/10 text-brand-400 rounded-lg">
  330. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  331. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
  332. </svg>
  333. </div>
  334. </div>
  335. <div class="flex items-baseline space-x-2">
  336. <span id="stat-ifaces-up" class="text-2xl font-bold text-white">0</span>
  337. <span class="text-xs text-slate-400">UP /</span>
  338. <span id="stat-ifaces-total" class="text-sm font-semibold text-slate-400">0 Total</span>
  339. </div>
  340. <div class="mt-2 text-xs text-slate-400 flex items-center">
  341. <span id="stat-ifaces-down" class="text-rose-400 font-medium mr-1.5">0 DOWN</span>
  342. <span class="text-slate-500">•</span>
  343. <span class="text-slate-400 ml-1.5">Plug & Play</span>
  344. </div>
  345. </div>
  346. <div class="bg-slate-900/80 border border-slate-800 rounded-xl p-5 relative overflow-hidden group hover:border-slate-700 transition">
  347. <div class="flex items-center justify-between mb-3">
  348. <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">802.1Q VLANs</span>
  349. <div class="p-2 bg-cyan-500/10 text-cyan-400 rounded-lg">
  350. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  351. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z" />
  352. </svg>
  353. </div>
  354. </div>
  355. <div class="flex items-baseline space-x-2">
  356. <span id="stat-vlans-count" class="text-2xl font-bold text-cyan-400">0</span>
  357. <span class="text-xs text-slate-400">Virtual Subnets</span>
  358. </div>
  359. <div class="mt-2 text-xs text-slate-400">Kernel Tagging Active</div>
  360. </div>
  361. <div class="bg-slate-900/80 border border-slate-800 rounded-xl p-5 relative overflow-hidden group hover:border-slate-700 transition">
  362. <div class="flex items-center justify-between mb-3">
  363. <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">WAN & VPN Services</span>
  364. <div class="p-2 bg-violet-500/10 text-violet-400 rounded-lg">
  365. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  366. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" />
  367. </svg>
  368. </div>
  369. </div>
  370. <div class="flex items-baseline space-x-2">
  371. <span id="stat-vpn-active" class="text-2xl font-bold text-violet-400">0</span>
  372. <span class="text-xs text-slate-400">Connected Tunnels</span>
  373. </div>
  374. <div class="mt-2 text-[11px] text-slate-400 flex items-center gap-1.5 font-mono">
  375. <span>WG • IPSec • PPPoE • L2TP</span>
  376. </div>
  377. </div>
  378. <div class="bg-slate-900/80 border border-slate-800 rounded-xl p-5 relative overflow-hidden group hover:border-slate-700 transition">
  379. <div class="flex items-center justify-between mb-3">
  380. <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">Live Traffic</span>
  381. <div class="p-2 bg-amber-500/10 text-amber-400 rounded-lg">
  382. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  383. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  384. </svg>
  385. </div>
  386. </div>
  387. <div class="space-y-1">
  388. <div class="flex items-center justify-between text-xs">
  389. <span class="text-slate-400 flex items-center gap-1"><span class="text-emerald-400 font-bold">↓</span> RX:</span>
  390. <span id="stat-traffic-rx" class="font-mono font-semibold text-emerald-400">0 B/s</span>
  391. </div>
  392. <div class="flex items-center justify-between text-xs">
  393. <span class="text-slate-400 flex items-center gap-1"><span class="text-cyan-400 font-bold">↑</span> TX:</span>
  394. <span id="stat-traffic-tx" class="font-mono font-semibold text-cyan-400">0 B/s</span>
  395. </div>
  396. </div>
  397. </div>
  398. </div>
  399. <!-- Port Matrix -->
  400. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  401. <div class="flex items-center justify-between mb-4">
  402. <div>
  403. <h3 class="text-sm font-bold text-white uppercase tracking-wider flex items-center gap-2">
  404. <span>Hardware & Virtual Port Matrix</span>
  405. <span class="text-[10px] bg-slate-800 text-slate-400 font-normal px-2 py-0.5 rounded-full">Live Hardware State</span>
  406. </h3>
  407. </div>
  408. </div>
  409. <div id="port-matrix" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-3"></div>
  410. </div>
  411. <!-- Quick Overview Tables -->
  412. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  413. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  414. <div class="flex items-center justify-between mb-4">
  415. <h3 class="text-sm font-bold text-white">Interfaces Overview</h3>
  416. <button onclick="navigate('interfaces')" class="text-xs text-brand-400 hover:text-brand-300 font-medium">View All →</button>
  417. </div>
  418. <div class="overflow-x-auto">
  419. <table class="w-full text-left text-xs">
  420. <thead class="text-slate-400 border-b border-slate-800">
  421. <tr><th class="pb-2">Interface</th><th class="pb-2">Role</th><th class="pb-2">IP</th><th class="pb-2 text-right">Status</th></tr>
  422. </thead>
  423. <tbody id="quick-interfaces-table" class="divide-y divide-slate-800/60 font-mono"></tbody>
  424. </table>
  425. </div>
  426. </div>
  427. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  428. <div class="flex items-center justify-between mb-4">
  429. <h3 class="text-sm font-bold text-white">Active VLANs</h3>
  430. <button onclick="navigate('vlans')" class="text-xs text-cyan-400 hover:text-cyan-300 font-medium">Manage →</button>
  431. </div>
  432. <div class="overflow-x-auto">
  433. <table class="w-full text-left text-xs">
  434. <thead class="text-slate-400 border-b border-slate-800">
  435. <tr><th class="pb-2">VLAN</th><th class="pb-2">Device</th><th class="pb-2">Subnet</th><th class="pb-2 text-right">Parent</th></tr>
  436. </thead>
  437. <tbody id="quick-vlans-table" class="divide-y divide-slate-800/60 font-mono"></tbody>
  438. </table>
  439. </div>
  440. </div>
  441. </div>
  442. </section>
  443. <!-- ================= SECTION: INTERFACES (HIERARCHICAL TREE) ================= -->
  444. <section id="section-interfaces" class="hidden space-y-6">
  445. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-4 flex flex-wrap items-center justify-between gap-4">
  446. <div class="flex items-center space-x-2">
  447. <span class="text-xs font-semibold text-slate-400 mr-2">Filter:</span>
  448. <button onclick="filterIfaces('all')" id="filter-all" class="filter-btn px-3 py-1.5 rounded-lg text-xs font-medium bg-slate-800 text-white border border-slate-700">All Interfaces</button>
  449. <button onclick="filterIfaces('has_vlans')" id="filter-has_vlans" class="filter-btn px-3 py-1.5 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800 hover:text-white">With VLANs</button>
  450. <button onclick="filterIfaces('physical')" id="filter-physical" class="filter-btn px-3 py-1.5 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800 hover:text-white">Physical Only</button>
  451. <button onclick="filterIfaces('up')" id="filter-up" class="filter-btn px-3 py-1.5 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800 hover:text-white">Only UP</button>
  452. </div>
  453. <div class="flex items-center space-x-3">
  454. <button onclick="expandAllIfaces(true)" class="text-xs text-cyan-400 hover:text-cyan-300 font-medium px-2.5 py-1.5 rounded bg-cyan-950/50 border border-cyan-800/60">Expand All</button>
  455. <button onclick="expandAllIfaces(false)" class="text-xs text-slate-400 hover:text-slate-300 font-medium px-2.5 py-1.5 rounded bg-slate-800 border border-slate-700">Collapse All</button>
  456. <input type="text" id="iface-search" oninput="renderInterfacesList()" placeholder="Search interfaces..."
  457. class="bg-slate-800/80 border border-slate-700 rounded-lg px-3 py-1.5 text-xs text-white placeholder-slate-500 focus:outline-none focus:border-brand-500 w-48">
  458. </div>
  459. </div>
  460. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden shadow-2xl">
  461. <div class="p-4 border-b border-slate-800 bg-slate-950/40 flex items-center justify-between">
  462. <div>
  463. <h3 class="text-sm font-bold text-white flex items-center gap-2">
  464. <span>Interface Hierarchy & VLAN Sub-interfaces</span>
  465. <span class="text-[10px] bg-cyan-500/10 text-cyan-400 border border-cyan-500/20 px-2 py-0.5 rounded font-mono">Expandable Tree</span>
  466. </h3>
  467. </div>
  468. <div class="text-xs text-slate-400">
  469. <span id="ifaces-list-summary" class="font-mono">Loading interfaces...</span>
  470. </div>
  471. </div>
  472. <div class="overflow-x-auto">
  473. <table class="w-full text-left text-xs">
  474. <thead class="text-slate-400 bg-slate-950/80 border-b border-slate-800 uppercase tracking-wider text-[11px]">
  475. <tr>
  476. <th class="py-3 px-3 font-semibold w-8 text-center"></th>
  477. <th class="py-3 px-4 font-semibold">Interface / Type</th>
  478. <th class="py-3 px-4 font-semibold">Role & Alias</th>
  479. <th class="py-3 px-4 font-semibold">IP Address (CIDR)</th>
  480. <th class="py-3 px-4 font-semibold">MAC & MTU</th>
  481. <th class="py-3 px-4 font-semibold">Throughput (RX/TX)</th>
  482. <th class="py-3 px-4 font-semibold">Link State</th>
  483. <th class="py-3 px-4 font-semibold text-right">Actions</th>
  484. </tr>
  485. </thead>
  486. <tbody id="interfaces-tree-tbody" class="divide-y divide-slate-800 font-mono"></tbody>
  487. </table>
  488. </div>
  489. <div id="interfaces-empty-state" class="hidden p-12 text-center text-slate-500">
  490. No interfaces found matching your search.
  491. </div>
  492. </div>
  493. </section>
  494. <!-- ================= SECTION: BRIDGE (/interface bridge) ================= -->
  495. <section id="section-bridge" class="hidden space-y-6">
  496. <!-- Bridge Navigation Header -->
  497. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-4 flex flex-wrap items-center justify-between gap-4">
  498. <div class="flex items-center space-x-3">
  499. <div class="p-2.5 rounded-lg bg-sky-500/10 border border-sky-500/20 text-sky-400">
  500. <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  501. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M3 14h18M5 14v4a2 2 0 002 2h2a2 2 0 002-2v-4m6 0v4a2 2 0 002 2h2a2 2 0 002-2v-4M4 10V6a2 2 0 012-2h12a2 2 0 012 2v4" />
  502. </svg>
  503. </div>
  504. <div>
  505. <div class="flex items-center gap-2">
  506. <h2 class="text-base font-bold text-white">Bridge Interfaces</h2>
  507. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-sky-500/20 text-sky-300 border border-sky-500/30 font-semibold">IEEE 802.1D / 802.1Q</span>
  508. </div>
  509. <p class="text-xs text-slate-400">MikroTik RouterOS style bridge with RSTP, VLAN filtering, split-horizon port isolation & dynamic host MAC forwarding table.</p>
  510. </div>
  511. </div>
  512. <div class="flex items-center space-x-3">
  513. <button id="bridge-top-action-btn" onclick="openCurrentBridgeModal()" class="flex items-center space-x-2 bg-gradient-to-r from-sky-600 to-cyan-600 hover:from-sky-500 hover:to-cyan-500 text-white font-semibold text-xs px-4 py-2.5 rounded-lg shadow-lg shadow-sky-500/20 transition">
  514. <span>+ Add Bridge</span>
  515. </button>
  516. </div>
  517. </div>
  518. <!-- Bridge Subtabs Nav -->
  519. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl overflow-hidden p-1 flex flex-wrap items-center justify-between gap-2">
  520. <div class="flex items-center space-x-1">
  521. <button id="bridge-subtab-btn-bridges" onclick="switchBridgeSubTab('bridges')" class="px-4 py-2 text-xs font-bold rounded-lg bg-slate-800 text-white shadow-sm transition flex items-center gap-2">
  522. <span>Bridges</span>
  523. <span id="bridge-badge-bridges" class="px-1.5 py-0.2 rounded text-[10px] bg-sky-950 text-sky-300 border border-sky-800/40">0</span>
  524. </button>
  525. <button id="bridge-subtab-btn-ports" onclick="switchBridgeSubTab('ports')" class="px-4 py-2 text-xs font-bold rounded-lg text-slate-400 hover:text-slate-200 transition flex items-center gap-2">
  526. <span>Ports</span>
  527. <span id="bridge-badge-ports" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  528. </button>
  529. <button id="bridge-subtab-btn-vlans" onclick="switchBridgeSubTab('vlans')" class="px-4 py-2 text-xs font-bold rounded-lg text-slate-400 hover:text-slate-200 transition flex items-center gap-2">
  530. <span>VLANs</span>
  531. <span id="bridge-badge-vlans" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  532. </button>
  533. <button id="bridge-subtab-btn-hosts" onclick="switchBridgeSubTab('hosts')" class="px-4 py-2 text-xs font-bold rounded-lg text-slate-400 hover:text-slate-200 transition flex items-center gap-2">
  534. <span>Hosts (MAC Table)</span>
  535. <span id="bridge-badge-hosts" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  536. </button>
  537. </div>
  538. <!-- Stats Bar -->
  539. <div class="flex items-center space-x-4 px-3 text-xs font-mono text-slate-400">
  540. <div>Bridges: <span id="bridge-stat-bridges" class="font-bold text-white">0</span></div>
  541. <div>Ports: <span id="bridge-stat-ports" class="font-bold text-sky-400">0</span></div>
  542. <div>Learned MACs: <span id="bridge-stat-hosts" class="font-bold text-emerald-400">0</span></div>
  543. </div>
  544. </div>
  545. <!-- ================= SUBTAB 1: BRIDGES ================= -->
  546. <div id="bridge-subtab-bridges" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  547. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  548. <h3 class="text-sm font-bold text-white">Configured Bridges</h3>
  549. <span id="bridge-count-badge" class="text-xs font-mono text-slate-400">0 Bridges</span>
  550. </div>
  551. <div class="overflow-x-auto">
  552. <table class="w-full text-left text-xs font-mono">
  553. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  554. <tr>
  555. <th class="py-2.5 px-3 w-10 text-center">#</th>
  556. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  557. <th class="py-2.5 px-3">Name</th>
  558. <th class="py-2.5 px-3">MTU</th>
  559. <th class="py-2.5 px-3">MAC Address</th>
  560. <th class="py-2.5 px-3">STP</th>
  561. <th class="py-2.5 px-3">VLAN Filtering</th>
  562. <th class="py-2.5 px-3">PVID</th>
  563. <th class="py-2.5 px-3">Ports</th>
  564. <th class="py-2.5 px-3">IP Addresses</th>
  565. <th class="py-2.5 px-3">Traffic</th>
  566. <th class="py-2.5 px-3">Comment</th>
  567. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  568. </tr>
  569. </thead>
  570. <tbody id="bridge-table-body" class="divide-y divide-slate-800/80"></tbody>
  571. </table>
  572. </div>
  573. <div id="bridge-empty-bridges" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  574. No bridge interfaces configured. Click "+ Add Bridge" to create one.
  575. </div>
  576. </div>
  577. <!-- ================= SUBTAB 2: PORTS ================= -->
  578. <div id="bridge-subtab-ports" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  579. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  580. <div class="flex items-center gap-3">
  581. <h3 class="text-sm font-bold text-white">Bridge Ports</h3>
  582. <span id="bridge-ports-count-badge" class="text-xs font-mono text-slate-400">0 Ports</span>
  583. </div>
  584. <div class="flex items-center space-x-2">
  585. <label class="text-xs text-slate-400">Filter Bridge:</label>
  586. <select id="bridge-ports-filter-bridge" onchange="renderBridgePorts()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white">
  587. <option value="">All Bridges</option>
  588. </select>
  589. </div>
  590. </div>
  591. <div class="overflow-x-auto">
  592. <table class="w-full text-left text-xs font-mono">
  593. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  594. <tr>
  595. <th class="py-2.5 px-3 w-10 text-center">#</th>
  596. <th class="py-2.5 px-3 w-12 text-center" title="Flags: X=Disabled">Flag</th>
  597. <th class="py-2.5 px-3">Interface</th>
  598. <th class="py-2.5 px-3">Bridge</th>
  599. <th class="py-2.5 px-3">PVID</th>
  600. <th class="py-2.5 px-3">Frame Types</th>
  601. <th class="py-2.5 px-3">Ingress Filter</th>
  602. <th class="py-2.5 px-3">Horizon</th>
  603. <th class="py-2.5 px-3">Role / Status</th>
  604. <th class="py-2.5 px-3">Comment</th>
  605. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  606. </tr>
  607. </thead>
  608. <tbody id="bridge-ports-table-body" class="divide-y divide-slate-800/80"></tbody>
  609. </table>
  610. </div>
  611. <div id="bridge-empty-ports" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  612. No bridge ports configured. Click "+ Add Port" to attach a physical NIC, VLAN or EoIP tunnel.
  613. </div>
  614. </div>
  615. <!-- ================= SUBTAB 3: VLANS ================= -->
  616. <div id="bridge-subtab-vlans" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  617. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  618. <div class="flex items-center gap-3">
  619. <h3 class="text-sm font-bold text-white">Bridge VLAN Filtering Table</h3>
  620. <span id="bridge-vlans-count-badge" class="text-xs font-mono text-slate-400">0 Entries</span>
  621. </div>
  622. <div class="flex items-center space-x-2">
  623. <label class="text-xs text-slate-400">Filter Bridge:</label>
  624. <select id="bridge-vlans-filter-bridge" onchange="renderBridgeVLANs()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white">
  625. <option value="">All Bridges</option>
  626. </select>
  627. </div>
  628. </div>
  629. <div class="overflow-x-auto">
  630. <table class="w-full text-left text-xs font-mono">
  631. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  632. <tr>
  633. <th class="py-2.5 px-3 w-10 text-center">#</th>
  634. <th class="py-2.5 px-3 w-12 text-center" title="Flags: X=Disabled">Flag</th>
  635. <th class="py-2.5 px-3">Bridge</th>
  636. <th class="py-2.5 px-3">VLAN IDs</th>
  637. <th class="py-2.5 px-3">Tagged Member Ports</th>
  638. <th class="py-2.5 px-3">Untagged Member Ports</th>
  639. <th class="py-2.5 px-3">Comment</th>
  640. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  641. </tr>
  642. </thead>
  643. <tbody id="bridge-vlans-table-body" class="divide-y divide-slate-800/80"></tbody>
  644. </table>
  645. </div>
  646. <div id="bridge-empty-vlans" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  647. No bridge VLAN filtering entries configured. Click "+ Add VLAN Entry" to configure 802.1Q tagged ports.
  648. </div>
  649. </div>
  650. <!-- ================= SUBTAB 4: HOSTS (MAC TABLE) ================= -->
  651. <div id="bridge-subtab-hosts" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  652. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  653. <div class="flex items-center gap-3">
  654. <h3 class="text-sm font-bold text-white">Forwarding Database (MAC Table)</h3>
  655. <span id="bridge-hosts-count-badge" class="text-xs font-mono text-slate-400">0 Entries</span>
  656. </div>
  657. <div class="flex items-center space-x-2">
  658. <input type="text" id="bridge-hosts-search" oninput="renderBridgeHosts()" placeholder="Search MAC or Interface..." class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white">
  659. <select id="bridge-hosts-filter-bridge" onchange="loadBridgeHosts()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white">
  660. <option value="">All Bridges</option>
  661. </select>
  662. <button onclick="loadBridgeHosts()" class="px-2.5 py-1 rounded-lg bg-slate-800 hover:bg-slate-700 text-xs font-semibold text-slate-200 border border-slate-700">🔄 Refresh</button>
  663. <button onclick="flushBridgeHosts()" class="px-2.5 py-1 rounded-lg bg-rose-950/60 hover:bg-rose-900/80 text-rose-300 border border-rose-800/40 text-xs font-semibold">🗑️ Flush Dynamic</button>
  664. </div>
  665. </div>
  666. <div class="overflow-x-auto">
  667. <table class="w-full text-left text-xs font-mono">
  668. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  669. <tr>
  670. <th class="py-2.5 px-3">MAC Address</th>
  671. <th class="py-2.5 px-3">Interface / Port</th>
  672. <th class="py-2.5 px-3">Bridge</th>
  673. <th class="py-2.5 px-3">VLAN</th>
  674. <th class="py-2.5 px-3">Age (s)</th>
  675. <th class="py-2.5 px-3">Flags (L=Local, S=Static, D=Dynamic)</th>
  676. </tr>
  677. </thead>
  678. <tbody id="bridge-hosts-table-body" class="divide-y divide-slate-800/80"></tbody>
  679. </table>
  680. </div>
  681. <div id="bridge-empty-hosts" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  682. No MAC addresses learned in the forwarding database.
  683. </div>
  684. </div>
  685. </section>
  686. <!-- ================= SECTION: VLANS (802.1Q) ================= -->
  687. <section id="section-vlans" class="hidden space-y-6">
  688. <div class="bg-gradient-to-r from-cyan-950/60 via-slate-900 to-slate-900 border border-cyan-800/40 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  689. <div class="max-w-xl">
  690. <div class="flex items-center gap-2 mb-1">
  691. <span class="px-2 py-0.5 rounded text-[11px] font-mono bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 font-semibold">IEEE 802.1Q</span>
  692. <h2 class="text-base font-bold text-white">VLAN Virtual Sub-interfaces</h2>
  693. </div>
  694. <p class="text-xs text-slate-400 leading-relaxed">
  695. Tagged sub-interfaces on physical parent interfaces (e.g. <code class="text-cyan-300">eth0.10</code>).
  696. </p>
  697. </div>
  698. <button onclick="openVlanModal()" class="flex items-center space-x-2 bg-gradient-to-r from-brand-600 to-cyan-600 hover:from-brand-500 hover:to-cyan-500 text-white font-semibold text-xs px-4 py-2.5 rounded-lg shadow-lg shadow-cyan-500/20 transition">
  699. <span>+ Create VLAN Sub-interface</span>
  700. </button>
  701. </div>
  702. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  703. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  704. <h3 class="text-sm font-bold text-white">Configured VLANs</h3>
  705. <input type="text" id="vlan-search" oninput="renderVlansList()" placeholder="Filter VLAN ID..."
  706. class="bg-slate-800 border border-slate-700 rounded-lg px-3 py-1 text-xs text-white focus:outline-none focus:border-cyan-500 w-52">
  707. </div>
  708. <div class="overflow-x-auto">
  709. <table class="w-full text-left text-xs font-mono">
  710. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[11px] font-sans">
  711. <tr>
  712. <th class="py-3 px-4 font-semibold">VLAN ID</th>
  713. <th class="py-3 px-4 font-semibold">Device</th>
  714. <th class="py-3 px-4 font-semibold">Parent</th>
  715. <th class="py-3 px-4 font-semibold">Subnet (CIDR)</th>
  716. <th class="py-3 px-4 font-semibold">Role</th>
  717. <th class="py-3 px-4 font-semibold">MTU</th>
  718. <th class="py-3 px-4 font-semibold">Status</th>
  719. <th class="py-3 px-4 font-semibold text-right">Actions</th>
  720. </tr>
  721. </thead>
  722. <tbody id="vlans-table-body" class="divide-y divide-slate-800"></tbody>
  723. </table>
  724. </div>
  725. <div id="vlans-empty-state" class="hidden p-12 text-center text-slate-500">
  726. No VLANs configured. Click "+ Create VLAN" to add one.
  727. </div>
  728. </div>
  729. </section>
  730. <!-- ================= SECTION: PPPoE CLIENTS (MikroTik style) ================= -->
  731. <section id="section-pppoe" class="hidden space-y-6">
  732. <div class="bg-gradient-to-r from-blue-950/40 via-slate-900 to-slate-900 border border-blue-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  733. <div>
  734. <div class="flex items-center gap-2 mb-1">
  735. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-blue-500/20 text-blue-300 border border-blue-500/30 font-semibold">/interface pppoe-client</span>
  736. <h2 class="text-base font-bold text-white">PPPoE Client Sessions</h2>
  737. </div>
  738. <p class="text-xs text-slate-400">Manage multiple Point-to-Point Protocol over Ethernet WAN connections (MikroTik RouterOS style).</p>
  739. </div>
  740. <div class="flex items-center gap-2">
  741. <button onclick="navigate('ppp'); switchPPPSubTab('pppoe')" class="text-xs font-semibold px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-blue-300 border border-blue-900/40 transition flex items-center gap-1.5" title="Configure Router as PPPoE Access Concentrator Server">
  742. <span>⚙ Server Settings</span>
  743. </button>
  744. <button onclick="openAddPPPoEModal()" class="text-xs font-semibold px-4 py-2 rounded-lg bg-blue-600 hover:bg-blue-500 text-white shadow-lg shadow-blue-500/20 transition flex items-center gap-1.5">
  745. <span>+ Add PPPoE Client</span>
  746. </button>
  747. </div>
  748. </div>
  749. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  750. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  751. <h3 class="text-sm font-bold text-white">Configured PPPoE Interfaces</h3>
  752. <span id="pppoe-count-badge" class="text-xs font-mono bg-slate-800 text-slate-300 px-2.5 py-0.5 rounded-full">0 Interfaces</span>
  753. </div>
  754. <div class="overflow-x-auto">
  755. <table class="w-full text-left text-xs font-mono">
  756. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  757. <tr>
  758. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  759. <th class="py-2.5 px-3">Name</th>
  760. <th class="py-2.5 px-3">Interface</th>
  761. <th class="py-2.5 px-3">User</th>
  762. <th class="py-2.5 px-3">Assigned IP</th>
  763. <th class="py-2.5 px-3">Device</th>
  764. <th class="py-2.5 px-3 text-center">Def. Route</th>
  765. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  766. </tr>
  767. </thead>
  768. <tbody id="pppoe-table-body" class="divide-y divide-slate-800/80"></tbody>
  769. </table>
  770. </div>
  771. <div id="pppoe-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  772. No PPPoE clients configured. Click "+ Add PPPoE Client" to add a connection.
  773. </div>
  774. </div>
  775. </section>
  776. <!-- ================= SECTION: WIREGUARD (MikroTik style) ================= -->
  777. <section id="section-wireguard" class="hidden space-y-6">
  778. <div class="bg-gradient-to-r from-rose-950/40 via-slate-900 to-slate-900 border border-rose-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  779. <div>
  780. <div class="flex items-center gap-2 mb-1">
  781. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-rose-500/20 text-rose-300 border border-rose-500/30 font-semibold">/interface wireguard</span>
  782. <h2 class="text-base font-bold text-white">WireGuard VPN Suite</h2>
  783. </div>
  784. <p class="text-xs text-slate-400">High-performance multi-interface WireGuard server and peer controller (MikroTik RouterOS v7 style).</p>
  785. </div>
  786. <div class="flex items-center space-x-2.5">
  787. <button onclick="openAddWGInterfaceModal()" class="text-xs font-semibold px-3.5 py-2 rounded-lg bg-rose-600 hover:bg-rose-500 text-white shadow-lg shadow-rose-500/20 transition">
  788. + Add Interface
  789. </button>
  790. <button onclick="openAddWGPeerModal()" class="text-xs font-semibold px-3.5 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-white border border-slate-700 transition">
  791. + Add Peer
  792. </button>
  793. </div>
  794. </div>
  795. <!-- Sub Tabs: Interfaces / Peers -->
  796. <div class="flex border-b border-slate-800 space-x-2">
  797. <button id="wg-subtab-btn-ifaces" onclick="switchWGSubTab('ifaces')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-rose-500 text-white transition flex items-center gap-2">
  798. <span>Interfaces</span>
  799. <span id="wg-subtab-badge-ifaces" class="px-1.5 py-0.5 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  800. </button>
  801. <button id="wg-subtab-btn-peers" onclick="switchWGSubTab('peers')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2">
  802. <span>Peers</span>
  803. <span id="wg-subtab-badge-peers" class="px-1.5 py-0.5 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  804. </button>
  805. </div>
  806. <!-- Sub-Tab 1: Interfaces -->
  807. <div id="wg-subtab-ifaces" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  808. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  809. <h3 class="text-sm font-bold text-white">WireGuard Interfaces</h3>
  810. <span id="wg-ifaces-count" class="text-xs font-mono text-slate-400">0 Interfaces</span>
  811. </div>
  812. <div class="overflow-x-auto">
  813. <table class="w-full text-left text-xs font-mono">
  814. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  815. <tr>
  816. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  817. <th class="py-2.5 px-3">Name</th>
  818. <th class="py-2.5 px-3">Listen Port</th>
  819. <th class="py-2.5 px-3">Tunnel Address</th>
  820. <th class="py-2.5 px-3">Public Key</th>
  821. <th class="py-2.5 px-3">MTU</th>
  822. <th class="py-2.5 px-3 text-center">Peers</th>
  823. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  824. </tr>
  825. </thead>
  826. <tbody id="wg-ifaces-table-body" class="divide-y divide-slate-800/80"></tbody>
  827. </table>
  828. </div>
  829. <div id="wg-ifaces-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  830. No WireGuard interfaces configured. Click "+ Add Interface" to create wg0.
  831. </div>
  832. </div>
  833. <!-- Sub-Tab 2: Peers -->
  834. <div id="wg-subtab-peers" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  835. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  836. <div class="flex items-center gap-3">
  837. <h3 class="text-sm font-bold text-white">WireGuard Peers</h3>
  838. <span id="wg-peers-count" class="text-xs font-mono text-slate-400">0 Peers</span>
  839. </div>
  840. <div class="flex items-center gap-2">
  841. <label class="text-xs text-slate-400 font-sans">Filter Interface:</label>
  842. <select id="wg-peers-filter-iface" onchange="renderWGPeers()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white font-mono">
  843. <option value="">All Interfaces</option>
  844. </select>
  845. </div>
  846. </div>
  847. <div class="overflow-x-auto">
  848. <table class="w-full text-left text-xs font-mono">
  849. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  850. <tr>
  851. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Active, X=Disabled">Flag</th>
  852. <th class="py-2.5 px-3">Interface</th>
  853. <th class="py-2.5 px-3">Peer Name</th>
  854. <th class="py-2.5 px-3">Public Key</th>
  855. <th class="py-2.5 px-3">Allowed IPs</th>
  856. <th class="py-2.5 px-3">Endpoint</th>
  857. <th class="py-2.5 px-3">Latest Handshake</th>
  858. <th class="py-2.5 px-3">Traffic (RX/TX)</th>
  859. <th class="py-2.5 px-3 text-right font-sans">Action</th>
  860. </tr>
  861. </thead>
  862. <tbody id="wg-peers-table-body" class="divide-y divide-slate-800/80"></tbody>
  863. </table>
  864. </div>
  865. <div id="wg-peers-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  866. No peers found for the selected interface. Click "+ Add Peer" to add a client or branch.
  867. </div>
  868. </div>
  869. </section>
  870. <!-- ================= SECTION: IPSEC (MikroTik style) ================= -->
  871. <section id="section-ipsec" class="hidden space-y-6">
  872. <div class="bg-gradient-to-r from-amber-950/40 via-slate-900 to-slate-900 border border-amber-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  873. <div>
  874. <div class="flex items-center gap-2 mb-1">
  875. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-amber-500/20 text-amber-300 border border-amber-500/30 font-semibold">/ip ipsec</span>
  876. <h2 class="text-base font-bold text-white">IPSec (IKEv2) Tunnels</h2>
  877. </div>
  878. <p class="text-xs text-slate-400">Enterprise strongSwan 6 Site-to-Site and Remote Gateway connections.</p>
  879. </div>
  880. <div class="flex items-center gap-2">
  881. <button onclick="openIPSecServerModal()" class="text-xs font-semibold px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-amber-300 border border-amber-900/40 transition flex items-center gap-1.5" title="Configure Router as IPSec IKEv2 Roadwarrior Mobile Client Server">
  882. <span>⚙ Roadwarrior Server</span>
  883. </button>
  884. <button onclick="openAddIPSecModal()" class="text-xs font-semibold px-4 py-2 rounded-lg bg-amber-600 hover:bg-amber-500 text-white shadow-lg shadow-amber-500/20 transition">
  885. + Add IPSec Tunnel
  886. </button>
  887. </div>
  888. </div>
  889. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  890. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  891. <h3 class="text-sm font-bold text-white">Configured IPSec Tunnels</h3>
  892. <span id="ipsec-sas-badge" class="text-xs font-mono bg-slate-800 text-slate-300 px-2.5 py-0.5 rounded-full">0 Active SAs</span>
  893. </div>
  894. <div class="overflow-x-auto">
  895. <table class="w-full text-left text-xs font-mono">
  896. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  897. <tr>
  898. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Established, X=Disabled">Flag</th>
  899. <th class="py-2.5 px-4">Connection Name</th>
  900. <th class="py-2.5 px-4">Local Subnet</th>
  901. <th class="py-2.5 px-4">Remote Gateway</th>
  902. <th class="py-2.5 px-4">Remote Subnet</th>
  903. <th class="py-2.5 px-4">Status</th>
  904. <th class="py-2.5 px-4 text-right font-sans">Actions</th>
  905. </tr>
  906. </thead>
  907. <tbody id="ipsec-table-body" class="divide-y divide-slate-800"></tbody>
  908. </table>
  909. </div>
  910. <div id="ipsec-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  911. No IPSec tunnels configured. Click "+ Add IPSec Tunnel" to set up site-to-site networking.
  912. </div>
  913. </div>
  914. </section>
  915. <!-- ================= SECTION: L2TP CLIENT (MikroTik style) ================= -->
  916. <section id="section-l2tp" class="hidden space-y-6">
  917. <div class="bg-gradient-to-r from-cyan-950/40 via-slate-900 to-slate-900 border border-cyan-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  918. <div>
  919. <div class="flex items-center gap-2 mb-1">
  920. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-cyan-500/20 text-cyan-300 border border-cyan-500/30 font-semibold">/interface l2tp-client</span>
  921. <h2 class="text-base font-bold text-white">L2TP Client Sessions</h2>
  922. </div>
  923. <p class="text-xs text-slate-400">Multiple Layer 2 Tunneling Protocol clients with optional IPSec PSK encryption.</p>
  924. </div>
  925. <div class="flex items-center gap-2">
  926. <button onclick="navigate('ppp'); switchPPPSubTab('l2tp')" class="text-xs font-semibold px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-cyan-300 border border-cyan-900/40 transition flex items-center gap-1.5" title="Configure Router as L2TP Server">
  927. <span>⚙ Server Settings</span>
  928. </button>
  929. <button onclick="openAddL2TPModal()" class="text-xs font-semibold px-4 py-2 rounded-lg bg-cyan-600 hover:bg-cyan-500 text-white shadow-lg shadow-cyan-500/20 transition">
  930. + Add L2TP Client
  931. </button>
  932. </div>
  933. </div>
  934. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  935. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  936. <h3 class="text-sm font-bold text-white">Configured L2TP Clients</h3>
  937. <span id="l2tp-count-badge" class="text-xs font-mono bg-slate-800 text-slate-300 px-2.5 py-0.5 rounded-full">0 Clients</span>
  938. </div>
  939. <div class="overflow-x-auto">
  940. <table class="w-full text-left text-xs font-mono">
  941. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  942. <tr>
  943. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  944. <th class="py-2.5 px-3">Name</th>
  945. <th class="py-2.5 px-3">Server Address</th>
  946. <th class="py-2.5 px-3">User</th>
  947. <th class="py-2.5 px-3">Assigned IP</th>
  948. <th class="py-2.5 px-3">Device</th>
  949. <th class="py-2.5 px-3 text-center">Def. Route</th>
  950. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  951. </tr>
  952. </thead>
  953. <tbody id="l2tp-table-body" class="divide-y divide-slate-800/80"></tbody>
  954. </table>
  955. </div>
  956. <div id="l2tp-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  957. No L2TP clients configured. Click "+ Add L2TP Client" to add a tunnel.
  958. </div>
  959. </div>
  960. </section>
  961. <!-- ================= SECTION: PPTP CLIENT (MikroTik style) ================= -->
  962. <section id="section-pptp" class="hidden space-y-6">
  963. <div class="bg-gradient-to-r from-purple-950/40 via-slate-900 to-slate-900 border border-purple-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  964. <div>
  965. <div class="flex items-center gap-2 mb-1">
  966. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-purple-500/20 text-purple-300 border border-purple-500/30 font-semibold">/interface pptp-client</span>
  967. <h2 class="text-base font-bold text-white">PPTP Client Sessions</h2>
  968. </div>
  969. <p class="text-xs text-slate-400">Multiple Point-to-Point Tunneling Protocol clients with MPPE-128 encryption.</p>
  970. </div>
  971. <div class="flex items-center gap-2">
  972. <button onclick="navigate('ppp'); switchPPPSubTab('pptp')" class="text-xs font-semibold px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-purple-300 border border-purple-900/40 transition flex items-center gap-1.5" title="Configure Router as PPTP Server">
  973. <span>⚙ Server Settings</span>
  974. </button>
  975. <button onclick="openAddPPTPModal()" class="text-xs font-semibold px-4 py-2 rounded-lg bg-purple-600 hover:bg-purple-500 text-white shadow-lg shadow-purple-500/20 transition">
  976. + Add PPTP Client
  977. </button>
  978. </div>
  979. </div>
  980. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  981. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  982. <h3 class="text-sm font-bold text-white">Configured PPTP Clients</h3>
  983. <span id="pptp-count-badge" class="text-xs font-mono bg-slate-800 text-slate-300 px-2.5 py-0.5 rounded-full">0 Clients</span>
  984. </div>
  985. <div class="overflow-x-auto">
  986. <table class="w-full text-left text-xs font-mono">
  987. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  988. <tr>
  989. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  990. <th class="py-2.5 px-3">Name</th>
  991. <th class="py-2.5 px-3">Server Address</th>
  992. <th class="py-2.5 px-3">User</th>
  993. <th class="py-2.5 px-3">Assigned IP</th>
  994. <th class="py-2.5 px-3">Device</th>
  995. <th class="py-2.5 px-3 text-center">MPPE</th>
  996. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  997. </tr>
  998. </thead>
  999. <tbody id="pptp-table-body" class="divide-y divide-slate-800/80"></tbody>
  1000. </table>
  1001. </div>
  1002. <div id="pptp-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1003. No PPTP clients configured. Click "+ Add PPTP Client" to add a tunnel.
  1004. </div>
  1005. </div>
  1006. </section>
  1007. <!-- ================= SECTION: PPP SERVERS & SECRETS (/ppp) ================= -->
  1008. <section id="section-ppp" class="hidden space-y-6">
  1009. <div class="bg-gradient-to-r from-violet-950/40 via-slate-900 to-slate-900 border border-violet-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  1010. <div>
  1011. <div class="flex items-center gap-2 mb-1">
  1012. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-violet-500/20 text-violet-300 border border-violet-500/30 font-semibold">/ppp</span>
  1013. <h2 class="text-base font-bold text-white">PPP Servers, Secrets & Profiles</h2>
  1014. </div>
  1015. <p class="text-xs text-slate-400">MikroTik RouterOS centralized user authentication database, IP pools and VPN server concentrators.</p>
  1016. </div>
  1017. <div class="flex items-center space-x-2.5">
  1018. <button id="ppp-primary-add-btn" onclick="openCurrentPPPModal()" class="text-xs font-semibold px-4 py-2 rounded-lg bg-violet-600 hover:bg-violet-500 text-white shadow-lg shadow-violet-500/20 transition flex items-center gap-1.5">
  1019. <span>+ Add User (Secret)</span>
  1020. </button>
  1021. </div>
  1022. </div>
  1023. <!-- Sub Tabs: Secrets / Profiles / PPPoE Server / PPTP Server / L2TP Server / Active Sessions -->
  1024. <div class="flex border-b border-slate-800 space-x-1 overflow-x-auto">
  1025. <button id="ppp-subtab-btn-secrets" onclick="switchPPPSubTab('secrets')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-violet-500 text-white transition flex items-center gap-2 whitespace-nowrap">
  1026. <span>Secrets (Users)</span>
  1027. <span id="ppp-badge-secrets" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1028. </button>
  1029. <button id="ppp-subtab-btn-profiles" onclick="switchPPPSubTab('profiles')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1030. <span>Profiles (Pools)</span>
  1031. <span id="ppp-badge-profiles" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1032. </button>
  1033. <button id="ppp-subtab-btn-pppoe" onclick="switchPPPSubTab('pppoe')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1034. <span>PPPoE Server</span>
  1035. <span id="ppp-badge-pppoe-state" class="w-2 h-2 rounded-full bg-slate-600"></span>
  1036. </button>
  1037. <button id="ppp-subtab-btn-pptp" onclick="switchPPPSubTab('pptp')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1038. <span>PPTP Server</span>
  1039. <span id="ppp-badge-pptp-state" class="w-2 h-2 rounded-full bg-slate-600"></span>
  1040. </button>
  1041. <button id="ppp-subtab-btn-l2tp" onclick="switchPPPSubTab('l2tp')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1042. <span>L2TP Server</span>
  1043. <span id="ppp-badge-l2tp-state" class="w-2 h-2 rounded-full bg-slate-600"></span>
  1044. </button>
  1045. <button id="ppp-subtab-btn-active" onclick="switchPPPSubTab('active')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1046. <span>Active Sessions</span>
  1047. <span id="ppp-badge-active" class="px-1.5 py-0.2 rounded text-[10px] bg-emerald-950 text-emerald-400 border border-emerald-800/40">0</span>
  1048. </button>
  1049. </div>
  1050. <!-- TAB 1: SECRETS (USERS) -->
  1051. <div id="ppp-subtab-secrets" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1052. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1053. <h3 class="text-sm font-bold text-white">PPP Secrets (/ppp secret)</h3>
  1054. <span id="secrets-count-badge" class="text-xs font-mono text-slate-400">0 Users</span>
  1055. </div>
  1056. <div class="overflow-x-auto">
  1057. <table class="w-full text-left text-xs font-mono">
  1058. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1059. <tr>
  1060. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1061. <th class="py-2.5 px-3">Name (Username)</th>
  1062. <th class="py-2.5 px-3">Service</th>
  1063. <th class="py-2.5 px-3">Profile</th>
  1064. <th class="py-2.5 px-3">Local Address</th>
  1065. <th class="py-2.5 px-3">Remote Address</th>
  1066. <th class="py-2.5 px-3">Comment</th>
  1067. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1068. </tr>
  1069. </thead>
  1070. <tbody id="secrets-table-body" class="divide-y divide-slate-800/80"></tbody>
  1071. </table>
  1072. </div>
  1073. <div id="secrets-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1074. No PPP secrets configured. Click "+ Add User" to define an account.
  1075. </div>
  1076. </div>
  1077. <!-- TAB 2: PROFILES (POOLS) -->
  1078. <div id="ppp-subtab-profiles" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1079. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1080. <h3 class="text-sm font-bold text-white">PPP Profiles (/ppp profile)</h3>
  1081. <span id="profiles-count-badge" class="text-xs font-mono text-slate-400">0 Profiles</span>
  1082. </div>
  1083. <div class="overflow-x-auto">
  1084. <table class="w-full text-left text-xs font-mono">
  1085. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1086. <tr>
  1087. <th class="py-2.5 px-3">Profile Name</th>
  1088. <th class="py-2.5 px-3">Local Address</th>
  1089. <th class="py-2.5 px-3">Remote Address (Pool)</th>
  1090. <th class="py-2.5 px-3">DNS Servers</th>
  1091. <th class="py-2.5 px-3">Encryption</th>
  1092. <th class="py-2.5 px-3 text-center">Only One</th>
  1093. <th class="py-2.5 px-3">Comment</th>
  1094. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1095. </tr>
  1096. </thead>
  1097. <tbody id="profiles-table-body" class="divide-y divide-slate-800/80"></tbody>
  1098. </table>
  1099. </div>
  1100. </div>
  1101. <!-- TAB 3: PPPoE SERVER -->
  1102. <div id="ppp-subtab-pppoe" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl p-6">
  1103. <form onsubmit="savePPPoEServerConfig(event)" class="max-w-2xl space-y-5">
  1104. <div class="flex items-center justify-between border-b border-slate-800 pb-4">
  1105. <div>
  1106. <h3 class="text-sm font-bold text-white">PPPoE Access Concentrator Server</h3>
  1107. <p class="text-xs text-slate-400">Listens on physical interface or VLAN for PPPoE Discovery (PADI) packets</p>
  1108. </div>
  1109. <div class="flex items-center gap-3">
  1110. <span id="pppoe-server-status-pill" class="px-2 py-0.5 rounded text-[10px] font-mono font-semibold bg-slate-800 text-slate-400">STOPPED</span>
  1111. <label class="relative inline-flex items-center cursor-pointer">
  1112. <input type="checkbox" id="pppoe-server-enabled" class="sr-only peer">
  1113. <div class="w-11 h-6 bg-slate-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"></div>
  1114. </label>
  1115. </div>
  1116. </div>
  1117. <div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs font-sans">
  1118. <div>
  1119. <label class="block text-slate-300 font-medium mb-1">Service Name</label>
  1120. <input type="text" id="pppoe-server-name" placeholder="proxmox-pppoe" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  1121. </div>
  1122. <div>
  1123. <label class="block text-slate-300 font-medium mb-1">Listen Interface</label>
  1124. <select id="pppoe-server-iface" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono"></select>
  1125. </div>
  1126. <div>
  1127. <label class="block text-slate-300 font-medium mb-1">Default Profile</label>
  1128. <select id="pppoe-server-profile" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono"></select>
  1129. </div>
  1130. <div>
  1131. <label class="block text-slate-300 font-medium mb-1">Max MTU / MRU</label>
  1132. <input type="number" id="pppoe-server-mtu" value="1480" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  1133. </div>
  1134. </div>
  1135. <div class="flex items-center space-x-2 pt-2">
  1136. <input type="checkbox" id="pppoe-server-onesession" class="rounded bg-slate-800 border-slate-700 text-blue-600">
  1137. <label for="pppoe-server-onesession" class="text-xs text-slate-300">One Session Per Host (limit 1 PPPoE session per client MAC)</label>
  1138. </div>
  1139. <div class="pt-4 border-t border-slate-800 flex justify-end">
  1140. <button type="submit" class="px-5 py-2 rounded-lg text-xs font-semibold bg-blue-600 hover:bg-blue-500 text-white shadow-lg shadow-blue-500/20 transition">
  1141. Apply PPPoE Server Settings
  1142. </button>
  1143. </div>
  1144. </form>
  1145. </div>
  1146. <!-- TAB 4: PPTP SERVER -->
  1147. <div id="ppp-subtab-pptp" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl p-6">
  1148. <form onsubmit="savePPTPServerConfig(event)" class="max-w-2xl space-y-5">
  1149. <div class="flex items-center justify-between border-b border-slate-800 pb-4">
  1150. <div>
  1151. <h3 class="text-sm font-bold text-white">PPTP Server (/interface pptp-server server)</h3>
  1152. <p class="text-xs text-slate-400">Point-to-Point Tunneling Server listening on TCP port 1723 with MPPE-128 encryption</p>
  1153. </div>
  1154. <div class="flex items-center gap-3">
  1155. <span id="pptp-server-status-pill" class="px-2 py-0.5 rounded text-[10px] font-mono font-semibold bg-slate-800 text-slate-400">STOPPED</span>
  1156. <label class="relative inline-flex items-center cursor-pointer">
  1157. <input type="checkbox" id="pptp-server-enabled" class="sr-only peer">
  1158. <div class="w-11 h-6 bg-slate-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-purple-600"></div>
  1159. </label>
  1160. </div>
  1161. </div>
  1162. <div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs font-sans">
  1163. <div>
  1164. <label class="block text-slate-300 font-medium mb-1">Port</label>
  1165. <input type="number" id="pptp-server-port" value="1723" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  1166. </div>
  1167. <div>
  1168. <label class="block text-slate-300 font-medium mb-1">Default Profile</label>
  1169. <select id="pptp-server-profile" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono"></select>
  1170. </div>
  1171. </div>
  1172. <div class="flex items-center space-x-2 pt-2">
  1173. <input type="checkbox" id="pptp-server-mppe" checked class="rounded bg-slate-800 border-slate-700 text-purple-600">
  1174. <label for="pptp-server-mppe" class="text-xs text-slate-300">Require 128-bit MPPE Encryption (MS-CHAPv2)</label>
  1175. </div>
  1176. <div class="pt-4 border-t border-slate-800 flex justify-end">
  1177. <button type="submit" class="px-5 py-2 rounded-lg text-xs font-semibold bg-purple-600 hover:bg-purple-500 text-white shadow-lg shadow-purple-500/20 transition">
  1178. Apply PPTP Server Settings
  1179. </button>
  1180. </div>
  1181. </form>
  1182. </div>
  1183. <!-- TAB 5: L2TP SERVER -->
  1184. <div id="ppp-subtab-l2tp" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl p-6">
  1185. <form onsubmit="saveL2TPServerConfig(event)" class="max-w-2xl space-y-5">
  1186. <div class="flex items-center justify-between border-b border-slate-800 pb-4">
  1187. <div>
  1188. <h3 class="text-sm font-bold text-white">L2TP Server (/interface l2tp-server server)</h3>
  1189. <p class="text-xs text-slate-400">Layer 2 Tunneling Protocol Server listening on UDP port 1701 with optional IPSec</p>
  1190. </div>
  1191. <div class="flex items-center gap-3">
  1192. <span id="l2tp-server-status-pill" class="px-2 py-0.5 rounded text-[10px] font-mono font-semibold bg-slate-800 text-slate-400">STOPPED</span>
  1193. <label class="relative inline-flex items-center cursor-pointer">
  1194. <input type="checkbox" id="l2tp-server-enabled" class="sr-only peer">
  1195. <div class="w-11 h-6 bg-slate-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-cyan-600"></div>
  1196. </label>
  1197. </div>
  1198. </div>
  1199. <div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs font-sans">
  1200. <div>
  1201. <label class="block text-slate-300 font-medium mb-1">Port</label>
  1202. <input type="number" id="l2tp-server-port" value="1701" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  1203. </div>
  1204. <div>
  1205. <label class="block text-slate-300 font-medium mb-1">Default Profile</label>
  1206. <select id="l2tp-server-profile" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono"></select>
  1207. </div>
  1208. <div>
  1209. <label class="block text-slate-300 font-medium mb-1">Use IPSec</label>
  1210. <select id="l2tp-server-useipsec" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  1211. <option value="no">no</option>
  1212. <option value="yes">yes</option>
  1213. <option value="required">required</option>
  1214. </select>
  1215. </div>
  1216. <div>
  1217. <label class="block text-slate-300 font-medium mb-1">IPSec Secret (PSK)</label>
  1218. <input type="password" id="l2tp-server-ipsecsecret" placeholder="Optional Pre-Shared Key" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  1219. </div>
  1220. </div>
  1221. <div class="pt-4 border-t border-slate-800 flex justify-end">
  1222. <button type="submit" class="px-5 py-2 rounded-lg text-xs font-semibold bg-cyan-600 hover:bg-cyan-500 text-white shadow-lg shadow-cyan-500/20 transition">
  1223. Apply L2TP Server Settings
  1224. </button>
  1225. </div>
  1226. </form>
  1227. </div>
  1228. <!-- TAB 6: ACTIVE SESSIONS -->
  1229. <div id="ppp-subtab-active" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1230. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1231. <h3 class="text-sm font-bold text-white">Active PPP Connections (/ppp active)</h3>
  1232. <button onclick="loadPPPSessions()" class="text-xs text-slate-400 hover:text-white px-2 py-1 rounded bg-slate-800">Refresh</button>
  1233. </div>
  1234. <div class="overflow-x-auto">
  1235. <table class="w-full text-left text-xs font-mono">
  1236. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1237. <tr>
  1238. <th class="py-2.5 px-3">Interface</th>
  1239. <th class="py-2.5 px-3">Username</th>
  1240. <th class="py-2.5 px-3">Service</th>
  1241. <th class="py-2.5 px-3">Client IP Address</th>
  1242. <th class="py-2.5 px-3">Uptime</th>
  1243. <th class="py-2.5 px-3">RX / TX Traffic</th>
  1244. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1245. </tr>
  1246. </thead>
  1247. <tbody id="active-ppp-table-body" class="divide-y divide-slate-800/80"></tbody>
  1248. </table>
  1249. </div>
  1250. <div id="active-ppp-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1251. No active PPP sessions currently connected.
  1252. </div>
  1253. </div>
  1254. </section>
  1255. <!-- ================= SECTION: EoIP TUNNELS (/interface eoip) ================= -->
  1256. <section id="section-eoip" class="hidden space-y-6">
  1257. <div class="bg-gradient-to-r from-emerald-950/40 via-slate-900 to-slate-900 border border-emerald-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  1258. <div>
  1259. <div class="flex items-center gap-2 mb-1">
  1260. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-emerald-500/20 text-emerald-300 border border-emerald-500/30 font-semibold">/interface eoip</span>
  1261. <h2 class="text-base font-bold text-white">EoIP Tunnels (Ethernet over IP)</h2>
  1262. </div>
  1263. <p class="text-xs text-slate-400">MikroTik RouterOS Layer 2 GRETAP tunneling over IP. Transparently bridge Ethernet subnets across the Internet.</p>
  1264. </div>
  1265. <button onclick="openAddEoIPModal()" class="text-xs font-semibold px-4 py-2 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20 transition flex items-center gap-1.5">
  1266. <span>+ Add EoIP Tunnel</span>
  1267. </button>
  1268. </div>
  1269. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1270. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1271. <h3 class="text-sm font-bold text-white">Configured EoIP Interfaces</h3>
  1272. <span id="eoip-count-badge" class="text-xs font-mono bg-slate-800 text-slate-300 px-2.5 py-0.5 rounded-full">0 Tunnels</span>
  1273. </div>
  1274. <div class="overflow-x-auto">
  1275. <table class="w-full text-left text-xs font-mono">
  1276. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1277. <tr>
  1278. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  1279. <th class="py-2.5 px-3">Name</th>
  1280. <th class="py-2.5 px-3">Tunnel ID</th>
  1281. <th class="py-2.5 px-3">Tunnel IP</th>
  1282. <th class="py-2.5 px-3">Remote Address</th>
  1283. <th class="py-2.5 px-3">Local Address</th>
  1284. <th class="py-2.5 px-3">MAC Address</th>
  1285. <th class="py-2.5 px-3">MTU</th>
  1286. <th class="py-2.5 px-3">RX / TX Traffic</th>
  1287. <th class="py-2.5 px-3">Comment</th>
  1288. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1289. </tr>
  1290. </thead>
  1291. <tbody id="eoip-table-body" class="divide-y divide-slate-800/80"></tbody>
  1292. </table>
  1293. </div>
  1294. <div id="eoip-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1295. No EoIP tunnels configured. Click "+ Add EoIP Tunnel" to create one.
  1296. </div>
  1297. </div>
  1298. </section>
  1299. <!-- ================= SECTION: FIREWALL (/ip firewall) ================= -->
  1300. <section id="section-firewall" class="hidden space-y-6">
  1301. <div class="bg-gradient-to-r from-emerald-950/40 via-slate-900 to-slate-900 border border-emerald-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  1302. <div>
  1303. <div class="flex items-center gap-2 mb-1">
  1304. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-emerald-500/20 text-emerald-300 border border-emerald-500/30 font-semibold">/ip firewall</span>
  1305. <h2 class="text-base font-bold text-white">Firewall & Traffic Controller</h2>
  1306. </div>
  1307. <p class="text-xs text-slate-400">Complete MikroTik-grade stateful filter, NAT, packet/connection marking (Mangle), address lists and live connection tracker.</p>
  1308. </div>
  1309. <div class="flex items-center space-x-2.5">
  1310. <button id="fw-primary-add-btn" onclick="openCurrentFWModal()" class="text-xs font-semibold px-4 py-2 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20 transition flex items-center gap-1.5">
  1311. <span>+ Add Rule</span>
  1312. </button>
  1313. <button onclick="resetFirewallCounters()" class="text-xs font-medium px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 border border-slate-700 transition" title="Reset all packet & byte counters to zero">
  1314. Reset Counters
  1315. </button>
  1316. </div>
  1317. </div>
  1318. <!-- Sub Tabs: Filter / NAT / Mangle / Address Lists / Connections -->
  1319. <div class="flex border-b border-slate-800 space-x-1 overflow-x-auto">
  1320. <button id="fw-subtab-btn-filter" onclick="switchFWSubTab('filter')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-emerald-500 text-white transition flex items-center gap-2 whitespace-nowrap">
  1321. <span>Filter Rules</span>
  1322. <span id="fw-badge-filter" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1323. </button>
  1324. <button id="fw-subtab-btn-nat" onclick="switchFWSubTab('nat')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1325. <span>NAT</span>
  1326. <span id="fw-badge-nat" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1327. </button>
  1328. <button id="fw-subtab-btn-mangle" onclick="switchFWSubTab('mangle')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1329. <span>Mangle</span>
  1330. <span id="fw-badge-mangle" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1331. </button>
  1332. <button id="fw-subtab-btn-addrlist" onclick="switchFWSubTab('addrlist')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1333. <span>Address Lists</span>
  1334. <span id="fw-badge-addrlist" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1335. </button>
  1336. <button id="fw-subtab-btn-geo" onclick="switchFWSubTab('geo')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1337. <span>Geo-Location</span>
  1338. <span id="fw-badge-geo" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1339. </button>
  1340. <button id="fw-subtab-btn-connections" onclick="switchFWSubTab('connections')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1341. <span>Connections</span>
  1342. <span id="fw-badge-connections" class="px-1.5 py-0.2 rounded text-[10px] bg-emerald-950 text-emerald-400 border border-emerald-800/40">0</span>
  1343. </button>
  1344. </div>
  1345. <!-- ================= TAB 1: FILTER RULES ================= -->
  1346. <div id="fw-subtab-filter" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1347. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1348. <div class="flex items-center gap-3">
  1349. <h3 class="text-sm font-bold text-white">Firewall Filter Rules</h3>
  1350. <span id="filter-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1351. </div>
  1352. <div class="flex items-center gap-2">
  1353. <label class="text-xs text-slate-400 font-sans">Chain:</label>
  1354. <select id="filter-filter-chain" onchange="renderFilterRules()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white font-mono">
  1355. <option value="">All Chains</option>
  1356. <option value="input">input</option>
  1357. <option value="forward">forward</option>
  1358. <option value="output">output</option>
  1359. </select>
  1360. </div>
  1361. </div>
  1362. <div class="overflow-x-auto">
  1363. <table class="w-full text-left text-xs font-mono">
  1364. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1365. <tr>
  1366. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1367. <th class="py-2.5 px-3 w-12 text-center" title="Flags: X=Disabled, C=Comment">Flag</th>
  1368. <th class="py-2.5 px-3">Chain</th>
  1369. <th class="py-2.5 px-3">Src. Address</th>
  1370. <th class="py-2.5 px-3">Dst. Address</th>
  1371. <th class="py-2.5 px-3">Protocol</th>
  1372. <th class="py-2.5 px-3">Ports</th>
  1373. <th class="py-2.5 px-3">In / Out</th>
  1374. <th class="py-2.5 px-3">Action</th>
  1375. <th class="py-2.5 px-3">Packets / Bytes</th>
  1376. <th class="py-2.5 px-3">Comment</th>
  1377. <th class="py-2.5 px-3 text-right font-sans">Order & Actions</th>
  1378. </tr>
  1379. </thead>
  1380. <tbody id="filter-table-body" class="divide-y divide-slate-800/80"></tbody>
  1381. </table>
  1382. </div>
  1383. <div id="filter-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1384. No filter rules found in this chain. Click "+ Add Rule" to create one.
  1385. </div>
  1386. </div>
  1387. <!-- ================= TAB 2: NAT RULES ================= -->
  1388. <div id="fw-subtab-nat" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1389. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1390. <div class="flex items-center gap-3">
  1391. <h3 class="text-sm font-bold text-white">NAT Rules</h3>
  1392. <span id="nat-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1393. </div>
  1394. <div class="flex items-center gap-2">
  1395. <label class="text-xs text-slate-400 font-sans">Chain:</label>
  1396. <select id="nat-filter-chain" onchange="renderNATRules()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white font-mono">
  1397. <option value="">All Chains</option>
  1398. <option value="srcnat">srcnat (SNAT / Masquerade)</option>
  1399. <option value="dstnat">dstnat (Port Forwarding)</option>
  1400. </select>
  1401. </div>
  1402. </div>
  1403. <div class="overflow-x-auto">
  1404. <table class="w-full text-left text-xs font-mono">
  1405. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1406. <tr>
  1407. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1408. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1409. <th class="py-2.5 px-3">Chain</th>
  1410. <th class="py-2.5 px-3">Src. Address</th>
  1411. <th class="py-2.5 px-3">Dst. Address</th>
  1412. <th class="py-2.5 px-3">Proto/Port</th>
  1413. <th class="py-2.5 px-3">Out / In</th>
  1414. <th class="py-2.5 px-3">Action</th>
  1415. <th class="py-2.5 px-3">To Address:Port</th>
  1416. <th class="py-2.5 px-3">Packets / Bytes</th>
  1417. <th class="py-2.5 px-3">Comment</th>
  1418. <th class="py-2.5 px-3 text-right font-sans">Order & Actions</th>
  1419. </tr>
  1420. </thead>
  1421. <tbody id="nat-table-body" class="divide-y divide-slate-800/80"></tbody>
  1422. </table>
  1423. </div>
  1424. <div id="nat-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1425. No NAT rules configured. Click "+ Add Rule" to add masquerade or port forwarding.
  1426. </div>
  1427. </div>
  1428. <!-- ================= TAB 3: MANGLE RULES ================= -->
  1429. <div id="fw-subtab-mangle" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1430. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1431. <div class="flex items-center gap-3">
  1432. <h3 class="text-sm font-bold text-white">Mangle Packet & Connection Marking</h3>
  1433. <span id="mangle-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1434. </div>
  1435. <div class="flex items-center gap-2">
  1436. <label class="text-xs text-slate-400 font-sans">Chain:</label>
  1437. <select id="mangle-filter-chain" onchange="renderMangleRules()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white font-mono">
  1438. <option value="">All Chains</option>
  1439. <option value="prerouting">prerouting</option>
  1440. <option value="forward">forward</option>
  1441. <option value="postrouting">postrouting</option>
  1442. <option value="input">input</option>
  1443. <option value="output">output</option>
  1444. </select>
  1445. </div>
  1446. </div>
  1447. <div class="overflow-x-auto">
  1448. <table class="w-full text-left text-xs font-mono">
  1449. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1450. <tr>
  1451. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1452. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1453. <th class="py-2.5 px-3">Chain</th>
  1454. <th class="py-2.5 px-3">Src. Address</th>
  1455. <th class="py-2.5 px-3">Dst. Address</th>
  1456. <th class="py-2.5 px-3">Action</th>
  1457. <th class="py-2.5 px-3">New Mark / Value</th>
  1458. <th class="py-2.5 px-3 text-center">Pass</th>
  1459. <th class="py-2.5 px-3">Packets / Bytes</th>
  1460. <th class="py-2.5 px-3">Comment</th>
  1461. <th class="py-2.5 px-3 text-right font-sans">Order & Actions</th>
  1462. </tr>
  1463. </thead>
  1464. <tbody id="mangle-table-body" class="divide-y divide-slate-800/80"></tbody>
  1465. </table>
  1466. </div>
  1467. <div id="mangle-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1468. No mangle rules configured. Click "+ Add Rule" to mark connections or routing for Multi-WAN.
  1469. </div>
  1470. </div>
  1471. <!-- ================= TAB 4: ADDRESS LISTS ================= -->
  1472. <div id="fw-subtab-addrlist" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1473. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1474. <div class="flex items-center gap-3">
  1475. <h3 class="text-sm font-bold text-white">Address Lists (ipset)</h3>
  1476. <span id="addrlist-count-badge" class="text-xs font-mono text-slate-400">0 Entries</span>
  1477. </div>
  1478. <div class="flex items-center gap-2">
  1479. <label class="text-xs text-slate-400 font-sans">List:</label>
  1480. <select id="addrlist-filter-name" onchange="renderAddressLists()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white font-mono">
  1481. <option value="">All Lists</option>
  1482. </select>
  1483. </div>
  1484. </div>
  1485. <div class="overflow-x-auto">
  1486. <table class="w-full text-left text-xs font-mono">
  1487. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1488. <tr>
  1489. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1490. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1491. <th class="py-2.5 px-3">List Name</th>
  1492. <th class="py-2.5 px-3">IP Address / CIDR</th>
  1493. <th class="py-2.5 px-3">Comment</th>
  1494. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1495. </tr>
  1496. </thead>
  1497. <tbody id="addrlist-table-body" class="divide-y divide-slate-800/80"></tbody>
  1498. </table>
  1499. </div>
  1500. <div id="addrlist-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1501. No address list entries configured. Click "+ Add Item" to define a group of IPs/subnets.
  1502. </div>
  1503. </div>
  1504. <!-- ================= TAB 5: ACTIVE CONNECTIONS ================= -->
  1505. <div id="fw-subtab-connections" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1506. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1507. <div class="flex items-center gap-3">
  1508. <h3 class="text-sm font-bold text-white">Active Conntrack Connections</h3>
  1509. <span id="conns-count-badge" class="text-xs font-mono bg-emerald-500/10 text-emerald-400 border border-emerald-500/30 px-2 py-0.5 rounded-full">0 Flows</span>
  1510. </div>
  1511. <div class="flex items-center gap-2 flex-wrap">
  1512. <input type="text" id="conns-search-input" oninput="renderConnections()" placeholder="Filter IP, port..." class="bg-slate-800 border border-slate-700 rounded-lg px-3 py-1 text-xs text-white font-mono focus:outline-none focus:border-emerald-500">
  1513. <select id="conns-filter-proto" onchange="renderConnections()" class="bg-slate-800 border border-slate-700 rounded-lg px-2 py-1 text-xs text-white font-mono">
  1514. <option value="">All Proto</option>
  1515. <option value="TCP">TCP</option>
  1516. <option value="UDP">UDP</option>
  1517. <option value="ICMP">ICMP</option>
  1518. </select>
  1519. <button onclick="loadConnections()" class="text-xs text-emerald-400 hover:text-emerald-300 font-semibold px-2 py-1 bg-slate-800 rounded border border-slate-700">Refresh</button>
  1520. </div>
  1521. </div>
  1522. <div class="overflow-x-auto max-h-[550px] overflow-y-auto">
  1523. <table class="w-full text-left text-xs font-mono">
  1524. <thead class="text-slate-400 bg-slate-950/80 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans sticky top-0 z-10 backdrop-blur-sm">
  1525. <tr>
  1526. <th class="py-2.5 px-3">Proto</th>
  1527. <th class="py-2.5 px-3">Source Address</th>
  1528. <th class="py-2.5 px-3">Destination Address</th>
  1529. <th class="py-2.5 px-3">Reply Source</th>
  1530. <th class="py-2.5 px-3">Reply Dest</th>
  1531. <th class="py-2.5 px-3">TCP State</th>
  1532. <th class="py-2.5 px-3">Mark</th>
  1533. <th class="py-2.5 px-3">Timeout</th>
  1534. <th class="py-2.5 px-3 text-right font-sans">Action</th>
  1535. </tr>
  1536. </thead>
  1537. <tbody id="conns-table-body" class="divide-y divide-slate-800/60"></tbody>
  1538. </table>
  1539. </div>
  1540. <div id="conns-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1541. No active connections found matching your search.
  1542. </div>
  1543. </div>
  1544. <!-- ================= TAB 5: GEO-LOCATION ================= -->
  1545. <div id="fw-subtab-geo" class="hidden space-y-4">
  1546. <!-- Geo Header & Scheduler Status -->
  1547. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-4 flex flex-wrap items-center justify-between gap-4">
  1548. <div class="flex items-center space-x-3">
  1549. <div class="p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/20 text-emerald-400">
  1550. <span class="text-xl">🌍</span>
  1551. </div>
  1552. <div>
  1553. <div class="flex items-center gap-2">
  1554. <h3 class="text-sm font-bold text-white">Geo-Location IP Filtering</h3>
  1555. <span id="geo-status-badge" class="px-2 py-0.5 rounded text-[10px] font-mono font-bold bg-emerald-500/20 text-emerald-300 border border-emerald-500/30">Auto-Update ON</span>
  1556. </div>
  1557. <p class="text-xs text-slate-400">Aggregated country CIDR databases loaded into Linux kernel <code class="text-emerald-300">ipset</code>. Usable anywhere in Filter, NAT, and Mangle rules.</p>
  1558. </div>
  1559. </div>
  1560. <!-- Controls -->
  1561. <div class="flex items-center flex-wrap gap-2">
  1562. <div class="flex items-center space-x-1.5 bg-slate-950/60 border border-slate-800 px-3 py-1.5 rounded-lg text-xs font-mono">
  1563. <span class="text-slate-400">Schedule:</span>
  1564. <span id="geo-interval-label" class="font-bold text-white">Every 24h</span>
  1565. </div>
  1566. <button onclick="openGeoIntervalModal()" class="text-xs font-semibold px-3 py-1.5 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 transition">
  1567. ⚙️ Settings
  1568. </button>
  1569. <button id="geo-btn-update-now" onclick="triggerGeoUpdateNow()" class="text-xs font-semibold px-3.5 py-1.5 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20 transition flex items-center gap-1.5">
  1570. <span id="geo-update-spinner" class="hidden animate-spin text-xs">⏳</span>
  1571. <span>🔄 Update Now</span>
  1572. </button>
  1573. </div>
  1574. </div>
  1575. <!-- Stats Bar -->
  1576. <div class="grid grid-cols-2 sm:grid-cols-4 gap-3">
  1577. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl p-3">
  1578. <span class="text-[10px] uppercase font-bold text-slate-500 block">Countries in Rules</span>
  1579. <span id="geo-stat-active-countries" class="text-base font-bold font-mono text-emerald-400">0</span>
  1580. </div>
  1581. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl p-3">
  1582. <span class="text-[10px] uppercase font-bold text-slate-500 block">Total Subnets in Kernel</span>
  1583. <span id="geo-stat-total-subnets" class="text-base font-bold font-mono text-cyan-400">0</span>
  1584. </div>
  1585. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl p-3">
  1586. <span class="text-[10px] uppercase font-bold text-slate-500 block">Last Synced</span>
  1587. <span id="geo-stat-last-sync" class="text-xs font-mono text-slate-300">-</span>
  1588. </div>
  1589. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl p-3">
  1590. <span class="text-[10px] uppercase font-bold text-slate-500 block">Next Scheduled Run</span>
  1591. <span id="geo-stat-next-sync" class="text-xs font-mono text-slate-300">-</span>
  1592. </div>
  1593. </div>
  1594. <!-- Filters & Country Table -->
  1595. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1596. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1597. <div class="flex items-center flex-wrap gap-2">
  1598. <input type="text" id="geo-search-input" oninput="renderGeoCountries()" placeholder="Search country name or code (e.g. Greece, GR, Germany)..." class="bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-xs text-white placeholder-slate-500 focus:outline-none focus:border-emerald-500 w-64">
  1599. <select id="geo-continent-filter" onchange="renderGeoCountries()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1.5 text-xs text-white font-mono">
  1600. <option value="">All Continents</option>
  1601. <option value="Europe">Europe</option>
  1602. <option value="Asia">Asia</option>
  1603. <option value="Americas">Americas</option>
  1604. <option value="Africa">Africa</option>
  1605. <option value="Oceania">Oceania</option>
  1606. </select>
  1607. <label class="flex items-center space-x-1.5 text-xs text-slate-300 cursor-pointer ml-2">
  1608. <input type="checkbox" id="geo-filter-inuse-only" onchange="renderGeoCountries()" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  1609. <span>In Use by Rules only</span>
  1610. </label>
  1611. <label class="flex items-center space-x-1.5 text-xs text-slate-300 cursor-pointer ml-2">
  1612. <input type="checkbox" id="geo-filter-cached-only" onchange="renderGeoCountries()" class="rounded bg-slate-800 border-slate-700 text-cyan-500">
  1613. <span>Cached Only</span>
  1614. </label>
  1615. </div>
  1616. <div class="flex items-center space-x-2">
  1617. <span class="text-xs text-slate-400 font-sans">Quick Filter:</span>
  1618. <button onclick="quickFilterGeo('GR')" class="px-2.5 py-1 text-xs rounded bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 font-mono">🇬🇷 GR</button>
  1619. <button onclick="quickFilterGeo('Europe')" class="px-2.5 py-1 text-xs rounded bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 font-mono">🇪🇺 Europe</button>
  1620. <button onclick="quickFilterGeo('HIGHRISK')" class="px-2.5 py-1 text-xs rounded bg-rose-950/40 hover:bg-rose-900/50 text-rose-300 border border-rose-800/50 font-mono">🚫 High-Risk</button>
  1621. <button onclick="quickFilterGeo('')" class="px-2.5 py-1 text-xs rounded bg-slate-800 hover:bg-slate-700 text-slate-400 border border-slate-700 font-mono">Reset</button>
  1622. </div>
  1623. </div>
  1624. <div class="overflow-x-auto max-h-[600px] overflow-y-auto">
  1625. <table class="w-full text-left text-xs font-mono">
  1626. <thead class="text-slate-400 bg-slate-950/80 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans sticky top-0 z-10 backdrop-blur-sm">
  1627. <tr>
  1628. <th class="py-2.5 px-3 w-16 text-center">Code</th>
  1629. <th class="py-2.5 px-3">Country Name</th>
  1630. <th class="py-2.5 px-3">Continent</th>
  1631. <th class="py-2.5 px-3">Subnets</th>
  1632. <th class="py-2.5 px-3">Kernel IPSet</th>
  1633. <th class="py-2.5 px-3">Rule Usage</th>
  1634. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1635. </tr>
  1636. </thead>
  1637. <tbody id="geo-table-body" class="divide-y divide-slate-800/60"></tbody>
  1638. </table>
  1639. </div>
  1640. <div id="geo-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1641. No countries found matching your search.
  1642. </div>
  1643. </div>
  1644. </div>
  1645. </section>
  1646. <!-- ================= SECTION: ROUTES & POLICY (/ip route & rules) ================= -->
  1647. <section id="section-routes" class="hidden space-y-6">
  1648. <!-- Top Routing Switcher Bar -->
  1649. <div class="flex items-center gap-1.5 p-1 bg-slate-900/90 border border-slate-800 rounded-xl w-fit">
  1650. <button onclick="navigate('routes')" class="px-3.5 py-1.5 text-xs font-bold rounded-lg transition bg-cyan-600/20 text-cyan-300 border border-cyan-500/40 shadow-sm flex items-center gap-2">
  1651. <svg class="w-3.5 h-3.5 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1652. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7" />
  1653. </svg>
  1654. <span>Routes & Policy (/ip route)</span>
  1655. </button>
  1656. <button onclick="navigate('bgp')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1657. <svg class="w-3.5 h-3.5 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1658. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  1659. </svg>
  1660. <span>BGP (/routing bgp)</span>
  1661. </button>
  1662. <button onclick="navigate('ospf')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1663. <svg class="w-3.5 h-3.5 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1664. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
  1665. </svg>
  1666. <span>OSPF (/routing ospf)</span>
  1667. </button>
  1668. <button onclick="navigate('routing-filters')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1669. <svg class="w-3.5 h-3.5 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1670. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" />
  1671. </svg>
  1672. <span>Filters (/routing filter)</span>
  1673. </button>
  1674. </div>
  1675. <div class="bg-gradient-to-r from-cyan-950/40 via-slate-900 to-slate-900 border border-cyan-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  1676. <div>
  1677. <div class="flex items-center gap-2 mb-1">
  1678. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-cyan-500/20 text-cyan-300 border border-cyan-500/30 font-semibold">/ip route</span>
  1679. <h2 class="text-base font-bold text-white">IP Routes & Policy Rules</h2>
  1680. </div>
  1681. <p class="text-xs text-slate-400">Kernel FIB/RIB routing tables, static gateways, multipath uplinks, and policy routing (ip rule / fwmark lookup).</p>
  1682. </div>
  1683. <div class="flex items-center space-x-2.5">
  1684. <button onclick="openAddRouteModal()" class="text-xs font-semibold px-4 py-2 rounded-lg bg-cyan-600 hover:bg-cyan-500 text-white shadow-lg shadow-cyan-500/20 transition">
  1685. + Add Route
  1686. </button>
  1687. <button onclick="openAddPolicyRuleModal()" class="text-xs font-semibold px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-white border border-slate-700 transition">
  1688. + Add Rule
  1689. </button>
  1690. <button onclick="openAddTableModal()" class="text-xs font-semibold px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 border border-slate-700 transition">
  1691. + New Table
  1692. </button>
  1693. </div>
  1694. </div>
  1695. <!-- Sub Tabs: Routes / Policy Rules / Tables -->
  1696. <div class="flex border-b border-slate-800 space-x-1">
  1697. <button id="routes-subtab-btn-routes" onclick="switchRoutesSubTab('routes')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-cyan-500 text-white transition flex items-center gap-2">
  1698. <span>Routes</span>
  1699. <span id="routes-badge-routes" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1700. </button>
  1701. <button id="routes-subtab-btn-rules" onclick="switchRoutesSubTab('rules')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2">
  1702. <span>Policy Rules (/ip route rule)</span>
  1703. <span id="routes-badge-rules" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1704. </button>
  1705. <button id="routes-subtab-btn-tables" onclick="switchRoutesSubTab('tables')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2">
  1706. <span>Routing Tables</span>
  1707. <span id="routes-badge-tables" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1708. </button>
  1709. </div>
  1710. <!-- Sub-Tab 1: Routes Table -->
  1711. <div id="routes-subtab-routes" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1712. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1713. <div class="flex items-center gap-3">
  1714. <h3 class="text-sm font-bold text-white">Active Routing Table (RIB)</h3>
  1715. <span id="routes-count-badge" class="text-xs font-mono text-slate-400">0 Routes</span>
  1716. </div>
  1717. <div class="flex items-center gap-2">
  1718. <label class="text-xs text-slate-400 font-sans">Table Filter:</label>
  1719. <select id="routes-filter-table" onchange="renderRoutesList()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white font-mono">
  1720. <option value="">All Tables</option>
  1721. <option value="main">main</option>
  1722. </select>
  1723. <button onclick="loadRoutes()" class="text-xs text-cyan-400 hover:text-cyan-300 font-semibold px-2 py-1 bg-slate-800 rounded border border-slate-700">Refresh</button>
  1724. </div>
  1725. </div>
  1726. <div class="overflow-x-auto">
  1727. <table class="w-full text-left text-xs font-mono">
  1728. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1729. <tr>
  1730. <th class="py-2.5 px-3 w-16 text-center" title="Flags: D=Dynamic, A=Active, C=Connect, S=Static, X=Disabled">Flags</th>
  1731. <th class="py-2.5 px-3">Dst. Address</th>
  1732. <th class="py-2.5 px-3">Gateway</th>
  1733. <th class="py-2.5 px-3">Distance</th>
  1734. <th class="py-2.5 px-3">Table / Mark</th>
  1735. <th class="py-2.5 px-3">Interface</th>
  1736. <th class="py-2.5 px-3">Comment</th>
  1737. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1738. </tr>
  1739. </thead>
  1740. <tbody id="routes-table-body" class="divide-y divide-slate-800/80"></tbody>
  1741. </table>
  1742. </div>
  1743. <div id="routes-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1744. No routes found.
  1745. </div>
  1746. </div>
  1747. <!-- Sub-Tab 2: Policy Rules (/ip route rule) -->
  1748. <div id="routes-subtab-rules" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1749. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1750. <h3 class="text-sm font-bold text-white">Policy Routing Rules (ip rule)</h3>
  1751. <span id="rules-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1752. </div>
  1753. <div class="overflow-x-auto">
  1754. <table class="w-full text-left text-xs font-mono">
  1755. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1756. <tr>
  1757. <th class="py-2.5 px-3 w-16">Pref</th>
  1758. <th class="py-2.5 px-3">Src. Address</th>
  1759. <th class="py-2.5 px-3">Dst. Address</th>
  1760. <th class="py-2.5 px-3">Routing Mark (fwmark)</th>
  1761. <th class="py-2.5 px-3">Lookup Table</th>
  1762. <th class="py-2.5 px-3">Action</th>
  1763. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1764. </tr>
  1765. </thead>
  1766. <tbody id="rules-table-body" class="divide-y divide-slate-800/80"></tbody>
  1767. </table>
  1768. </div>
  1769. <div id="rules-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1770. No policy rules configured. Click "+ Add Rule" to route traffic based on routing-mark or source IP.
  1771. </div>
  1772. </div>
  1773. <!-- Sub-Tab 3: Routing Tables -->
  1774. <div id="routes-subtab-tables" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1775. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1776. <h3 class="text-sm font-bold text-white">Defined Routing Tables (/etc/iproute2/rt_tables)</h3>
  1777. <span id="tables-count-badge" class="text-xs font-mono text-slate-400">0 Tables</span>
  1778. </div>
  1779. <div class="overflow-x-auto">
  1780. <table class="w-full text-left text-xs font-mono">
  1781. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1782. <tr>
  1783. <th class="py-2.5 px-3 w-20">FIB ID</th>
  1784. <th class="py-2.5 px-3">Table Name</th>
  1785. <th class="py-2.5 px-3">Comment / Purpose</th>
  1786. </tr>
  1787. </thead>
  1788. <tbody id="tables-table-body" class="divide-y divide-slate-800/80"></tbody>
  1789. </table>
  1790. </div>
  1791. </div>
  1792. </section>
  1793. <!-- ================= SECTION: BGP ROUTING (/routing bgp) ================= -->
  1794. <section id="section-bgp" class="hidden space-y-6">
  1795. <!-- Top Routing Switcher Bar -->
  1796. <div class="flex items-center gap-1.5 p-1 bg-slate-900/90 border border-slate-800 rounded-xl w-fit">
  1797. <button onclick="navigate('routes')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1798. <svg class="w-3.5 h-3.5 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1799. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7" />
  1800. </svg>
  1801. <span>Routes & Policy (/ip route)</span>
  1802. </button>
  1803. <button onclick="navigate('bgp')" class="px-3.5 py-1.5 text-xs font-bold rounded-lg transition bg-purple-600/20 text-purple-300 border border-purple-500/40 shadow-sm flex items-center gap-2">
  1804. <svg class="w-3.5 h-3.5 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1805. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  1806. </svg>
  1807. <span>BGP (/routing bgp)</span>
  1808. </button>
  1809. <button onclick="navigate('ospf')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1810. <svg class="w-3.5 h-3.5 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1811. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
  1812. </svg>
  1813. <span>OSPF (/routing ospf)</span>
  1814. </button>
  1815. <button onclick="navigate('routing-filters')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1816. <svg class="w-3.5 h-3.5 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1817. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" />
  1818. </svg>
  1819. <span>Filters (/routing filter)</span>
  1820. </button>
  1821. </div>
  1822. <div class="bg-gradient-to-r from-purple-950/40 via-slate-900 to-slate-900 border border-purple-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  1823. <div>
  1824. <div class="flex items-center gap-2 mb-1">
  1825. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-purple-500/20 text-purple-300 border border-purple-500/30 font-semibold">/routing bgp</span>
  1826. <h2 class="text-base font-bold text-white">BGP Dynamic Routing</h2>
  1827. <span id="bgp-live-status-pill" class="text-[10px] px-2 py-0.5 rounded font-mono bg-slate-800 text-slate-400 border border-slate-700">Checking...</span>
  1828. </div>
  1829. <p class="text-xs text-slate-400">Enterprise FRRouting BGP stack: Autonomous System peering sessions, prefix announcements, and BGP routing table (RIB).</p>
  1830. </div>
  1831. <div class="flex items-center space-x-2 flex-wrap gap-y-2">
  1832. <button onclick="openBgpInstanceModal()" class="text-xs font-semibold px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-purple-300 border border-purple-900/50 transition flex items-center gap-1.5">
  1833. <span>⚙ BGP Settings</span>
  1834. </button>
  1835. <button onclick="openAddBgpPeerModal()" class="text-xs font-semibold px-3 py-2 rounded-lg bg-purple-600 hover:bg-purple-500 text-white shadow-lg shadow-purple-500/20 transition">
  1836. + Add BGP Peer
  1837. </button>
  1838. <button onclick="openAddBgpNetworkModal()" class="text-xs font-semibold px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 border border-slate-700 transition">
  1839. + Add Network
  1840. </button>
  1841. <button onclick="loadDynamicRouting()" class="text-xs text-slate-400 hover:text-white px-2.5 py-2 bg-slate-800 rounded-lg border border-slate-700 transition">
  1842. Refresh
  1843. </button>
  1844. </div>
  1845. </div>
  1846. <!-- BGP Sub-Tabs -->
  1847. <div class="flex border-b border-slate-800 space-x-1 overflow-x-auto">
  1848. <button id="bgp-subtab-btn-bgp-peers" onclick="switchBgpSubTab('bgp-peers')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-purple-500 text-white transition flex items-center gap-2 whitespace-nowrap">
  1849. <span>BGP Peers (/routing bgp connection)</span>
  1850. <span id="dyn-badge-bgp-peers" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1851. </button>
  1852. <button id="bgp-subtab-btn-bgp-nets" onclick="switchBgpSubTab('bgp-nets')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1853. <span>Advertised Networks (/routing bgp network)</span>
  1854. <span id="dyn-badge-bgp-nets" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1855. </button>
  1856. <button id="bgp-subtab-btn-bgp-routes" onclick="switchBgpSubTab('bgp-routes')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1857. <span>BGP Routes (RIB)</span>
  1858. <span id="dyn-badge-bgp-routes" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1859. </button>
  1860. </div>
  1861. <!-- Sub-Tab 1: BGP Peers -->
  1862. <div id="dyn-subtab-bgp-peers" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1863. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1864. <div class="flex items-center gap-3">
  1865. <h3 class="text-sm font-bold text-white">Configured BGP Peers</h3>
  1866. <span id="bgp-peers-count-badge" class="text-xs font-mono text-slate-400">0 Peers</span>
  1867. <span id="bgp-live-status-pill" class="text-[10px] px-2 py-0.5 rounded font-mono bg-slate-800 text-slate-400 border border-slate-700">Checking...</span>
  1868. </div>
  1869. <div class="flex items-center gap-2">
  1870. <button onclick="loadDynamicRouting()" class="text-xs text-purple-400 hover:text-purple-300 font-semibold px-2.5 py-1 bg-slate-800 rounded border border-slate-700">Refresh</button>
  1871. </div>
  1872. </div>
  1873. <div class="overflow-x-auto">
  1874. <table class="w-full text-left text-xs font-mono">
  1875. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1876. <tr>
  1877. <th class="py-2.5 px-3 w-16 text-center">Flags</th>
  1878. <th class="py-2.5 px-3">Name</th>
  1879. <th class="py-2.5 px-3">Remote Address</th>
  1880. <th class="py-2.5 px-3">Remote AS</th>
  1881. <th class="py-2.5 px-3">State</th>
  1882. <th class="py-2.5 px-3">Uptime</th>
  1883. <th class="py-2.5 px-3">Prefixes (RX/TX)</th>
  1884. <th class="py-2.5 px-3">Routing Filters</th>
  1885. <th class="py-2.5 px-3">Comment</th>
  1886. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1887. </tr>
  1888. </thead>
  1889. <tbody id="bgp-peers-table-body" class="divide-y divide-slate-800/80"></tbody>
  1890. </table>
  1891. </div>
  1892. <div id="bgp-peers-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1893. No BGP peers configured. Click "+ Add BGP Peer" to establish an eBGP or iBGP peering session.
  1894. </div>
  1895. </div>
  1896. <!-- Sub-Tab 2: BGP Networks -->
  1897. <div id="dyn-subtab-bgp-nets" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1898. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1899. <div class="flex items-center gap-3">
  1900. <h3 class="text-sm font-bold text-white">Advertised BGP Networks (/routing bgp network)</h3>
  1901. <span id="bgp-nets-count-badge" class="text-xs font-mono text-slate-400">0 Networks</span>
  1902. </div>
  1903. <button onclick="openAddBgpNetworkModal()" class="text-xs font-semibold px-3 py-1.5 rounded-lg bg-purple-600 hover:bg-purple-500 text-white transition">
  1904. + Add Network
  1905. </button>
  1906. </div>
  1907. <div class="overflow-x-auto">
  1908. <table class="w-full text-left text-xs font-mono">
  1909. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1910. <tr>
  1911. <th class="py-2.5 px-3">Network (CIDR)</th>
  1912. <th class="py-2.5 px-3">Status</th>
  1913. <th class="py-2.5 px-3">Comment</th>
  1914. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1915. </tr>
  1916. </thead>
  1917. <tbody id="bgp-nets-table-body" class="divide-y divide-slate-800/80"></tbody>
  1918. </table>
  1919. </div>
  1920. <div id="bgp-nets-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1921. No networks advertised. Click "+ Add Network" to announce your IP prefixes to BGP peers.
  1922. </div>
  1923. </div>
  1924. <!-- Sub-Tab 3: BGP Routes -->
  1925. <div id="dyn-subtab-bgp-routes" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1926. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1927. <h3 class="text-sm font-bold text-white">BGP Routing Information Base (show ip bgp)</h3>
  1928. <span id="bgp-routes-count-badge" class="text-xs font-mono text-slate-400">0 Routes</span>
  1929. </div>
  1930. <div class="overflow-x-auto">
  1931. <table class="w-full text-left text-xs font-mono">
  1932. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1933. <tr>
  1934. <th class="py-2.5 px-3">Prefix</th>
  1935. <th class="py-2.5 px-3">Next Hop</th>
  1936. <th class="py-2.5 px-3">Metric</th>
  1937. <th class="py-2.5 px-3">Weight</th>
  1938. <th class="py-2.5 px-3">AS Path</th>
  1939. <th class="py-2.5 px-3">Origin</th>
  1940. </tr>
  1941. </thead>
  1942. <tbody id="bgp-routes-table-body" class="divide-y divide-slate-800/80"></tbody>
  1943. </table>
  1944. </div>
  1945. <div id="bgp-routes-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1946. No active routes in BGP table. Check peer connections and ensure BGP is enabled.
  1947. </div>
  1948. </div>
  1949. </section>
  1950. <!-- ================= SECTION: OSPF ROUTING (/routing ospf) ================= -->
  1951. <section id="section-ospf" class="hidden space-y-6">
  1952. <!-- Top Routing Switcher Bar -->
  1953. <div class="flex items-center gap-1.5 p-1 bg-slate-900/90 border border-slate-800 rounded-xl w-fit">
  1954. <button onclick="navigate('routes')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1955. <svg class="w-3.5 h-3.5 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1956. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7" />
  1957. </svg>
  1958. <span>Routes & Policy (/ip route)</span>
  1959. </button>
  1960. <button onclick="navigate('bgp')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1961. <svg class="w-3.5 h-3.5 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1962. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  1963. </svg>
  1964. <span>BGP (/routing bgp)</span>
  1965. </button>
  1966. <button onclick="navigate('ospf')" class="px-3.5 py-1.5 text-xs font-bold rounded-lg transition bg-indigo-600/20 text-indigo-300 border border-indigo-500/40 shadow-sm flex items-center gap-2">
  1967. <svg class="w-3.5 h-3.5 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1968. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
  1969. </svg>
  1970. <span>OSPF (/routing ospf)</span>
  1971. </button>
  1972. <button onclick="navigate('routing-filters')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1973. <svg class="w-3.5 h-3.5 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1974. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" />
  1975. </svg>
  1976. <span>Filters (/routing filter)</span>
  1977. </button>
  1978. </div>
  1979. <div class="bg-gradient-to-r from-indigo-950/40 via-slate-900 to-slate-900 border border-indigo-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  1980. <div>
  1981. <div class="flex items-center gap-2 mb-1">
  1982. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-indigo-500/20 text-indigo-300 border border-indigo-500/30 font-semibold">/routing ospf</span>
  1983. <h2 class="text-base font-bold text-white">OSPF Dynamic Routing</h2>
  1984. <span id="ospf-live-status-pill" class="text-[10px] px-2 py-0.5 rounded font-mono bg-slate-800 text-slate-400 border border-slate-700">Checking...</span>
  1985. </div>
  1986. <p class="text-xs text-slate-400">Enterprise FRRouting OSPFv2 stack: Link-state interior gateway routing, multi-area topologies, and neighbor adjacencies.</p>
  1987. </div>
  1988. <div class="flex items-center space-x-2 flex-wrap gap-y-2">
  1989. <button onclick="openOspfInstanceModal()" class="text-xs font-semibold px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-indigo-300 border border-indigo-900/50 transition flex items-center gap-1.5">
  1990. <span>⚙ OSPF Settings</span>
  1991. </button>
  1992. <button onclick="openAddOspfInterfaceModal()" class="text-xs font-semibold px-3 py-2 rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white shadow-lg shadow-indigo-500/20 transition">
  1993. + Add OSPF Interface
  1994. </button>
  1995. <button onclick="openAddOspfAreaModal()" class="text-xs font-semibold px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 border border-slate-700 transition">
  1996. + Add Area
  1997. </button>
  1998. <button onclick="loadDynamicRouting()" class="text-xs text-slate-400 hover:text-white px-2.5 py-2 bg-slate-800 rounded-lg border border-slate-700 transition">
  1999. Refresh
  2000. </button>
  2001. </div>
  2002. </div>
  2003. <!-- OSPF Sub-Tabs -->
  2004. <div class="flex border-b border-slate-800 space-x-1 overflow-x-auto">
  2005. <button id="ospf-subtab-btn-ospf-ifaces" onclick="switchOspfSubTab('ospf-ifaces')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-indigo-500 text-white transition flex items-center gap-2 whitespace-nowrap">
  2006. <span>OSPF Interfaces</span>
  2007. <span id="dyn-badge-ospf-ifaces" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  2008. </button>
  2009. <button id="ospf-subtab-btn-ospf-areas" onclick="switchOspfSubTab('ospf-areas')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  2010. <span>OSPF Areas</span>
  2011. <span id="dyn-badge-ospf-areas" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  2012. </button>
  2013. <button id="ospf-subtab-btn-ospf-nbrs" onclick="switchOspfSubTab('ospf-nbrs')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  2014. <span>OSPF Neighbors</span>
  2015. <span id="dyn-badge-ospf-nbrs" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  2016. </button>
  2017. <button id="ospf-subtab-btn-ospf-routes" onclick="switchOspfSubTab('ospf-routes')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  2018. <span>OSPF Routes</span>
  2019. <span id="dyn-badge-ospf-routes" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  2020. </button>
  2021. </div>
  2022. <!-- Sub-Tab 4: OSPF Interfaces -->
  2023. <div id="dyn-subtab-ospf-ifaces" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  2024. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  2025. <div class="flex items-center gap-3">
  2026. <h3 class="text-sm font-bold text-white">OSPF Interface Templates (/routing ospf interface-template)</h3>
  2027. <span id="ospf-ifaces-count-badge" class="text-xs font-mono text-slate-400">0 Interfaces</span>
  2028. <span id="ospf-live-status-pill" class="text-[10px] px-2 py-0.5 rounded font-mono bg-slate-800 text-slate-400 border border-slate-700">Checking...</span>
  2029. </div>
  2030. <button onclick="openAddOspfInterfaceModal()" class="text-xs font-semibold px-3 py-1.5 rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white transition">
  2031. + Add Interface
  2032. </button>
  2033. </div>
  2034. <div class="overflow-x-auto">
  2035. <table class="w-full text-left text-xs font-mono">
  2036. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  2037. <tr>
  2038. <th class="py-2.5 px-3 w-16 text-center">Flags</th>
  2039. <th class="py-2.5 px-3">Network (CIDR)</th>
  2040. <th class="py-2.5 px-3">Area</th>
  2041. <th class="py-2.5 px-3">Interface</th>
  2042. <th class="py-2.5 px-3">Cost</th>
  2043. <th class="py-2.5 px-3">Priority</th>
  2044. <th class="py-2.5 px-3">Timers (H/D)</th>
  2045. <th class="py-2.5 px-3">Auth</th>
  2046. <th class="py-2.5 px-3">Comment</th>
  2047. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  2048. </tr>
  2049. </thead>
  2050. <tbody id="ospf-ifaces-table-body" class="divide-y divide-slate-800/80"></tbody>
  2051. </table>
  2052. </div>
  2053. <div id="ospf-ifaces-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  2054. No OSPF interfaces configured. Click "+ Add OSPF Interface" to enable OSPF on local subnets.
  2055. </div>
  2056. </div>
  2057. <!-- Sub-Tab 5: OSPF Areas -->
  2058. <div id="dyn-subtab-ospf-areas" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  2059. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  2060. <div class="flex items-center gap-3">
  2061. <h3 class="text-sm font-bold text-white">OSPF Areas (/routing ospf area)</h3>
  2062. <span id="ospf-areas-count-badge" class="text-xs font-mono text-slate-400">0 Areas</span>
  2063. </div>
  2064. <button onclick="openAddOspfAreaModal()" class="text-xs font-semibold px-3 py-1.5 rounded-lg bg-indigo-600 hover:bg-indigo-500 text-white transition">
  2065. + Add Area
  2066. </button>
  2067. </div>
  2068. <div class="overflow-x-auto">
  2069. <table class="w-full text-left text-xs font-mono">
  2070. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  2071. <tr>
  2072. <th class="py-2.5 px-3">Name</th>
  2073. <th class="py-2.5 px-3">Area ID</th>
  2074. <th class="py-2.5 px-3">Type</th>
  2075. <th class="py-2.5 px-3">Comment</th>
  2076. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  2077. </tr>
  2078. </thead>
  2079. <tbody id="ospf-areas-table-body" class="divide-y divide-slate-800/80"></tbody>
  2080. </table>
  2081. </div>
  2082. </div>
  2083. <!-- Sub-Tab 6: OSPF Neighbors -->
  2084. <div id="dyn-subtab-ospf-nbrs" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  2085. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  2086. <h3 class="text-sm font-bold text-white">Live OSPF Neighbors (show ip ospf neighbor)</h3>
  2087. <span id="ospf-nbrs-count-badge" class="text-xs font-mono text-slate-400">0 Neighbors</span>
  2088. </div>
  2089. <div class="overflow-x-auto">
  2090. <table class="w-full text-left text-xs font-mono">
  2091. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  2092. <tr>
  2093. <th class="py-2.5 px-3">Neighbor ID</th>
  2094. <th class="py-2.5 px-3">IP Address</th>
  2095. <th class="py-2.5 px-3">Interface</th>
  2096. <th class="py-2.5 px-3">Area</th>
  2097. <th class="py-2.5 px-3">State</th>
  2098. <th class="py-2.5 px-3">Dead Timer</th>
  2099. </tr>
  2100. </thead>
  2101. <tbody id="ospf-nbrs-table-body" class="divide-y divide-slate-800/80"></tbody>
  2102. </table>
  2103. </div>
  2104. <div id="ospf-nbrs-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  2105. No active OSPF neighbors discovered. Ensure neighbors are in the same subnet and hello/dead timers match.
  2106. </div>
  2107. </div>
  2108. <!-- Sub-Tab 7: OSPF Routes -->
  2109. <div id="dyn-subtab-ospf-routes" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  2110. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  2111. <h3 class="text-sm font-bold text-white">OSPF Routing Table (show ip ospf route)</h3>
  2112. <span id="ospf-routes-count-badge" class="text-xs font-mono text-slate-400">0 Routes</span>
  2113. </div>
  2114. <div class="overflow-x-auto">
  2115. <table class="w-full text-left text-xs font-mono">
  2116. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  2117. <tr>
  2118. <th class="py-2.5 px-3">Prefix</th>
  2119. <th class="py-2.5 px-3">Type</th>
  2120. <th class="py-2.5 px-3">Cost</th>
  2121. <th class="py-2.5 px-3">Area</th>
  2122. <th class="py-2.5 px-3">Next Hop / Dev</th>
  2123. </tr>
  2124. </thead>
  2125. <tbody id="ospf-routes-table-body" class="divide-y divide-slate-800/80"></tbody>
  2126. </table>
  2127. </div>
  2128. <div id="ospf-routes-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  2129. No OSPF routes calculated.
  2130. </div>
  2131. </div>
  2132. </section>
  2133. <!-- ================= SECTION: ROUTING FILTERS (/routing filter) ================= -->
  2134. <section id="section-routing-filters" class="hidden space-y-6">
  2135. <!-- Top Routing Switcher Bar -->
  2136. <div class="flex items-center gap-1.5 p-1 bg-slate-900/90 border border-slate-800 rounded-xl w-fit">
  2137. <button onclick="navigate('routes')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  2138. <svg class="w-3.5 h-3.5 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  2139. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7" />
  2140. </svg>
  2141. <span>Routes & Policy (/ip route)</span>
  2142. </button>
  2143. <button onclick="navigate('bgp')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  2144. <svg class="w-3.5 h-3.5 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  2145. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  2146. </svg>
  2147. <span>BGP (/routing bgp)</span>
  2148. </button>
  2149. <button onclick="navigate('ospf')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  2150. <svg class="w-3.5 h-3.5 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  2151. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
  2152. </svg>
  2153. <span>OSPF (/routing ospf)</span>
  2154. </button>
  2155. <button onclick="navigate('routing-filters')" class="px-3.5 py-1.5 text-xs font-bold rounded-lg transition bg-emerald-600/20 text-emerald-300 border border-emerald-500/40 shadow-sm flex items-center gap-2">
  2156. <svg class="w-3.5 h-3.5 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  2157. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z" />
  2158. </svg>
  2159. <span>Filters (/routing filter)</span>
  2160. </button>
  2161. </div>
  2162. <!-- Top Banner -->
  2163. <div class="bg-gradient-to-r from-emerald-950/40 via-slate-900 to-slate-900 border border-emerald-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  2164. <div>
  2165. <div class="flex items-center gap-2 mb-1">
  2166. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-emerald-500/20 text-emerald-300 border border-emerald-500/30 font-semibold">/routing filter</span>
  2167. <h2 class="text-base font-bold text-white">Routing Filters & Policy Maps</h2>
  2168. </div>
  2169. <p class="text-xs text-slate-400">RouterOS-style filter chains (in-filter / out-filter), prefix-lists, community matching, and BGP attribute modifications</p>
  2170. </div>
  2171. <div class="flex items-center gap-2.5">
  2172. <div class="flex items-center gap-2">
  2173. <label class="text-[11px] text-slate-400 font-medium">Chain:</label>
  2174. <select id="routing-filter-chain-select" onchange="filterRoutingFiltersByChain(this.value)" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1.5 text-xs text-white font-mono">
  2175. <option value="all">All Chains</option>
  2176. </select>
  2177. </div>
  2178. <button onclick="openAddRoutingFilterModal()" class="px-3.5 py-1.5 rounded-lg text-xs font-semibold bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20 transition flex items-center gap-1.5">
  2179. <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  2180. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
  2181. </svg>
  2182. <span>+ Add Filter Rule</span>
  2183. </button>
  2184. <button onclick="loadDynamicRouting(true)" class="px-3 py-1.5 rounded-lg text-xs font-medium bg-slate-800 hover:bg-slate-700 text-slate-300 border border-slate-700 transition" title="Refresh routing telemetry">
  2185. ↻
  2186. </button>
  2187. </div>
  2188. </div>
  2189. <!-- Filter Rules Table -->
  2190. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  2191. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  2192. <div class="flex items-center gap-2">
  2193. <h3 class="text-sm font-bold text-white">Filter Rules</h3>
  2194. <span id="routing-filters-count-badge" class="px-2 py-0.5 rounded text-[10px] font-mono bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 font-semibold">0 Rules</span>
  2195. </div>
  2196. <span class="text-xs text-slate-500 font-sans">Evaluated sequentially by order</span>
  2197. </div>
  2198. <div class="overflow-x-auto">
  2199. <table class="w-full text-left text-xs font-mono">
  2200. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  2201. <tr>
  2202. <th class="py-2.5 px-3 text-center w-12">Flags</th>
  2203. <th class="py-2.5 px-3 w-16">#</th>
  2204. <th class="py-2.5 px-3">Chain</th>
  2205. <th class="py-2.5 px-3">Action</th>
  2206. <th class="py-2.5 px-3">Match Prefix / Length</th>
  2207. <th class="py-2.5 px-3">Match AS-Path / Community</th>
  2208. <th class="py-2.5 px-3">Set Modifications</th>
  2209. <th class="py-2.5 px-3">Comment</th>
  2210. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  2211. </tr>
  2212. </thead>
  2213. <tbody id="routing-filters-table-body" class="divide-y divide-slate-800/80"></tbody>
  2214. </table>
  2215. </div>
  2216. <div id="routing-filters-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  2217. No routing filter rules configured. Click "+ Add Filter Rule" to create a filter chain.
  2218. </div>
  2219. </div>
  2220. </section>
  2221. <!-- ================= SECTION: DEBIAN CONFIG PERSISTENCE ================= -->
  2222. <section id="section-persistence" class="hidden space-y-6">
  2223. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  2224. <div class="flex flex-wrap items-center justify-between gap-4 mb-4">
  2225. <div>
  2226. <h3 class="text-sm font-bold text-white flex items-center gap-2">
  2227. <span>Debian /etc/network/interfaces.d/ Persistence</span>
  2228. <span class="text-[10px] bg-brand-500/20 text-brand-400 px-2 py-0.5 rounded border border-brand-500/30">Debian Native</span>
  2229. </h3>
  2230. <p class="text-xs text-slate-400 mt-1">Changes saved to <code class="text-brand-400">/etc/network/interfaces.d/vlans.cfg</code> survive container reboots.</p>
  2231. </div>
  2232. <div class="flex items-center space-x-3">
  2233. <button onclick="loadDebianConfig()" class="text-xs bg-slate-800 hover:bg-slate-700 text-slate-300 px-3 py-2 rounded-lg border border-slate-700 transition">Re-generate Preview</button>
  2234. <button onclick="saveDebianConfig()" class="flex items-center space-x-2 bg-brand-600 hover:bg-brand-500 text-white font-medium text-xs px-4 py-2 rounded-lg shadow-lg shadow-brand-500/20 transition">
  2235. <span>Save to Debian Config</span>
  2236. </button>
  2237. </div>
  2238. </div>
  2239. <div class="relative">
  2240. <pre id="debian-config-view" class="bg-slate-950 p-4 rounded-lg font-mono text-xs text-slate-300 overflow-x-auto border border-slate-800 max-h-96 leading-relaxed">Loading config preview...</pre>
  2241. </div>
  2242. </div>
  2243. </section>
  2244. </main>
  2245. </div>
  2246. </div>
  2247. <!-- ================= MODAL: CREATE VLAN ================= -->
  2248. <div id="vlan-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  2249. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2250. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2251. <h3 class="text-sm font-bold text-white">Create New VLAN Interface</h3>
  2252. <button onclick="closeVlanModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2253. </div>
  2254. <form id="vlan-form" onsubmit="submitCreateVlan(event)" class="p-6 space-y-4">
  2255. <div>
  2256. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Parent Interface *</label>
  2257. <select id="vlan-parent" onchange="autoSuggestVlanName()" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white focus:outline-none focus:border-cyan-500 font-mono"></select>
  2258. </div>
  2259. <div class="grid grid-cols-2 gap-4">
  2260. <div>
  2261. <label class="block text-xs font-semibold text-slate-300 mb-1.5">VLAN ID (1-4094) *</label>
  2262. <input type="number" id="vlan-id" min="1" max="4094" placeholder="10" required oninput="autoSuggestVlanName()" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2263. </div>
  2264. <div>
  2265. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Interface Name</label>
  2266. <input type="text" id="vlan-name" placeholder="eth0.10" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2267. </div>
  2268. </div>
  2269. <div>
  2270. <div class="flex items-center justify-between mb-1.5">
  2271. <label class="text-xs font-semibold text-slate-300">Router IP Address & CIDR</label>
  2272. <div class="flex space-x-1">
  2273. <button type="button" onclick="setSubnetPreset('/24')" class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded">/24</button>
  2274. <button type="button" onclick="setSubnetPreset('/23')" class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded">/23</button>
  2275. <button type="button" onclick="setSubnetPreset('/16')" class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded">/16</button>
  2276. </div>
  2277. </div>
  2278. <input type="text" id="vlan-ip" placeholder="192.168.10.1/24" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2279. </div>
  2280. <div class="grid grid-cols-2 gap-4">
  2281. <div>
  2282. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Role Tag</label>
  2283. <select id="vlan-role" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white">
  2284. <option value="LAN">LAN</option>
  2285. <option value="GUEST">Guest Network</option>
  2286. <option value="IOT">IoT / Smart Home</option>
  2287. <option value="DMZ">DMZ / Isolated</option>
  2288. <option value="MGMT">Management</option>
  2289. <option value="WAN">WAN / Uplink</option>
  2290. </select>
  2291. </div>
  2292. <div>
  2293. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Description / Alias</label>
  2294. <input type="text" id="vlan-desc" placeholder="Guest WiFi Subnet" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white">
  2295. </div>
  2296. </div>
  2297. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2298. <button type="button" onclick="closeVlanModal()" class="px-4 py-2 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800">Cancel</button>
  2299. <button type="submit" id="vlan-submit-btn" class="px-5 py-2 rounded-lg text-xs font-semibold bg-gradient-to-r from-brand-600 to-cyan-600 text-white">Create VLAN</button>
  2300. </div>
  2301. </form>
  2302. </div>
  2303. </div>
  2304. <!-- ================= MODAL: EDIT INTERFACE ================= -->
  2305. <div id="iface-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  2306. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2307. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2308. <div>
  2309. <h3 class="text-sm font-bold text-white flex items-center gap-2">
  2310. <span id="modal-iface-name">eth0</span>
  2311. <span id="modal-iface-badge" class="text-[10px] font-mono px-2 py-0.5 rounded bg-slate-800 text-slate-300">Ethernet</span>
  2312. </h3>
  2313. </div>
  2314. <button onclick="closeIfaceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2315. </div>
  2316. <div class="p-6 space-y-5">
  2317. <div class="grid grid-cols-2 gap-4 p-3 bg-slate-950/60 rounded-xl border border-slate-800/80">
  2318. <div>
  2319. <span class="block text-[11px] text-slate-400 mb-1">Administrative Link</span>
  2320. <div class="flex items-center space-x-2">
  2321. <button id="modal-btn-up" onclick="setIfaceState(currentModalIface, 'up')" class="px-3 py-1 rounded text-xs font-semibold bg-emerald-600/30 text-emerald-400 border border-emerald-500/40">UP</button>
  2322. <button id="modal-btn-down" onclick="setIfaceState(currentModalIface, 'down')" class="px-3 py-1 rounded text-xs font-semibold bg-slate-800 text-slate-400 hover:bg-rose-600/30 hover:text-rose-400">DOWN</button>
  2323. </div>
  2324. </div>
  2325. <div>
  2326. <span class="block text-[11px] text-slate-400 mb-1">MTU Size</span>
  2327. <div class="flex items-center space-x-2">
  2328. <input type="number" id="modal-iface-mtu" min="68" max="9000" class="w-24 bg-slate-800 border border-slate-700 rounded px-2 py-1 text-xs text-white font-mono">
  2329. <button onclick="applyMTU()" class="text-xs bg-slate-800 hover:bg-slate-700 text-white px-2.5 py-1 rounded border border-slate-700">Set</button>
  2330. </div>
  2331. </div>
  2332. </div>
  2333. <div>
  2334. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Assigned IP Addresses</label>
  2335. <div id="modal-ip-list" class="space-y-1.5 mb-3 font-mono text-xs"></div>
  2336. <div class="flex space-x-2">
  2337. <input type="text" id="modal-new-ip" placeholder="192.168.100.1/24" class="flex-1 bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2338. <button onclick="addInterfaceIP()" class="bg-brand-600 hover:bg-brand-500 text-white px-4 py-2 rounded-lg text-xs font-semibold">+ Add IP</button>
  2339. </div>
  2340. </div>
  2341. <div class="grid grid-cols-2 gap-4">
  2342. <div>
  2343. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Role Tag</label>
  2344. <select id="modal-iface-role" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white">
  2345. <option value="WAN">WAN / Uplink</option>
  2346. <option value="LAN">LAN</option>
  2347. <option value="DMZ">DMZ</option>
  2348. <option value="GUEST">Guest</option>
  2349. <option value="IOT">IoT</option>
  2350. <option value="MGMT">Management</option>
  2351. </select>
  2352. </div>
  2353. <div>
  2354. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Description</label>
  2355. <input type="text" id="modal-iface-desc" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white">
  2356. </div>
  2357. </div>
  2358. <div class="pt-4 border-t border-slate-800 flex justify-between items-center">
  2359. <button id="modal-delete-vlan-btn" onclick="confirmDeleteVlan(currentModalIface)" class="hidden text-xs text-rose-400 hover:text-rose-300">Delete VLAN</button>
  2360. <div class="flex space-x-3">
  2361. <button onclick="closeIfaceModal()" class="px-4 py-2 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800">Close</button>
  2362. <button onclick="saveInterfaceMetadata()" class="px-5 py-2 rounded-lg text-xs font-semibold bg-brand-600 hover:bg-brand-500 text-white">Save Changes</button>
  2363. </div>
  2364. </div>
  2365. </div>
  2366. </div>
  2367. </div>
  2368. <!-- ================= MODAL: PPPoE CLIENT ================= -->
  2369. <div id="pppoe-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  2370. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2371. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2372. <h3 id="pppoe-modal-title" class="text-sm font-bold text-white">Add PPPoE Client Interface</h3>
  2373. <button onclick="closePPPoEModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2374. </div>
  2375. <form onsubmit="submitSavePPPoE(event)" class="p-6 space-y-4">
  2376. <input type="hidden" id="pppoe-modal-edit-orig">
  2377. <div class="grid grid-cols-2 gap-4">
  2378. <div>
  2379. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Name *</label>
  2380. <input type="text" id="pppoe-modal-name" placeholder="pppoe-out1" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-blue-500">
  2381. </div>
  2382. <div>
  2383. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Interface *</label>
  2384. <select id="pppoe-modal-iface" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-blue-500"></select>
  2385. </div>
  2386. </div>
  2387. <div class="grid grid-cols-2 gap-4">
  2388. <div>
  2389. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Username *</label>
  2390. <input type="text" id="pppoe-modal-user" placeholder="user@isp" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-blue-500">
  2391. </div>
  2392. <div>
  2393. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Password *</label>
  2394. <input type="password" id="pppoe-modal-pass" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-blue-500">
  2395. </div>
  2396. </div>
  2397. <div class="grid grid-cols-2 gap-4">
  2398. <div>
  2399. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Service Name (Optional)</label>
  2400. <input type="text" id="pppoe-modal-service" placeholder="ISP Service" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white">
  2401. </div>
  2402. <div>
  2403. <label class="block text-xs font-semibold text-slate-300 mb-1.5">MTU</label>
  2404. <input type="number" id="pppoe-modal-mtu" value="1492" min="576" max="1500" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2405. </div>
  2406. </div>
  2407. <div class="grid grid-cols-3 gap-2 pt-2 border-t border-slate-800/80">
  2408. <label class="flex items-center space-x-2 cursor-pointer">
  2409. <input type="checkbox" id="pppoe-modal-defroute" checked class="rounded bg-slate-800 border-slate-700 text-blue-500">
  2410. <span class="text-xs text-slate-300 font-medium">Default Route</span>
  2411. </label>
  2412. <label class="flex items-center space-x-2 cursor-pointer">
  2413. <input type="checkbox" id="pppoe-modal-reconnect" checked class="rounded bg-slate-800 border-slate-700 text-blue-500">
  2414. <span class="text-xs text-slate-300 font-medium">Auto-Reconnect</span>
  2415. </label>
  2416. <label class="flex items-center space-x-2 cursor-pointer">
  2417. <input type="checkbox" id="pppoe-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2418. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2419. </label>
  2420. </div>
  2421. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2422. <button type="button" onclick="closePPPoEModal()" class="px-4 py-2 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800">Cancel</button>
  2423. <button type="submit" class="px-5 py-2 rounded-lg text-xs font-semibold bg-blue-600 hover:bg-blue-500 text-white shadow-lg shadow-blue-500/20">Save PPPoE</button>
  2424. </div>
  2425. </form>
  2426. </div>
  2427. </div>
  2428. <!-- ================= MODAL: WIREGUARD INTERFACE ================= -->
  2429. <div id="wg-iface-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  2430. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2431. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2432. <h3 id="wg-iface-modal-title" class="text-sm font-bold text-white">Add WireGuard Interface</h3>
  2433. <button onclick="closeAddWGInterfaceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2434. </div>
  2435. <form onsubmit="submitSaveWGInterface(event)" class="p-6 space-y-4">
  2436. <input type="hidden" id="wg-iface-modal-edit-orig">
  2437. <div class="grid grid-cols-2 gap-4">
  2438. <div>
  2439. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Interface Name *</label>
  2440. <input type="text" id="wg-iface-modal-name" placeholder="wg0" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-rose-500">
  2441. </div>
  2442. <div>
  2443. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Listen Port *</label>
  2444. <input type="number" id="wg-iface-modal-port" value="51820" min="1" max="65535" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-rose-500">
  2445. </div>
  2446. </div>
  2447. <div class="grid grid-cols-2 gap-4">
  2448. <div>
  2449. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Tunnel IP (CIDR) *</label>
  2450. <input type="text" id="wg-iface-modal-addr" placeholder="10.10.0.1/24" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-rose-500">
  2451. </div>
  2452. <div>
  2453. <label class="block text-xs font-semibold text-slate-300 mb-1.5">MTU</label>
  2454. <input type="number" id="wg-iface-modal-mtu" value="1420" min="1280" max="1500" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2455. </div>
  2456. </div>
  2457. <div>
  2458. <div class="flex items-center justify-between mb-1.5">
  2459. <label class="text-xs font-semibold text-slate-300">Public Key</label>
  2460. <button type="button" onclick="generateWGInterfaceKeys()" class="text-[10px] text-cyan-400 hover:text-cyan-300 font-semibold">Generate New Keypair</button>
  2461. </div>
  2462. <input type="text" id="wg-iface-modal-pubkey" readonly class="w-full bg-slate-950 border border-slate-800 rounded-lg px-3 py-2 text-xs text-slate-300 font-mono">
  2463. </div>
  2464. <div>
  2465. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Private Key (Secret) *</label>
  2466. <input type="password" id="wg-iface-modal-privkey" required class="w-full bg-slate-950 border border-slate-800 rounded-lg px-3 py-2 text-xs text-slate-300 font-mono focus:outline-none focus:border-rose-500">
  2467. </div>
  2468. <div class="pt-2">
  2469. <label class="flex items-center space-x-2 cursor-pointer">
  2470. <input type="checkbox" id="wg-iface-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2471. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2472. </label>
  2473. </div>
  2474. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2475. <button type="button" onclick="closeAddWGInterfaceModal()" class="px-4 py-2 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800">Cancel</button>
  2476. <button type="submit" class="px-5 py-2 rounded-lg text-xs font-semibold bg-rose-600 hover:bg-rose-500 text-white shadow-lg shadow-rose-500/20">Save Interface</button>
  2477. </div>
  2478. </form>
  2479. </div>
  2480. </div>
  2481. <!-- ================= MODAL: ADD WIREGUARD PEER ================= -->
  2482. <div id="wg-peer-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  2483. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2484. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2485. <h3 id="wg-peer-modal-title" class="text-sm font-bold text-white">Add WireGuard Peer</h3>
  2486. <button onclick="closeAddWGPeerModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2487. </div>
  2488. <form onsubmit="submitSaveWGPeer(event)" class="p-6 space-y-4">
  2489. <div class="grid grid-cols-2 gap-4">
  2490. <div>
  2491. <label class="block text-xs font-semibold text-slate-300 mb-1.5">WireGuard Interface *</label>
  2492. <select id="wg-peer-modal-iface" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-rose-500"></select>
  2493. </div>
  2494. <div>
  2495. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Peer Name / Alias *</label>
  2496. <input type="text" id="wg-peer-modal-name" placeholder="Laptop, iPhone, Branch" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white">
  2497. </div>
  2498. </div>
  2499. <div>
  2500. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Peer Public Key *</label>
  2501. <input type="text" id="wg-peer-modal-pubkey" placeholder="Base64 44-character public key" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2502. </div>
  2503. <div>
  2504. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Allowed IPs (CIDR) *</label>
  2505. <input type="text" id="wg-peer-modal-allowedips" placeholder="e.g. 10.10.0.2/32, 192.168.20.0/24" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2506. </div>
  2507. <div class="grid grid-cols-2 gap-4">
  2508. <div>
  2509. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Endpoint (Optional)</label>
  2510. <input type="text" id="wg-peer-modal-endpoint" placeholder="host:port" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2511. </div>
  2512. <div>
  2513. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Keepalive (sec)</label>
  2514. <input type="number" id="wg-peer-modal-keepalive" value="25" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2515. </div>
  2516. </div>
  2517. <div>
  2518. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Preshared Key (Optional)</label>
  2519. <input type="password" id="wg-peer-modal-preshared" placeholder="Optional PSK for extra post-quantum security" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2520. </div>
  2521. <div class="pt-2">
  2522. <label class="flex items-center space-x-2 cursor-pointer">
  2523. <input type="checkbox" id="wg-peer-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2524. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2525. </label>
  2526. </div>
  2527. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2528. <button type="button" onclick="closeAddWGPeerModal()" class="px-4 py-2 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800">Cancel</button>
  2529. <button type="submit" class="px-5 py-2 rounded-lg text-xs font-semibold bg-rose-600 hover:bg-rose-500 text-white">Save Peer</button>
  2530. </div>
  2531. </form>
  2532. </div>
  2533. </div>
  2534. <!-- ================= MODAL: IPSEC TUNNEL ================= -->
  2535. <div id="ipsec-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  2536. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2537. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2538. <h3 id="ipsec-modal-title" class="text-sm font-bold text-white">Configure IPSec IKEv2 Tunnel</h3>
  2539. <button onclick="closeAddIPSecModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2540. </div>
  2541. <form onsubmit="submitSaveIPSec(event)" class="p-6 space-y-4">
  2542. <div>
  2543. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Connection Name *</label>
  2544. <input type="text" id="ipsec-modal-name" placeholder="e.g. site-to-site-office" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2545. </div>
  2546. <div class="grid grid-cols-2 gap-4">
  2547. <div>
  2548. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Local Subnet *</label>
  2549. <input type="text" id="ipsec-modal-localts" placeholder="192.168.10.0/24" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2550. </div>
  2551. <div>
  2552. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Remote Subnet *</label>
  2553. <input type="text" id="ipsec-modal-remotets" placeholder="192.168.20.0/24" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2554. </div>
  2555. </div>
  2556. <div>
  2557. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Remote Gateway IP / FQDN *</label>
  2558. <input type="text" id="ipsec-modal-remotegw" placeholder="203.0.113.50 or vpn.remote.com" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2559. </div>
  2560. <div>
  2561. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Pre-Shared Key (PSK) *</label>
  2562. <input type="password" id="ipsec-modal-psk" placeholder="Secret Pre-Shared Key" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2563. </div>
  2564. <div class="grid grid-cols-2 gap-4">
  2565. <div>
  2566. <label class="block text-xs font-semibold text-slate-300 mb-1.5">IKE Proposals</label>
  2567. <input type="text" id="ipsec-modal-ikeprop" value="aes256-sha256-modp2048,default" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-[11px] text-white font-mono">
  2568. </div>
  2569. <div>
  2570. <label class="block text-xs font-semibold text-slate-300 mb-1.5">ESP Proposals</label>
  2571. <input type="text" id="ipsec-modal-espprop" value="aes256-sha256-modp2048,default" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-[11px] text-white font-mono">
  2572. </div>
  2573. </div>
  2574. <div class="grid grid-cols-2 gap-4 pt-2">
  2575. <label class="flex items-center space-x-2 cursor-pointer">
  2576. <input type="checkbox" id="ipsec-modal-autostart" checked class="rounded bg-slate-800 border-slate-700 text-amber-500">
  2577. <span class="text-xs text-slate-300 font-medium">Auto-start on boot</span>
  2578. </label>
  2579. <label class="flex items-center space-x-2 cursor-pointer">
  2580. <input type="checkbox" id="ipsec-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2581. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2582. </label>
  2583. </div>
  2584. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2585. <button type="button" onclick="closeAddIPSecModal()" class="px-4 py-2 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800">Cancel</button>
  2586. <button type="submit" class="px-5 py-2 rounded-lg text-xs font-semibold bg-amber-600 hover:bg-amber-500 text-white">Save Tunnel</button>
  2587. </div>
  2588. </form>
  2589. </div>
  2590. </div>
  2591. <!-- ================= MODAL: L2TP CLIENT ================= -->
  2592. <div id="l2tp-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  2593. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2594. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2595. <h3 id="l2tp-modal-title" class="text-sm font-bold text-white">Add L2TP Client Interface</h3>
  2596. <button onclick="closeL2TPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2597. </div>
  2598. <form onsubmit="submitSaveL2TP(event)" class="p-6 space-y-4">
  2599. <div>
  2600. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Client Interface Name *</label>
  2601. <input type="text" id="l2tp-modal-name" placeholder="l2tp-out1" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-cyan-500">
  2602. </div>
  2603. <div>
  2604. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Connect To (Server IP / Host) *</label>
  2605. <input type="text" id="l2tp-modal-server" placeholder="vpn.example.com or 203.0.113.1" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-cyan-500">
  2606. </div>
  2607. <div class="grid grid-cols-2 gap-4">
  2608. <div>
  2609. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Username *</label>
  2610. <input type="text" id="l2tp-modal-user" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-cyan-500">
  2611. </div>
  2612. <div>
  2613. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Password *</label>
  2614. <input type="password" id="l2tp-modal-pass" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-cyan-500">
  2615. </div>
  2616. </div>
  2617. <div>
  2618. <label class="block text-xs font-semibold text-slate-300 mb-1.5">IPSec Secret / PSK (Optional for L2TP/IPsec)</label>
  2619. <input type="password" id="l2tp-modal-ipsec" placeholder="Optional Pre-Shared Key" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono">
  2620. </div>
  2621. <div class="grid grid-cols-2 gap-4 pt-2">
  2622. <label class="flex items-center space-x-2 cursor-pointer">
  2623. <input type="checkbox" id="l2tp-modal-defroute" checked class="rounded bg-slate-800 border-slate-700 text-cyan-500">
  2624. <span class="text-xs text-slate-300 font-medium">Default Route</span>
  2625. </label>
  2626. <label class="flex items-center space-x-2 cursor-pointer">
  2627. <input type="checkbox" id="l2tp-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2628. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2629. </label>
  2630. </div>
  2631. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2632. <button type="button" onclick="closeL2TPModal()" class="px-4 py-2 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800">Cancel</button>
  2633. <button type="submit" class="px-5 py-2 rounded-lg text-xs font-semibold bg-cyan-600 hover:bg-cyan-500 text-white shadow-lg shadow-cyan-500/20">Save L2TP</button>
  2634. </div>
  2635. </form>
  2636. </div>
  2637. </div>
  2638. <!-- ================= MODAL: PPTP CLIENT ================= -->
  2639. <div id="pptp-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  2640. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2641. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2642. <h3 id="pptp-modal-title" class="text-sm font-bold text-white">Add PPTP Client Interface</h3>
  2643. <button onclick="closePPTPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2644. </div>
  2645. <form onsubmit="submitSavePPTP(event)" class="p-6 space-y-4">
  2646. <div>
  2647. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Client Interface Name *</label>
  2648. <input type="text" id="pptp-modal-name" placeholder="pptp-out1" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-purple-500">
  2649. </div>
  2650. <div>
  2651. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Connect To (Server IP / Host) *</label>
  2652. <input type="text" id="pptp-modal-server" placeholder="vpn.example.com or 203.0.113.1" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-purple-500">
  2653. </div>
  2654. <div class="grid grid-cols-2 gap-4">
  2655. <div>
  2656. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Username *</label>
  2657. <input type="text" id="pptp-modal-user" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-purple-500">
  2658. </div>
  2659. <div>
  2660. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Password *</label>
  2661. <input type="password" id="pptp-modal-pass" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white font-mono focus:outline-none focus:border-purple-500">
  2662. </div>
  2663. </div>
  2664. <div class="grid grid-cols-3 gap-2 pt-2 border-t border-slate-800/80">
  2665. <label class="flex items-center space-x-2 cursor-pointer">
  2666. <input type="checkbox" id="pptp-modal-mppe" checked class="rounded bg-slate-800 border-slate-700 text-purple-500">
  2667. <span class="text-xs text-slate-300 font-medium">MPPE-128</span>
  2668. </label>
  2669. <label class="flex items-center space-x-2 cursor-pointer">
  2670. <input type="checkbox" id="pptp-modal-defroute" checked class="rounded bg-slate-800 border-slate-700 text-purple-500">
  2671. <span class="text-xs text-slate-300 font-medium">Default Route</span>
  2672. </label>
  2673. <label class="flex items-center space-x-2 cursor-pointer">
  2674. <input type="checkbox" id="pptp-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2675. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2676. </label>
  2677. </div>
  2678. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2679. <button type="button" onclick="closePPTPModal()" class="px-4 py-2 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800">Cancel</button>
  2680. <button type="submit" class="px-5 py-2 rounded-lg text-xs font-semibold bg-purple-600 hover:bg-purple-500 text-white shadow-lg shadow-purple-500/20">Save PPTP</button>
  2681. </div>
  2682. </form>
  2683. </div>
  2684. </div>
  2685. <!-- ================= MODAL: FIREWALL FILTER RULE ================= -->
  2686. <div id="filter-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  2687. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-xl shadow-2xl overflow-hidden animate-in max-h-[90vh] flex flex-col">
  2688. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2689. <h3 id="filter-modal-title" class="text-sm font-bold text-white">Add Firewall Filter Rule</h3>
  2690. <button onclick="closeFilterModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2691. </div>
  2692. <form onsubmit="submitSaveFilterRule(event)" class="p-6 space-y-4 overflow-y-auto flex-1 text-xs">
  2693. <input type="hidden" id="filter-modal-id">
  2694. <div class="grid grid-cols-2 gap-4">
  2695. <div>
  2696. <label class="block font-semibold text-slate-300 mb-1">Chain *</label>
  2697. <select id="filter-modal-chain" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  2698. <option value="input">input (traffic to router)</option>
  2699. <option value="forward" selected>forward (routed traffic)</option>
  2700. <option value="output">output (traffic from router)</option>
  2701. </select>
  2702. </div>
  2703. <div>
  2704. <label class="block font-semibold text-slate-300 mb-1">Action *</label>
  2705. <select id="filter-modal-action" onchange="toggleFilterActionFields()" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  2706. <option value="accept" selected>accept</option>
  2707. <option value="drop">drop</option>
  2708. <option value="reject">reject</option>
  2709. <option value="log">log</option>
  2710. <option value="jump">jump</option>
  2711. <option value="return">return</option>
  2712. </select>
  2713. </div>
  2714. </div>
  2715. <div id="filter-action-reject-box" class="hidden p-3 bg-rose-950/20 border border-rose-900/30 rounded-lg">
  2716. <label class="block font-semibold text-rose-300 mb-1">Reject With</label>
  2717. <select id="filter-modal-rejectwith" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2718. <option value="icmp-network-unreachable">icmp-network-unreachable</option>
  2719. <option value="icmp-host-unreachable">icmp-host-unreachable</option>
  2720. <option value="icmp-port-unreachable">icmp-port-unreachable</option>
  2721. <option value="tcp-reset">tcp-reset (TCP RST)</option>
  2722. </select>
  2723. </div>
  2724. <div class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2725. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Match Properties</span>
  2726. <div class="grid grid-cols-2 gap-3">
  2727. <div>
  2728. <label class="block font-semibold text-slate-300 mb-1">Protocol</label>
  2729. <select id="filter-modal-proto" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2730. <option value="all">all</option>
  2731. <option value="tcp">tcp (6)</option>
  2732. <option value="udp">udp (17)</option>
  2733. <option value="icmp">icmp (1)</option>
  2734. <option value="gre">gre (47)</option>
  2735. <option value="esp">esp (50)</option>
  2736. </select>
  2737. </div>
  2738. <div>
  2739. <label class="block font-semibold text-slate-300 mb-1">Connection Mark</label>
  2740. <input type="text" id="filter-modal-connmark" placeholder="e.g. wan2_conn" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2741. </div>
  2742. </div>
  2743. <div class="grid grid-cols-2 gap-3">
  2744. <div>
  2745. <label class="block font-semibold text-slate-300 mb-1">Src. Address / CIDR</label>
  2746. <input type="text" id="filter-modal-src" placeholder="192.168.1.0/24 or !10.0.0.1" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2747. </div>
  2748. <div>
  2749. <label class="block font-semibold text-slate-300 mb-1">Dst. Address / CIDR</label>
  2750. <input type="text" id="filter-modal-dst" placeholder="0.0.0.0/0 or !192.168.10.1" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2751. </div>
  2752. </div>
  2753. <div class="grid grid-cols-2 gap-3">
  2754. <div>
  2755. <label class="block font-semibold text-slate-300 mb-1">Src. Port(s)</label>
  2756. <input type="text" id="filter-modal-sport" placeholder="80,443 or 1000-2000" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2757. </div>
  2758. <div>
  2759. <label class="block font-semibold text-slate-300 mb-1">Dst. Port(s)</label>
  2760. <input type="text" id="filter-modal-dport" placeholder="80,443,8080" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2761. </div>
  2762. </div>
  2763. <div class="grid grid-cols-2 gap-3">
  2764. <div>
  2765. <label class="block font-semibold text-slate-300 mb-1">In. Interface</label>
  2766. <select id="filter-modal-iniface" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  2767. </div>
  2768. <div>
  2769. <label class="block font-semibold text-slate-300 mb-1">Out. Interface</label>
  2770. <select id="filter-modal-outiface" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  2771. </div>
  2772. </div>
  2773. <div>
  2774. <label class="block font-semibold text-slate-300 mb-1.5">Connection State</label>
  2775. <div class="flex flex-wrap gap-3">
  2776. <label class="flex items-center space-x-1.5 cursor-pointer">
  2777. <input type="checkbox" id="filter-modal-cs-established" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2778. <span class="text-slate-300">established</span>
  2779. </label>
  2780. <label class="flex items-center space-x-1.5 cursor-pointer">
  2781. <input type="checkbox" id="filter-modal-cs-related" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2782. <span class="text-slate-300">related</span>
  2783. </label>
  2784. <label class="flex items-center space-x-1.5 cursor-pointer">
  2785. <input type="checkbox" id="filter-modal-cs-new" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2786. <span class="text-slate-300">new</span>
  2787. </label>
  2788. <label class="flex items-center space-x-1.5 cursor-pointer">
  2789. <input type="checkbox" id="filter-modal-cs-invalid" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2790. <span class="text-slate-300">invalid</span>
  2791. </label>
  2792. </div>
  2793. </div>
  2794. <div class="grid grid-cols-2 gap-3">
  2795. <div>
  2796. <div class="flex items-center justify-between mb-1">
  2797. <label class="font-semibold text-slate-300">Src. Address List</label>
  2798. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2799. <input type="checkbox" id="filter-modal-srclist-inv" class="rounded bg-slate-800 border-slate-700">
  2800. <span>! Invert</span>
  2801. </label>
  2802. </div>
  2803. <select id="filter-modal-srclist" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2804. <option value="">(None)</option>
  2805. </select>
  2806. </div>
  2807. <div>
  2808. <div class="flex items-center justify-between mb-1">
  2809. <label class="font-semibold text-slate-300">Dst. Address List</label>
  2810. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2811. <input type="checkbox" id="filter-modal-dstlist-inv" class="rounded bg-slate-800 border-slate-700">
  2812. <span>! Invert</span>
  2813. </label>
  2814. </div>
  2815. <select id="filter-modal-dstlist" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2816. <option value="">(None)</option>
  2817. </select>
  2818. </div>
  2819. </div>
  2820. <div class="grid grid-cols-2 gap-3">
  2821. <div>
  2822. <div class="flex items-center justify-between mb-1">
  2823. <label class="font-semibold text-emerald-400 flex items-center gap-1"><span>🌍</span> <span>Source GEO IP List</span></label>
  2824. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2825. <input type="checkbox" id="filter-modal-srcgeoip-inv" class="rounded bg-slate-800 border-slate-700">
  2826. <span>! Invert</span>
  2827. </label>
  2828. </div>
  2829. <select id="filter-modal-srcgeoip" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2830. <option value="">(None)</option>
  2831. </select>
  2832. </div>
  2833. <div>
  2834. <div class="flex items-center justify-between mb-1">
  2835. <label class="font-semibold text-emerald-400 flex items-center gap-1"><span>🌍</span> <span>Destination GEO IP List</span></label>
  2836. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2837. <input type="checkbox" id="filter-modal-dstgeoip-inv" class="rounded bg-slate-800 border-slate-700">
  2838. <span>! Invert</span>
  2839. </label>
  2840. </div>
  2841. <select id="filter-modal-dstgeoip" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2842. <option value="">(None)</option>
  2843. </select>
  2844. </div>
  2845. </div>
  2846. </div>
  2847. <div>
  2848. <label class="block font-semibold text-slate-300 mb-1">Comment</label>
  2849. <input type="text" id="filter-modal-comment" placeholder="e.g. Drop invalid packets" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white">
  2850. </div>
  2851. <div class="pt-2">
  2852. <label class="flex items-center space-x-2 cursor-pointer">
  2853. <input type="checkbox" id="filter-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2854. <span class="font-medium text-slate-300">Disabled (X)</span>
  2855. </label>
  2856. </div>
  2857. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2858. <button type="button" onclick="closeFilterModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2859. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20">Save Filter Rule</button>
  2860. </div>
  2861. </form>
  2862. </div>
  2863. </div>
  2864. <!-- ================= MODAL: FIREWALL NAT RULE ================= -->
  2865. <div id="nat-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  2866. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-xl shadow-2xl overflow-hidden animate-in max-h-[90vh] flex flex-col">
  2867. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2868. <h3 id="nat-modal-title" class="text-sm font-bold text-white">Add NAT Rule</h3>
  2869. <button onclick="closeNATModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2870. </div>
  2871. <form onsubmit="submitSaveNATRule(event)" class="p-6 space-y-4 overflow-y-auto flex-1 text-xs">
  2872. <input type="hidden" id="nat-modal-id">
  2873. <div class="grid grid-cols-2 gap-4">
  2874. <div>
  2875. <label class="block font-semibold text-slate-300 mb-1">Chain *</label>
  2876. <select id="nat-modal-chain" onchange="toggleNATChainFields()" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  2877. <option value="srcnat" selected>srcnat (Outgoing / Masquerade)</option>
  2878. <option value="dstnat">dstnat (Incoming / Port Forwarding)</option>
  2879. </select>
  2880. </div>
  2881. <div>
  2882. <label class="block font-semibold text-slate-300 mb-1">Action *</label>
  2883. <select id="nat-modal-action" onchange="toggleNATActionFields()" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  2884. <option value="masquerade" selected>masquerade</option>
  2885. <option value="src-nat">src-nat</option>
  2886. <option value="dst-nat">dst-nat</option>
  2887. <option value="redirect">redirect</option>
  2888. <option value="accept">accept</option>
  2889. </select>
  2890. </div>
  2891. </div>
  2892. <div id="nat-action-to-box" class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2893. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">NAT Target (To Addresses / Ports)</span>
  2894. <div class="grid grid-cols-2 gap-3">
  2895. <div>
  2896. <label class="block font-semibold text-slate-300 mb-1">To Addresses</label>
  2897. <input type="text" id="nat-modal-toaddr" placeholder="192.168.10.50" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2898. </div>
  2899. <div>
  2900. <label class="block font-semibold text-slate-300 mb-1">To Ports</label>
  2901. <input type="text" id="nat-modal-toport" placeholder="80 or 8080" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2902. </div>
  2903. </div>
  2904. </div>
  2905. <div class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2906. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Match Properties</span>
  2907. <div class="grid grid-cols-2 gap-3">
  2908. <div>
  2909. <label class="block font-semibold text-slate-300 mb-1">Protocol</label>
  2910. <select id="nat-modal-proto" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2911. <option value="all">all</option>
  2912. <option value="tcp">tcp</option>
  2913. <option value="udp">udp</option>
  2914. <option value="icmp">icmp</option>
  2915. </select>
  2916. </div>
  2917. <div>
  2918. <label class="block font-semibold text-slate-300 mb-1">Dst. Port(s)</label>
  2919. <input type="text" id="nat-modal-dport" placeholder="80,443" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2920. </div>
  2921. </div>
  2922. <div class="grid grid-cols-2 gap-3">
  2923. <div>
  2924. <label class="block font-semibold text-slate-300 mb-1">Src. Address / CIDR</label>
  2925. <input type="text" id="nat-modal-src" placeholder="192.168.10.0/24" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2926. </div>
  2927. <div>
  2928. <label class="block font-semibold text-slate-300 mb-1">Dst. Address / CIDR</label>
  2929. <input type="text" id="nat-modal-dst" placeholder="e.g. WAN Public IP" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2930. </div>
  2931. </div>
  2932. <div class="grid grid-cols-2 gap-3">
  2933. <div>
  2934. <label class="block font-semibold text-slate-300 mb-1">In. Interface</label>
  2935. <select id="nat-modal-iniface" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  2936. </div>
  2937. <div>
  2938. <label class="block font-semibold text-slate-300 mb-1">Out. Interface</label>
  2939. <select id="nat-modal-outiface" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  2940. </div>
  2941. </div>
  2942. <div class="grid grid-cols-2 gap-3">
  2943. <div>
  2944. <div class="flex items-center justify-between mb-1">
  2945. <label class="font-semibold text-slate-300">Src. Address List</label>
  2946. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2947. <input type="checkbox" id="nat-modal-srclist-inv" class="rounded bg-slate-800 border-slate-700">
  2948. <span>! Invert</span>
  2949. </label>
  2950. </div>
  2951. <select id="nat-modal-srclist" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  2952. </div>
  2953. <div>
  2954. <div class="flex items-center justify-between mb-1">
  2955. <label class="font-semibold text-slate-300">Dst. Address List</label>
  2956. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2957. <input type="checkbox" id="nat-modal-dstlist-inv" class="rounded bg-slate-800 border-slate-700">
  2958. <span>! Invert</span>
  2959. </label>
  2960. </div>
  2961. <select id="nat-modal-dstlist" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  2962. </div>
  2963. </div>
  2964. <div class="grid grid-cols-2 gap-3">
  2965. <div>
  2966. <div class="flex items-center justify-between mb-1">
  2967. <label class="font-semibold text-emerald-400 flex items-center gap-1"><span>🌍</span> <span>Source GEO IP List</span></label>
  2968. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2969. <input type="checkbox" id="nat-modal-srcgeoip-inv" class="rounded bg-slate-800 border-slate-700">
  2970. <span>! Invert</span>
  2971. </label>
  2972. </div>
  2973. <select id="nat-modal-srcgeoip" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2974. <option value="">(None)</option>
  2975. </select>
  2976. </div>
  2977. <div>
  2978. <div class="flex items-center justify-between mb-1">
  2979. <label class="font-semibold text-emerald-400 flex items-center gap-1"><span>🌍</span> <span>Destination GEO IP List</span></label>
  2980. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2981. <input type="checkbox" id="nat-modal-dstgeoip-inv" class="rounded bg-slate-800 border-slate-700">
  2982. <span>! Invert</span>
  2983. </label>
  2984. </div>
  2985. <select id="nat-modal-dstgeoip" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2986. <option value="">(None)</option>
  2987. </select>
  2988. </div>
  2989. </div>
  2990. </div>
  2991. <div>
  2992. <label class="block font-semibold text-slate-300 mb-1">Comment</label>
  2993. <input type="text" id="nat-modal-comment" placeholder="e.g. Masquerade to WAN" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white">
  2994. </div>
  2995. <div class="pt-2">
  2996. <label class="flex items-center space-x-2 cursor-pointer">
  2997. <input type="checkbox" id="nat-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2998. <span class="font-medium text-slate-300">Disabled (X)</span>
  2999. </label>
  3000. </div>
  3001. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3002. <button type="button" onclick="closeNATModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3003. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20">Save NAT Rule</button>
  3004. </div>
  3005. </form>
  3006. </div>
  3007. </div>
  3008. <!-- ================= MODAL: FIREWALL MANGLE RULE ================= -->
  3009. <div id="mangle-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3010. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-xl shadow-2xl overflow-hidden animate-in max-h-[90vh] flex flex-col">
  3011. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3012. <h3 id="mangle-modal-title" class="text-sm font-bold text-white">Add Mangle Rule</h3>
  3013. <button onclick="closeMangleModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3014. </div>
  3015. <form onsubmit="submitSaveMangleRule(event)" class="p-6 space-y-4 overflow-y-auto flex-1 text-xs">
  3016. <input type="hidden" id="mangle-modal-id">
  3017. <div class="grid grid-cols-2 gap-4">
  3018. <div>
  3019. <label class="block font-semibold text-slate-300 mb-1">Chain *</label>
  3020. <select id="mangle-modal-chain" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  3021. <option value="prerouting" selected>prerouting (Policy Routing / Marks)</option>
  3022. <option value="forward">forward</option>
  3023. <option value="postrouting">postrouting</option>
  3024. <option value="input">input</option>
  3025. <option value="output">output</option>
  3026. </select>
  3027. </div>
  3028. <div>
  3029. <label class="block font-semibold text-slate-300 mb-1">Action *</label>
  3030. <select id="mangle-modal-action" onchange="toggleMangleActionFields()" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  3031. <option value="mark-connection" selected>mark-connection</option>
  3032. <option value="mark-routing">mark-routing (Policy Routing)</option>
  3033. <option value="mark-packet">mark-packet (QoS / Queues)</option>
  3034. <option value="change-mss">change-mss (TCP MSS Clamp)</option>
  3035. <option value="set-dscp">set-dscp</option>
  3036. <option value="accept">accept</option>
  3037. </select>
  3038. </div>
  3039. </div>
  3040. <div id="mangle-target-box" class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  3041. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Mark Target & Passthrough</span>
  3042. <div class="grid grid-cols-2 gap-3">
  3043. <div id="mangle-field-newmark">
  3044. <label class="block font-semibold text-slate-300 mb-1">New Mark Name</label>
  3045. <input type="text" id="mangle-modal-newmark" placeholder="e.g. wan2_conn or to_WAN2" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  3046. </div>
  3047. <div class="flex items-center pt-5">
  3048. <label class="flex items-center space-x-2 cursor-pointer">
  3049. <input type="checkbox" id="mangle-modal-passthrough" checked class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  3050. <span class="font-medium text-slate-300">Passthrough</span>
  3051. </label>
  3052. </div>
  3053. </div>
  3054. </div>
  3055. <div class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  3056. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Match Criteria</span>
  3057. <div class="grid grid-cols-2 gap-3">
  3058. <div>
  3059. <label class="block font-semibold text-slate-300 mb-1">Src. Address / CIDR</label>
  3060. <input type="text" id="mangle-modal-src" placeholder="192.168.10.0/24" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  3061. </div>
  3062. <div>
  3063. <label class="block font-semibold text-slate-300 mb-1">Dst. Address / CIDR</label>
  3064. <input type="text" id="mangle-modal-dst" placeholder="!192.168.0.0/16" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  3065. </div>
  3066. </div>
  3067. <div class="grid grid-cols-2 gap-3">
  3068. <div>
  3069. <label class="block font-semibold text-slate-300 mb-1">Connection Mark</label>
  3070. <input type="text" id="mangle-modal-connmark" placeholder="e.g. wan2_conn" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  3071. </div>
  3072. <div>
  3073. <label class="block font-semibold text-slate-300 mb-1">In. Interface</label>
  3074. <select id="mangle-modal-iniface" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  3075. </div>
  3076. </div>
  3077. <div class="grid grid-cols-2 gap-3">
  3078. <div>
  3079. <div class="flex items-center justify-between mb-1">
  3080. <label class="font-semibold text-slate-300">Src. Address List</label>
  3081. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  3082. <input type="checkbox" id="mangle-modal-srclist-inv" class="rounded bg-slate-800 border-slate-700">
  3083. <span>! Invert</span>
  3084. </label>
  3085. </div>
  3086. <select id="mangle-modal-srclist" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  3087. </div>
  3088. <div>
  3089. <div class="flex items-center justify-between mb-1">
  3090. <label class="font-semibold text-slate-300">Dst. Address List</label>
  3091. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  3092. <input type="checkbox" id="mangle-modal-dstlist-inv" class="rounded bg-slate-800 border-slate-700">
  3093. <span>! Invert</span>
  3094. </label>
  3095. </div>
  3096. <select id="mangle-modal-dstlist" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  3097. </div>
  3098. </div>
  3099. <div class="grid grid-cols-2 gap-3">
  3100. <div>
  3101. <div class="flex items-center justify-between mb-1">
  3102. <label class="font-semibold text-emerald-400 flex items-center gap-1"><span>🌍</span> <span>Source GEO IP List</span></label>
  3103. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  3104. <input type="checkbox" id="mangle-modal-srcgeoip-inv" class="rounded bg-slate-800 border-slate-700">
  3105. <span>! Invert</span>
  3106. </label>
  3107. </div>
  3108. <select id="mangle-modal-srcgeoip" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  3109. <option value="">(None)</option>
  3110. </select>
  3111. </div>
  3112. <div>
  3113. <div class="flex items-center justify-between mb-1">
  3114. <label class="font-semibold text-emerald-400 flex items-center gap-1"><span>🌍</span> <span>Destination GEO IP List</span></label>
  3115. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  3116. <input type="checkbox" id="mangle-modal-dstgeoip-inv" class="rounded bg-slate-800 border-slate-700">
  3117. <span>! Invert</span>
  3118. </label>
  3119. </div>
  3120. <select id="mangle-modal-dstgeoip" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  3121. <option value="">(None)</option>
  3122. </select>
  3123. </div>
  3124. </div>
  3125. </div>
  3126. <div>
  3127. <label class="block font-semibold text-slate-300 mb-1">Comment</label>
  3128. <input type="text" id="mangle-modal-comment" placeholder="e.g. Mark routing for Office traffic" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white">
  3129. </div>
  3130. <div class="pt-2">
  3131. <label class="flex items-center space-x-2 cursor-pointer">
  3132. <input type="checkbox" id="mangle-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  3133. <span class="font-medium text-slate-300">Disabled (X)</span>
  3134. </label>
  3135. </div>
  3136. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3137. <button type="button" onclick="closeMangleModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3138. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20">Save Mangle Rule</button>
  3139. </div>
  3140. </form>
  3141. </div>
  3142. </div>
  3143. <!-- ================= MODAL: ADDRESS LIST ENTRY ================= -->
  3144. <div id="addrlist-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3145. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3146. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3147. <h3 id="addrlist-modal-title" class="text-sm font-bold text-white">Add Address List Entry</h3>
  3148. <button onclick="closeAddrListModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3149. </div>
  3150. <form onsubmit="submitSaveAddrList(event)" class="p-6 space-y-4 text-xs">
  3151. <input type="hidden" id="addrlist-modal-id">
  3152. <div>
  3153. <label class="block font-semibold text-slate-300 mb-1.5">List Name *</label>
  3154. <input type="text" id="addrlist-modal-name" placeholder="e.g. LAN_Subnets, Blocked_IPs" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  3155. </div>
  3156. <div>
  3157. <label class="block font-semibold text-slate-300 mb-1.5">IP Address / Subnet (CIDR) *</label>
  3158. <input type="text" id="addrlist-modal-addr" placeholder="192.168.10.0/24 or 203.0.113.5" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  3159. </div>
  3160. <div>
  3161. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3162. <input type="text" id="addrlist-modal-comment" placeholder="Optional description" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  3163. </div>
  3164. <div class="pt-2">
  3165. <label class="flex items-center space-x-2 cursor-pointer">
  3166. <input type="checkbox" id="addrlist-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  3167. <span class="font-medium text-slate-300">Disabled (X)</span>
  3168. </label>
  3169. </div>
  3170. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3171. <button type="button" onclick="closeAddrListModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3172. <button type="submit" id="addrlist-modal-submit-btn" class="px-5 py-2 rounded-lg font-semibold bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20">Save Entry</button>
  3173. </div>
  3174. </form>
  3175. </div>
  3176. </div>
  3177. <!-- ================= MODAL: GEO INTERVAL SETTINGS ================= -->
  3178. <div id="geo-interval-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3179. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3180. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3181. <h3 class="text-sm font-bold text-white">Geo-Location Auto-Update Settings</h3>
  3182. <button onclick="closeGeoIntervalModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3183. </div>
  3184. <form onsubmit="submitGeoIntervalSettings(event)" class="p-6 space-y-4 text-xs">
  3185. <div class="p-3 bg-slate-950/60 border border-slate-800 rounded-xl space-y-2">
  3186. <label class="flex items-center space-x-2.5 cursor-pointer">
  3187. <input type="checkbox" id="geo-cfg-autoupdate" checked class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  3188. <span class="font-semibold text-white">Enable Automatic Background Updates</span>
  3189. </label>
  3190. <p class="text-[11px] text-slate-400 pl-6">Automatically fetches the latest country IP blocks from IPdeny registries and updates active kernel ipsets without service interruption.</p>
  3191. </div>
  3192. <div>
  3193. <label class="block font-semibold text-slate-300 mb-1.5">Update Interval *</label>
  3194. <select id="geo-cfg-interval" onchange="toggleCustomGeoInterval()" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  3195. <option value="12">Every 12 Hours</option>
  3196. <option value="24" selected>Every 24 Hours (Daily - Recommended)</option>
  3197. <option value="48">Every 48 Hours (2 Days)</option>
  3198. <option value="72">Every 3 Days</option>
  3199. <option value="168">Every 7 Days (Weekly)</option>
  3200. <option value="720">Every 30 Days (Monthly)</option>
  3201. <option value="custom">Custom Hours...</option>
  3202. </select>
  3203. </div>
  3204. <div id="geo-cfg-custom-box" class="hidden">
  3205. <label class="block font-semibold text-slate-300 mb-1.5">Custom Interval (Hours)</label>
  3206. <input type="number" id="geo-cfg-custom-hours" min="1" max="8760" value="24" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3207. </div>
  3208. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3209. <button type="button" onclick="closeGeoIntervalModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3210. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20">Save Schedule</button>
  3211. </div>
  3212. </form>
  3213. </div>
  3214. </div>
  3215. <!-- ================= MODAL: GEO SUBNETS PREVIEW ================= -->
  3216. <div id="geo-subnets-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3217. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3218. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3219. <div>
  3220. <h3 id="geo-subnets-title" class="text-sm font-bold text-white">Country Subnets</h3>
  3221. <span id="geo-subnets-subtitle" class="text-[11px] font-mono text-slate-400">CIDR Blocks</span>
  3222. </div>
  3223. <button onclick="closeGeoSubnetsModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3224. </div>
  3225. <div class="p-6 space-y-3 text-xs">
  3226. <p class="text-slate-400">Showing first 100 subnets in this country zone:</p>
  3227. <div id="geo-subnets-list" class="bg-slate-950 border border-slate-800 rounded-xl p-3 max-h-72 overflow-y-auto font-mono text-[11px] text-emerald-400 space-y-1"></div>
  3228. <div class="pt-3 border-t border-slate-800 flex justify-end">
  3229. <button type="button" onclick="closeGeoSubnetsModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Close</button>
  3230. </div>
  3231. </div>
  3232. </div>
  3233. </div>
  3234. <!-- ================= MODAL: ADD / EDIT ROUTE ================= -->
  3235. <div id="route-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3236. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3237. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3238. <h3 id="route-modal-title" class="text-sm font-bold text-white">Add Static Route</h3>
  3239. <button onclick="closeRouteModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3240. </div>
  3241. <form onsubmit="submitSaveRoute(event)" class="p-6 space-y-4 text-xs">
  3242. <input type="hidden" id="route-modal-id">
  3243. <input type="hidden" id="route-modal-old-dst">
  3244. <input type="hidden" id="route-modal-old-gw">
  3245. <input type="hidden" id="route-modal-old-distance">
  3246. <input type="hidden" id="route-modal-old-table">
  3247. <input type="hidden" id="route-modal-old-iface">
  3248. <div>
  3249. <label class="block font-semibold text-slate-300 mb-1.5">Dst. Address (CIDR) *</label>
  3250. <input type="text" id="route-modal-dst" value="0.0.0.0/0" placeholder="0.0.0.0/0 or 10.0.0.0/8" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-cyan-500">
  3251. </div>
  3252. <div class="grid grid-cols-2 gap-4">
  3253. <div>
  3254. <label class="block font-semibold text-slate-300 mb-1.5">Gateway (IP or Interface)</label>
  3255. <input type="text" id="route-modal-gw" placeholder="10.42.36.1 or wg0" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-cyan-500">
  3256. </div>
  3257. <div>
  3258. <label class="block font-semibold text-slate-300 mb-1.5">Routing Table / Mark</label>
  3259. <select id="route-modal-table" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-cyan-500">
  3260. <option value="main" selected>main</option>
  3261. </select>
  3262. </div>
  3263. </div>
  3264. <div class="grid grid-cols-2 gap-4">
  3265. <div>
  3266. <label class="block font-semibold text-slate-300 mb-1.5">Distance (Metric)</label>
  3267. <input type="number" id="route-modal-distance" value="1" min="0" max="255" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-cyan-500">
  3268. </div>
  3269. <div>
  3270. <label class="block font-semibold text-slate-300 mb-1.5">Interface (Optional)</label>
  3271. <select id="route-modal-iface" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-cyan-500"></select>
  3272. </div>
  3273. </div>
  3274. <div>
  3275. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3276. <input type="text" id="route-modal-comment" placeholder="e.g. Primary WAN Default Gateway" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  3277. </div>
  3278. <div class="pt-2">
  3279. <label class="flex items-center space-x-2 cursor-pointer">
  3280. <input type="checkbox" id="route-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  3281. <span class="font-medium text-slate-300">Disabled (X)</span>
  3282. </label>
  3283. </div>
  3284. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3285. <button type="button" onclick="closeRouteModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3286. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-cyan-600 hover:bg-cyan-500 text-white shadow-lg shadow-cyan-500/20">Save Route</button>
  3287. </div>
  3288. </form>
  3289. </div>
  3290. </div>
  3291. <!-- ================= MODAL: ADD POLICY ROUTING RULE ================= -->
  3292. <div id="prule-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3293. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3294. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3295. <h3 id="prule-modal-title" class="text-sm font-bold text-white">Add Policy Routing Rule (/ip route rule)</h3>
  3296. <button onclick="closePolicyRuleModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3297. </div>
  3298. <form onsubmit="submitSavePolicyRule(event)" class="p-6 space-y-4 text-xs">
  3299. <input type="hidden" id="prule-modal-id">
  3300. <div class="grid grid-cols-2 gap-4">
  3301. <div>
  3302. <label class="block font-semibold text-slate-300 mb-1.5">Priority / Preference</label>
  3303. <input type="number" id="prule-modal-pref" placeholder="1000" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3304. </div>
  3305. <div>
  3306. <label class="block font-semibold text-slate-300 mb-1.5">Routing Mark (fwmark)</label>
  3307. <input type="text" id="prule-modal-mark" placeholder="e.g. to_WAN2 or 100" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3308. </div>
  3309. </div>
  3310. <div class="grid grid-cols-2 gap-4">
  3311. <div>
  3312. <label class="block font-semibold text-slate-300 mb-1.5">Src. Address (CIDR)</label>
  3313. <input type="text" id="prule-modal-src" placeholder="192.168.10.0/24" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3314. </div>
  3315. <div>
  3316. <label class="block font-semibold text-slate-300 mb-1.5">Dst. Address (CIDR)</label>
  3317. <input type="text" id="prule-modal-dst" placeholder="0.0.0.0/0" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3318. </div>
  3319. </div>
  3320. <div class="grid grid-cols-2 gap-4">
  3321. <div>
  3322. <label class="block font-semibold text-slate-300 mb-1.5">Lookup Table *</label>
  3323. <select id="prule-modal-table" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono"></select>
  3324. </div>
  3325. <div>
  3326. <label class="block font-semibold text-slate-300 mb-1.5">Action</label>
  3327. <select id="prule-modal-action" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3328. <option value="lookup" selected>lookup (standard)</option>
  3329. <option value="unreachable">unreachable</option>
  3330. <option value="blackhole">blackhole</option>
  3331. </select>
  3332. </div>
  3333. </div>
  3334. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3335. <button type="button" onclick="closePolicyRuleModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3336. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-cyan-600 hover:bg-cyan-500 text-white shadow-lg shadow-cyan-500/20">Save Policy Rule</button>
  3337. </div>
  3338. </form>
  3339. </div>
  3340. </div>
  3341. <!-- ================= MODAL: CREATE ROUTING TABLE ================= -->
  3342. <div id="table-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3343. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3344. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3345. <h3 class="text-sm font-bold text-white">Create New Routing Table</h3>
  3346. <button onclick="closeTableModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3347. </div>
  3348. <form onsubmit="submitSaveTable(event)" class="p-6 space-y-4 text-xs">
  3349. <div>
  3350. <label class="block font-semibold text-slate-300 mb-1.5">Table Name *</label>
  3351. <input type="text" id="table-modal-name" placeholder="e.g. wan2_traffic, vpn_table" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-cyan-500">
  3352. </div>
  3353. <div>
  3354. <label class="block font-semibold text-slate-300 mb-1.5">FIB Table ID (Optional)</label>
  3355. <input type="number" id="table-modal-id" min="1" max="252" placeholder="Auto (100+)" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3356. </div>
  3357. <div>
  3358. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3359. <input type="text" id="table-modal-comment" placeholder="Purpose of this routing table" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  3360. </div>
  3361. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3362. <button type="button" onclick="closeTableModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3363. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-cyan-600 hover:bg-cyan-500 text-white shadow-lg shadow-cyan-500/20">Create Table</button>
  3364. </div>
  3365. </form>
  3366. </div>
  3367. </div>
  3368. <!-- ================= MODAL: ADD/EDIT EoIP TUNNEL ================= -->
  3369. <div id="eoip-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3370. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3371. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3372. <div>
  3373. <h3 id="eoip-modal-title" class="text-sm font-bold text-white">Add EoIP Tunnel</h3>
  3374. <p class="text-[11px] text-slate-400">MikroTik RouterOS Layer 2 GRETAP Tunnel</p>
  3375. </div>
  3376. <button onclick="closeEoIPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3377. </div>
  3378. <form onsubmit="submitSaveEoIP(event)" class="p-6 space-y-4 text-xs font-sans">
  3379. <input type="hidden" id="eoip-modal-id">
  3380. <div class="grid grid-cols-2 gap-4">
  3381. <div>
  3382. <label class="block font-semibold text-slate-300 mb-1.5">Interface Name *</label>
  3383. <input type="text" id="eoip-modal-name" placeholder="eoip-tunnel1" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  3384. </div>
  3385. <div>
  3386. <label class="block font-semibold text-slate-300 mb-1.5">Tunnel ID (1 - 65535) *</label>
  3387. <input type="number" id="eoip-modal-tunnelid" min="1" max="65535" placeholder="10" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  3388. </div>
  3389. </div>
  3390. <div class="grid grid-cols-2 gap-4">
  3391. <div>
  3392. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (Remote Router IP) *</label>
  3393. <input type="text" id="eoip-modal-remote" placeholder="e.g. 10.2.145.253" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  3394. <span class="text-[10px] text-slate-400">Underlay IP of the remote MikroTik router</span>
  3395. </div>
  3396. <div>
  3397. <label class="block font-semibold text-slate-300 mb-1.5">Tunnel IP / Subnet (CIDR)</label>
  3398. <input type="text" id="eoip-modal-ip" placeholder="e.g. 172.16.33.254/30" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  3399. <span class="text-[10px] text-slate-400">Overlay IPv4 assigned directly to tunnel (/30, /24)</span>
  3400. </div>
  3401. </div>
  3402. <div class="grid grid-cols-2 gap-4">
  3403. <div>
  3404. <label class="block font-semibold text-slate-300 mb-1.5">Underlay Local IP (GRE Source)</label>
  3405. <input type="text" id="eoip-modal-local" placeholder="e.g. 10.42.36.5" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  3406. <span class="text-[10px] text-slate-400">Local router IP for outer GRE packets</span>
  3407. </div>
  3408. <div>
  3409. <label class="block font-semibold text-slate-300 mb-1.5">MAC Address (Auto if empty)</label>
  3410. <input type="text" id="eoip-modal-mac" placeholder="02:64:xx:xx:xx:xx" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3411. </div>
  3412. </div>
  3413. <div class="grid grid-cols-2 gap-4">
  3414. <div>
  3415. <label class="block font-semibold text-slate-300 mb-1.5">MTU</label>
  3416. <input type="number" id="eoip-modal-mtu" value="1500" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3417. </div>
  3418. <div>
  3419. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3420. <input type="text" id="eoip-modal-comment" placeholder="Bridge to Office Branch" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  3421. </div>
  3422. </div>
  3423. <div class="flex items-center justify-between pt-1">
  3424. <label class="flex items-center space-x-2 text-slate-300">
  3425. <input type="checkbox" id="eoip-modal-clampmss" checked class="rounded bg-slate-800 border-slate-700 text-emerald-600">
  3426. <span>Clamp TCP MSS (PMTUD protection)</span>
  3427. </label>
  3428. <label class="flex items-center space-x-2 text-slate-300">
  3429. <input type="checkbox" id="eoip-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-600">
  3430. <span>Disabled</span>
  3431. </label>
  3432. </div>
  3433. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3434. <button type="button" onclick="closeEoIPModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3435. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20">Save Tunnel</button>
  3436. </div>
  3437. </form>
  3438. </div>
  3439. </div>
  3440. <!-- ================= MODAL: ADD/EDIT PPP SECRET (USER) ================= -->
  3441. <div id="ppp-secret-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3442. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3443. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3444. <div>
  3445. <h3 id="secret-modal-title" class="text-sm font-bold text-white">Add PPP Secret</h3>
  3446. <p class="text-[11px] text-slate-400">User account for PPPoE, PPTP, and L2TP authentication</p>
  3447. </div>
  3448. <button onclick="closePPPSecretModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3449. </div>
  3450. <form onsubmit="submitSavePPPSecret(event)" class="p-6 space-y-4 text-xs font-sans">
  3451. <input type="hidden" id="secret-modal-id">
  3452. <div class="grid grid-cols-2 gap-4">
  3453. <div>
  3454. <label class="block font-semibold text-slate-300 mb-1.5">Username (Name) *</label>
  3455. <input type="text" id="secret-modal-name" placeholder="client_user1" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-violet-500">
  3456. </div>
  3457. <div>
  3458. <label class="block font-semibold text-slate-300 mb-1.5">Password *</label>
  3459. <input type="password" id="secret-modal-password" placeholder="••••••••" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-violet-500">
  3460. </div>
  3461. </div>
  3462. <div class="grid grid-cols-2 gap-4">
  3463. <div>
  3464. <label class="block font-semibold text-slate-300 mb-1.5">Service</label>
  3465. <select id="secret-modal-service" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3466. <option value="any">any</option>
  3467. <option value="pppoe">pppoe</option>
  3468. <option value="pptp">pptp</option>
  3469. <option value="l2tp">l2tp</option>
  3470. </select>
  3471. </div>
  3472. <div>
  3473. <label class="block font-semibold text-slate-300 mb-1.5">Profile</label>
  3474. <select id="secret-modal-profile" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono"></select>
  3475. </div>
  3476. </div>
  3477. <div class="grid grid-cols-2 gap-4">
  3478. <div>
  3479. <label class="block font-semibold text-slate-300 mb-1.5">Local Address (Optional)</label>
  3480. <input type="text" id="secret-modal-local" placeholder="Override server IP" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3481. </div>
  3482. <div>
  3483. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (Optional Static IP)</label>
  3484. <input type="text" id="secret-modal-remote" placeholder="Static client IP" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3485. </div>
  3486. </div>
  3487. <div>
  3488. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3489. <input type="text" id="secret-modal-comment" placeholder="Home user / Office user" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  3490. </div>
  3491. <div class="flex items-center space-x-2 pt-1">
  3492. <input type="checkbox" id="secret-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-600">
  3493. <label for="secret-modal-disabled" class="text-slate-300">Disabled</label>
  3494. </div>
  3495. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3496. <button type="button" onclick="closePPPSecretModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3497. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-violet-600 hover:bg-violet-500 text-white shadow-lg shadow-violet-500/20">Save Secret</button>
  3498. </div>
  3499. </form>
  3500. </div>
  3501. </div>
  3502. <!-- ================= MODAL: ADD/EDIT PPP PROFILE ================= -->
  3503. <div id="ppp-profile-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3504. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3505. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3506. <div>
  3507. <h3 id="profile-modal-title" class="text-sm font-bold text-white">Add PPP Profile</h3>
  3508. <p class="text-[11px] text-slate-400">IP pool and encryption settings for PPP servers</p>
  3509. </div>
  3510. <button onclick="closePPPProfileModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3511. </div>
  3512. <form onsubmit="submitSavePPPProfile(event)" class="p-6 space-y-4 text-xs font-sans">
  3513. <input type="hidden" id="profile-modal-id">
  3514. <div>
  3515. <label class="block font-semibold text-slate-300 mb-1.5">Profile Name *</label>
  3516. <input type="text" id="profile-modal-name" placeholder="e.g. office-pool" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-violet-500">
  3517. </div>
  3518. <div class="grid grid-cols-2 gap-4">
  3519. <div>
  3520. <label class="block font-semibold text-slate-300 mb-1.5">Local Address *</label>
  3521. <input type="text" id="profile-modal-local" placeholder="10.10.10.1" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3522. </div>
  3523. <div>
  3524. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (Pool) *</label>
  3525. <input type="text" id="profile-modal-remote" placeholder="10.10.10.10-10.10.10.50" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3526. </div>
  3527. </div>
  3528. <div class="grid grid-cols-2 gap-4">
  3529. <div>
  3530. <label class="block font-semibold text-slate-300 mb-1.5">DNS Servers</label>
  3531. <input type="text" id="profile-modal-dns" value="1.1.1.1,8.8.8.8" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3532. </div>
  3533. <div>
  3534. <label class="block font-semibold text-slate-300 mb-1.5">Use Encryption</label>
  3535. <select id="profile-modal-encryption" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3536. <option value="no">no</option>
  3537. <option value="yes">yes</option>
  3538. <option value="required" selected>required (MPPE-128)</option>
  3539. </select>
  3540. </div>
  3541. </div>
  3542. <div>
  3543. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3544. <input type="text" id="profile-modal-comment" placeholder="Description of this profile" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  3545. </div>
  3546. <div class="flex items-center space-x-2 pt-1">
  3547. <input type="checkbox" id="profile-modal-onlyone" checked class="rounded bg-slate-800 border-slate-700 text-violet-600">
  3548. <label for="profile-modal-onlyone" class="text-slate-300">Only One session per user account</label>
  3549. </div>
  3550. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3551. <button type="button" onclick="closePPPProfileModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3552. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-violet-600 hover:bg-violet-500 text-white shadow-lg shadow-violet-500/20">Save Profile</button>
  3553. </div>
  3554. </form>
  3555. </div>
  3556. </div>
  3557. <!-- ================= MODAL: IPSEC ROADWARRIOR SERVER ================= -->
  3558. <div id="ipsec-server-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3559. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3560. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3561. <div>
  3562. <h3 class="text-sm font-bold text-white">IPSec (IKEv2) Roadwarrior Server</h3>
  3563. <p class="text-[11px] text-slate-400">Mobile VPN server for Windows, macOS, iOS, Android clients</p>
  3564. </div>
  3565. <button onclick="closeIPSecServerModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3566. </div>
  3567. <form onsubmit="submitSaveIPSecServer(event)" class="p-6 space-y-4 text-xs font-sans">
  3568. <div class="flex items-center justify-between border-b border-slate-800 pb-3">
  3569. <span class="text-slate-300 font-semibold">Server State</span>
  3570. <div class="flex items-center gap-3">
  3571. <span id="modal-ipsec-server-status" class="px-2 py-0.5 rounded text-[10px] font-mono font-semibold bg-slate-800 text-slate-400">STOPPED</span>
  3572. <label class="relative inline-flex items-center cursor-pointer">
  3573. <input type="checkbox" id="modal-ipsec-server-enabled" class="sr-only peer">
  3574. <div class="w-11 h-6 bg-slate-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-slate-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-amber-600"></div>
  3575. </label>
  3576. </div>
  3577. </div>
  3578. <div>
  3579. <label class="block font-semibold text-slate-300 mb-1.5">Pre-Shared Key (PSK) *</label>
  3580. <input type="password" id="modal-ipsec-server-psk" placeholder="••••••••" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-amber-500">
  3581. </div>
  3582. <div class="grid grid-cols-2 gap-4">
  3583. <div>
  3584. <label class="block font-semibold text-slate-300 mb-1.5">Virtual IP Pool (CIDR) *</label>
  3585. <input type="text" id="modal-ipsec-server-pool" value="10.10.30.0/24" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3586. </div>
  3587. <div>
  3588. <label class="block font-semibold text-slate-300 mb-1.5">DNS Servers</label>
  3589. <input type="text" id="modal-ipsec-server-dns" value="1.1.1.1,8.8.8.8" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3590. </div>
  3591. </div>
  3592. <div>
  3593. <label class="block font-semibold text-slate-300 mb-1.5">Local Traffic Selector (Subnet)</label>
  3594. <input type="text" id="modal-ipsec-server-subnet" value="0.0.0.0/0" placeholder="0.0.0.0/0 (Full Tunnel)" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3595. </div>
  3596. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3597. <button type="button" onclick="closeIPSecServerModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3598. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-amber-600 hover:bg-amber-500 text-white shadow-lg shadow-amber-500/20">Apply IPSec Server</button>
  3599. </div>
  3600. </form>
  3601. </div>
  3602. </div>
  3603. <!-- ================= MODAL: WIREGUARD CLIENT CONFIG VIEWER ================= -->
  3604. <div id="wg-client-conf-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3605. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3606. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3607. <div>
  3608. <h3 class="text-sm font-bold text-white">WireGuard Client Configuration</h3>
  3609. <p class="text-[11px] text-slate-400">Import this .conf into WireGuard on iOS, Android, macOS or Windows</p>
  3610. </div>
  3611. <button onclick="closeWGClientConfModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3612. </div>
  3613. <div class="p-6 space-y-4">
  3614. <div>
  3615. <label class="block text-xs font-semibold text-slate-300 mb-1.5">WireGuard Client Profile (.conf)</label>
  3616. <textarea id="wg-client-conf-text" rows="11" readonly class="w-full bg-slate-950 border border-slate-800 rounded-xl p-3 text-xs font-mono text-cyan-300 select-all focus:outline-none"></textarea>
  3617. </div>
  3618. <div class="flex justify-between items-center pt-2">
  3619. <span class="text-[11px] text-slate-500">Ready for instant import</span>
  3620. <div class="space-x-2">
  3621. <button onclick="copyWGClientConf()" class="px-4 py-2 rounded-lg text-xs font-semibold bg-slate-800 hover:bg-slate-700 text-white border border-slate-700 transition">
  3622. Copy Config
  3623. </button>
  3624. <button onclick="downloadWGClientConf()" class="px-4 py-2 rounded-lg text-xs font-semibold bg-cyan-600 hover:bg-cyan-500 text-white shadow-lg shadow-cyan-500/20 transition">
  3625. Download .conf
  3626. </button>
  3627. </div>
  3628. </div>
  3629. </div>
  3630. </div>
  3631. </div>
  3632. <!-- ================= MODAL: BGP INSTANCE SETTINGS ================= -->
  3633. <div id="bgp-instance-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3634. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3635. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3636. <div>
  3637. <h3 class="text-sm font-bold text-white">BGP Instance Settings (/routing bgp instance)</h3>
  3638. <p class="text-[11px] text-slate-400">Configure global Autonomous System and route redistribution</p>
  3639. </div>
  3640. <button onclick="closeBgpInstanceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3641. </div>
  3642. <form id="bgp-instance-form" onsubmit="submitBgpInstance(event)" class="p-6 space-y-4 text-xs">
  3643. <div class="flex items-center justify-between p-3 rounded-xl bg-slate-800/60 border border-slate-700/60">
  3644. <div>
  3645. <div class="font-semibold text-white">Enable BGP Routing</div>
  3646. <div class="text-[11px] text-slate-400">Run FRRouting bgpd service for dynamic exterior gateway routing</div>
  3647. </div>
  3648. <input type="checkbox" id="modal-bgp-enabled" class="w-4 h-4 rounded text-purple-600 focus:ring-purple-500 bg-slate-800 border-slate-600">
  3649. </div>
  3650. <div class="grid grid-cols-2 gap-4">
  3651. <div>
  3652. <label class="block font-semibold text-slate-300 mb-1.5">Autonomous System (AS) *</label>
  3653. <input type="number" id="modal-bgp-as" required min="1" max="4294967295" placeholder="65001" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-purple-500">
  3654. </div>
  3655. <div>
  3656. <label class="block font-semibold text-slate-300 mb-1.5">Router ID</label>
  3657. <input type="text" id="modal-bgp-router-id" placeholder="192.168.131.56" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-purple-500">
  3658. </div>
  3659. </div>
  3660. <div class="grid grid-cols-2 gap-4">
  3661. <div>
  3662. <label class="block font-semibold text-slate-300 mb-1.5">Keepalive Time (s)</label>
  3663. <input type="number" id="modal-bgp-keepalive" value="60" min="1" max="65535" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3664. </div>
  3665. <div>
  3666. <label class="block font-semibold text-slate-300 mb-1.5">Hold Time (s)</label>
  3667. <input type="number" id="modal-bgp-holdtime" value="180" min="3" max="65535" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3668. </div>
  3669. </div>
  3670. <div class="border-t border-slate-800 pt-3">
  3671. <label class="block font-semibold text-slate-300 mb-2">Redistribute Routes into BGP</label>
  3672. <div class="space-y-2">
  3673. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3674. <input type="checkbox" id="modal-bgp-redist-conn" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3675. <span>Redistribute Connected Subnets</span>
  3676. </label>
  3677. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3678. <input type="checkbox" id="modal-bgp-redist-static" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3679. <span>Redistribute Static Routes</span>
  3680. </label>
  3681. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3682. <input type="checkbox" id="modal-bgp-redist-ospf" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3683. <span>Redistribute OSPF Routes</span>
  3684. </label>
  3685. </div>
  3686. </div>
  3687. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3688. <button type="button" onclick="closeBgpInstanceModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3689. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-purple-600 hover:bg-purple-500 text-white shadow-lg shadow-purple-500/20">Save BGP Settings</button>
  3690. </div>
  3691. </form>
  3692. </div>
  3693. </div>
  3694. <!-- ================= MODAL: BGP PEER ================= -->
  3695. <div id="bgp-peer-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3696. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3697. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3698. <div>
  3699. <h3 id="bgp-peer-modal-title" class="text-sm font-bold text-white">Add BGP Peer Connection</h3>
  3700. <p class="text-[11px] text-slate-400">Establish eBGP / iBGP session with remote router</p>
  3701. </div>
  3702. <button onclick="closeBgpPeerModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3703. </div>
  3704. <form id="bgp-peer-form" onsubmit="submitBgpPeer(event)" class="p-6 space-y-4 text-xs">
  3705. <input type="hidden" id="modal-bgp-peer-id">
  3706. <div>
  3707. <label class="block font-semibold text-slate-300 mb-1.5">Connection Name *</label>
  3708. <input type="text" id="modal-bgp-peer-name" required placeholder="upstream-carrier-a" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3709. </div>
  3710. <div class="grid grid-cols-2 gap-4">
  3711. <div>
  3712. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (IP) *</label>
  3713. <input type="text" id="modal-bgp-peer-remote-addr" required placeholder="192.168.131.1" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3714. </div>
  3715. <div>
  3716. <label class="block font-semibold text-slate-300 mb-1.5">Remote AS *</label>
  3717. <input type="number" id="modal-bgp-peer-remote-as" required min="1" max="4294967295" placeholder="65000" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3718. </div>
  3719. </div>
  3720. <div class="grid grid-cols-2 gap-4">
  3721. <div>
  3722. <label class="block font-semibold text-slate-300 mb-1.5">Local Address (Update Source)</label>
  3723. <input type="text" id="modal-bgp-peer-local-addr" placeholder="Optional source IP/iface" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3724. </div>
  3725. <div>
  3726. <label class="block font-semibold text-slate-300 mb-1.5">MD5 Password (BGP Auth)</label>
  3727. <input type="password" id="modal-bgp-peer-password" placeholder="Optional secret" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3728. </div>
  3729. </div>
  3730. <div class="grid grid-cols-2 gap-4">
  3731. <div>
  3732. <label class="block font-semibold text-slate-300 mb-1.5">In Filter (Routing Filter Chain)</label>
  3733. <input type="text" id="modal-bgp-peer-in-filter" placeholder="e.g. bgp-in" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3734. <p class="text-[10px] text-slate-500 mt-0.5">Filter chain for inbound routes from peer</p>
  3735. </div>
  3736. <div>
  3737. <label class="block font-semibold text-slate-300 mb-1.5">Out Filter (Routing Filter Chain)</label>
  3738. <input type="text" id="modal-bgp-peer-out-filter" placeholder="e.g. bgp-out" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3739. <p class="text-[10px] text-slate-500 mt-0.5">Filter chain for outbound routes to peer</p>
  3740. </div>
  3741. </div>
  3742. <div class="grid grid-cols-2 gap-3 p-3 rounded-xl bg-slate-800/40 border border-slate-700/50">
  3743. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3744. <input type="checkbox" id="modal-bgp-peer-multihop" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3745. <span>eBGP Multi-hop</span>
  3746. </label>
  3747. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3748. <input type="checkbox" id="modal-bgp-peer-nexthop-self" checked class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3749. <span>Next-hop Self</span>
  3750. </label>
  3751. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3752. <input type="checkbox" id="modal-bgp-peer-passive" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3753. <span>Passive Mode</span>
  3754. </label>
  3755. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3756. <input type="checkbox" id="modal-bgp-peer-disabled" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3757. <span>Disabled (X)</span>
  3758. </label>
  3759. </div>
  3760. <div>
  3761. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3762. <input type="text" id="modal-bgp-peer-comment" placeholder="Core transit uplink" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  3763. </div>
  3764. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3765. <button type="button" onclick="closeBgpPeerModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3766. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-purple-600 hover:bg-purple-500 text-white shadow-lg shadow-purple-500/20">Save Peer</button>
  3767. </div>
  3768. </form>
  3769. </div>
  3770. </div>
  3771. <!-- ================= MODAL: BGP NETWORK ================= -->
  3772. <div id="bgp-network-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3773. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3774. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3775. <h3 id="bgp-network-modal-title" class="text-sm font-bold text-white">Advertise BGP Network</h3>
  3776. <button onclick="closeBgpNetworkModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3777. </div>
  3778. <form id="bgp-network-form" onsubmit="submitBgpNetwork(event)" class="p-6 space-y-4 text-xs">
  3779. <input type="hidden" id="modal-bgp-net-id">
  3780. <div>
  3781. <label class="block font-semibold text-slate-300 mb-1.5">Network Prefix (CIDR) *</label>
  3782. <input type="text" id="modal-bgp-net-cidr" required placeholder="10.200.0.0/24" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-purple-500">
  3783. </div>
  3784. <div>
  3785. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3786. <input type="text" id="modal-bgp-net-comment" placeholder="Public IP block prefix" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  3787. </div>
  3788. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3789. <input type="checkbox" id="modal-bgp-net-disabled" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3790. <span>Disabled</span>
  3791. </label>
  3792. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3793. <button type="button" onclick="closeBgpNetworkModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3794. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-purple-600 hover:bg-purple-500 text-white shadow-lg shadow-purple-500/20">Save Network</button>
  3795. </div>
  3796. </form>
  3797. </div>
  3798. </div>
  3799. <!-- ================= MODAL: OSPF INSTANCE SETTINGS ================= -->
  3800. <div id="ospf-instance-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3801. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3802. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3803. <div>
  3804. <h3 class="text-sm font-bold text-white">OSPF Instance Settings (/routing ospf instance)</h3>
  3805. <p class="text-[11px] text-slate-400">Configure OSPFv2 link-state routing daemon and redistributions</p>
  3806. </div>
  3807. <button onclick="closeOspfInstanceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3808. </div>
  3809. <form id="ospf-instance-form" onsubmit="submitOspfInstance(event)" class="p-6 space-y-4 text-xs">
  3810. <div class="flex items-center justify-between p-3 rounded-xl bg-slate-800/60 border border-slate-700/60">
  3811. <div>
  3812. <div class="font-semibold text-white">Enable OSPF Routing</div>
  3813. <div class="text-[11px] text-slate-400">Run FRRouting ospfd service for dynamic interior gateway routing</div>
  3814. </div>
  3815. <input type="checkbox" id="modal-ospf-enabled" class="w-4 h-4 rounded text-indigo-600 focus:ring-indigo-500 bg-slate-800 border-slate-600">
  3816. </div>
  3817. <div class="grid grid-cols-2 gap-4">
  3818. <div>
  3819. <label class="block font-semibold text-slate-300 mb-1.5">Router ID</label>
  3820. <input type="text" id="modal-ospf-router-id" placeholder="192.168.131.56" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-indigo-500">
  3821. </div>
  3822. <div>
  3823. <label class="block font-semibold text-slate-300 mb-1.5">Default Metric</label>
  3824. <input type="number" id="modal-ospf-metric" value="10" min="1" max="65535" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3825. </div>
  3826. </div>
  3827. <div class="border-t border-slate-800 pt-3">
  3828. <label class="block font-semibold text-slate-300 mb-2">Redistribute Routes into OSPF</label>
  3829. <div class="space-y-2">
  3830. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3831. <input type="checkbox" id="modal-ospf-redist-conn" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3832. <span>Redistribute Connected Subnets</span>
  3833. </label>
  3834. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3835. <input type="checkbox" id="modal-ospf-redist-static" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3836. <span>Redistribute Static Routes</span>
  3837. </label>
  3838. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3839. <input type="checkbox" id="modal-ospf-redist-bgp" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3840. <span>Redistribute BGP Routes</span>
  3841. </label>
  3842. </div>
  3843. </div>
  3844. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3845. <button type="button" onclick="closeOspfInstanceModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3846. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-indigo-600 hover:bg-indigo-500 text-white shadow-lg shadow-indigo-500/20">Save OSPF Settings</button>
  3847. </div>
  3848. </form>
  3849. </div>
  3850. </div>
  3851. <!-- ================= MODAL: OSPF AREA ================= -->
  3852. <div id="ospf-area-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3853. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3854. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3855. <h3 id="ospf-area-modal-title" class="text-sm font-bold text-white">Add OSPF Area</h3>
  3856. <button onclick="closeOspfAreaModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3857. </div>
  3858. <form id="ospf-area-form" onsubmit="submitOspfArea(event)" class="p-6 space-y-4 text-xs">
  3859. <input type="hidden" id="modal-ospf-area-id">
  3860. <div>
  3861. <label class="block font-semibold text-slate-300 mb-1.5">Area Name *</label>
  3862. <input type="text" id="modal-ospf-area-name" required placeholder="backbone" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3863. </div>
  3864. <div class="grid grid-cols-2 gap-4">
  3865. <div>
  3866. <label class="block font-semibold text-slate-300 mb-1.5">Area ID *</label>
  3867. <input type="text" id="modal-ospf-area-areaid" required placeholder="0.0.0.0" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3868. </div>
  3869. <div>
  3870. <label class="block font-semibold text-slate-300 mb-1.5">Area Type</label>
  3871. <select id="modal-ospf-area-type" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3872. <option value="default">Default / Normal</option>
  3873. <option value="stub">Stub</option>
  3874. <option value="nssa">NSSA</option>
  3875. </select>
  3876. </div>
  3877. </div>
  3878. <div>
  3879. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3880. <input type="text" id="modal-ospf-area-comment" placeholder="Area description" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  3881. </div>
  3882. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3883. <button type="button" onclick="closeOspfAreaModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3884. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-indigo-600 hover:bg-indigo-500 text-white shadow-lg shadow-indigo-500/20">Save Area</button>
  3885. </div>
  3886. </form>
  3887. </div>
  3888. </div>
  3889. <!-- ================= MODAL: OSPF INTERFACE ================= -->
  3890. <div id="ospf-interface-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3891. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3892. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3893. <div>
  3894. <h3 id="ospf-interface-modal-title" class="text-sm font-bold text-white">Add OSPF Interface</h3>
  3895. <p class="text-[11px] text-slate-400">Configure OSPF link parameters on a network subnet or interface</p>
  3896. </div>
  3897. <button onclick="closeOspfInterfaceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3898. </div>
  3899. <form id="ospf-interface-form" onsubmit="submitOspfInterface(event)" class="p-6 space-y-4 text-xs">
  3900. <input type="hidden" id="modal-ospf-iface-id">
  3901. <div class="grid grid-cols-2 gap-4">
  3902. <div>
  3903. <label class="block font-semibold text-slate-300 mb-1.5">Subnet Network (CIDR) *</label>
  3904. <input type="text" id="modal-ospf-iface-net" required placeholder="192.168.131.0/24" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3905. </div>
  3906. <div>
  3907. <label class="block font-semibold text-slate-300 mb-1.5">OSPF Area *</label>
  3908. <input type="text" id="modal-ospf-iface-area" required value="0.0.0.0" placeholder="0.0.0.0" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3909. </div>
  3910. </div>
  3911. <div class="grid grid-cols-2 gap-4">
  3912. <div>
  3913. <label class="block font-semibold text-slate-300 mb-1.5">Interface (Optional Device)</label>
  3914. <select id="modal-ospf-iface-device" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3915. <option value="">Any matching interface</option>
  3916. </select>
  3917. </div>
  3918. <div>
  3919. <label class="block font-semibold text-slate-300 mb-1.5">Metric Cost</label>
  3920. <input type="number" id="modal-ospf-iface-cost" value="10" min="1" max="65535" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3921. </div>
  3922. </div>
  3923. <div class="grid grid-cols-3 gap-3">
  3924. <div>
  3925. <label class="block font-semibold text-slate-300 mb-1.5">Priority</label>
  3926. <input type="number" id="modal-ospf-iface-priority" value="1" min="0" max="255" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3927. </div>
  3928. <div>
  3929. <label class="block font-semibold text-slate-300 mb-1.5">Hello (s)</label>
  3930. <input type="number" id="modal-ospf-iface-hello" value="10" min="1" max="65535" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3931. </div>
  3932. <div>
  3933. <label class="block font-semibold text-slate-300 mb-1.5">Dead (s)</label>
  3934. <input type="number" id="modal-ospf-iface-dead" value="40" min="1" max="65535" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3935. </div>
  3936. </div>
  3937. <div class="grid grid-cols-2 gap-4">
  3938. <div>
  3939. <label class="block font-semibold text-slate-300 mb-1.5">Authentication Type</label>
  3940. <select id="modal-ospf-iface-auth-type" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3941. <option value="none">None</option>
  3942. <option value="simple">Simple Password</option>
  3943. <option value="md5">MD5 Cryptographic</option>
  3944. </select>
  3945. </div>
  3946. <div>
  3947. <label class="block font-semibold text-slate-300 mb-1.5">Auth Secret Key</label>
  3948. <input type="password" id="modal-ospf-iface-auth-key" placeholder="••••••••" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3949. </div>
  3950. </div>
  3951. <div class="grid grid-cols-2 gap-3 p-3 rounded-xl bg-slate-800/40 border border-slate-700/50">
  3952. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3953. <input type="checkbox" id="modal-ospf-iface-passive" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3954. <span>Passive (Do not form adjs)</span>
  3955. </label>
  3956. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3957. <input type="checkbox" id="modal-ospf-iface-disabled" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3958. <span>Disabled (X)</span>
  3959. </label>
  3960. </div>
  3961. <div>
  3962. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3963. <input type="text" id="modal-ospf-iface-comment" placeholder="LAN segment routing" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  3964. </div>
  3965. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3966. <button type="button" onclick="closeOspfInterfaceModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3967. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-indigo-600 hover:bg-indigo-500 text-white shadow-lg shadow-indigo-500/20">Save Interface</button>
  3968. </div>
  3969. </form>
  3970. </div>
  3971. </div>
  3972. <!-- ================= MODAL: ADD / EDIT ROUTING FILTER ================= -->
  3973. <div id="modal-routing-filter" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3974. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-xl shadow-2xl overflow-hidden animate-in">
  3975. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3976. <div>
  3977. <h3 id="modal-rf-title" class="text-sm font-bold text-white">Add Routing Filter Rule</h3>
  3978. <p class="text-[11px] text-slate-400">Match routing prefixes, AS-Path, communities, and set BGP attributes (/routing filter)</p>
  3979. </div>
  3980. <button onclick="closeRoutingFilterModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3981. </div>
  3982. <form id="routing-filter-form" onsubmit="submitRoutingFilter(event)" class="p-6 space-y-4 text-xs max-h-[85vh] overflow-y-auto">
  3983. <input type="hidden" id="modal-rf-id">
  3984. <div class="grid grid-cols-3 gap-3">
  3985. <div class="col-span-1">
  3986. <label class="block font-semibold text-slate-300 mb-1.5">Chain Name *</label>
  3987. <input type="text" id="modal-rf-chain" required placeholder="bgp-in" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3988. <p class="text-[10px] text-slate-500 mt-0.5">e.g. bgp-in, bgp-out</p>
  3989. </div>
  3990. <div>
  3991. <label class="block font-semibold text-slate-300 mb-1.5">Rule Order *</label>
  3992. <input type="number" id="modal-rf-order" value="10" min="1" max="65535" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3993. <p class="text-[10px] text-slate-500 mt-0.5">Sequence (10, 20...)</p>
  3994. </div>
  3995. <div>
  3996. <label class="block font-semibold text-slate-300 mb-1.5">Action *</label>
  3997. <select id="modal-rf-action" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3998. <option value="accept">accept (Permit)</option>
  3999. <option value="discard">discard (Deny)</option>
  4000. <option value="reject">reject (Deny)</option>
  4001. <option value="passthrough">passthrough (Continue)</option>
  4002. </select>
  4003. <p class="text-[10px] text-slate-500 mt-0.5">Filter action</p>
  4004. </div>
  4005. </div>
  4006. <!-- Match Criteria Box -->
  4007. <div class="p-3.5 rounded-xl bg-slate-800/40 border border-slate-700/50 space-y-3">
  4008. <div class="text-[11px] font-bold text-cyan-400 uppercase tracking-wider">Match Conditions</div>
  4009. <div class="grid grid-cols-2 gap-3">
  4010. <div>
  4011. <label class="block font-medium text-slate-300 mb-1">Prefix (CIDR)</label>
  4012. <input type="text" id="modal-rf-prefix" placeholder="e.g. 10.0.0.0/8 or 0.0.0.0/0" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  4013. <p class="text-[10px] text-slate-500 mt-0.5">Leave blank to match all prefixes</p>
  4014. </div>
  4015. <div>
  4016. <label class="block font-medium text-slate-300 mb-1">Prefix Length (Range)</label>
  4017. <input type="text" id="modal-rf-prefix-len" placeholder="e.g. 16-24 or ge 24 le 32" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  4018. <p class="text-[10px] text-slate-500 mt-0.5">Optional subnet mask length filter</p>
  4019. </div>
  4020. </div>
  4021. <div class="grid grid-cols-3 gap-3">
  4022. <div>
  4023. <label class="block font-medium text-slate-300 mb-1">Match Protocol</label>
  4024. <select id="modal-rf-protocol" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  4025. <option value="any">Any Protocol</option>
  4026. <option value="bgp">BGP</option>
  4027. <option value="ospf">OSPF</option>
  4028. <option value="connected">Connected</option>
  4029. <option value="static">Static</option>
  4030. </select>
  4031. </div>
  4032. <div>
  4033. <label class="block font-medium text-slate-300 mb-1">Match AS-Path (Regex)</label>
  4034. <input type="text" id="modal-rf-as-path" placeholder="e.g. ^65001_ or _65000$" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  4035. </div>
  4036. <div>
  4037. <label class="block font-medium text-slate-300 mb-1">Match Community</label>
  4038. <input type="text" id="modal-rf-community" placeholder="e.g. 65001:100" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  4039. </div>
  4040. </div>
  4041. </div>
  4042. <!-- Set Attributes Box (Modifications) -->
  4043. <div class="p-3.5 rounded-xl bg-slate-800/40 border border-slate-700/50 space-y-3">
  4044. <div class="text-[11px] font-bold text-purple-400 uppercase tracking-wider">Set Modifications (On Accept)</div>
  4045. <div class="grid grid-cols-3 gap-3">
  4046. <div>
  4047. <label class="block font-medium text-slate-300 mb-1">Set BGP Local Pref</label>
  4048. <input type="number" id="modal-rf-set-local-pref" placeholder="e.g. 150" min="0" max="4294967295" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  4049. </div>
  4050. <div>
  4051. <label class="block font-medium text-slate-300 mb-1">Set Metric / MED</label>
  4052. <input type="number" id="modal-rf-set-metric" placeholder="e.g. 20" min="0" max="4294967295" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  4053. </div>
  4054. <div>
  4055. <label class="block font-medium text-slate-300 mb-1">Set AS Prepend (Count)</label>
  4056. <input type="number" id="modal-rf-set-as-prepend" placeholder="e.g. 2" min="1" max="10" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  4057. </div>
  4058. </div>
  4059. <div class="grid grid-cols-2 gap-3">
  4060. <div>
  4061. <label class="block font-medium text-slate-300 mb-1">Set Community</label>
  4062. <input type="text" id="modal-rf-set-community" placeholder="e.g. 65001:200 or no-export" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  4063. </div>
  4064. <div>
  4065. <label class="block font-medium text-slate-300 mb-1">Set Next Hop (IP)</label>
  4066. <input type="text" id="modal-rf-set-next-hop" placeholder="e.g. 192.168.1.1" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  4067. </div>
  4068. </div>
  4069. </div>
  4070. <div class="grid grid-cols-3 gap-3">
  4071. <div class="col-span-2">
  4072. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  4073. <input type="text" id="modal-rf-comment" placeholder="Filter upstream customer prefix" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  4074. </div>
  4075. <div class="flex items-center pt-6">
  4076. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  4077. <input type="checkbox" id="modal-rf-disabled" class="rounded text-emerald-600 bg-slate-800 border-slate-700">
  4078. <span class="font-medium">Disabled (X)</span>
  4079. </label>
  4080. </div>
  4081. </div>
  4082. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  4083. <button type="button" onclick="closeRoutingFilterModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  4084. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20">Save Filter Rule</button>
  4085. </div>
  4086. </form>
  4087. </div>
  4088. </div>
  4089. <!-- ================= MODAL: ADD / EDIT BRIDGE ================= -->
  4090. <div id="bridge-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  4091. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  4092. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  4093. <h3 id="bridge-modal-title" class="text-sm font-bold text-white">Add Bridge Interface</h3>
  4094. <button onclick="closeBridgeModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  4095. </div>
  4096. <form onsubmit="submitSaveBridge(event)" class="p-6 space-y-4 text-xs">
  4097. <input type="hidden" id="bridge-modal-id">
  4098. <div class="grid grid-cols-2 gap-4">
  4099. <div>
  4100. <label class="block font-semibold text-slate-300 mb-1.5">Bridge Name *</label>
  4101. <input type="text" id="bridge-modal-name" required placeholder="e.g. bridge1" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4102. </div>
  4103. <div>
  4104. <label class="block font-semibold text-slate-300 mb-1.5">MTU</label>
  4105. <input type="number" id="bridge-modal-mtu" value="1500" min="68" max="65535" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4106. </div>
  4107. </div>
  4108. <div>
  4109. <label class="block font-semibold text-slate-300 mb-1.5">Admin MAC Address (Optional)</label>
  4110. <input type="text" id="bridge-modal-mac" placeholder="Leave blank for auto MAC" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4111. </div>
  4112. <div class="grid grid-cols-2 gap-4">
  4113. <div>
  4114. <label class="block font-semibold text-slate-300 mb-1.5">STP Protocol</label>
  4115. <select id="bridge-modal-stp" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4116. <option value="rstp" selected>RSTP (Rapid STP - Recommended)</option>
  4117. <option value="stp">STP (IEEE 802.1D)</option>
  4118. <option value="none">none (Disable STP)</option>
  4119. </select>
  4120. </div>
  4121. <div>
  4122. <label class="block font-semibold text-slate-300 mb-1.5">STP Priority</label>
  4123. <input type="number" id="bridge-modal-priority" value="32768" min="0" max="65535" step="4096" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4124. </div>
  4125. </div>
  4126. <!-- VLAN Filtering Box -->
  4127. <div class="p-3.5 bg-slate-950/60 border border-slate-800 rounded-xl space-y-3">
  4128. <label class="flex items-center space-x-2.5 cursor-pointer">
  4129. <input type="checkbox" id="bridge-modal-vlanfiltering" onchange="toggleBridgeModalVlanFiltering()" class="rounded bg-slate-800 border-slate-700 text-sky-500">
  4130. <span class="font-semibold text-white">VLAN Filtering (802.1Q Aware)</span>
  4131. </label>
  4132. <div id="bridge-modal-pvid-box" class="grid grid-cols-2 gap-3 pl-6">
  4133. <div>
  4134. <label class="block text-[11px] text-slate-400 mb-1">Default PVID</label>
  4135. <input type="number" id="bridge-modal-pvid" value="1" min="1" max="4094" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-white font-mono text-xs">
  4136. </div>
  4137. <div class="flex items-center pt-4">
  4138. <label class="flex items-center space-x-2 text-slate-400 cursor-pointer text-xs">
  4139. <input type="checkbox" id="bridge-modal-fastforward" checked class="rounded bg-slate-800 border-slate-700 text-sky-500">
  4140. <span>Fast Forward</span>
  4141. </label>
  4142. </div>
  4143. </div>
  4144. </div>
  4145. <div>
  4146. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  4147. <input type="text" id="bridge-modal-comment" placeholder="e.g. LAN Bridge with EoIP" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  4148. </div>
  4149. <div class="pt-1">
  4150. <label class="flex items-center space-x-2 cursor-pointer">
  4151. <input type="checkbox" id="bridge-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  4152. <span class="font-medium text-slate-300">Disabled (X)</span>
  4153. </label>
  4154. </div>
  4155. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  4156. <button type="button" onclick="closeBridgeModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  4157. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-sky-600 hover:bg-sky-500 text-white shadow-lg shadow-sky-500/20">Save Bridge</button>
  4158. </div>
  4159. </form>
  4160. </div>
  4161. </div>
  4162. <!-- ================= MODAL: ADD / EDIT BRIDGE PORT ================= -->
  4163. <div id="bridge-port-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  4164. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  4165. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  4166. <h3 id="bridge-port-modal-title" class="text-sm font-bold text-white">Add Port to Bridge</h3>
  4167. <button onclick="closeBridgePortModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  4168. </div>
  4169. <form onsubmit="submitSaveBridgePort(event)" class="p-6 space-y-4 text-xs">
  4170. <input type="hidden" id="bridge-port-modal-id">
  4171. <div class="grid grid-cols-2 gap-4">
  4172. <div>
  4173. <label class="block font-semibold text-slate-300 mb-1.5">Target Bridge *</label>
  4174. <select id="bridge-port-modal-bridge" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono"></select>
  4175. </div>
  4176. <div>
  4177. <label class="block font-semibold text-slate-300 mb-1.5">Interface *</label>
  4178. <select id="bridge-port-modal-interface" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono"></select>
  4179. </div>
  4180. </div>
  4181. <div class="grid grid-cols-3 gap-3">
  4182. <div>
  4183. <label class="block font-semibold text-slate-300 mb-1.5">PVID</label>
  4184. <input type="number" id="bridge-port-modal-pvid" value="1" min="1" max="4094" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4185. </div>
  4186. <div>
  4187. <label class="block font-semibold text-slate-300 mb-1.5">Path Cost</label>
  4188. <input type="number" id="bridge-port-modal-pathcost" value="10" min="1" max="65535" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4189. </div>
  4190. <div>
  4191. <label class="block font-semibold text-slate-300 mb-1.5">Horizon (Split)</label>
  4192. <input type="number" id="bridge-port-modal-horizon" value="0" min="0" max="65535" title="0=none. Ports with identical horizon > 0 cannot communicate (split-horizon isolation for EoIP / VPLS)" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4193. </div>
  4194. </div>
  4195. <div class="grid grid-cols-2 gap-4">
  4196. <div>
  4197. <label class="block font-semibold text-slate-300 mb-1.5">Frame Types</label>
  4198. <select id="bridge-port-modal-frametypes" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4199. <option value="admit-all" selected>admit all</option>
  4200. <option value="admit-only-vlan-tagged">admit only VLAN tagged</option>
  4201. <option value="admit-only-untagged-and-priority-tagged">admit only untagged</option>
  4202. </select>
  4203. </div>
  4204. <div>
  4205. <label class="block font-semibold text-slate-300 mb-1.5">Priority</label>
  4206. <input type="number" id="bridge-port-modal-priority" value="128" min="0" max="240" step="16" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4207. </div>
  4208. </div>
  4209. <div class="grid grid-cols-2 gap-3 p-3 bg-slate-950/60 border border-slate-800 rounded-xl">
  4210. <label class="flex items-center space-x-2 cursor-pointer">
  4211. <input type="checkbox" id="bridge-port-modal-learn" checked class="rounded bg-slate-800 border-slate-700 text-sky-500">
  4212. <span class="text-white font-semibold">MAC Learning</span>
  4213. </label>
  4214. <label class="flex items-center space-x-2 cursor-pointer">
  4215. <input type="checkbox" id="bridge-port-modal-ingressfiltering" class="rounded bg-slate-800 border-slate-700 text-sky-500">
  4216. <span class="text-white font-semibold">Ingress Filtering</span>
  4217. </label>
  4218. </div>
  4219. <div>
  4220. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  4221. <input type="text" id="bridge-port-modal-comment" placeholder="e.g. Uplink to switch" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  4222. </div>
  4223. <div class="pt-1">
  4224. <label class="flex items-center space-x-2 cursor-pointer">
  4225. <input type="checkbox" id="bridge-port-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  4226. <span class="font-medium text-slate-300">Disabled (X)</span>
  4227. </label>
  4228. </div>
  4229. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  4230. <button type="button" onclick="closeBridgePortModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  4231. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-sky-600 hover:bg-sky-500 text-white shadow-lg shadow-sky-500/20">Save Port</button>
  4232. </div>
  4233. </form>
  4234. </div>
  4235. </div>
  4236. <!-- ================= MODAL: ADD / EDIT BRIDGE VLAN ================= -->
  4237. <div id="bridge-vlan-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  4238. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  4239. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  4240. <h3 id="bridge-vlan-modal-title" class="text-sm font-bold text-white">Add Bridge VLAN Entry</h3>
  4241. <button onclick="closeBridgeVlanModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  4242. </div>
  4243. <form onsubmit="submitSaveBridgeVLAN(event)" class="p-6 space-y-4 text-xs">
  4244. <input type="hidden" id="bridge-vlan-modal-id">
  4245. <div class="grid grid-cols-2 gap-4">
  4246. <div>
  4247. <label class="block font-semibold text-slate-300 mb-1.5">Target Bridge *</label>
  4248. <select id="bridge-vlan-modal-bridge" onchange="updateBridgeVlanPortCheckboxes()" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono"></select>
  4249. </div>
  4250. <div>
  4251. <label class="block font-semibold text-slate-300 mb-1.5">VLAN IDs *</label>
  4252. <input type="text" id="bridge-vlan-modal-vlanids" required placeholder="e.g. 10 or 10,20,30 or 10-20" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4253. </div>
  4254. </div>
  4255. <div>
  4256. <label class="block font-semibold text-slate-300 mb-1.5">Tagged Member Ports (Trunk)</label>
  4257. <div id="bridge-vlan-tagged-ports" class="max-h-36 overflow-y-auto p-2.5 bg-slate-950/60 border border-slate-800 rounded-xl space-y-1 font-mono text-slate-300">
  4258. <span class="text-slate-500 text-xs font-sans">Select a bridge above to view member ports</span>
  4259. </div>
  4260. </div>
  4261. <div>
  4262. <label class="block font-semibold text-slate-300 mb-1.5">Untagged Member Ports (Access)</label>
  4263. <div id="bridge-vlan-untagged-ports" class="max-h-36 overflow-y-auto p-2.5 bg-slate-950/60 border border-slate-800 rounded-xl space-y-1 font-mono text-slate-300">
  4264. <span class="text-slate-500 text-xs font-sans">Select a bridge above to view member ports</span>
  4265. </div>
  4266. </div>
  4267. <div>
  4268. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  4269. <input type="text" id="bridge-vlan-modal-comment" placeholder="e.g. Office & Guest VLANs" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  4270. </div>
  4271. <div class="pt-1">
  4272. <label class="flex items-center space-x-2 cursor-pointer">
  4273. <input type="checkbox" id="bridge-vlan-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  4274. <span class="font-medium text-slate-300">Disabled (X)</span>
  4275. </label>
  4276. </div>
  4277. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  4278. <button type="button" onclick="closeBridgeVlanModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  4279. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-sky-600 hover:bg-sky-500 text-white shadow-lg shadow-sky-500/20">Save VLAN Entry</button>
  4280. </div>
  4281. </form>
  4282. </div>
  4283. </div>
  4284. <!-- ================= MODAL: ADD IP ADDRESS TO BRIDGE ================= -->
  4285. <div id="bridge-ip-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  4286. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-sm shadow-2xl overflow-hidden animate-in">
  4287. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  4288. <div>
  4289. <h3 class="text-sm font-bold text-white">Assign IP Address to Bridge</h3>
  4290. <span id="bridge-ip-modal-sub" class="text-[11px] font-mono text-sky-400">bridge1</span>
  4291. </div>
  4292. <button onclick="closeBridgeIPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  4293. </div>
  4294. <form onsubmit="submitAddBridgeIP(event)" class="p-6 space-y-4 text-xs">
  4295. <input type="hidden" id="bridge-ip-modal-id">
  4296. <div>
  4297. <label class="block font-semibold text-slate-300 mb-1.5">IPv4 / Subnet (CIDR) *</label>
  4298. <input type="text" id="bridge-ip-modal-cidr" required placeholder="e.g. 192.168.88.1/24" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4299. </div>
  4300. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  4301. <button type="button" onclick="closeBridgeIPModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  4302. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-sky-600 hover:bg-sky-500 text-white shadow-lg shadow-sky-500/20">Assign IP</button>
  4303. </div>
  4304. </form>
  4305. </div>
  4306. </div>
  4307. <script src="app.js?v=3.4"></script>
  4308. </body>
  4309. </html>