index.html 223 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466
  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="#vlans" onclick="navigate('vlans')" id="nav-vlans"
  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" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  99. <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" />
  100. </svg>
  101. <span>VLANs (802.1Q)</span>
  102. </div>
  103. <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>
  104. </a>
  105. <a href="#firewall" onclick="navigate('firewall')" id="nav-firewall"
  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 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  109. <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" />
  110. </svg>
  111. <span>Firewall</span>
  112. </div>
  113. <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>
  114. </a>
  115. <a href="#routes" onclick="navigate('routes')" id="nav-routes"
  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-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  119. <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" />
  120. </svg>
  121. <span>Routes & Policy</span>
  122. </div>
  123. <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>
  124. </a>
  125. <a href="#dynamic-routing" onclick="navigate('dynamic-routing')" id="nav-dynamic-routing"
  126. 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">
  127. <div class="flex items-center space-x-2.5">
  128. <svg class="w-4 h-4 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  129. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  130. </svg>
  131. <span>BGP & OSPF</span>
  132. </div>
  133. <div class="flex items-center gap-1.5">
  134. <span id="badge-bgp-dot" class="w-2 h-2 rounded-full bg-slate-600" title="BGP Status"></span>
  135. <span id="badge-ospf-dot" class="w-2 h-2 rounded-full bg-slate-600" title="OSPF Status"></span>
  136. </div>
  137. </a>
  138. <!-- CATEGORY: WAN & ACCESS -->
  139. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">WAN & Access</div>
  140. <a href="#pppoe" onclick="navigate('pppoe')" id="nav-pppoe"
  141. 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">
  142. <div class="flex items-center space-x-2.5">
  143. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  144. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
  145. </svg>
  146. <span>PPPoE Client</span>
  147. </div>
  148. <span id="badge-pppoe-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  149. </a>
  150. <!-- CATEGORY: VPN & TUNNELS -->
  151. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">VPN & Tunnels</div>
  152. <a href="#wireguard" onclick="navigate('wireguard')" id="nav-wireguard"
  153. 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">
  154. <div class="flex items-center space-x-2.5">
  155. <svg class="w-4 h-4 text-rose-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  156. <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" />
  157. </svg>
  158. <span>WireGuard</span>
  159. </div>
  160. <span id="badge-wg-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  161. </a>
  162. <a href="#ipsec" onclick="navigate('ipsec')" id="nav-ipsec"
  163. 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">
  164. <div class="flex items-center space-x-2.5">
  165. <svg class="w-4 h-4 text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  166. <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" />
  167. </svg>
  168. <span>IPSec (IKEv2)</span>
  169. </div>
  170. <span id="badge-ipsec-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  171. </a>
  172. <a href="#l2tp" onclick="navigate('l2tp')" id="nav-l2tp"
  173. 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">
  174. <div class="flex items-center space-x-2.5">
  175. <svg class="w-4 h-4 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  176. <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" />
  177. </svg>
  178. <span>L2TP Client</span>
  179. </div>
  180. <span id="badge-l2tp-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  181. </a>
  182. <a href="#pptp" onclick="navigate('pptp')" id="nav-pptp"
  183. 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">
  184. <div class="flex items-center space-x-2.5">
  185. <svg class="w-4 h-4 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  186. <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" />
  187. </svg>
  188. <span>PPTP Client</span>
  189. </div>
  190. <span id="badge-pptp-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  191. </a>
  192. <a href="#ppp" onclick="navigate('ppp')" id="nav-ppp"
  193. 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">
  194. <div class="flex items-center space-x-2.5">
  195. <svg class="w-4 h-4 text-violet-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  196. <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" />
  197. </svg>
  198. <span>PPP (Servers & Users)</span>
  199. </div>
  200. <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>
  201. </a>
  202. <a href="#eoip" onclick="navigate('eoip')" id="nav-eoip"
  203. 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">
  204. <div class="flex items-center space-x-2.5">
  205. <svg class="w-4 h-4 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  206. <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" />
  207. </svg>
  208. <span>EoIP Tunnels</span>
  209. </div>
  210. <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>
  211. </a>
  212. <!-- CATEGORY: SYSTEM -->
  213. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">System</div>
  214. <a href="#persistence" onclick="navigate('persistence')" id="nav-persistence"
  215. 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">
  216. <div class="flex items-center space-x-2.5">
  217. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  218. <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" />
  219. </svg>
  220. <span>Debian Config</span>
  221. </div>
  222. <span class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.2 rounded">.cfg</span>
  223. </a>
  224. </nav>
  225. <!-- Sidebar Footer: Host System Metrics -->
  226. <div class="p-4 border-t border-slate-800/80 bg-slate-900/60">
  227. <div class="flex items-center justify-between text-xs text-slate-400 mb-2">
  228. <span class="truncate font-mono" id="side-hostname">debian-lxc</span>
  229. <span class="text-[11px] text-slate-500" id="side-uptime">0h 0m</span>
  230. </div>
  231. <div class="mb-2">
  232. <div class="flex justify-between text-[11px] text-slate-400 mb-1">
  233. <span>CPU Usage</span>
  234. <span id="side-cpu-val" class="font-mono text-slate-300">0.0%</span>
  235. </div>
  236. <div class="w-full bg-slate-800 h-1.5 rounded-full overflow-hidden">
  237. <div id="side-cpu-bar" class="bg-brand-500 h-full rounded-full transition-all duration-500" style="width: 5%"></div>
  238. </div>
  239. </div>
  240. <div>
  241. <div class="flex justify-between text-[11px] text-slate-400 mb-1">
  242. <span>RAM Usage</span>
  243. <span id="side-ram-val" class="font-mono text-slate-300">0%</span>
  244. </div>
  245. <div class="w-full bg-slate-800 h-1.5 rounded-full overflow-hidden">
  246. <div id="side-ram-bar" class="bg-cyan-500 h-full rounded-full transition-all duration-500" style="width: 25%"></div>
  247. </div>
  248. </div>
  249. </div>
  250. </aside>
  251. <!-- Main Content Area -->
  252. <div class="flex-1 flex flex-col min-w-0 overflow-hidden">
  253. <!-- Top Navbar -->
  254. <header class="h-16 bg-[#0f172a]/80 backdrop-blur border-b border-slate-800 flex items-center justify-between px-6 z-20">
  255. <div class="flex items-center space-x-4">
  256. <button onclick="toggleSidebar()" class="lg:hidden p-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800">
  257. <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  258. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
  259. </svg>
  260. </button>
  261. <div>
  262. <h1 id="page-title" class="text-lg font-bold text-white tracking-tight">Dashboard Overview</h1>
  263. <p id="page-subtitle" class="text-xs text-slate-400">Live router performance and interface management</p>
  264. </div>
  265. </div>
  266. <div class="flex items-center space-x-3">
  267. <!-- Active Tunnels Pill -->
  268. <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">
  269. <span id="tunnels-dot" class="w-2 h-2 rounded-full bg-slate-500"></span>
  270. <span id="tunnels-label" class="font-mono text-[11px]">0 Active VPN Tunnels</span>
  271. </div>
  272. <!-- Quick Actions -->
  273. <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">
  274. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  275. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
  276. </svg>
  277. <span>+ Create VLAN</span>
  278. </button>
  279. <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">
  280. <svg id="refresh-spinner" class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  281. <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" />
  282. </svg>
  283. </button>
  284. </div>
  285. </header>
  286. <!-- Scrollable Main Viewport -->
  287. <main class="flex-1 overflow-y-auto p-6 space-y-6">
  288. <!-- ================= SECTION: DASHBOARD ================= -->
  289. <section id="section-dashboard" class="space-y-6">
  290. <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
  291. <div class="bg-slate-900/80 border border-slate-800 rounded-xl p-5 relative overflow-hidden group hover:border-slate-700 transition">
  292. <div class="flex items-center justify-between mb-3">
  293. <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">Interfaces</span>
  294. <div class="p-2 bg-brand-500/10 text-brand-400 rounded-lg">
  295. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  296. <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" />
  297. </svg>
  298. </div>
  299. </div>
  300. <div class="flex items-baseline space-x-2">
  301. <span id="stat-ifaces-up" class="text-2xl font-bold text-white">0</span>
  302. <span class="text-xs text-slate-400">UP /</span>
  303. <span id="stat-ifaces-total" class="text-sm font-semibold text-slate-400">0 Total</span>
  304. </div>
  305. <div class="mt-2 text-xs text-slate-400 flex items-center">
  306. <span id="stat-ifaces-down" class="text-rose-400 font-medium mr-1.5">0 DOWN</span>
  307. <span class="text-slate-500">•</span>
  308. <span class="text-slate-400 ml-1.5">Plug & Play</span>
  309. </div>
  310. </div>
  311. <div class="bg-slate-900/80 border border-slate-800 rounded-xl p-5 relative overflow-hidden group hover:border-slate-700 transition">
  312. <div class="flex items-center justify-between mb-3">
  313. <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">802.1Q VLANs</span>
  314. <div class="p-2 bg-cyan-500/10 text-cyan-400 rounded-lg">
  315. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  316. <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" />
  317. </svg>
  318. </div>
  319. </div>
  320. <div class="flex items-baseline space-x-2">
  321. <span id="stat-vlans-count" class="text-2xl font-bold text-cyan-400">0</span>
  322. <span class="text-xs text-slate-400">Virtual Subnets</span>
  323. </div>
  324. <div class="mt-2 text-xs text-slate-400">Kernel Tagging Active</div>
  325. </div>
  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">WAN & VPN Services</span>
  329. <div class="p-2 bg-violet-500/10 text-violet-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="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" />
  332. </svg>
  333. </div>
  334. </div>
  335. <div class="flex items-baseline space-x-2">
  336. <span id="stat-vpn-active" class="text-2xl font-bold text-violet-400">0</span>
  337. <span class="text-xs text-slate-400">Connected Tunnels</span>
  338. </div>
  339. <div class="mt-2 text-[11px] text-slate-400 flex items-center gap-1.5 font-mono">
  340. <span>WG • IPSec • PPPoE • L2TP</span>
  341. </div>
  342. </div>
  343. <div class="bg-slate-900/80 border border-slate-800 rounded-xl p-5 relative overflow-hidden group hover:border-slate-700 transition">
  344. <div class="flex items-center justify-between mb-3">
  345. <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">Live Traffic</span>
  346. <div class="p-2 bg-amber-500/10 text-amber-400 rounded-lg">
  347. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  348. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  349. </svg>
  350. </div>
  351. </div>
  352. <div class="space-y-1">
  353. <div class="flex items-center justify-between text-xs">
  354. <span class="text-slate-400 flex items-center gap-1"><span class="text-emerald-400 font-bold">↓</span> RX:</span>
  355. <span id="stat-traffic-rx" class="font-mono font-semibold text-emerald-400">0 B/s</span>
  356. </div>
  357. <div class="flex items-center justify-between text-xs">
  358. <span class="text-slate-400 flex items-center gap-1"><span class="text-cyan-400 font-bold">↑</span> TX:</span>
  359. <span id="stat-traffic-tx" class="font-mono font-semibold text-cyan-400">0 B/s</span>
  360. </div>
  361. </div>
  362. </div>
  363. </div>
  364. <!-- Port Matrix -->
  365. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  366. <div class="flex items-center justify-between mb-4">
  367. <div>
  368. <h3 class="text-sm font-bold text-white uppercase tracking-wider flex items-center gap-2">
  369. <span>Hardware & Virtual Port Matrix</span>
  370. <span class="text-[10px] bg-slate-800 text-slate-400 font-normal px-2 py-0.5 rounded-full">Live Hardware State</span>
  371. </h3>
  372. </div>
  373. </div>
  374. <div id="port-matrix" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-3"></div>
  375. </div>
  376. <!-- Quick Overview Tables -->
  377. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  378. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  379. <div class="flex items-center justify-between mb-4">
  380. <h3 class="text-sm font-bold text-white">Interfaces Overview</h3>
  381. <button onclick="navigate('interfaces')" class="text-xs text-brand-400 hover:text-brand-300 font-medium">View All →</button>
  382. </div>
  383. <div class="overflow-x-auto">
  384. <table class="w-full text-left text-xs">
  385. <thead class="text-slate-400 border-b border-slate-800">
  386. <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>
  387. </thead>
  388. <tbody id="quick-interfaces-table" class="divide-y divide-slate-800/60 font-mono"></tbody>
  389. </table>
  390. </div>
  391. </div>
  392. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  393. <div class="flex items-center justify-between mb-4">
  394. <h3 class="text-sm font-bold text-white">Active VLANs</h3>
  395. <button onclick="navigate('vlans')" class="text-xs text-cyan-400 hover:text-cyan-300 font-medium">Manage →</button>
  396. </div>
  397. <div class="overflow-x-auto">
  398. <table class="w-full text-left text-xs">
  399. <thead class="text-slate-400 border-b border-slate-800">
  400. <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>
  401. </thead>
  402. <tbody id="quick-vlans-table" class="divide-y divide-slate-800/60 font-mono"></tbody>
  403. </table>
  404. </div>
  405. </div>
  406. </div>
  407. </section>
  408. <!-- ================= SECTION: INTERFACES (HIERARCHICAL TREE) ================= -->
  409. <section id="section-interfaces" class="hidden space-y-6">
  410. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-4 flex flex-wrap items-center justify-between gap-4">
  411. <div class="flex items-center space-x-2">
  412. <span class="text-xs font-semibold text-slate-400 mr-2">Filter:</span>
  413. <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>
  414. <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>
  415. <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>
  416. <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>
  417. </div>
  418. <div class="flex items-center space-x-3">
  419. <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>
  420. <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>
  421. <input type="text" id="iface-search" oninput="renderInterfacesList()" placeholder="Search interfaces..."
  422. 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">
  423. </div>
  424. </div>
  425. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden shadow-2xl">
  426. <div class="p-4 border-b border-slate-800 bg-slate-950/40 flex items-center justify-between">
  427. <div>
  428. <h3 class="text-sm font-bold text-white flex items-center gap-2">
  429. <span>Interface Hierarchy & VLAN Sub-interfaces</span>
  430. <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>
  431. </h3>
  432. </div>
  433. <div class="text-xs text-slate-400">
  434. <span id="ifaces-list-summary" class="font-mono">Loading interfaces...</span>
  435. </div>
  436. </div>
  437. <div class="overflow-x-auto">
  438. <table class="w-full text-left text-xs">
  439. <thead class="text-slate-400 bg-slate-950/80 border-b border-slate-800 uppercase tracking-wider text-[11px]">
  440. <tr>
  441. <th class="py-3 px-3 font-semibold w-8 text-center"></th>
  442. <th class="py-3 px-4 font-semibold">Interface / Type</th>
  443. <th class="py-3 px-4 font-semibold">Role & Alias</th>
  444. <th class="py-3 px-4 font-semibold">IP Address (CIDR)</th>
  445. <th class="py-3 px-4 font-semibold">MAC & MTU</th>
  446. <th class="py-3 px-4 font-semibold">Throughput (RX/TX)</th>
  447. <th class="py-3 px-4 font-semibold">Link State</th>
  448. <th class="py-3 px-4 font-semibold text-right">Actions</th>
  449. </tr>
  450. </thead>
  451. <tbody id="interfaces-tree-tbody" class="divide-y divide-slate-800 font-mono"></tbody>
  452. </table>
  453. </div>
  454. <div id="interfaces-empty-state" class="hidden p-12 text-center text-slate-500">
  455. No interfaces found matching your search.
  456. </div>
  457. </div>
  458. </section>
  459. <!-- ================= SECTION: VLANS (802.1Q) ================= -->
  460. <section id="section-vlans" class="hidden space-y-6">
  461. <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">
  462. <div class="max-w-xl">
  463. <div class="flex items-center gap-2 mb-1">
  464. <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>
  465. <h2 class="text-base font-bold text-white">VLAN Virtual Sub-interfaces</h2>
  466. </div>
  467. <p class="text-xs text-slate-400 leading-relaxed">
  468. Tagged sub-interfaces on physical parent interfaces (e.g. <code class="text-cyan-300">eth0.10</code>).
  469. </p>
  470. </div>
  471. <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">
  472. <span>+ Create VLAN Sub-interface</span>
  473. </button>
  474. </div>
  475. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  476. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  477. <h3 class="text-sm font-bold text-white">Configured VLANs</h3>
  478. <input type="text" id="vlan-search" oninput="renderVlansList()" placeholder="Filter VLAN ID..."
  479. 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">
  480. </div>
  481. <div class="overflow-x-auto">
  482. <table class="w-full text-left text-xs font-mono">
  483. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[11px] font-sans">
  484. <tr>
  485. <th class="py-3 px-4 font-semibold">VLAN ID</th>
  486. <th class="py-3 px-4 font-semibold">Device</th>
  487. <th class="py-3 px-4 font-semibold">Parent</th>
  488. <th class="py-3 px-4 font-semibold">Subnet (CIDR)</th>
  489. <th class="py-3 px-4 font-semibold">Role</th>
  490. <th class="py-3 px-4 font-semibold">MTU</th>
  491. <th class="py-3 px-4 font-semibold">Status</th>
  492. <th class="py-3 px-4 font-semibold text-right">Actions</th>
  493. </tr>
  494. </thead>
  495. <tbody id="vlans-table-body" class="divide-y divide-slate-800"></tbody>
  496. </table>
  497. </div>
  498. <div id="vlans-empty-state" class="hidden p-12 text-center text-slate-500">
  499. No VLANs configured. Click "+ Create VLAN" to add one.
  500. </div>
  501. </div>
  502. </section>
  503. <!-- ================= SECTION: PPPoE CLIENTS (MikroTik style) ================= -->
  504. <section id="section-pppoe" class="hidden space-y-6">
  505. <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">
  506. <div>
  507. <div class="flex items-center gap-2 mb-1">
  508. <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>
  509. <h2 class="text-base font-bold text-white">PPPoE Client Sessions</h2>
  510. </div>
  511. <p class="text-xs text-slate-400">Manage multiple Point-to-Point Protocol over Ethernet WAN connections (MikroTik RouterOS style).</p>
  512. </div>
  513. <div class="flex items-center gap-2">
  514. <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">
  515. <span>⚙ Server Settings</span>
  516. </button>
  517. <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">
  518. <span>+ Add PPPoE Client</span>
  519. </button>
  520. </div>
  521. </div>
  522. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  523. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  524. <h3 class="text-sm font-bold text-white">Configured PPPoE Interfaces</h3>
  525. <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>
  526. </div>
  527. <div class="overflow-x-auto">
  528. <table class="w-full text-left text-xs font-mono">
  529. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  530. <tr>
  531. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  532. <th class="py-2.5 px-3">Name</th>
  533. <th class="py-2.5 px-3">Interface</th>
  534. <th class="py-2.5 px-3">User</th>
  535. <th class="py-2.5 px-3">Assigned IP</th>
  536. <th class="py-2.5 px-3">Device</th>
  537. <th class="py-2.5 px-3 text-center">Def. Route</th>
  538. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  539. </tr>
  540. </thead>
  541. <tbody id="pppoe-table-body" class="divide-y divide-slate-800/80"></tbody>
  542. </table>
  543. </div>
  544. <div id="pppoe-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  545. No PPPoE clients configured. Click "+ Add PPPoE Client" to add a connection.
  546. </div>
  547. </div>
  548. </section>
  549. <!-- ================= SECTION: WIREGUARD (MikroTik style) ================= -->
  550. <section id="section-wireguard" class="hidden space-y-6">
  551. <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">
  552. <div>
  553. <div class="flex items-center gap-2 mb-1">
  554. <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>
  555. <h2 class="text-base font-bold text-white">WireGuard VPN Suite</h2>
  556. </div>
  557. <p class="text-xs text-slate-400">High-performance multi-interface WireGuard server and peer controller (MikroTik RouterOS v7 style).</p>
  558. </div>
  559. <div class="flex items-center space-x-2.5">
  560. <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">
  561. + Add Interface
  562. </button>
  563. <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">
  564. + Add Peer
  565. </button>
  566. </div>
  567. </div>
  568. <!-- Sub Tabs: Interfaces / Peers -->
  569. <div class="flex border-b border-slate-800 space-x-2">
  570. <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">
  571. <span>Interfaces</span>
  572. <span id="wg-subtab-badge-ifaces" class="px-1.5 py-0.5 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  573. </button>
  574. <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">
  575. <span>Peers</span>
  576. <span id="wg-subtab-badge-peers" class="px-1.5 py-0.5 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  577. </button>
  578. </div>
  579. <!-- Sub-Tab 1: Interfaces -->
  580. <div id="wg-subtab-ifaces" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  581. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  582. <h3 class="text-sm font-bold text-white">WireGuard Interfaces</h3>
  583. <span id="wg-ifaces-count" class="text-xs font-mono text-slate-400">0 Interfaces</span>
  584. </div>
  585. <div class="overflow-x-auto">
  586. <table class="w-full text-left text-xs font-mono">
  587. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  588. <tr>
  589. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  590. <th class="py-2.5 px-3">Name</th>
  591. <th class="py-2.5 px-3">Listen Port</th>
  592. <th class="py-2.5 px-3">Tunnel Address</th>
  593. <th class="py-2.5 px-3">Public Key</th>
  594. <th class="py-2.5 px-3">MTU</th>
  595. <th class="py-2.5 px-3 text-center">Peers</th>
  596. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  597. </tr>
  598. </thead>
  599. <tbody id="wg-ifaces-table-body" class="divide-y divide-slate-800/80"></tbody>
  600. </table>
  601. </div>
  602. <div id="wg-ifaces-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  603. No WireGuard interfaces configured. Click "+ Add Interface" to create wg0.
  604. </div>
  605. </div>
  606. <!-- Sub-Tab 2: Peers -->
  607. <div id="wg-subtab-peers" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  608. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  609. <div class="flex items-center gap-3">
  610. <h3 class="text-sm font-bold text-white">WireGuard Peers</h3>
  611. <span id="wg-peers-count" class="text-xs font-mono text-slate-400">0 Peers</span>
  612. </div>
  613. <div class="flex items-center gap-2">
  614. <label class="text-xs text-slate-400 font-sans">Filter Interface:</label>
  615. <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">
  616. <option value="">All Interfaces</option>
  617. </select>
  618. </div>
  619. </div>
  620. <div class="overflow-x-auto">
  621. <table class="w-full text-left text-xs font-mono">
  622. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  623. <tr>
  624. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Active, X=Disabled">Flag</th>
  625. <th class="py-2.5 px-3">Interface</th>
  626. <th class="py-2.5 px-3">Peer Name</th>
  627. <th class="py-2.5 px-3">Public Key</th>
  628. <th class="py-2.5 px-3">Allowed IPs</th>
  629. <th class="py-2.5 px-3">Endpoint</th>
  630. <th class="py-2.5 px-3">Latest Handshake</th>
  631. <th class="py-2.5 px-3">Traffic (RX/TX)</th>
  632. <th class="py-2.5 px-3 text-right font-sans">Action</th>
  633. </tr>
  634. </thead>
  635. <tbody id="wg-peers-table-body" class="divide-y divide-slate-800/80"></tbody>
  636. </table>
  637. </div>
  638. <div id="wg-peers-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  639. No peers found for the selected interface. Click "+ Add Peer" to add a client or branch.
  640. </div>
  641. </div>
  642. </section>
  643. <!-- ================= SECTION: IPSEC (MikroTik style) ================= -->
  644. <section id="section-ipsec" class="hidden space-y-6">
  645. <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">
  646. <div>
  647. <div class="flex items-center gap-2 mb-1">
  648. <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>
  649. <h2 class="text-base font-bold text-white">IPSec (IKEv2) Tunnels</h2>
  650. </div>
  651. <p class="text-xs text-slate-400">Enterprise strongSwan 6 Site-to-Site and Remote Gateway connections.</p>
  652. </div>
  653. <div class="flex items-center gap-2">
  654. <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">
  655. <span>⚙ Roadwarrior Server</span>
  656. </button>
  657. <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">
  658. + Add IPSec Tunnel
  659. </button>
  660. </div>
  661. </div>
  662. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  663. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  664. <h3 class="text-sm font-bold text-white">Configured IPSec Tunnels</h3>
  665. <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>
  666. </div>
  667. <div class="overflow-x-auto">
  668. <table class="w-full text-left text-xs font-mono">
  669. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  670. <tr>
  671. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Established, X=Disabled">Flag</th>
  672. <th class="py-2.5 px-4">Connection Name</th>
  673. <th class="py-2.5 px-4">Local Subnet</th>
  674. <th class="py-2.5 px-4">Remote Gateway</th>
  675. <th class="py-2.5 px-4">Remote Subnet</th>
  676. <th class="py-2.5 px-4">Status</th>
  677. <th class="py-2.5 px-4 text-right font-sans">Actions</th>
  678. </tr>
  679. </thead>
  680. <tbody id="ipsec-table-body" class="divide-y divide-slate-800"></tbody>
  681. </table>
  682. </div>
  683. <div id="ipsec-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  684. No IPSec tunnels configured. Click "+ Add IPSec Tunnel" to set up site-to-site networking.
  685. </div>
  686. </div>
  687. </section>
  688. <!-- ================= SECTION: L2TP CLIENT (MikroTik style) ================= -->
  689. <section id="section-l2tp" class="hidden space-y-6">
  690. <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">
  691. <div>
  692. <div class="flex items-center gap-2 mb-1">
  693. <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>
  694. <h2 class="text-base font-bold text-white">L2TP Client Sessions</h2>
  695. </div>
  696. <p class="text-xs text-slate-400">Multiple Layer 2 Tunneling Protocol clients with optional IPSec PSK encryption.</p>
  697. </div>
  698. <div class="flex items-center gap-2">
  699. <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">
  700. <span>⚙ Server Settings</span>
  701. </button>
  702. <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">
  703. + Add L2TP Client
  704. </button>
  705. </div>
  706. </div>
  707. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  708. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  709. <h3 class="text-sm font-bold text-white">Configured L2TP Clients</h3>
  710. <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>
  711. </div>
  712. <div class="overflow-x-auto">
  713. <table class="w-full text-left text-xs font-mono">
  714. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  715. <tr>
  716. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  717. <th class="py-2.5 px-3">Name</th>
  718. <th class="py-2.5 px-3">Server Address</th>
  719. <th class="py-2.5 px-3">User</th>
  720. <th class="py-2.5 px-3">Assigned IP</th>
  721. <th class="py-2.5 px-3">Device</th>
  722. <th class="py-2.5 px-3 text-center">Def. Route</th>
  723. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  724. </tr>
  725. </thead>
  726. <tbody id="l2tp-table-body" class="divide-y divide-slate-800/80"></tbody>
  727. </table>
  728. </div>
  729. <div id="l2tp-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  730. No L2TP clients configured. Click "+ Add L2TP Client" to add a tunnel.
  731. </div>
  732. </div>
  733. </section>
  734. <!-- ================= SECTION: PPTP CLIENT (MikroTik style) ================= -->
  735. <section id="section-pptp" class="hidden space-y-6">
  736. <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">
  737. <div>
  738. <div class="flex items-center gap-2 mb-1">
  739. <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>
  740. <h2 class="text-base font-bold text-white">PPTP Client Sessions</h2>
  741. </div>
  742. <p class="text-xs text-slate-400">Multiple Point-to-Point Tunneling Protocol clients with MPPE-128 encryption.</p>
  743. </div>
  744. <div class="flex items-center gap-2">
  745. <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">
  746. <span>⚙ Server Settings</span>
  747. </button>
  748. <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">
  749. + Add PPTP Client
  750. </button>
  751. </div>
  752. </div>
  753. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  754. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  755. <h3 class="text-sm font-bold text-white">Configured PPTP Clients</h3>
  756. <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>
  757. </div>
  758. <div class="overflow-x-auto">
  759. <table class="w-full text-left text-xs font-mono">
  760. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  761. <tr>
  762. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  763. <th class="py-2.5 px-3">Name</th>
  764. <th class="py-2.5 px-3">Server Address</th>
  765. <th class="py-2.5 px-3">User</th>
  766. <th class="py-2.5 px-3">Assigned IP</th>
  767. <th class="py-2.5 px-3">Device</th>
  768. <th class="py-2.5 px-3 text-center">MPPE</th>
  769. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  770. </tr>
  771. </thead>
  772. <tbody id="pptp-table-body" class="divide-y divide-slate-800/80"></tbody>
  773. </table>
  774. </div>
  775. <div id="pptp-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  776. No PPTP clients configured. Click "+ Add PPTP Client" to add a tunnel.
  777. </div>
  778. </div>
  779. </section>
  780. <!-- ================= SECTION: PPP SERVERS & SECRETS (/ppp) ================= -->
  781. <section id="section-ppp" class="hidden space-y-6">
  782. <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">
  783. <div>
  784. <div class="flex items-center gap-2 mb-1">
  785. <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>
  786. <h2 class="text-base font-bold text-white">PPP Servers, Secrets & Profiles</h2>
  787. </div>
  788. <p class="text-xs text-slate-400">MikroTik RouterOS centralized user authentication database, IP pools and VPN server concentrators.</p>
  789. </div>
  790. <div class="flex items-center space-x-2.5">
  791. <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">
  792. <span>+ Add User (Secret)</span>
  793. </button>
  794. </div>
  795. </div>
  796. <!-- Sub Tabs: Secrets / Profiles / PPPoE Server / PPTP Server / L2TP Server / Active Sessions -->
  797. <div class="flex border-b border-slate-800 space-x-1 overflow-x-auto">
  798. <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">
  799. <span>Secrets (Users)</span>
  800. <span id="ppp-badge-secrets" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  801. </button>
  802. <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">
  803. <span>Profiles (Pools)</span>
  804. <span id="ppp-badge-profiles" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  805. </button>
  806. <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">
  807. <span>PPPoE Server</span>
  808. <span id="ppp-badge-pppoe-state" class="w-2 h-2 rounded-full bg-slate-600"></span>
  809. </button>
  810. <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">
  811. <span>PPTP Server</span>
  812. <span id="ppp-badge-pptp-state" class="w-2 h-2 rounded-full bg-slate-600"></span>
  813. </button>
  814. <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">
  815. <span>L2TP Server</span>
  816. <span id="ppp-badge-l2tp-state" class="w-2 h-2 rounded-full bg-slate-600"></span>
  817. </button>
  818. <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">
  819. <span>Active Sessions</span>
  820. <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>
  821. </button>
  822. </div>
  823. <!-- TAB 1: SECRETS (USERS) -->
  824. <div id="ppp-subtab-secrets" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  825. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  826. <h3 class="text-sm font-bold text-white">PPP Secrets (/ppp secret)</h3>
  827. <span id="secrets-count-badge" class="text-xs font-mono text-slate-400">0 Users</span>
  828. </div>
  829. <div class="overflow-x-auto">
  830. <table class="w-full text-left text-xs font-mono">
  831. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  832. <tr>
  833. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  834. <th class="py-2.5 px-3">Name (Username)</th>
  835. <th class="py-2.5 px-3">Service</th>
  836. <th class="py-2.5 px-3">Profile</th>
  837. <th class="py-2.5 px-3">Local Address</th>
  838. <th class="py-2.5 px-3">Remote Address</th>
  839. <th class="py-2.5 px-3">Comment</th>
  840. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  841. </tr>
  842. </thead>
  843. <tbody id="secrets-table-body" class="divide-y divide-slate-800/80"></tbody>
  844. </table>
  845. </div>
  846. <div id="secrets-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  847. No PPP secrets configured. Click "+ Add User" to define an account.
  848. </div>
  849. </div>
  850. <!-- TAB 2: PROFILES (POOLS) -->
  851. <div id="ppp-subtab-profiles" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  852. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  853. <h3 class="text-sm font-bold text-white">PPP Profiles (/ppp profile)</h3>
  854. <span id="profiles-count-badge" class="text-xs font-mono text-slate-400">0 Profiles</span>
  855. </div>
  856. <div class="overflow-x-auto">
  857. <table class="w-full text-left text-xs font-mono">
  858. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  859. <tr>
  860. <th class="py-2.5 px-3">Profile Name</th>
  861. <th class="py-2.5 px-3">Local Address</th>
  862. <th class="py-2.5 px-3">Remote Address (Pool)</th>
  863. <th class="py-2.5 px-3">DNS Servers</th>
  864. <th class="py-2.5 px-3">Encryption</th>
  865. <th class="py-2.5 px-3 text-center">Only One</th>
  866. <th class="py-2.5 px-3">Comment</th>
  867. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  868. </tr>
  869. </thead>
  870. <tbody id="profiles-table-body" class="divide-y divide-slate-800/80"></tbody>
  871. </table>
  872. </div>
  873. </div>
  874. <!-- TAB 3: PPPoE SERVER -->
  875. <div id="ppp-subtab-pppoe" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl p-6">
  876. <form onsubmit="savePPPoEServerConfig(event)" class="max-w-2xl space-y-5">
  877. <div class="flex items-center justify-between border-b border-slate-800 pb-4">
  878. <div>
  879. <h3 class="text-sm font-bold text-white">PPPoE Access Concentrator Server</h3>
  880. <p class="text-xs text-slate-400">Listens on physical interface or VLAN for PPPoE Discovery (PADI) packets</p>
  881. </div>
  882. <div class="flex items-center gap-3">
  883. <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>
  884. <label class="relative inline-flex items-center cursor-pointer">
  885. <input type="checkbox" id="pppoe-server-enabled" class="sr-only peer">
  886. <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>
  887. </label>
  888. </div>
  889. </div>
  890. <div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs font-sans">
  891. <div>
  892. <label class="block text-slate-300 font-medium mb-1">Service Name</label>
  893. <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">
  894. </div>
  895. <div>
  896. <label class="block text-slate-300 font-medium mb-1">Listen Interface</label>
  897. <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>
  898. </div>
  899. <div>
  900. <label class="block text-slate-300 font-medium mb-1">Default Profile</label>
  901. <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>
  902. </div>
  903. <div>
  904. <label class="block text-slate-300 font-medium mb-1">Max MTU / MRU</label>
  905. <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">
  906. </div>
  907. </div>
  908. <div class="flex items-center space-x-2 pt-2">
  909. <input type="checkbox" id="pppoe-server-onesession" class="rounded bg-slate-800 border-slate-700 text-blue-600">
  910. <label for="pppoe-server-onesession" class="text-xs text-slate-300">One Session Per Host (limit 1 PPPoE session per client MAC)</label>
  911. </div>
  912. <div class="pt-4 border-t border-slate-800 flex justify-end">
  913. <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">
  914. Apply PPPoE Server Settings
  915. </button>
  916. </div>
  917. </form>
  918. </div>
  919. <!-- TAB 4: PPTP SERVER -->
  920. <div id="ppp-subtab-pptp" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl p-6">
  921. <form onsubmit="savePPTPServerConfig(event)" class="max-w-2xl space-y-5">
  922. <div class="flex items-center justify-between border-b border-slate-800 pb-4">
  923. <div>
  924. <h3 class="text-sm font-bold text-white">PPTP Server (/interface pptp-server server)</h3>
  925. <p class="text-xs text-slate-400">Point-to-Point Tunneling Server listening on TCP port 1723 with MPPE-128 encryption</p>
  926. </div>
  927. <div class="flex items-center gap-3">
  928. <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>
  929. <label class="relative inline-flex items-center cursor-pointer">
  930. <input type="checkbox" id="pptp-server-enabled" class="sr-only peer">
  931. <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>
  932. </label>
  933. </div>
  934. </div>
  935. <div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs font-sans">
  936. <div>
  937. <label class="block text-slate-300 font-medium mb-1">Port</label>
  938. <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">
  939. </div>
  940. <div>
  941. <label class="block text-slate-300 font-medium mb-1">Default Profile</label>
  942. <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>
  943. </div>
  944. </div>
  945. <div class="flex items-center space-x-2 pt-2">
  946. <input type="checkbox" id="pptp-server-mppe" checked class="rounded bg-slate-800 border-slate-700 text-purple-600">
  947. <label for="pptp-server-mppe" class="text-xs text-slate-300">Require 128-bit MPPE Encryption (MS-CHAPv2)</label>
  948. </div>
  949. <div class="pt-4 border-t border-slate-800 flex justify-end">
  950. <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">
  951. Apply PPTP Server Settings
  952. </button>
  953. </div>
  954. </form>
  955. </div>
  956. <!-- TAB 5: L2TP SERVER -->
  957. <div id="ppp-subtab-l2tp" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl p-6">
  958. <form onsubmit="saveL2TPServerConfig(event)" class="max-w-2xl space-y-5">
  959. <div class="flex items-center justify-between border-b border-slate-800 pb-4">
  960. <div>
  961. <h3 class="text-sm font-bold text-white">L2TP Server (/interface l2tp-server server)</h3>
  962. <p class="text-xs text-slate-400">Layer 2 Tunneling Protocol Server listening on UDP port 1701 with optional IPSec</p>
  963. </div>
  964. <div class="flex items-center gap-3">
  965. <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>
  966. <label class="relative inline-flex items-center cursor-pointer">
  967. <input type="checkbox" id="l2tp-server-enabled" class="sr-only peer">
  968. <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>
  969. </label>
  970. </div>
  971. </div>
  972. <div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs font-sans">
  973. <div>
  974. <label class="block text-slate-300 font-medium mb-1">Port</label>
  975. <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">
  976. </div>
  977. <div>
  978. <label class="block text-slate-300 font-medium mb-1">Default Profile</label>
  979. <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>
  980. </div>
  981. <div>
  982. <label class="block text-slate-300 font-medium mb-1">Use IPSec</label>
  983. <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">
  984. <option value="no">no</option>
  985. <option value="yes">yes</option>
  986. <option value="required">required</option>
  987. </select>
  988. </div>
  989. <div>
  990. <label class="block text-slate-300 font-medium mb-1">IPSec Secret (PSK)</label>
  991. <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">
  992. </div>
  993. </div>
  994. <div class="pt-4 border-t border-slate-800 flex justify-end">
  995. <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">
  996. Apply L2TP Server Settings
  997. </button>
  998. </div>
  999. </form>
  1000. </div>
  1001. <!-- TAB 6: ACTIVE SESSIONS -->
  1002. <div id="ppp-subtab-active" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1003. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1004. <h3 class="text-sm font-bold text-white">Active PPP Connections (/ppp active)</h3>
  1005. <button onclick="loadPPPSessions()" class="text-xs text-slate-400 hover:text-white px-2 py-1 rounded bg-slate-800">Refresh</button>
  1006. </div>
  1007. <div class="overflow-x-auto">
  1008. <table class="w-full text-left text-xs font-mono">
  1009. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1010. <tr>
  1011. <th class="py-2.5 px-3">Interface</th>
  1012. <th class="py-2.5 px-3">Username</th>
  1013. <th class="py-2.5 px-3">Service</th>
  1014. <th class="py-2.5 px-3">Client IP Address</th>
  1015. <th class="py-2.5 px-3">Uptime</th>
  1016. <th class="py-2.5 px-3">RX / TX Traffic</th>
  1017. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1018. </tr>
  1019. </thead>
  1020. <tbody id="active-ppp-table-body" class="divide-y divide-slate-800/80"></tbody>
  1021. </table>
  1022. </div>
  1023. <div id="active-ppp-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1024. No active PPP sessions currently connected.
  1025. </div>
  1026. </div>
  1027. </section>
  1028. <!-- ================= SECTION: EoIP TUNNELS (/interface eoip) ================= -->
  1029. <section id="section-eoip" class="hidden space-y-6">
  1030. <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">
  1031. <div>
  1032. <div class="flex items-center gap-2 mb-1">
  1033. <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>
  1034. <h2 class="text-base font-bold text-white">EoIP Tunnels (Ethernet over IP)</h2>
  1035. </div>
  1036. <p class="text-xs text-slate-400">MikroTik RouterOS Layer 2 GRETAP tunneling over IP. Transparently bridge Ethernet subnets across the Internet.</p>
  1037. </div>
  1038. <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">
  1039. <span>+ Add EoIP Tunnel</span>
  1040. </button>
  1041. </div>
  1042. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1043. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1044. <h3 class="text-sm font-bold text-white">Configured EoIP Interfaces</h3>
  1045. <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>
  1046. </div>
  1047. <div class="overflow-x-auto">
  1048. <table class="w-full text-left text-xs font-mono">
  1049. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1050. <tr>
  1051. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  1052. <th class="py-2.5 px-3">Name</th>
  1053. <th class="py-2.5 px-3">Tunnel ID</th>
  1054. <th class="py-2.5 px-3">Tunnel IP</th>
  1055. <th class="py-2.5 px-3">Remote Address</th>
  1056. <th class="py-2.5 px-3">Local Address</th>
  1057. <th class="py-2.5 px-3">MAC Address</th>
  1058. <th class="py-2.5 px-3">MTU</th>
  1059. <th class="py-2.5 px-3">RX / TX Traffic</th>
  1060. <th class="py-2.5 px-3">Comment</th>
  1061. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1062. </tr>
  1063. </thead>
  1064. <tbody id="eoip-table-body" class="divide-y divide-slate-800/80"></tbody>
  1065. </table>
  1066. </div>
  1067. <div id="eoip-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1068. No EoIP tunnels configured. Click "+ Add EoIP Tunnel" to create one.
  1069. </div>
  1070. </div>
  1071. </section>
  1072. <!-- ================= SECTION: FIREWALL (/ip firewall) ================= -->
  1073. <section id="section-firewall" class="hidden space-y-6">
  1074. <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">
  1075. <div>
  1076. <div class="flex items-center gap-2 mb-1">
  1077. <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>
  1078. <h2 class="text-base font-bold text-white">Firewall & Traffic Controller</h2>
  1079. </div>
  1080. <p class="text-xs text-slate-400">Complete MikroTik-grade stateful filter, NAT, packet/connection marking (Mangle), address lists and live connection tracker.</p>
  1081. </div>
  1082. <div class="flex items-center space-x-2.5">
  1083. <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">
  1084. <span>+ Add Rule</span>
  1085. </button>
  1086. <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">
  1087. Reset Counters
  1088. </button>
  1089. </div>
  1090. </div>
  1091. <!-- Sub Tabs: Filter / NAT / Mangle / Address Lists / Connections -->
  1092. <div class="flex border-b border-slate-800 space-x-1 overflow-x-auto">
  1093. <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">
  1094. <span>Filter Rules</span>
  1095. <span id="fw-badge-filter" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1096. </button>
  1097. <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">
  1098. <span>NAT</span>
  1099. <span id="fw-badge-nat" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1100. </button>
  1101. <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">
  1102. <span>Mangle</span>
  1103. <span id="fw-badge-mangle" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1104. </button>
  1105. <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">
  1106. <span>Address Lists</span>
  1107. <span id="fw-badge-addrlist" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1108. </button>
  1109. <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">
  1110. <span>Connections</span>
  1111. <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>
  1112. </button>
  1113. </div>
  1114. <!-- ================= TAB 1: FILTER RULES ================= -->
  1115. <div id="fw-subtab-filter" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1116. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1117. <div class="flex items-center gap-3">
  1118. <h3 class="text-sm font-bold text-white">Firewall Filter Rules</h3>
  1119. <span id="filter-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1120. </div>
  1121. <div class="flex items-center gap-2">
  1122. <label class="text-xs text-slate-400 font-sans">Chain:</label>
  1123. <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">
  1124. <option value="">All Chains</option>
  1125. <option value="input">input</option>
  1126. <option value="forward">forward</option>
  1127. <option value="output">output</option>
  1128. </select>
  1129. </div>
  1130. </div>
  1131. <div class="overflow-x-auto">
  1132. <table class="w-full text-left text-xs font-mono">
  1133. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1134. <tr>
  1135. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1136. <th class="py-2.5 px-3 w-12 text-center" title="Flags: X=Disabled, C=Comment">Flag</th>
  1137. <th class="py-2.5 px-3">Chain</th>
  1138. <th class="py-2.5 px-3">Src. Address</th>
  1139. <th class="py-2.5 px-3">Dst. Address</th>
  1140. <th class="py-2.5 px-3">Protocol</th>
  1141. <th class="py-2.5 px-3">Ports</th>
  1142. <th class="py-2.5 px-3">In / Out</th>
  1143. <th class="py-2.5 px-3">Action</th>
  1144. <th class="py-2.5 px-3">Packets / Bytes</th>
  1145. <th class="py-2.5 px-3">Comment</th>
  1146. <th class="py-2.5 px-3 text-right font-sans">Order & Actions</th>
  1147. </tr>
  1148. </thead>
  1149. <tbody id="filter-table-body" class="divide-y divide-slate-800/80"></tbody>
  1150. </table>
  1151. </div>
  1152. <div id="filter-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1153. No filter rules found in this chain. Click "+ Add Rule" to create one.
  1154. </div>
  1155. </div>
  1156. <!-- ================= TAB 2: NAT RULES ================= -->
  1157. <div id="fw-subtab-nat" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1158. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1159. <div class="flex items-center gap-3">
  1160. <h3 class="text-sm font-bold text-white">NAT Rules</h3>
  1161. <span id="nat-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1162. </div>
  1163. <div class="flex items-center gap-2">
  1164. <label class="text-xs text-slate-400 font-sans">Chain:</label>
  1165. <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">
  1166. <option value="">All Chains</option>
  1167. <option value="srcnat">srcnat (SNAT / Masquerade)</option>
  1168. <option value="dstnat">dstnat (Port Forwarding)</option>
  1169. </select>
  1170. </div>
  1171. </div>
  1172. <div class="overflow-x-auto">
  1173. <table class="w-full text-left text-xs font-mono">
  1174. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1175. <tr>
  1176. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1177. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1178. <th class="py-2.5 px-3">Chain</th>
  1179. <th class="py-2.5 px-3">Src. Address</th>
  1180. <th class="py-2.5 px-3">Dst. Address</th>
  1181. <th class="py-2.5 px-3">Proto/Port</th>
  1182. <th class="py-2.5 px-3">Out / In</th>
  1183. <th class="py-2.5 px-3">Action</th>
  1184. <th class="py-2.5 px-3">To Address:Port</th>
  1185. <th class="py-2.5 px-3">Packets / Bytes</th>
  1186. <th class="py-2.5 px-3">Comment</th>
  1187. <th class="py-2.5 px-3 text-right font-sans">Order & Actions</th>
  1188. </tr>
  1189. </thead>
  1190. <tbody id="nat-table-body" class="divide-y divide-slate-800/80"></tbody>
  1191. </table>
  1192. </div>
  1193. <div id="nat-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1194. No NAT rules configured. Click "+ Add Rule" to add masquerade or port forwarding.
  1195. </div>
  1196. </div>
  1197. <!-- ================= TAB 3: MANGLE RULES ================= -->
  1198. <div id="fw-subtab-mangle" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1199. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1200. <div class="flex items-center gap-3">
  1201. <h3 class="text-sm font-bold text-white">Mangle Packet & Connection Marking</h3>
  1202. <span id="mangle-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1203. </div>
  1204. <div class="flex items-center gap-2">
  1205. <label class="text-xs text-slate-400 font-sans">Chain:</label>
  1206. <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">
  1207. <option value="">All Chains</option>
  1208. <option value="prerouting">prerouting</option>
  1209. <option value="forward">forward</option>
  1210. <option value="postrouting">postrouting</option>
  1211. <option value="input">input</option>
  1212. <option value="output">output</option>
  1213. </select>
  1214. </div>
  1215. </div>
  1216. <div class="overflow-x-auto">
  1217. <table class="w-full text-left text-xs font-mono">
  1218. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1219. <tr>
  1220. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1221. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1222. <th class="py-2.5 px-3">Chain</th>
  1223. <th class="py-2.5 px-3">Src. Address</th>
  1224. <th class="py-2.5 px-3">Dst. Address</th>
  1225. <th class="py-2.5 px-3">Action</th>
  1226. <th class="py-2.5 px-3">New Mark / Value</th>
  1227. <th class="py-2.5 px-3 text-center">Pass</th>
  1228. <th class="py-2.5 px-3">Packets / Bytes</th>
  1229. <th class="py-2.5 px-3">Comment</th>
  1230. <th class="py-2.5 px-3 text-right font-sans">Order & Actions</th>
  1231. </tr>
  1232. </thead>
  1233. <tbody id="mangle-table-body" class="divide-y divide-slate-800/80"></tbody>
  1234. </table>
  1235. </div>
  1236. <div id="mangle-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1237. No mangle rules configured. Click "+ Add Rule" to mark connections or routing for Multi-WAN.
  1238. </div>
  1239. </div>
  1240. <!-- ================= TAB 4: ADDRESS LISTS ================= -->
  1241. <div id="fw-subtab-addrlist" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1242. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1243. <div class="flex items-center gap-3">
  1244. <h3 class="text-sm font-bold text-white">Address Lists (ipset)</h3>
  1245. <span id="addrlist-count-badge" class="text-xs font-mono text-slate-400">0 Entries</span>
  1246. </div>
  1247. <div class="flex items-center gap-2">
  1248. <label class="text-xs text-slate-400 font-sans">List:</label>
  1249. <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">
  1250. <option value="">All Lists</option>
  1251. </select>
  1252. </div>
  1253. </div>
  1254. <div class="overflow-x-auto">
  1255. <table class="w-full text-left text-xs font-mono">
  1256. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1257. <tr>
  1258. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1259. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1260. <th class="py-2.5 px-3">List Name</th>
  1261. <th class="py-2.5 px-3">IP Address / CIDR</th>
  1262. <th class="py-2.5 px-3">Comment</th>
  1263. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1264. </tr>
  1265. </thead>
  1266. <tbody id="addrlist-table-body" class="divide-y divide-slate-800/80"></tbody>
  1267. </table>
  1268. </div>
  1269. <div id="addrlist-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1270. No address list entries configured. Click "+ Add Item" to define a group of IPs/subnets.
  1271. </div>
  1272. </div>
  1273. <!-- ================= TAB 5: ACTIVE CONNECTIONS ================= -->
  1274. <div id="fw-subtab-connections" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1275. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1276. <div class="flex items-center gap-3">
  1277. <h3 class="text-sm font-bold text-white">Active Conntrack Connections</h3>
  1278. <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>
  1279. </div>
  1280. <div class="flex items-center gap-2 flex-wrap">
  1281. <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">
  1282. <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">
  1283. <option value="">All Proto</option>
  1284. <option value="TCP">TCP</option>
  1285. <option value="UDP">UDP</option>
  1286. <option value="ICMP">ICMP</option>
  1287. </select>
  1288. <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>
  1289. </div>
  1290. </div>
  1291. <div class="overflow-x-auto max-h-[550px] overflow-y-auto">
  1292. <table class="w-full text-left text-xs font-mono">
  1293. <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">
  1294. <tr>
  1295. <th class="py-2.5 px-3">Proto</th>
  1296. <th class="py-2.5 px-3">Source Address</th>
  1297. <th class="py-2.5 px-3">Destination Address</th>
  1298. <th class="py-2.5 px-3">Reply Source</th>
  1299. <th class="py-2.5 px-3">Reply Dest</th>
  1300. <th class="py-2.5 px-3">TCP State</th>
  1301. <th class="py-2.5 px-3">Mark</th>
  1302. <th class="py-2.5 px-3">Timeout</th>
  1303. <th class="py-2.5 px-3 text-right font-sans">Action</th>
  1304. </tr>
  1305. </thead>
  1306. <tbody id="conns-table-body" class="divide-y divide-slate-800/60"></tbody>
  1307. </table>
  1308. </div>
  1309. <div id="conns-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1310. No active connections found matching your search.
  1311. </div>
  1312. </div>
  1313. </section>
  1314. <!-- ================= SECTION: ROUTES & POLICY (/ip route & rules) ================= -->
  1315. <section id="section-routes" class="hidden space-y-6">
  1316. <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">
  1317. <div>
  1318. <div class="flex items-center gap-2 mb-1">
  1319. <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>
  1320. <h2 class="text-base font-bold text-white">IP Routes & Policy Rules</h2>
  1321. </div>
  1322. <p class="text-xs text-slate-400">Kernel FIB/RIB routing tables, static gateways, multipath uplinks, and policy routing (ip rule / fwmark lookup).</p>
  1323. </div>
  1324. <div class="flex items-center space-x-2.5">
  1325. <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">
  1326. + Add Route
  1327. </button>
  1328. <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">
  1329. + Add Rule
  1330. </button>
  1331. <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">
  1332. + New Table
  1333. </button>
  1334. </div>
  1335. </div>
  1336. <!-- Sub Tabs: Routes / Policy Rules / Tables -->
  1337. <div class="flex border-b border-slate-800 space-x-1">
  1338. <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">
  1339. <span>Routes</span>
  1340. <span id="routes-badge-routes" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1341. </button>
  1342. <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">
  1343. <span>Policy Rules (/ip route rule)</span>
  1344. <span id="routes-badge-rules" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1345. </button>
  1346. <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">
  1347. <span>Routing Tables</span>
  1348. <span id="routes-badge-tables" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1349. </button>
  1350. </div>
  1351. <!-- Sub-Tab 1: Routes Table -->
  1352. <div id="routes-subtab-routes" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1353. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1354. <div class="flex items-center gap-3">
  1355. <h3 class="text-sm font-bold text-white">Active Routing Table (RIB)</h3>
  1356. <span id="routes-count-badge" class="text-xs font-mono text-slate-400">0 Routes</span>
  1357. </div>
  1358. <div class="flex items-center gap-2">
  1359. <label class="text-xs text-slate-400 font-sans">Table Filter:</label>
  1360. <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">
  1361. <option value="">All Tables</option>
  1362. <option value="main">main</option>
  1363. </select>
  1364. <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>
  1365. </div>
  1366. </div>
  1367. <div class="overflow-x-auto">
  1368. <table class="w-full text-left text-xs font-mono">
  1369. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1370. <tr>
  1371. <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>
  1372. <th class="py-2.5 px-3">Dst. Address</th>
  1373. <th class="py-2.5 px-3">Gateway</th>
  1374. <th class="py-2.5 px-3">Distance</th>
  1375. <th class="py-2.5 px-3">Table / Mark</th>
  1376. <th class="py-2.5 px-3">Interface</th>
  1377. <th class="py-2.5 px-3">Comment</th>
  1378. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1379. </tr>
  1380. </thead>
  1381. <tbody id="routes-table-body" class="divide-y divide-slate-800/80"></tbody>
  1382. </table>
  1383. </div>
  1384. <div id="routes-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1385. No routes found.
  1386. </div>
  1387. </div>
  1388. <!-- Sub-Tab 2: Policy Rules (/ip route rule) -->
  1389. <div id="routes-subtab-rules" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1390. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1391. <h3 class="text-sm font-bold text-white">Policy Routing Rules (ip rule)</h3>
  1392. <span id="rules-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1393. </div>
  1394. <div class="overflow-x-auto">
  1395. <table class="w-full text-left text-xs font-mono">
  1396. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1397. <tr>
  1398. <th class="py-2.5 px-3 w-16">Pref</th>
  1399. <th class="py-2.5 px-3">Src. Address</th>
  1400. <th class="py-2.5 px-3">Dst. Address</th>
  1401. <th class="py-2.5 px-3">Routing Mark (fwmark)</th>
  1402. <th class="py-2.5 px-3">Lookup Table</th>
  1403. <th class="py-2.5 px-3">Action</th>
  1404. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1405. </tr>
  1406. </thead>
  1407. <tbody id="rules-table-body" class="divide-y divide-slate-800/80"></tbody>
  1408. </table>
  1409. </div>
  1410. <div id="rules-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1411. No policy rules configured. Click "+ Add Rule" to route traffic based on routing-mark or source IP.
  1412. </div>
  1413. </div>
  1414. <!-- Sub-Tab 3: Routing Tables -->
  1415. <div id="routes-subtab-tables" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1416. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1417. <h3 class="text-sm font-bold text-white">Defined Routing Tables (/etc/iproute2/rt_tables)</h3>
  1418. <span id="tables-count-badge" class="text-xs font-mono text-slate-400">0 Tables</span>
  1419. </div>
  1420. <div class="overflow-x-auto">
  1421. <table class="w-full text-left text-xs font-mono">
  1422. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1423. <tr>
  1424. <th class="py-2.5 px-3 w-20">FIB ID</th>
  1425. <th class="py-2.5 px-3">Table Name</th>
  1426. <th class="py-2.5 px-3">Comment / Purpose</th>
  1427. </tr>
  1428. </thead>
  1429. <tbody id="tables-table-body" class="divide-y divide-slate-800/80"></tbody>
  1430. </table>
  1431. </div>
  1432. </div>
  1433. </section>
  1434. <!-- ================= SECTION: DYNAMIC ROUTING (BGP & OSPF) ================= -->
  1435. <section id="section-dynamic-routing" class="hidden space-y-6">
  1436. <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">
  1437. <div>
  1438. <div class="flex items-center gap-2 mb-1">
  1439. <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>
  1440. <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>
  1441. <h2 class="text-base font-bold text-white">Dynamic Routing Engine (BGP & OSPF)</h2>
  1442. </div>
  1443. <p class="text-xs text-slate-400">Enterprise FRRouting stack providing BGP peering, network advertisement, and OSPFv2 link-state routing.</p>
  1444. </div>
  1445. <div class="flex items-center space-x-2 flex-wrap gap-y-2">
  1446. <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">
  1447. <span>⚙ BGP Settings</span>
  1448. </button>
  1449. <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">
  1450. <span>⚙ OSPF Settings</span>
  1451. </button>
  1452. <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">
  1453. + Add BGP Peer
  1454. </button>
  1455. <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">
  1456. + Add OSPF Interface
  1457. </button>
  1458. </div>
  1459. </div>
  1460. <!-- Dynamic Routing Sub-Tabs -->
  1461. <div class="flex border-b border-slate-800 space-x-1 overflow-x-auto">
  1462. <button id="dyn-subtab-btn-bgp-peers" onclick="switchDynSubTab('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">
  1463. <span>BGP Peers (/routing bgp connection)</span>
  1464. <span id="dyn-badge-bgp-peers" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1465. </button>
  1466. <button id="dyn-subtab-btn-bgp-nets" onclick="switchDynSubTab('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">
  1467. <span>BGP Networks</span>
  1468. <span id="dyn-badge-bgp-nets" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1469. </button>
  1470. <button id="dyn-subtab-btn-bgp-routes" onclick="switchDynSubTab('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">
  1471. <span>BGP Routes (RIB)</span>
  1472. <span id="dyn-badge-bgp-routes" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1473. </button>
  1474. <button id="dyn-subtab-btn-ospf-ifaces" onclick="switchDynSubTab('ospf-ifaces')" 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">
  1475. <span>OSPF Interfaces</span>
  1476. <span id="dyn-badge-ospf-ifaces" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1477. </button>
  1478. <button id="dyn-subtab-btn-ospf-areas" onclick="switchDynSubTab('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">
  1479. <span>OSPF Areas</span>
  1480. <span id="dyn-badge-ospf-areas" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1481. </button>
  1482. <button id="dyn-subtab-btn-ospf-nbrs" onclick="switchDynSubTab('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">
  1483. <span>OSPF Neighbors</span>
  1484. <span id="dyn-badge-ospf-nbrs" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1485. </button>
  1486. <button id="dyn-subtab-btn-ospf-routes" onclick="switchDynSubTab('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">
  1487. <span>OSPF Routes</span>
  1488. <span id="dyn-badge-ospf-routes" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1489. </button>
  1490. </div>
  1491. <!-- Sub-Tab 1: BGP Peers -->
  1492. <div id="dyn-subtab-bgp-peers" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1493. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1494. <div class="flex items-center gap-3">
  1495. <h3 class="text-sm font-bold text-white">Configured BGP Peers</h3>
  1496. <span id="bgp-peers-count-badge" class="text-xs font-mono text-slate-400">0 Peers</span>
  1497. <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>
  1498. </div>
  1499. <div class="flex items-center gap-2">
  1500. <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>
  1501. </div>
  1502. </div>
  1503. <div class="overflow-x-auto">
  1504. <table class="w-full text-left text-xs font-mono">
  1505. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1506. <tr>
  1507. <th class="py-2.5 px-3 w-16 text-center">Flags</th>
  1508. <th class="py-2.5 px-3">Name</th>
  1509. <th class="py-2.5 px-3">Remote Address</th>
  1510. <th class="py-2.5 px-3">Remote AS</th>
  1511. <th class="py-2.5 px-3">State</th>
  1512. <th class="py-2.5 px-3">Uptime</th>
  1513. <th class="py-2.5 px-3">Prefixes (RX/TX)</th>
  1514. <th class="py-2.5 px-3">Comment</th>
  1515. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1516. </tr>
  1517. </thead>
  1518. <tbody id="bgp-peers-table-body" class="divide-y divide-slate-800/80"></tbody>
  1519. </table>
  1520. </div>
  1521. <div id="bgp-peers-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1522. No BGP peers configured. Click "+ Add BGP Peer" to establish an eBGP or iBGP peering session.
  1523. </div>
  1524. </div>
  1525. <!-- Sub-Tab 2: BGP Networks -->
  1526. <div id="dyn-subtab-bgp-nets" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1527. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1528. <div class="flex items-center gap-3">
  1529. <h3 class="text-sm font-bold text-white">Advertised BGP Networks (/routing bgp network)</h3>
  1530. <span id="bgp-nets-count-badge" class="text-xs font-mono text-slate-400">0 Networks</span>
  1531. </div>
  1532. <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">
  1533. + Add Network
  1534. </button>
  1535. </div>
  1536. <div class="overflow-x-auto">
  1537. <table class="w-full text-left text-xs font-mono">
  1538. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1539. <tr>
  1540. <th class="py-2.5 px-3">Network (CIDR)</th>
  1541. <th class="py-2.5 px-3">Status</th>
  1542. <th class="py-2.5 px-3">Comment</th>
  1543. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1544. </tr>
  1545. </thead>
  1546. <tbody id="bgp-nets-table-body" class="divide-y divide-slate-800/80"></tbody>
  1547. </table>
  1548. </div>
  1549. <div id="bgp-nets-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1550. No networks advertised. Click "+ Add Network" to announce your IP prefixes to BGP peers.
  1551. </div>
  1552. </div>
  1553. <!-- Sub-Tab 3: BGP Routes -->
  1554. <div id="dyn-subtab-bgp-routes" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1555. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1556. <h3 class="text-sm font-bold text-white">BGP Routing Information Base (show ip bgp)</h3>
  1557. <span id="bgp-routes-count-badge" class="text-xs font-mono text-slate-400">0 Routes</span>
  1558. </div>
  1559. <div class="overflow-x-auto">
  1560. <table class="w-full text-left text-xs font-mono">
  1561. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1562. <tr>
  1563. <th class="py-2.5 px-3">Prefix</th>
  1564. <th class="py-2.5 px-3">Next Hop</th>
  1565. <th class="py-2.5 px-3">Metric</th>
  1566. <th class="py-2.5 px-3">Weight</th>
  1567. <th class="py-2.5 px-3">AS Path</th>
  1568. <th class="py-2.5 px-3">Origin</th>
  1569. </tr>
  1570. </thead>
  1571. <tbody id="bgp-routes-table-body" class="divide-y divide-slate-800/80"></tbody>
  1572. </table>
  1573. </div>
  1574. <div id="bgp-routes-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1575. No active routes in BGP table. Check peer connections and ensure BGP is enabled.
  1576. </div>
  1577. </div>
  1578. <!-- Sub-Tab 4: OSPF Interfaces -->
  1579. <div id="dyn-subtab-ospf-ifaces" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1580. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1581. <div class="flex items-center gap-3">
  1582. <h3 class="text-sm font-bold text-white">OSPF Interface Templates (/routing ospf interface-template)</h3>
  1583. <span id="ospf-ifaces-count-badge" class="text-xs font-mono text-slate-400">0 Interfaces</span>
  1584. <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>
  1585. </div>
  1586. <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">
  1587. + Add Interface
  1588. </button>
  1589. </div>
  1590. <div class="overflow-x-auto">
  1591. <table class="w-full text-left text-xs font-mono">
  1592. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1593. <tr>
  1594. <th class="py-2.5 px-3 w-16 text-center">Flags</th>
  1595. <th class="py-2.5 px-3">Network (CIDR)</th>
  1596. <th class="py-2.5 px-3">Area</th>
  1597. <th class="py-2.5 px-3">Interface</th>
  1598. <th class="py-2.5 px-3">Cost</th>
  1599. <th class="py-2.5 px-3">Priority</th>
  1600. <th class="py-2.5 px-3">Timers (H/D)</th>
  1601. <th class="py-2.5 px-3">Auth</th>
  1602. <th class="py-2.5 px-3">Comment</th>
  1603. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1604. </tr>
  1605. </thead>
  1606. <tbody id="ospf-ifaces-table-body" class="divide-y divide-slate-800/80"></tbody>
  1607. </table>
  1608. </div>
  1609. <div id="ospf-ifaces-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1610. No OSPF interfaces configured. Click "+ Add OSPF Interface" to enable OSPF on local subnets.
  1611. </div>
  1612. </div>
  1613. <!-- Sub-Tab 5: OSPF Areas -->
  1614. <div id="dyn-subtab-ospf-areas" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1615. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1616. <div class="flex items-center gap-3">
  1617. <h3 class="text-sm font-bold text-white">OSPF Areas (/routing ospf area)</h3>
  1618. <span id="ospf-areas-count-badge" class="text-xs font-mono text-slate-400">0 Areas</span>
  1619. </div>
  1620. <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">
  1621. + Add Area
  1622. </button>
  1623. </div>
  1624. <div class="overflow-x-auto">
  1625. <table class="w-full text-left text-xs font-mono">
  1626. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1627. <tr>
  1628. <th class="py-2.5 px-3">Name</th>
  1629. <th class="py-2.5 px-3">Area ID</th>
  1630. <th class="py-2.5 px-3">Type</th>
  1631. <th class="py-2.5 px-3">Comment</th>
  1632. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1633. </tr>
  1634. </thead>
  1635. <tbody id="ospf-areas-table-body" class="divide-y divide-slate-800/80"></tbody>
  1636. </table>
  1637. </div>
  1638. </div>
  1639. <!-- Sub-Tab 6: OSPF Neighbors -->
  1640. <div id="dyn-subtab-ospf-nbrs" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1641. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1642. <h3 class="text-sm font-bold text-white">Live OSPF Neighbors (show ip ospf neighbor)</h3>
  1643. <span id="ospf-nbrs-count-badge" class="text-xs font-mono text-slate-400">0 Neighbors</span>
  1644. </div>
  1645. <div class="overflow-x-auto">
  1646. <table class="w-full text-left text-xs font-mono">
  1647. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1648. <tr>
  1649. <th class="py-2.5 px-3">Neighbor ID</th>
  1650. <th class="py-2.5 px-3">IP Address</th>
  1651. <th class="py-2.5 px-3">Interface</th>
  1652. <th class="py-2.5 px-3">Area</th>
  1653. <th class="py-2.5 px-3">State</th>
  1654. <th class="py-2.5 px-3">Dead Timer</th>
  1655. </tr>
  1656. </thead>
  1657. <tbody id="ospf-nbrs-table-body" class="divide-y divide-slate-800/80"></tbody>
  1658. </table>
  1659. </div>
  1660. <div id="ospf-nbrs-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1661. No active OSPF neighbors discovered. Ensure neighbors are in the same subnet and hello/dead timers match.
  1662. </div>
  1663. </div>
  1664. <!-- Sub-Tab 7: OSPF Routes -->
  1665. <div id="dyn-subtab-ospf-routes" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1666. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1667. <h3 class="text-sm font-bold text-white">OSPF Routing Table (show ip ospf route)</h3>
  1668. <span id="ospf-routes-count-badge" class="text-xs font-mono text-slate-400">0 Routes</span>
  1669. </div>
  1670. <div class="overflow-x-auto">
  1671. <table class="w-full text-left text-xs font-mono">
  1672. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1673. <tr>
  1674. <th class="py-2.5 px-3">Prefix</th>
  1675. <th class="py-2.5 px-3">Type</th>
  1676. <th class="py-2.5 px-3">Cost</th>
  1677. <th class="py-2.5 px-3">Area</th>
  1678. <th class="py-2.5 px-3">Next Hop / Dev</th>
  1679. </tr>
  1680. </thead>
  1681. <tbody id="ospf-routes-table-body" class="divide-y divide-slate-800/80"></tbody>
  1682. </table>
  1683. </div>
  1684. <div id="ospf-routes-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1685. No OSPF routes calculated.
  1686. </div>
  1687. </div>
  1688. </section>
  1689. <!-- ================= SECTION: DEBIAN CONFIG PERSISTENCE ================= -->
  1690. <section id="section-persistence" class="hidden space-y-6">
  1691. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  1692. <div class="flex flex-wrap items-center justify-between gap-4 mb-4">
  1693. <div>
  1694. <h3 class="text-sm font-bold text-white flex items-center gap-2">
  1695. <span>Debian /etc/network/interfaces.d/ Persistence</span>
  1696. <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>
  1697. </h3>
  1698. <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>
  1699. </div>
  1700. <div class="flex items-center space-x-3">
  1701. <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>
  1702. <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">
  1703. <span>Save to Debian Config</span>
  1704. </button>
  1705. </div>
  1706. </div>
  1707. <div class="relative">
  1708. <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>
  1709. </div>
  1710. </div>
  1711. </section>
  1712. </main>
  1713. </div>
  1714. </div>
  1715. <!-- ================= MODAL: CREATE VLAN ================= -->
  1716. <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">
  1717. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  1718. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  1719. <h3 class="text-sm font-bold text-white">Create New VLAN Interface</h3>
  1720. <button onclick="closeVlanModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  1721. </div>
  1722. <form id="vlan-form" onsubmit="submitCreateVlan(event)" class="p-6 space-y-4">
  1723. <div>
  1724. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Parent Interface *</label>
  1725. <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>
  1726. </div>
  1727. <div class="grid grid-cols-2 gap-4">
  1728. <div>
  1729. <label class="block text-xs font-semibold text-slate-300 mb-1.5">VLAN ID (1-4094) *</label>
  1730. <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">
  1731. </div>
  1732. <div>
  1733. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Interface Name</label>
  1734. <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">
  1735. </div>
  1736. </div>
  1737. <div>
  1738. <div class="flex items-center justify-between mb-1.5">
  1739. <label class="text-xs font-semibold text-slate-300">Router IP Address & CIDR</label>
  1740. <div class="flex space-x-1">
  1741. <button type="button" onclick="setSubnetPreset('/24')" class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded">/24</button>
  1742. <button type="button" onclick="setSubnetPreset('/23')" class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded">/23</button>
  1743. <button type="button" onclick="setSubnetPreset('/16')" class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded">/16</button>
  1744. </div>
  1745. </div>
  1746. <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">
  1747. </div>
  1748. <div class="grid grid-cols-2 gap-4">
  1749. <div>
  1750. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Role Tag</label>
  1751. <select id="vlan-role" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white">
  1752. <option value="LAN">LAN</option>
  1753. <option value="GUEST">Guest Network</option>
  1754. <option value="IOT">IoT / Smart Home</option>
  1755. <option value="DMZ">DMZ / Isolated</option>
  1756. <option value="MGMT">Management</option>
  1757. <option value="WAN">WAN / Uplink</option>
  1758. </select>
  1759. </div>
  1760. <div>
  1761. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Description / Alias</label>
  1762. <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">
  1763. </div>
  1764. </div>
  1765. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  1766. <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>
  1767. <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>
  1768. </div>
  1769. </form>
  1770. </div>
  1771. </div>
  1772. <!-- ================= MODAL: EDIT INTERFACE ================= -->
  1773. <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">
  1774. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  1775. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  1776. <div>
  1777. <h3 class="text-sm font-bold text-white flex items-center gap-2">
  1778. <span id="modal-iface-name">eth0</span>
  1779. <span id="modal-iface-badge" class="text-[10px] font-mono px-2 py-0.5 rounded bg-slate-800 text-slate-300">Ethernet</span>
  1780. </h3>
  1781. </div>
  1782. <button onclick="closeIfaceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  1783. </div>
  1784. <div class="p-6 space-y-5">
  1785. <div class="grid grid-cols-2 gap-4 p-3 bg-slate-950/60 rounded-xl border border-slate-800/80">
  1786. <div>
  1787. <span class="block text-[11px] text-slate-400 mb-1">Administrative Link</span>
  1788. <div class="flex items-center space-x-2">
  1789. <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>
  1790. <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>
  1791. </div>
  1792. </div>
  1793. <div>
  1794. <span class="block text-[11px] text-slate-400 mb-1">MTU Size</span>
  1795. <div class="flex items-center space-x-2">
  1796. <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">
  1797. <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>
  1798. </div>
  1799. </div>
  1800. </div>
  1801. <div>
  1802. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Assigned IP Addresses</label>
  1803. <div id="modal-ip-list" class="space-y-1.5 mb-3 font-mono text-xs"></div>
  1804. <div class="flex space-x-2">
  1805. <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">
  1806. <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>
  1807. </div>
  1808. </div>
  1809. <div class="grid grid-cols-2 gap-4">
  1810. <div>
  1811. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Role Tag</label>
  1812. <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">
  1813. <option value="WAN">WAN / Uplink</option>
  1814. <option value="LAN">LAN</option>
  1815. <option value="DMZ">DMZ</option>
  1816. <option value="GUEST">Guest</option>
  1817. <option value="IOT">IoT</option>
  1818. <option value="MGMT">Management</option>
  1819. </select>
  1820. </div>
  1821. <div>
  1822. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Description</label>
  1823. <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">
  1824. </div>
  1825. </div>
  1826. <div class="pt-4 border-t border-slate-800 flex justify-between items-center">
  1827. <button id="modal-delete-vlan-btn" onclick="confirmDeleteVlan(currentModalIface)" class="hidden text-xs text-rose-400 hover:text-rose-300">Delete VLAN</button>
  1828. <div class="flex space-x-3">
  1829. <button onclick="closeIfaceModal()" class="px-4 py-2 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800">Close</button>
  1830. <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>
  1831. </div>
  1832. </div>
  1833. </div>
  1834. </div>
  1835. </div>
  1836. <!-- ================= MODAL: PPPoE CLIENT ================= -->
  1837. <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">
  1838. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  1839. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  1840. <h3 id="pppoe-modal-title" class="text-sm font-bold text-white">Add PPPoE Client Interface</h3>
  1841. <button onclick="closePPPoEModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  1842. </div>
  1843. <form onsubmit="submitSavePPPoE(event)" class="p-6 space-y-4">
  1844. <input type="hidden" id="pppoe-modal-edit-orig">
  1845. <div class="grid grid-cols-2 gap-4">
  1846. <div>
  1847. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Name *</label>
  1848. <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">
  1849. </div>
  1850. <div>
  1851. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Interface *</label>
  1852. <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>
  1853. </div>
  1854. </div>
  1855. <div class="grid grid-cols-2 gap-4">
  1856. <div>
  1857. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Username *</label>
  1858. <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">
  1859. </div>
  1860. <div>
  1861. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Password *</label>
  1862. <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">
  1863. </div>
  1864. </div>
  1865. <div class="grid grid-cols-2 gap-4">
  1866. <div>
  1867. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Service Name (Optional)</label>
  1868. <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">
  1869. </div>
  1870. <div>
  1871. <label class="block text-xs font-semibold text-slate-300 mb-1.5">MTU</label>
  1872. <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">
  1873. </div>
  1874. </div>
  1875. <div class="grid grid-cols-3 gap-2 pt-2 border-t border-slate-800/80">
  1876. <label class="flex items-center space-x-2 cursor-pointer">
  1877. <input type="checkbox" id="pppoe-modal-defroute" checked class="rounded bg-slate-800 border-slate-700 text-blue-500">
  1878. <span class="text-xs text-slate-300 font-medium">Default Route</span>
  1879. </label>
  1880. <label class="flex items-center space-x-2 cursor-pointer">
  1881. <input type="checkbox" id="pppoe-modal-reconnect" checked class="rounded bg-slate-800 border-slate-700 text-blue-500">
  1882. <span class="text-xs text-slate-300 font-medium">Auto-Reconnect</span>
  1883. </label>
  1884. <label class="flex items-center space-x-2 cursor-pointer">
  1885. <input type="checkbox" id="pppoe-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  1886. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  1887. </label>
  1888. </div>
  1889. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  1890. <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>
  1891. <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>
  1892. </div>
  1893. </form>
  1894. </div>
  1895. </div>
  1896. <!-- ================= MODAL: WIREGUARD INTERFACE ================= -->
  1897. <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">
  1898. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  1899. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  1900. <h3 id="wg-iface-modal-title" class="text-sm font-bold text-white">Add WireGuard Interface</h3>
  1901. <button onclick="closeAddWGInterfaceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  1902. </div>
  1903. <form onsubmit="submitSaveWGInterface(event)" class="p-6 space-y-4">
  1904. <input type="hidden" id="wg-iface-modal-edit-orig">
  1905. <div class="grid grid-cols-2 gap-4">
  1906. <div>
  1907. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Interface Name *</label>
  1908. <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">
  1909. </div>
  1910. <div>
  1911. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Listen Port *</label>
  1912. <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">
  1913. </div>
  1914. </div>
  1915. <div class="grid grid-cols-2 gap-4">
  1916. <div>
  1917. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Tunnel IP (CIDR) *</label>
  1918. <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">
  1919. </div>
  1920. <div>
  1921. <label class="block text-xs font-semibold text-slate-300 mb-1.5">MTU</label>
  1922. <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">
  1923. </div>
  1924. </div>
  1925. <div>
  1926. <div class="flex items-center justify-between mb-1.5">
  1927. <label class="text-xs font-semibold text-slate-300">Public Key</label>
  1928. <button type="button" onclick="generateWGInterfaceKeys()" class="text-[10px] text-cyan-400 hover:text-cyan-300 font-semibold">Generate New Keypair</button>
  1929. </div>
  1930. <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">
  1931. </div>
  1932. <div>
  1933. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Private Key (Secret) *</label>
  1934. <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">
  1935. </div>
  1936. <div class="pt-2">
  1937. <label class="flex items-center space-x-2 cursor-pointer">
  1938. <input type="checkbox" id="wg-iface-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  1939. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  1940. </label>
  1941. </div>
  1942. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  1943. <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>
  1944. <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>
  1945. </div>
  1946. </form>
  1947. </div>
  1948. </div>
  1949. <!-- ================= MODAL: ADD WIREGUARD PEER ================= -->
  1950. <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">
  1951. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  1952. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  1953. <h3 id="wg-peer-modal-title" class="text-sm font-bold text-white">Add WireGuard Peer</h3>
  1954. <button onclick="closeAddWGPeerModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  1955. </div>
  1956. <form onsubmit="submitSaveWGPeer(event)" class="p-6 space-y-4">
  1957. <div class="grid grid-cols-2 gap-4">
  1958. <div>
  1959. <label class="block text-xs font-semibold text-slate-300 mb-1.5">WireGuard Interface *</label>
  1960. <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>
  1961. </div>
  1962. <div>
  1963. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Peer Name / Alias *</label>
  1964. <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">
  1965. </div>
  1966. </div>
  1967. <div>
  1968. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Peer Public Key *</label>
  1969. <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">
  1970. </div>
  1971. <div>
  1972. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Allowed IPs (CIDR) *</label>
  1973. <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">
  1974. </div>
  1975. <div class="grid grid-cols-2 gap-4">
  1976. <div>
  1977. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Endpoint (Optional)</label>
  1978. <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">
  1979. </div>
  1980. <div>
  1981. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Keepalive (sec)</label>
  1982. <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">
  1983. </div>
  1984. </div>
  1985. <div>
  1986. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Preshared Key (Optional)</label>
  1987. <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">
  1988. </div>
  1989. <div class="pt-2">
  1990. <label class="flex items-center space-x-2 cursor-pointer">
  1991. <input type="checkbox" id="wg-peer-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  1992. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  1993. </label>
  1994. </div>
  1995. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  1996. <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>
  1997. <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>
  1998. </div>
  1999. </form>
  2000. </div>
  2001. </div>
  2002. <!-- ================= MODAL: IPSEC TUNNEL ================= -->
  2003. <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">
  2004. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2005. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2006. <h3 id="ipsec-modal-title" class="text-sm font-bold text-white">Configure IPSec IKEv2 Tunnel</h3>
  2007. <button onclick="closeAddIPSecModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2008. </div>
  2009. <form onsubmit="submitSaveIPSec(event)" class="p-6 space-y-4">
  2010. <div>
  2011. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Connection Name *</label>
  2012. <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">
  2013. </div>
  2014. <div class="grid grid-cols-2 gap-4">
  2015. <div>
  2016. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Local Subnet *</label>
  2017. <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">
  2018. </div>
  2019. <div>
  2020. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Remote Subnet *</label>
  2021. <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">
  2022. </div>
  2023. </div>
  2024. <div>
  2025. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Remote Gateway IP / FQDN *</label>
  2026. <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">
  2027. </div>
  2028. <div>
  2029. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Pre-Shared Key (PSK) *</label>
  2030. <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">
  2031. </div>
  2032. <div class="grid grid-cols-2 gap-4">
  2033. <div>
  2034. <label class="block text-xs font-semibold text-slate-300 mb-1.5">IKE Proposals</label>
  2035. <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">
  2036. </div>
  2037. <div>
  2038. <label class="block text-xs font-semibold text-slate-300 mb-1.5">ESP Proposals</label>
  2039. <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">
  2040. </div>
  2041. </div>
  2042. <div class="grid grid-cols-2 gap-4 pt-2">
  2043. <label class="flex items-center space-x-2 cursor-pointer">
  2044. <input type="checkbox" id="ipsec-modal-autostart" checked class="rounded bg-slate-800 border-slate-700 text-amber-500">
  2045. <span class="text-xs text-slate-300 font-medium">Auto-start on boot</span>
  2046. </label>
  2047. <label class="flex items-center space-x-2 cursor-pointer">
  2048. <input type="checkbox" id="ipsec-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2049. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2050. </label>
  2051. </div>
  2052. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2053. <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>
  2054. <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>
  2055. </div>
  2056. </form>
  2057. </div>
  2058. </div>
  2059. <!-- ================= MODAL: L2TP CLIENT ================= -->
  2060. <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">
  2061. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2062. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2063. <h3 id="l2tp-modal-title" class="text-sm font-bold text-white">Add L2TP Client Interface</h3>
  2064. <button onclick="closeL2TPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2065. </div>
  2066. <form onsubmit="submitSaveL2TP(event)" class="p-6 space-y-4">
  2067. <div>
  2068. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Client Interface Name *</label>
  2069. <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">
  2070. </div>
  2071. <div>
  2072. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Connect To (Server IP / Host) *</label>
  2073. <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">
  2074. </div>
  2075. <div class="grid grid-cols-2 gap-4">
  2076. <div>
  2077. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Username *</label>
  2078. <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">
  2079. </div>
  2080. <div>
  2081. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Password *</label>
  2082. <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">
  2083. </div>
  2084. </div>
  2085. <div>
  2086. <label class="block text-xs font-semibold text-slate-300 mb-1.5">IPSec Secret / PSK (Optional for L2TP/IPsec)</label>
  2087. <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">
  2088. </div>
  2089. <div class="grid grid-cols-2 gap-4 pt-2">
  2090. <label class="flex items-center space-x-2 cursor-pointer">
  2091. <input type="checkbox" id="l2tp-modal-defroute" checked class="rounded bg-slate-800 border-slate-700 text-cyan-500">
  2092. <span class="text-xs text-slate-300 font-medium">Default Route</span>
  2093. </label>
  2094. <label class="flex items-center space-x-2 cursor-pointer">
  2095. <input type="checkbox" id="l2tp-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2096. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2097. </label>
  2098. </div>
  2099. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2100. <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>
  2101. <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>
  2102. </div>
  2103. </form>
  2104. </div>
  2105. </div>
  2106. <!-- ================= MODAL: PPTP CLIENT ================= -->
  2107. <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">
  2108. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2109. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2110. <h3 id="pptp-modal-title" class="text-sm font-bold text-white">Add PPTP Client Interface</h3>
  2111. <button onclick="closePPTPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2112. </div>
  2113. <form onsubmit="submitSavePPTP(event)" class="p-6 space-y-4">
  2114. <div>
  2115. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Client Interface Name *</label>
  2116. <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">
  2117. </div>
  2118. <div>
  2119. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Connect To (Server IP / Host) *</label>
  2120. <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">
  2121. </div>
  2122. <div class="grid grid-cols-2 gap-4">
  2123. <div>
  2124. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Username *</label>
  2125. <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">
  2126. </div>
  2127. <div>
  2128. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Password *</label>
  2129. <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">
  2130. </div>
  2131. </div>
  2132. <div class="grid grid-cols-3 gap-2 pt-2 border-t border-slate-800/80">
  2133. <label class="flex items-center space-x-2 cursor-pointer">
  2134. <input type="checkbox" id="pptp-modal-mppe" checked class="rounded bg-slate-800 border-slate-700 text-purple-500">
  2135. <span class="text-xs text-slate-300 font-medium">MPPE-128</span>
  2136. </label>
  2137. <label class="flex items-center space-x-2 cursor-pointer">
  2138. <input type="checkbox" id="pptp-modal-defroute" checked class="rounded bg-slate-800 border-slate-700 text-purple-500">
  2139. <span class="text-xs text-slate-300 font-medium">Default Route</span>
  2140. </label>
  2141. <label class="flex items-center space-x-2 cursor-pointer">
  2142. <input type="checkbox" id="pptp-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2143. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2144. </label>
  2145. </div>
  2146. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2147. <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>
  2148. <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>
  2149. </div>
  2150. </form>
  2151. </div>
  2152. </div>
  2153. <!-- ================= MODAL: FIREWALL FILTER RULE ================= -->
  2154. <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">
  2155. <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">
  2156. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2157. <h3 id="filter-modal-title" class="text-sm font-bold text-white">Add Firewall Filter Rule</h3>
  2158. <button onclick="closeFilterModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2159. </div>
  2160. <form onsubmit="submitSaveFilterRule(event)" class="p-6 space-y-4 overflow-y-auto flex-1 text-xs">
  2161. <input type="hidden" id="filter-modal-id">
  2162. <div class="grid grid-cols-2 gap-4">
  2163. <div>
  2164. <label class="block font-semibold text-slate-300 mb-1">Chain *</label>
  2165. <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">
  2166. <option value="input">input (traffic to router)</option>
  2167. <option value="forward" selected>forward (routed traffic)</option>
  2168. <option value="output">output (traffic from router)</option>
  2169. </select>
  2170. </div>
  2171. <div>
  2172. <label class="block font-semibold text-slate-300 mb-1">Action *</label>
  2173. <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">
  2174. <option value="accept" selected>accept</option>
  2175. <option value="drop">drop</option>
  2176. <option value="reject">reject</option>
  2177. <option value="log">log</option>
  2178. <option value="jump">jump</option>
  2179. <option value="return">return</option>
  2180. </select>
  2181. </div>
  2182. </div>
  2183. <div id="filter-action-reject-box" class="hidden p-3 bg-rose-950/20 border border-rose-900/30 rounded-lg">
  2184. <label class="block font-semibold text-rose-300 mb-1">Reject With</label>
  2185. <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">
  2186. <option value="icmp-network-unreachable">icmp-network-unreachable</option>
  2187. <option value="icmp-host-unreachable">icmp-host-unreachable</option>
  2188. <option value="icmp-port-unreachable">icmp-port-unreachable</option>
  2189. <option value="tcp-reset">tcp-reset (TCP RST)</option>
  2190. </select>
  2191. </div>
  2192. <div class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2193. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Match Properties</span>
  2194. <div class="grid grid-cols-2 gap-3">
  2195. <div>
  2196. <label class="block font-semibold text-slate-300 mb-1">Protocol</label>
  2197. <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">
  2198. <option value="all">all</option>
  2199. <option value="tcp">tcp (6)</option>
  2200. <option value="udp">udp (17)</option>
  2201. <option value="icmp">icmp (1)</option>
  2202. <option value="gre">gre (47)</option>
  2203. <option value="esp">esp (50)</option>
  2204. </select>
  2205. </div>
  2206. <div>
  2207. <label class="block font-semibold text-slate-300 mb-1">Connection Mark</label>
  2208. <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">
  2209. </div>
  2210. </div>
  2211. <div class="grid grid-cols-2 gap-3">
  2212. <div>
  2213. <label class="block font-semibold text-slate-300 mb-1">Src. Address / CIDR</label>
  2214. <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">
  2215. </div>
  2216. <div>
  2217. <label class="block font-semibold text-slate-300 mb-1">Dst. Address / CIDR</label>
  2218. <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">
  2219. </div>
  2220. </div>
  2221. <div class="grid grid-cols-2 gap-3">
  2222. <div>
  2223. <label class="block font-semibold text-slate-300 mb-1">Src. Port(s)</label>
  2224. <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">
  2225. </div>
  2226. <div>
  2227. <label class="block font-semibold text-slate-300 mb-1">Dst. Port(s)</label>
  2228. <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">
  2229. </div>
  2230. </div>
  2231. <div class="grid grid-cols-2 gap-3">
  2232. <div>
  2233. <label class="block font-semibold text-slate-300 mb-1">In. Interface</label>
  2234. <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>
  2235. </div>
  2236. <div>
  2237. <label class="block font-semibold text-slate-300 mb-1">Out. Interface</label>
  2238. <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>
  2239. </div>
  2240. </div>
  2241. <div>
  2242. <label class="block font-semibold text-slate-300 mb-1.5">Connection State</label>
  2243. <div class="flex flex-wrap gap-3">
  2244. <label class="flex items-center space-x-1.5 cursor-pointer">
  2245. <input type="checkbox" id="filter-modal-cs-established" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2246. <span class="text-slate-300">established</span>
  2247. </label>
  2248. <label class="flex items-center space-x-1.5 cursor-pointer">
  2249. <input type="checkbox" id="filter-modal-cs-related" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2250. <span class="text-slate-300">related</span>
  2251. </label>
  2252. <label class="flex items-center space-x-1.5 cursor-pointer">
  2253. <input type="checkbox" id="filter-modal-cs-new" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2254. <span class="text-slate-300">new</span>
  2255. </label>
  2256. <label class="flex items-center space-x-1.5 cursor-pointer">
  2257. <input type="checkbox" id="filter-modal-cs-invalid" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2258. <span class="text-slate-300">invalid</span>
  2259. </label>
  2260. </div>
  2261. </div>
  2262. <div class="grid grid-cols-2 gap-3">
  2263. <div>
  2264. <label class="block font-semibold text-slate-300 mb-1">Src. Address List</label>
  2265. <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">
  2266. <option value="">(None)</option>
  2267. </select>
  2268. </div>
  2269. <div>
  2270. <label class="block font-semibold text-slate-300 mb-1">Dst. Address List</label>
  2271. <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">
  2272. <option value="">(None)</option>
  2273. </select>
  2274. </div>
  2275. </div>
  2276. </div>
  2277. <div>
  2278. <label class="block font-semibold text-slate-300 mb-1">Comment</label>
  2279. <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">
  2280. </div>
  2281. <div class="pt-2">
  2282. <label class="flex items-center space-x-2 cursor-pointer">
  2283. <input type="checkbox" id="filter-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2284. <span class="font-medium text-slate-300">Disabled (X)</span>
  2285. </label>
  2286. </div>
  2287. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2288. <button type="button" onclick="closeFilterModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2289. <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>
  2290. </div>
  2291. </form>
  2292. </div>
  2293. </div>
  2294. <!-- ================= MODAL: FIREWALL NAT RULE ================= -->
  2295. <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">
  2296. <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">
  2297. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2298. <h3 id="nat-modal-title" class="text-sm font-bold text-white">Add NAT Rule</h3>
  2299. <button onclick="closeNATModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2300. </div>
  2301. <form onsubmit="submitSaveNATRule(event)" class="p-6 space-y-4 overflow-y-auto flex-1 text-xs">
  2302. <input type="hidden" id="nat-modal-id">
  2303. <div class="grid grid-cols-2 gap-4">
  2304. <div>
  2305. <label class="block font-semibold text-slate-300 mb-1">Chain *</label>
  2306. <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">
  2307. <option value="srcnat" selected>srcnat (Outgoing / Masquerade)</option>
  2308. <option value="dstnat">dstnat (Incoming / Port Forwarding)</option>
  2309. </select>
  2310. </div>
  2311. <div>
  2312. <label class="block font-semibold text-slate-300 mb-1">Action *</label>
  2313. <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">
  2314. <option value="masquerade" selected>masquerade</option>
  2315. <option value="src-nat">src-nat</option>
  2316. <option value="dst-nat">dst-nat</option>
  2317. <option value="redirect">redirect</option>
  2318. <option value="accept">accept</option>
  2319. </select>
  2320. </div>
  2321. </div>
  2322. <div id="nat-action-to-box" class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2323. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">NAT Target (To Addresses / Ports)</span>
  2324. <div class="grid grid-cols-2 gap-3">
  2325. <div>
  2326. <label class="block font-semibold text-slate-300 mb-1">To Addresses</label>
  2327. <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">
  2328. </div>
  2329. <div>
  2330. <label class="block font-semibold text-slate-300 mb-1">To Ports</label>
  2331. <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">
  2332. </div>
  2333. </div>
  2334. </div>
  2335. <div class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2336. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Match Properties</span>
  2337. <div class="grid grid-cols-2 gap-3">
  2338. <div>
  2339. <label class="block font-semibold text-slate-300 mb-1">Protocol</label>
  2340. <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">
  2341. <option value="all">all</option>
  2342. <option value="tcp">tcp</option>
  2343. <option value="udp">udp</option>
  2344. <option value="icmp">icmp</option>
  2345. </select>
  2346. </div>
  2347. <div>
  2348. <label class="block font-semibold text-slate-300 mb-1">Dst. Port(s)</label>
  2349. <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">
  2350. </div>
  2351. </div>
  2352. <div class="grid grid-cols-2 gap-3">
  2353. <div>
  2354. <label class="block font-semibold text-slate-300 mb-1">Src. Address / CIDR</label>
  2355. <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">
  2356. </div>
  2357. <div>
  2358. <label class="block font-semibold text-slate-300 mb-1">Dst. Address / CIDR</label>
  2359. <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">
  2360. </div>
  2361. </div>
  2362. <div class="grid grid-cols-2 gap-3">
  2363. <div>
  2364. <label class="block font-semibold text-slate-300 mb-1">In. Interface</label>
  2365. <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>
  2366. </div>
  2367. <div>
  2368. <label class="block font-semibold text-slate-300 mb-1">Out. Interface</label>
  2369. <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>
  2370. </div>
  2371. </div>
  2372. </div>
  2373. <div>
  2374. <label class="block font-semibold text-slate-300 mb-1">Comment</label>
  2375. <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">
  2376. </div>
  2377. <div class="pt-2">
  2378. <label class="flex items-center space-x-2 cursor-pointer">
  2379. <input type="checkbox" id="nat-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2380. <span class="font-medium text-slate-300">Disabled (X)</span>
  2381. </label>
  2382. </div>
  2383. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2384. <button type="button" onclick="closeNATModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2385. <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>
  2386. </div>
  2387. </form>
  2388. </div>
  2389. </div>
  2390. <!-- ================= MODAL: FIREWALL MANGLE RULE ================= -->
  2391. <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">
  2392. <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">
  2393. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2394. <h3 id="mangle-modal-title" class="text-sm font-bold text-white">Add Mangle Rule</h3>
  2395. <button onclick="closeMangleModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2396. </div>
  2397. <form onsubmit="submitSaveMangleRule(event)" class="p-6 space-y-4 overflow-y-auto flex-1 text-xs">
  2398. <input type="hidden" id="mangle-modal-id">
  2399. <div class="grid grid-cols-2 gap-4">
  2400. <div>
  2401. <label class="block font-semibold text-slate-300 mb-1">Chain *</label>
  2402. <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">
  2403. <option value="prerouting" selected>prerouting (Policy Routing / Marks)</option>
  2404. <option value="forward">forward</option>
  2405. <option value="postrouting">postrouting</option>
  2406. <option value="input">input</option>
  2407. <option value="output">output</option>
  2408. </select>
  2409. </div>
  2410. <div>
  2411. <label class="block font-semibold text-slate-300 mb-1">Action *</label>
  2412. <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">
  2413. <option value="mark-connection" selected>mark-connection</option>
  2414. <option value="mark-routing">mark-routing (Policy Routing)</option>
  2415. <option value="mark-packet">mark-packet (QoS / Queues)</option>
  2416. <option value="change-mss">change-mss (TCP MSS Clamp)</option>
  2417. <option value="set-dscp">set-dscp</option>
  2418. <option value="accept">accept</option>
  2419. </select>
  2420. </div>
  2421. </div>
  2422. <div id="mangle-target-box" class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2423. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Mark Target & Passthrough</span>
  2424. <div class="grid grid-cols-2 gap-3">
  2425. <div id="mangle-field-newmark">
  2426. <label class="block font-semibold text-slate-300 mb-1">New Mark Name</label>
  2427. <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">
  2428. </div>
  2429. <div class="flex items-center pt-5">
  2430. <label class="flex items-center space-x-2 cursor-pointer">
  2431. <input type="checkbox" id="mangle-modal-passthrough" checked class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2432. <span class="font-medium text-slate-300">Passthrough</span>
  2433. </label>
  2434. </div>
  2435. </div>
  2436. </div>
  2437. <div class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2438. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Match Criteria</span>
  2439. <div class="grid grid-cols-2 gap-3">
  2440. <div>
  2441. <label class="block font-semibold text-slate-300 mb-1">Src. Address / CIDR</label>
  2442. <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">
  2443. </div>
  2444. <div>
  2445. <label class="block font-semibold text-slate-300 mb-1">Dst. Address / CIDR</label>
  2446. <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">
  2447. </div>
  2448. </div>
  2449. <div class="grid grid-cols-2 gap-3">
  2450. <div>
  2451. <label class="block font-semibold text-slate-300 mb-1">Connection Mark</label>
  2452. <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">
  2453. </div>
  2454. <div>
  2455. <label class="block font-semibold text-slate-300 mb-1">In. Interface</label>
  2456. <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>
  2457. </div>
  2458. </div>
  2459. </div>
  2460. <div>
  2461. <label class="block font-semibold text-slate-300 mb-1">Comment</label>
  2462. <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">
  2463. </div>
  2464. <div class="pt-2">
  2465. <label class="flex items-center space-x-2 cursor-pointer">
  2466. <input type="checkbox" id="mangle-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2467. <span class="font-medium text-slate-300">Disabled (X)</span>
  2468. </label>
  2469. </div>
  2470. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2471. <button type="button" onclick="closeMangleModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2472. <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>
  2473. </div>
  2474. </form>
  2475. </div>
  2476. </div>
  2477. <!-- ================= MODAL: ADDRESS LIST ENTRY ================= -->
  2478. <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">
  2479. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  2480. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2481. <h3 id="addrlist-modal-title" class="text-sm font-bold text-white">Add Address List Entry</h3>
  2482. <button onclick="closeAddrListModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2483. </div>
  2484. <form onsubmit="submitSaveAddrList(event)" class="p-6 space-y-4 text-xs">
  2485. <div>
  2486. <label class="block font-semibold text-slate-300 mb-1.5">List Name *</label>
  2487. <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">
  2488. </div>
  2489. <div>
  2490. <label class="block font-semibold text-slate-300 mb-1.5">IP Address / Subnet (CIDR) *</label>
  2491. <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">
  2492. </div>
  2493. <div>
  2494. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  2495. <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">
  2496. </div>
  2497. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2498. <button type="button" onclick="closeAddrListModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2499. <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">Add to List</button>
  2500. </div>
  2501. </form>
  2502. </div>
  2503. </div>
  2504. <!-- ================= MODAL: ADD / EDIT ROUTE ================= -->
  2505. <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">
  2506. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2507. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2508. <h3 id="route-modal-title" class="text-sm font-bold text-white">Add Static Route</h3>
  2509. <button onclick="closeRouteModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2510. </div>
  2511. <form onsubmit="submitSaveRoute(event)" class="p-6 space-y-4 text-xs">
  2512. <input type="hidden" id="route-modal-id">
  2513. <div>
  2514. <label class="block font-semibold text-slate-300 mb-1.5">Dst. Address (CIDR) *</label>
  2515. <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">
  2516. </div>
  2517. <div class="grid grid-cols-2 gap-4">
  2518. <div>
  2519. <label class="block font-semibold text-slate-300 mb-1.5">Gateway (IP or Interface) *</label>
  2520. <input type="text" id="route-modal-gw" placeholder="192.168.1.1 or wg0" 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">
  2521. </div>
  2522. <div>
  2523. <label class="block font-semibold text-slate-300 mb-1.5">Routing Table / Mark</label>
  2524. <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">
  2525. <option value="main" selected>main</option>
  2526. </select>
  2527. </div>
  2528. </div>
  2529. <div class="grid grid-cols-2 gap-4">
  2530. <div>
  2531. <label class="block font-semibold text-slate-300 mb-1.5">Distance (Metric)</label>
  2532. <input type="number" id="route-modal-distance" value="1" min="1" max="255" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  2533. </div>
  2534. <div>
  2535. <label class="block font-semibold text-slate-300 mb-1.5">Interface (Optional)</label>
  2536. <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"></select>
  2537. </div>
  2538. </div>
  2539. <div>
  2540. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  2541. <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">
  2542. </div>
  2543. <div class="pt-2">
  2544. <label class="flex items-center space-x-2 cursor-pointer">
  2545. <input type="checkbox" id="route-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2546. <span class="font-medium text-slate-300">Disabled (X)</span>
  2547. </label>
  2548. </div>
  2549. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2550. <button type="button" onclick="closeRouteModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2551. <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>
  2552. </div>
  2553. </form>
  2554. </div>
  2555. </div>
  2556. <!-- ================= MODAL: ADD POLICY ROUTING RULE ================= -->
  2557. <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">
  2558. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2559. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2560. <h3 id="prule-modal-title" class="text-sm font-bold text-white">Add Policy Routing Rule (/ip route rule)</h3>
  2561. <button onclick="closePolicyRuleModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2562. </div>
  2563. <form onsubmit="submitSavePolicyRule(event)" class="p-6 space-y-4 text-xs">
  2564. <input type="hidden" id="prule-modal-id">
  2565. <div class="grid grid-cols-2 gap-4">
  2566. <div>
  2567. <label class="block font-semibold text-slate-300 mb-1.5">Priority / Preference</label>
  2568. <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">
  2569. </div>
  2570. <div>
  2571. <label class="block font-semibold text-slate-300 mb-1.5">Routing Mark (fwmark)</label>
  2572. <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">
  2573. </div>
  2574. </div>
  2575. <div class="grid grid-cols-2 gap-4">
  2576. <div>
  2577. <label class="block font-semibold text-slate-300 mb-1.5">Src. Address (CIDR)</label>
  2578. <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">
  2579. </div>
  2580. <div>
  2581. <label class="block font-semibold text-slate-300 mb-1.5">Dst. Address (CIDR)</label>
  2582. <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">
  2583. </div>
  2584. </div>
  2585. <div class="grid grid-cols-2 gap-4">
  2586. <div>
  2587. <label class="block font-semibold text-slate-300 mb-1.5">Lookup Table *</label>
  2588. <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>
  2589. </div>
  2590. <div>
  2591. <label class="block font-semibold text-slate-300 mb-1.5">Action</label>
  2592. <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">
  2593. <option value="lookup" selected>lookup (standard)</option>
  2594. <option value="unreachable">unreachable</option>
  2595. <option value="blackhole">blackhole</option>
  2596. </select>
  2597. </div>
  2598. </div>
  2599. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2600. <button type="button" onclick="closePolicyRuleModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2601. <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>
  2602. </div>
  2603. </form>
  2604. </div>
  2605. </div>
  2606. <!-- ================= MODAL: CREATE ROUTING TABLE ================= -->
  2607. <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">
  2608. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  2609. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2610. <h3 class="text-sm font-bold text-white">Create New Routing Table</h3>
  2611. <button onclick="closeTableModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2612. </div>
  2613. <form onsubmit="submitSaveTable(event)" class="p-6 space-y-4 text-xs">
  2614. <div>
  2615. <label class="block font-semibold text-slate-300 mb-1.5">Table Name *</label>
  2616. <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">
  2617. </div>
  2618. <div>
  2619. <label class="block font-semibold text-slate-300 mb-1.5">FIB Table ID (Optional)</label>
  2620. <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">
  2621. </div>
  2622. <div>
  2623. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  2624. <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">
  2625. </div>
  2626. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2627. <button type="button" onclick="closeTableModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2628. <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>
  2629. </div>
  2630. </form>
  2631. </div>
  2632. </div>
  2633. <!-- ================= MODAL: ADD/EDIT EoIP TUNNEL ================= -->
  2634. <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">
  2635. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2636. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2637. <div>
  2638. <h3 id="eoip-modal-title" class="text-sm font-bold text-white">Add EoIP Tunnel</h3>
  2639. <p class="text-[11px] text-slate-400">MikroTik RouterOS Layer 2 GRETAP Tunnel</p>
  2640. </div>
  2641. <button onclick="closeEoIPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2642. </div>
  2643. <form onsubmit="submitSaveEoIP(event)" class="p-6 space-y-4 text-xs font-sans">
  2644. <input type="hidden" id="eoip-modal-id">
  2645. <div class="grid grid-cols-2 gap-4">
  2646. <div>
  2647. <label class="block font-semibold text-slate-300 mb-1.5">Interface Name *</label>
  2648. <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">
  2649. </div>
  2650. <div>
  2651. <label class="block font-semibold text-slate-300 mb-1.5">Tunnel ID (1 - 65535) *</label>
  2652. <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">
  2653. </div>
  2654. </div>
  2655. <div class="grid grid-cols-2 gap-4">
  2656. <div>
  2657. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (Remote Router IP) *</label>
  2658. <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">
  2659. <span class="text-[10px] text-slate-400">Underlay IP of the remote MikroTik router</span>
  2660. </div>
  2661. <div>
  2662. <label class="block font-semibold text-slate-300 mb-1.5">Tunnel IP / Subnet (CIDR)</label>
  2663. <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">
  2664. <span class="text-[10px] text-slate-400">Overlay IPv4 assigned directly to tunnel (/30, /24)</span>
  2665. </div>
  2666. </div>
  2667. <div class="grid grid-cols-2 gap-4">
  2668. <div>
  2669. <label class="block font-semibold text-slate-300 mb-1.5">Underlay Local IP (GRE Source)</label>
  2670. <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">
  2671. <span class="text-[10px] text-slate-400">Local router IP for outer GRE packets</span>
  2672. </div>
  2673. <div>
  2674. <label class="block font-semibold text-slate-300 mb-1.5">MAC Address (Auto if empty)</label>
  2675. <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">
  2676. </div>
  2677. </div>
  2678. <div class="grid grid-cols-2 gap-4">
  2679. <div>
  2680. <label class="block font-semibold text-slate-300 mb-1.5">MTU</label>
  2681. <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">
  2682. </div>
  2683. <div>
  2684. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  2685. <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">
  2686. </div>
  2687. </div>
  2688. <div class="flex items-center justify-between pt-1">
  2689. <label class="flex items-center space-x-2 text-slate-300">
  2690. <input type="checkbox" id="eoip-modal-clampmss" checked class="rounded bg-slate-800 border-slate-700 text-emerald-600">
  2691. <span>Clamp TCP MSS (PMTUD protection)</span>
  2692. </label>
  2693. <label class="flex items-center space-x-2 text-slate-300">
  2694. <input type="checkbox" id="eoip-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-600">
  2695. <span>Disabled</span>
  2696. </label>
  2697. </div>
  2698. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2699. <button type="button" onclick="closeEoIPModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2700. <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>
  2701. </div>
  2702. </form>
  2703. </div>
  2704. </div>
  2705. <!-- ================= MODAL: ADD/EDIT PPP SECRET (USER) ================= -->
  2706. <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">
  2707. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2708. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2709. <div>
  2710. <h3 id="secret-modal-title" class="text-sm font-bold text-white">Add PPP Secret</h3>
  2711. <p class="text-[11px] text-slate-400">User account for PPPoE, PPTP, and L2TP authentication</p>
  2712. </div>
  2713. <button onclick="closePPPSecretModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2714. </div>
  2715. <form onsubmit="submitSavePPPSecret(event)" class="p-6 space-y-4 text-xs font-sans">
  2716. <input type="hidden" id="secret-modal-id">
  2717. <div class="grid grid-cols-2 gap-4">
  2718. <div>
  2719. <label class="block font-semibold text-slate-300 mb-1.5">Username (Name) *</label>
  2720. <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">
  2721. </div>
  2722. <div>
  2723. <label class="block font-semibold text-slate-300 mb-1.5">Password *</label>
  2724. <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">
  2725. </div>
  2726. </div>
  2727. <div class="grid grid-cols-2 gap-4">
  2728. <div>
  2729. <label class="block font-semibold text-slate-300 mb-1.5">Service</label>
  2730. <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">
  2731. <option value="any">any</option>
  2732. <option value="pppoe">pppoe</option>
  2733. <option value="pptp">pptp</option>
  2734. <option value="l2tp">l2tp</option>
  2735. </select>
  2736. </div>
  2737. <div>
  2738. <label class="block font-semibold text-slate-300 mb-1.5">Profile</label>
  2739. <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>
  2740. </div>
  2741. </div>
  2742. <div class="grid grid-cols-2 gap-4">
  2743. <div>
  2744. <label class="block font-semibold text-slate-300 mb-1.5">Local Address (Optional)</label>
  2745. <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">
  2746. </div>
  2747. <div>
  2748. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (Optional Static IP)</label>
  2749. <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">
  2750. </div>
  2751. </div>
  2752. <div>
  2753. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  2754. <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">
  2755. </div>
  2756. <div class="flex items-center space-x-2 pt-1">
  2757. <input type="checkbox" id="secret-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-600">
  2758. <label for="secret-modal-disabled" class="text-slate-300">Disabled</label>
  2759. </div>
  2760. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2761. <button type="button" onclick="closePPPSecretModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2762. <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>
  2763. </div>
  2764. </form>
  2765. </div>
  2766. </div>
  2767. <!-- ================= MODAL: ADD/EDIT PPP PROFILE ================= -->
  2768. <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">
  2769. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2770. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2771. <div>
  2772. <h3 id="profile-modal-title" class="text-sm font-bold text-white">Add PPP Profile</h3>
  2773. <p class="text-[11px] text-slate-400">IP pool and encryption settings for PPP servers</p>
  2774. </div>
  2775. <button onclick="closePPPProfileModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2776. </div>
  2777. <form onsubmit="submitSavePPPProfile(event)" class="p-6 space-y-4 text-xs font-sans">
  2778. <input type="hidden" id="profile-modal-id">
  2779. <div>
  2780. <label class="block font-semibold text-slate-300 mb-1.5">Profile Name *</label>
  2781. <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">
  2782. </div>
  2783. <div class="grid grid-cols-2 gap-4">
  2784. <div>
  2785. <label class="block font-semibold text-slate-300 mb-1.5">Local Address *</label>
  2786. <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">
  2787. </div>
  2788. <div>
  2789. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (Pool) *</label>
  2790. <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">
  2791. </div>
  2792. </div>
  2793. <div class="grid grid-cols-2 gap-4">
  2794. <div>
  2795. <label class="block font-semibold text-slate-300 mb-1.5">DNS Servers</label>
  2796. <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">
  2797. </div>
  2798. <div>
  2799. <label class="block font-semibold text-slate-300 mb-1.5">Use Encryption</label>
  2800. <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">
  2801. <option value="no">no</option>
  2802. <option value="yes">yes</option>
  2803. <option value="required" selected>required (MPPE-128)</option>
  2804. </select>
  2805. </div>
  2806. </div>
  2807. <div>
  2808. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  2809. <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">
  2810. </div>
  2811. <div class="flex items-center space-x-2 pt-1">
  2812. <input type="checkbox" id="profile-modal-onlyone" checked class="rounded bg-slate-800 border-slate-700 text-violet-600">
  2813. <label for="profile-modal-onlyone" class="text-slate-300">Only One session per user account</label>
  2814. </div>
  2815. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2816. <button type="button" onclick="closePPPProfileModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2817. <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>
  2818. </div>
  2819. </form>
  2820. </div>
  2821. </div>
  2822. <!-- ================= MODAL: IPSEC ROADWARRIOR SERVER ================= -->
  2823. <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">
  2824. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2825. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2826. <div>
  2827. <h3 class="text-sm font-bold text-white">IPSec (IKEv2) Roadwarrior Server</h3>
  2828. <p class="text-[11px] text-slate-400">Mobile VPN server for Windows, macOS, iOS, Android clients</p>
  2829. </div>
  2830. <button onclick="closeIPSecServerModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2831. </div>
  2832. <form onsubmit="submitSaveIPSecServer(event)" class="p-6 space-y-4 text-xs font-sans">
  2833. <div class="flex items-center justify-between border-b border-slate-800 pb-3">
  2834. <span class="text-slate-300 font-semibold">Server State</span>
  2835. <div class="flex items-center gap-3">
  2836. <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>
  2837. <label class="relative inline-flex items-center cursor-pointer">
  2838. <input type="checkbox" id="modal-ipsec-server-enabled" class="sr-only peer">
  2839. <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>
  2840. </label>
  2841. </div>
  2842. </div>
  2843. <div>
  2844. <label class="block font-semibold text-slate-300 mb-1.5">Pre-Shared Key (PSK) *</label>
  2845. <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">
  2846. </div>
  2847. <div class="grid grid-cols-2 gap-4">
  2848. <div>
  2849. <label class="block font-semibold text-slate-300 mb-1.5">Virtual IP Pool (CIDR) *</label>
  2850. <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">
  2851. </div>
  2852. <div>
  2853. <label class="block font-semibold text-slate-300 mb-1.5">DNS Servers</label>
  2854. <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">
  2855. </div>
  2856. </div>
  2857. <div>
  2858. <label class="block font-semibold text-slate-300 mb-1.5">Local Traffic Selector (Subnet)</label>
  2859. <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">
  2860. </div>
  2861. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2862. <button type="button" onclick="closeIPSecServerModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2863. <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>
  2864. </div>
  2865. </form>
  2866. </div>
  2867. </div>
  2868. <!-- ================= MODAL: WIREGUARD CLIENT CONFIG VIEWER ================= -->
  2869. <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">
  2870. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2871. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2872. <div>
  2873. <h3 class="text-sm font-bold text-white">WireGuard Client Configuration</h3>
  2874. <p class="text-[11px] text-slate-400">Import this .conf into WireGuard on iOS, Android, macOS or Windows</p>
  2875. </div>
  2876. <button onclick="closeWGClientConfModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2877. </div>
  2878. <div class="p-6 space-y-4">
  2879. <div>
  2880. <label class="block text-xs font-semibold text-slate-300 mb-1.5">WireGuard Client Profile (.conf)</label>
  2881. <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>
  2882. </div>
  2883. <div class="flex justify-between items-center pt-2">
  2884. <span class="text-[11px] text-slate-500">Ready for instant import</span>
  2885. <div class="space-x-2">
  2886. <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">
  2887. Copy Config
  2888. </button>
  2889. <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">
  2890. Download .conf
  2891. </button>
  2892. </div>
  2893. </div>
  2894. </div>
  2895. </div>
  2896. </div>
  2897. <!-- ================= MODAL: BGP INSTANCE SETTINGS ================= -->
  2898. <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">
  2899. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2900. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2901. <div>
  2902. <h3 class="text-sm font-bold text-white">BGP Instance Settings (/routing bgp instance)</h3>
  2903. <p class="text-[11px] text-slate-400">Configure global Autonomous System and route redistribution</p>
  2904. </div>
  2905. <button onclick="closeBgpInstanceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2906. </div>
  2907. <form id="bgp-instance-form" onsubmit="submitBgpInstance(event)" class="p-6 space-y-4 text-xs">
  2908. <div class="flex items-center justify-between p-3 rounded-xl bg-slate-800/60 border border-slate-700/60">
  2909. <div>
  2910. <div class="font-semibold text-white">Enable BGP Routing</div>
  2911. <div class="text-[11px] text-slate-400">Run FRRouting bgpd service for dynamic exterior gateway routing</div>
  2912. </div>
  2913. <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">
  2914. </div>
  2915. <div class="grid grid-cols-2 gap-4">
  2916. <div>
  2917. <label class="block font-semibold text-slate-300 mb-1.5">Autonomous System (AS) *</label>
  2918. <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">
  2919. </div>
  2920. <div>
  2921. <label class="block font-semibold text-slate-300 mb-1.5">Router ID</label>
  2922. <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">
  2923. </div>
  2924. </div>
  2925. <div class="grid grid-cols-2 gap-4">
  2926. <div>
  2927. <label class="block font-semibold text-slate-300 mb-1.5">Keepalive Time (s)</label>
  2928. <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">
  2929. </div>
  2930. <div>
  2931. <label class="block font-semibold text-slate-300 mb-1.5">Hold Time (s)</label>
  2932. <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">
  2933. </div>
  2934. </div>
  2935. <div class="border-t border-slate-800 pt-3">
  2936. <label class="block font-semibold text-slate-300 mb-2">Redistribute Routes into BGP</label>
  2937. <div class="space-y-2">
  2938. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  2939. <input type="checkbox" id="modal-bgp-redist-conn" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  2940. <span>Redistribute Connected Subnets</span>
  2941. </label>
  2942. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  2943. <input type="checkbox" id="modal-bgp-redist-static" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  2944. <span>Redistribute Static Routes</span>
  2945. </label>
  2946. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  2947. <input type="checkbox" id="modal-bgp-redist-ospf" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  2948. <span>Redistribute OSPF Routes</span>
  2949. </label>
  2950. </div>
  2951. </div>
  2952. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2953. <button type="button" onclick="closeBgpInstanceModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2954. <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>
  2955. </div>
  2956. </form>
  2957. </div>
  2958. </div>
  2959. <!-- ================= MODAL: BGP PEER ================= -->
  2960. <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">
  2961. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2962. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2963. <div>
  2964. <h3 id="bgp-peer-modal-title" class="text-sm font-bold text-white">Add BGP Peer Connection</h3>
  2965. <p class="text-[11px] text-slate-400">Establish eBGP / iBGP session with remote router</p>
  2966. </div>
  2967. <button onclick="closeBgpPeerModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2968. </div>
  2969. <form id="bgp-peer-form" onsubmit="submitBgpPeer(event)" class="p-6 space-y-4 text-xs">
  2970. <input type="hidden" id="modal-bgp-peer-id">
  2971. <div>
  2972. <label class="block font-semibold text-slate-300 mb-1.5">Connection Name *</label>
  2973. <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">
  2974. </div>
  2975. <div class="grid grid-cols-2 gap-4">
  2976. <div>
  2977. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (IP) *</label>
  2978. <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">
  2979. </div>
  2980. <div>
  2981. <label class="block font-semibold text-slate-300 mb-1.5">Remote AS *</label>
  2982. <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">
  2983. </div>
  2984. </div>
  2985. <div class="grid grid-cols-2 gap-4">
  2986. <div>
  2987. <label class="block font-semibold text-slate-300 mb-1.5">Local Address (Update Source)</label>
  2988. <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">
  2989. </div>
  2990. <div>
  2991. <label class="block font-semibold text-slate-300 mb-1.5">MD5 Password (BGP Auth)</label>
  2992. <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">
  2993. </div>
  2994. </div>
  2995. <div class="grid grid-cols-2 gap-3 p-3 rounded-xl bg-slate-800/40 border border-slate-700/50">
  2996. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  2997. <input type="checkbox" id="modal-bgp-peer-multihop" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  2998. <span>eBGP Multi-hop</span>
  2999. </label>
  3000. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3001. <input type="checkbox" id="modal-bgp-peer-nexthop-self" checked class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3002. <span>Next-hop Self</span>
  3003. </label>
  3004. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3005. <input type="checkbox" id="modal-bgp-peer-passive" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3006. <span>Passive Mode</span>
  3007. </label>
  3008. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3009. <input type="checkbox" id="modal-bgp-peer-disabled" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3010. <span>Disabled (X)</span>
  3011. </label>
  3012. </div>
  3013. <div>
  3014. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3015. <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">
  3016. </div>
  3017. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3018. <button type="button" onclick="closeBgpPeerModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3019. <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>
  3020. </div>
  3021. </form>
  3022. </div>
  3023. </div>
  3024. <!-- ================= MODAL: BGP NETWORK ================= -->
  3025. <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">
  3026. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3027. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3028. <h3 id="bgp-network-modal-title" class="text-sm font-bold text-white">Advertise BGP Network</h3>
  3029. <button onclick="closeBgpNetworkModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3030. </div>
  3031. <form id="bgp-network-form" onsubmit="submitBgpNetwork(event)" class="p-6 space-y-4 text-xs">
  3032. <input type="hidden" id="modal-bgp-net-id">
  3033. <div>
  3034. <label class="block font-semibold text-slate-300 mb-1.5">Network Prefix (CIDR) *</label>
  3035. <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">
  3036. </div>
  3037. <div>
  3038. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3039. <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">
  3040. </div>
  3041. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3042. <input type="checkbox" id="modal-bgp-net-disabled" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3043. <span>Disabled</span>
  3044. </label>
  3045. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3046. <button type="button" onclick="closeBgpNetworkModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3047. <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>
  3048. </div>
  3049. </form>
  3050. </div>
  3051. </div>
  3052. <!-- ================= MODAL: OSPF INSTANCE SETTINGS ================= -->
  3053. <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">
  3054. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3055. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3056. <div>
  3057. <h3 class="text-sm font-bold text-white">OSPF Instance Settings (/routing ospf instance)</h3>
  3058. <p class="text-[11px] text-slate-400">Configure OSPFv2 link-state routing daemon and redistributions</p>
  3059. </div>
  3060. <button onclick="closeOspfInstanceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3061. </div>
  3062. <form id="ospf-instance-form" onsubmit="submitOspfInstance(event)" class="p-6 space-y-4 text-xs">
  3063. <div class="flex items-center justify-between p-3 rounded-xl bg-slate-800/60 border border-slate-700/60">
  3064. <div>
  3065. <div class="font-semibold text-white">Enable OSPF Routing</div>
  3066. <div class="text-[11px] text-slate-400">Run FRRouting ospfd service for dynamic interior gateway routing</div>
  3067. </div>
  3068. <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">
  3069. </div>
  3070. <div class="grid grid-cols-2 gap-4">
  3071. <div>
  3072. <label class="block font-semibold text-slate-300 mb-1.5">Router ID</label>
  3073. <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">
  3074. </div>
  3075. <div>
  3076. <label class="block font-semibold text-slate-300 mb-1.5">Default Metric</label>
  3077. <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">
  3078. </div>
  3079. </div>
  3080. <div class="border-t border-slate-800 pt-3">
  3081. <label class="block font-semibold text-slate-300 mb-2">Redistribute Routes into OSPF</label>
  3082. <div class="space-y-2">
  3083. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3084. <input type="checkbox" id="modal-ospf-redist-conn" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3085. <span>Redistribute Connected Subnets</span>
  3086. </label>
  3087. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3088. <input type="checkbox" id="modal-ospf-redist-static" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3089. <span>Redistribute Static Routes</span>
  3090. </label>
  3091. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3092. <input type="checkbox" id="modal-ospf-redist-bgp" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3093. <span>Redistribute BGP Routes</span>
  3094. </label>
  3095. </div>
  3096. </div>
  3097. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3098. <button type="button" onclick="closeOspfInstanceModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3099. <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>
  3100. </div>
  3101. </form>
  3102. </div>
  3103. </div>
  3104. <!-- ================= MODAL: OSPF AREA ================= -->
  3105. <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">
  3106. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3107. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3108. <h3 id="ospf-area-modal-title" class="text-sm font-bold text-white">Add OSPF Area</h3>
  3109. <button onclick="closeOspfAreaModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3110. </div>
  3111. <form id="ospf-area-form" onsubmit="submitOspfArea(event)" class="p-6 space-y-4 text-xs">
  3112. <input type="hidden" id="modal-ospf-area-id">
  3113. <div>
  3114. <label class="block font-semibold text-slate-300 mb-1.5">Area Name *</label>
  3115. <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">
  3116. </div>
  3117. <div class="grid grid-cols-2 gap-4">
  3118. <div>
  3119. <label class="block font-semibold text-slate-300 mb-1.5">Area ID *</label>
  3120. <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">
  3121. </div>
  3122. <div>
  3123. <label class="block font-semibold text-slate-300 mb-1.5">Area Type</label>
  3124. <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">
  3125. <option value="default">Default / Normal</option>
  3126. <option value="stub">Stub</option>
  3127. <option value="nssa">NSSA</option>
  3128. </select>
  3129. </div>
  3130. </div>
  3131. <div>
  3132. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3133. <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">
  3134. </div>
  3135. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3136. <button type="button" onclick="closeOspfAreaModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3137. <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>
  3138. </div>
  3139. </form>
  3140. </div>
  3141. </div>
  3142. <!-- ================= MODAL: OSPF INTERFACE ================= -->
  3143. <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">
  3144. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3145. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3146. <div>
  3147. <h3 id="ospf-interface-modal-title" class="text-sm font-bold text-white">Add OSPF Interface</h3>
  3148. <p class="text-[11px] text-slate-400">Configure OSPF link parameters on a network subnet or interface</p>
  3149. </div>
  3150. <button onclick="closeOspfInterfaceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3151. </div>
  3152. <form id="ospf-interface-form" onsubmit="submitOspfInterface(event)" class="p-6 space-y-4 text-xs">
  3153. <input type="hidden" id="modal-ospf-iface-id">
  3154. <div class="grid grid-cols-2 gap-4">
  3155. <div>
  3156. <label class="block font-semibold text-slate-300 mb-1.5">Subnet Network (CIDR) *</label>
  3157. <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">
  3158. </div>
  3159. <div>
  3160. <label class="block font-semibold text-slate-300 mb-1.5">OSPF Area *</label>
  3161. <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">
  3162. </div>
  3163. </div>
  3164. <div class="grid grid-cols-2 gap-4">
  3165. <div>
  3166. <label class="block font-semibold text-slate-300 mb-1.5">Interface (Optional Device)</label>
  3167. <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">
  3168. <option value="">Any matching interface</option>
  3169. </select>
  3170. </div>
  3171. <div>
  3172. <label class="block font-semibold text-slate-300 mb-1.5">Metric Cost</label>
  3173. <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">
  3174. </div>
  3175. </div>
  3176. <div class="grid grid-cols-3 gap-3">
  3177. <div>
  3178. <label class="block font-semibold text-slate-300 mb-1.5">Priority</label>
  3179. <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">
  3180. </div>
  3181. <div>
  3182. <label class="block font-semibold text-slate-300 mb-1.5">Hello (s)</label>
  3183. <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">
  3184. </div>
  3185. <div>
  3186. <label class="block font-semibold text-slate-300 mb-1.5">Dead (s)</label>
  3187. <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">
  3188. </div>
  3189. </div>
  3190. <div class="grid grid-cols-2 gap-4">
  3191. <div>
  3192. <label class="block font-semibold text-slate-300 mb-1.5">Authentication Type</label>
  3193. <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">
  3194. <option value="none">None</option>
  3195. <option value="simple">Simple Password</option>
  3196. <option value="md5">MD5 Cryptographic</option>
  3197. </select>
  3198. </div>
  3199. <div>
  3200. <label class="block font-semibold text-slate-300 mb-1.5">Auth Secret Key</label>
  3201. <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">
  3202. </div>
  3203. </div>
  3204. <div class="grid grid-cols-2 gap-3 p-3 rounded-xl bg-slate-800/40 border border-slate-700/50">
  3205. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3206. <input type="checkbox" id="modal-ospf-iface-passive" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3207. <span>Passive (Do not form adjs)</span>
  3208. </label>
  3209. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3210. <input type="checkbox" id="modal-ospf-iface-disabled" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3211. <span>Disabled (X)</span>
  3212. </label>
  3213. </div>
  3214. <div>
  3215. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3216. <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">
  3217. </div>
  3218. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3219. <button type="button" onclick="closeOspfInterfaceModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3220. <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>
  3221. </div>
  3222. </form>
  3223. </div>
  3224. </div>
  3225. <script src="app.js?v=2.6"></script>
  3226. </body>
  3227. </html>