index.html 223 KB

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