index.html 181 KB

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