index.html 238 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696
  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-geo" onclick="switchFWSubTab('geo')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1110. <span>Geo-Location</span>
  1111. <span id="fw-badge-geo" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1112. </button>
  1113. <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">
  1114. <span>Connections</span>
  1115. <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>
  1116. </button>
  1117. </div>
  1118. <!-- ================= TAB 1: FILTER RULES ================= -->
  1119. <div id="fw-subtab-filter" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1120. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1121. <div class="flex items-center gap-3">
  1122. <h3 class="text-sm font-bold text-white">Firewall Filter Rules</h3>
  1123. <span id="filter-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1124. </div>
  1125. <div class="flex items-center gap-2">
  1126. <label class="text-xs text-slate-400 font-sans">Chain:</label>
  1127. <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">
  1128. <option value="">All Chains</option>
  1129. <option value="input">input</option>
  1130. <option value="forward">forward</option>
  1131. <option value="output">output</option>
  1132. </select>
  1133. </div>
  1134. </div>
  1135. <div class="overflow-x-auto">
  1136. <table class="w-full text-left text-xs font-mono">
  1137. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1138. <tr>
  1139. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1140. <th class="py-2.5 px-3 w-12 text-center" title="Flags: X=Disabled, C=Comment">Flag</th>
  1141. <th class="py-2.5 px-3">Chain</th>
  1142. <th class="py-2.5 px-3">Src. Address</th>
  1143. <th class="py-2.5 px-3">Dst. Address</th>
  1144. <th class="py-2.5 px-3">Protocol</th>
  1145. <th class="py-2.5 px-3">Ports</th>
  1146. <th class="py-2.5 px-3">In / Out</th>
  1147. <th class="py-2.5 px-3">Action</th>
  1148. <th class="py-2.5 px-3">Packets / Bytes</th>
  1149. <th class="py-2.5 px-3">Comment</th>
  1150. <th class="py-2.5 px-3 text-right font-sans">Order & Actions</th>
  1151. </tr>
  1152. </thead>
  1153. <tbody id="filter-table-body" class="divide-y divide-slate-800/80"></tbody>
  1154. </table>
  1155. </div>
  1156. <div id="filter-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1157. No filter rules found in this chain. Click "+ Add Rule" to create one.
  1158. </div>
  1159. </div>
  1160. <!-- ================= TAB 2: NAT RULES ================= -->
  1161. <div id="fw-subtab-nat" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1162. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1163. <div class="flex items-center gap-3">
  1164. <h3 class="text-sm font-bold text-white">NAT Rules</h3>
  1165. <span id="nat-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1166. </div>
  1167. <div class="flex items-center gap-2">
  1168. <label class="text-xs text-slate-400 font-sans">Chain:</label>
  1169. <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">
  1170. <option value="">All Chains</option>
  1171. <option value="srcnat">srcnat (SNAT / Masquerade)</option>
  1172. <option value="dstnat">dstnat (Port Forwarding)</option>
  1173. </select>
  1174. </div>
  1175. </div>
  1176. <div class="overflow-x-auto">
  1177. <table class="w-full text-left text-xs font-mono">
  1178. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1179. <tr>
  1180. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1181. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1182. <th class="py-2.5 px-3">Chain</th>
  1183. <th class="py-2.5 px-3">Src. Address</th>
  1184. <th class="py-2.5 px-3">Dst. Address</th>
  1185. <th class="py-2.5 px-3">Proto/Port</th>
  1186. <th class="py-2.5 px-3">Out / In</th>
  1187. <th class="py-2.5 px-3">Action</th>
  1188. <th class="py-2.5 px-3">To Address:Port</th>
  1189. <th class="py-2.5 px-3">Packets / Bytes</th>
  1190. <th class="py-2.5 px-3">Comment</th>
  1191. <th class="py-2.5 px-3 text-right font-sans">Order & Actions</th>
  1192. </tr>
  1193. </thead>
  1194. <tbody id="nat-table-body" class="divide-y divide-slate-800/80"></tbody>
  1195. </table>
  1196. </div>
  1197. <div id="nat-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1198. No NAT rules configured. Click "+ Add Rule" to add masquerade or port forwarding.
  1199. </div>
  1200. </div>
  1201. <!-- ================= TAB 3: MANGLE RULES ================= -->
  1202. <div id="fw-subtab-mangle" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1203. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1204. <div class="flex items-center gap-3">
  1205. <h3 class="text-sm font-bold text-white">Mangle Packet & Connection Marking</h3>
  1206. <span id="mangle-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1207. </div>
  1208. <div class="flex items-center gap-2">
  1209. <label class="text-xs text-slate-400 font-sans">Chain:</label>
  1210. <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">
  1211. <option value="">All Chains</option>
  1212. <option value="prerouting">prerouting</option>
  1213. <option value="forward">forward</option>
  1214. <option value="postrouting">postrouting</option>
  1215. <option value="input">input</option>
  1216. <option value="output">output</option>
  1217. </select>
  1218. </div>
  1219. </div>
  1220. <div class="overflow-x-auto">
  1221. <table class="w-full text-left text-xs font-mono">
  1222. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1223. <tr>
  1224. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1225. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1226. <th class="py-2.5 px-3">Chain</th>
  1227. <th class="py-2.5 px-3">Src. Address</th>
  1228. <th class="py-2.5 px-3">Dst. Address</th>
  1229. <th class="py-2.5 px-3">Action</th>
  1230. <th class="py-2.5 px-3">New Mark / Value</th>
  1231. <th class="py-2.5 px-3 text-center">Pass</th>
  1232. <th class="py-2.5 px-3">Packets / Bytes</th>
  1233. <th class="py-2.5 px-3">Comment</th>
  1234. <th class="py-2.5 px-3 text-right font-sans">Order & Actions</th>
  1235. </tr>
  1236. </thead>
  1237. <tbody id="mangle-table-body" class="divide-y divide-slate-800/80"></tbody>
  1238. </table>
  1239. </div>
  1240. <div id="mangle-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1241. No mangle rules configured. Click "+ Add Rule" to mark connections or routing for Multi-WAN.
  1242. </div>
  1243. </div>
  1244. <!-- ================= TAB 4: ADDRESS LISTS ================= -->
  1245. <div id="fw-subtab-addrlist" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1246. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1247. <div class="flex items-center gap-3">
  1248. <h3 class="text-sm font-bold text-white">Address Lists (ipset)</h3>
  1249. <span id="addrlist-count-badge" class="text-xs font-mono text-slate-400">0 Entries</span>
  1250. </div>
  1251. <div class="flex items-center gap-2">
  1252. <label class="text-xs text-slate-400 font-sans">List:</label>
  1253. <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">
  1254. <option value="">All Lists</option>
  1255. </select>
  1256. </div>
  1257. </div>
  1258. <div class="overflow-x-auto">
  1259. <table class="w-full text-left text-xs font-mono">
  1260. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1261. <tr>
  1262. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1263. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1264. <th class="py-2.5 px-3">List Name</th>
  1265. <th class="py-2.5 px-3">IP Address / CIDR</th>
  1266. <th class="py-2.5 px-3">Comment</th>
  1267. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1268. </tr>
  1269. </thead>
  1270. <tbody id="addrlist-table-body" class="divide-y divide-slate-800/80"></tbody>
  1271. </table>
  1272. </div>
  1273. <div id="addrlist-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1274. No address list entries configured. Click "+ Add Item" to define a group of IPs/subnets.
  1275. </div>
  1276. </div>
  1277. <!-- ================= TAB 5: ACTIVE CONNECTIONS ================= -->
  1278. <div id="fw-subtab-connections" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1279. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1280. <div class="flex items-center gap-3">
  1281. <h3 class="text-sm font-bold text-white">Active Conntrack Connections</h3>
  1282. <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>
  1283. </div>
  1284. <div class="flex items-center gap-2 flex-wrap">
  1285. <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">
  1286. <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">
  1287. <option value="">All Proto</option>
  1288. <option value="TCP">TCP</option>
  1289. <option value="UDP">UDP</option>
  1290. <option value="ICMP">ICMP</option>
  1291. </select>
  1292. <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>
  1293. </div>
  1294. </div>
  1295. <div class="overflow-x-auto max-h-[550px] overflow-y-auto">
  1296. <table class="w-full text-left text-xs font-mono">
  1297. <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">
  1298. <tr>
  1299. <th class="py-2.5 px-3">Proto</th>
  1300. <th class="py-2.5 px-3">Source Address</th>
  1301. <th class="py-2.5 px-3">Destination Address</th>
  1302. <th class="py-2.5 px-3">Reply Source</th>
  1303. <th class="py-2.5 px-3">Reply Dest</th>
  1304. <th class="py-2.5 px-3">TCP State</th>
  1305. <th class="py-2.5 px-3">Mark</th>
  1306. <th class="py-2.5 px-3">Timeout</th>
  1307. <th class="py-2.5 px-3 text-right font-sans">Action</th>
  1308. </tr>
  1309. </thead>
  1310. <tbody id="conns-table-body" class="divide-y divide-slate-800/60"></tbody>
  1311. </table>
  1312. </div>
  1313. <div id="conns-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1314. No active connections found matching your search.
  1315. </div>
  1316. </div>
  1317. <!-- ================= TAB 5: GEO-LOCATION ================= -->
  1318. <div id="fw-subtab-geo" class="hidden space-y-4">
  1319. <!-- Geo Header & Scheduler Status -->
  1320. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-4 flex flex-wrap items-center justify-between gap-4">
  1321. <div class="flex items-center space-x-3">
  1322. <div class="p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/20 text-emerald-400">
  1323. <span class="text-xl">🌍</span>
  1324. </div>
  1325. <div>
  1326. <div class="flex items-center gap-2">
  1327. <h3 class="text-sm font-bold text-white">Geo-Location IP Filtering</h3>
  1328. <span id="geo-status-badge" class="px-2 py-0.5 rounded text-[10px] font-mono font-bold bg-emerald-500/20 text-emerald-300 border border-emerald-500/30">Auto-Update ON</span>
  1329. </div>
  1330. <p class="text-xs text-slate-400">Aggregated country CIDR databases loaded into Linux kernel <code class="text-emerald-300">ipset</code>. Usable anywhere in Filter, NAT, and Mangle rules.</p>
  1331. </div>
  1332. </div>
  1333. <!-- Controls -->
  1334. <div class="flex items-center flex-wrap gap-2">
  1335. <div class="flex items-center space-x-1.5 bg-slate-950/60 border border-slate-800 px-3 py-1.5 rounded-lg text-xs font-mono">
  1336. <span class="text-slate-400">Schedule:</span>
  1337. <span id="geo-interval-label" class="font-bold text-white">Every 24h</span>
  1338. </div>
  1339. <button onclick="openGeoIntervalModal()" class="text-xs font-semibold px-3 py-1.5 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 transition">
  1340. ⚙️ Settings
  1341. </button>
  1342. <button id="geo-btn-update-now" onclick="triggerGeoUpdateNow()" class="text-xs font-semibold px-3.5 py-1.5 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20 transition flex items-center gap-1.5">
  1343. <span id="geo-update-spinner" class="hidden animate-spin text-xs">⏳</span>
  1344. <span>🔄 Update Now</span>
  1345. </button>
  1346. </div>
  1347. </div>
  1348. <!-- Stats Bar -->
  1349. <div class="grid grid-cols-2 sm:grid-cols-4 gap-3">
  1350. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl p-3">
  1351. <span class="text-[10px] uppercase font-bold text-slate-500 block">Active Countries</span>
  1352. <span id="geo-stat-active-countries" class="text-base font-bold font-mono text-emerald-400">0</span>
  1353. </div>
  1354. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl p-3">
  1355. <span class="text-[10px] uppercase font-bold text-slate-500 block">Total Subnets in Kernel</span>
  1356. <span id="geo-stat-total-subnets" class="text-base font-bold font-mono text-cyan-400">0</span>
  1357. </div>
  1358. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl p-3">
  1359. <span class="text-[10px] uppercase font-bold text-slate-500 block">Last Synced</span>
  1360. <span id="geo-stat-last-sync" class="text-xs font-mono text-slate-300">-</span>
  1361. </div>
  1362. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl p-3">
  1363. <span class="text-[10px] uppercase font-bold text-slate-500 block">Next Scheduled Run</span>
  1364. <span id="geo-stat-next-sync" class="text-xs font-mono text-slate-300">-</span>
  1365. </div>
  1366. </div>
  1367. <!-- Filters & Country Table -->
  1368. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1369. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1370. <div class="flex items-center flex-wrap gap-2">
  1371. <input type="text" id="geo-search-input" oninput="renderGeoCountries()" placeholder="Search country name or code (e.g. Greece, GR, Germany)..." class="bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-xs text-white placeholder-slate-500 focus:outline-none focus:border-emerald-500 w-64">
  1372. <select id="geo-continent-filter" onchange="renderGeoCountries()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1.5 text-xs text-white font-mono">
  1373. <option value="">All Continents</option>
  1374. <option value="Europe">Europe</option>
  1375. <option value="Asia">Asia</option>
  1376. <option value="Americas">Americas</option>
  1377. <option value="Africa">Africa</option>
  1378. <option value="Oceania">Oceania</option>
  1379. </select>
  1380. <label class="flex items-center space-x-1.5 text-xs text-slate-300 cursor-pointer ml-2">
  1381. <input type="checkbox" id="geo-filter-enabled-only" onchange="renderGeoCountries()" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  1382. <span>Enabled in Firewall only</span>
  1383. </label>
  1384. </div>
  1385. <div class="flex items-center space-x-2">
  1386. <span class="text-xs text-slate-400 font-sans">Presets:</span>
  1387. <button onclick="applyGeoPreset('GR')" class="px-2.5 py-1 text-xs rounded bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 font-mono">🇬🇷 GR</button>
  1388. <button onclick="applyGeoPreset('EU')" class="px-2.5 py-1 text-xs rounded bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 font-mono">🇪🇺 EU</button>
  1389. <button onclick="applyGeoPreset('BLOCKLIST')" class="px-2.5 py-1 text-xs rounded bg-rose-950/40 hover:bg-rose-900/50 text-rose-300 border border-rose-800/50 font-mono">🚫 High-Risk</button>
  1390. <button onclick="applyGeoPreset('NONE')" class="px-2.5 py-1 text-xs rounded bg-slate-800 hover:bg-slate-700 text-slate-400 border border-slate-700 font-mono">Clear All</button>
  1391. </div>
  1392. </div>
  1393. <div class="overflow-x-auto max-h-[600px] overflow-y-auto">
  1394. <table class="w-full text-left text-xs font-mono">
  1395. <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">
  1396. <tr>
  1397. <th class="py-2.5 px-3 w-16 text-center">Code</th>
  1398. <th class="py-2.5 px-3">Country Name</th>
  1399. <th class="py-2.5 px-3">Continent</th>
  1400. <th class="py-2.5 px-3">Subnets</th>
  1401. <th class="py-2.5 px-3">Kernel IPSet</th>
  1402. <th class="py-2.5 px-3">Firewall Status</th>
  1403. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1404. </tr>
  1405. </thead>
  1406. <tbody id="geo-table-body" class="divide-y divide-slate-800/60"></tbody>
  1407. </table>
  1408. </div>
  1409. <div id="geo-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1410. No countries found matching your search.
  1411. </div>
  1412. </div>
  1413. </div>
  1414. </section>
  1415. <!-- ================= SECTION: ROUTES & POLICY (/ip route & rules) ================= -->
  1416. <section id="section-routes" class="hidden space-y-6">
  1417. <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">
  1418. <div>
  1419. <div class="flex items-center gap-2 mb-1">
  1420. <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>
  1421. <h2 class="text-base font-bold text-white">IP Routes & Policy Rules</h2>
  1422. </div>
  1423. <p class="text-xs text-slate-400">Kernel FIB/RIB routing tables, static gateways, multipath uplinks, and policy routing (ip rule / fwmark lookup).</p>
  1424. </div>
  1425. <div class="flex items-center space-x-2.5">
  1426. <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">
  1427. + Add Route
  1428. </button>
  1429. <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">
  1430. + Add Rule
  1431. </button>
  1432. <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">
  1433. + New Table
  1434. </button>
  1435. </div>
  1436. </div>
  1437. <!-- Sub Tabs: Routes / Policy Rules / Tables -->
  1438. <div class="flex border-b border-slate-800 space-x-1">
  1439. <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">
  1440. <span>Routes</span>
  1441. <span id="routes-badge-routes" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1442. </button>
  1443. <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">
  1444. <span>Policy Rules (/ip route rule)</span>
  1445. <span id="routes-badge-rules" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1446. </button>
  1447. <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">
  1448. <span>Routing Tables</span>
  1449. <span id="routes-badge-tables" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1450. </button>
  1451. </div>
  1452. <!-- Sub-Tab 1: Routes Table -->
  1453. <div id="routes-subtab-routes" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1454. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1455. <div class="flex items-center gap-3">
  1456. <h3 class="text-sm font-bold text-white">Active Routing Table (RIB)</h3>
  1457. <span id="routes-count-badge" class="text-xs font-mono text-slate-400">0 Routes</span>
  1458. </div>
  1459. <div class="flex items-center gap-2">
  1460. <label class="text-xs text-slate-400 font-sans">Table Filter:</label>
  1461. <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">
  1462. <option value="">All Tables</option>
  1463. <option value="main">main</option>
  1464. </select>
  1465. <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>
  1466. </div>
  1467. </div>
  1468. <div class="overflow-x-auto">
  1469. <table class="w-full text-left text-xs font-mono">
  1470. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1471. <tr>
  1472. <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>
  1473. <th class="py-2.5 px-3">Dst. Address</th>
  1474. <th class="py-2.5 px-3">Gateway</th>
  1475. <th class="py-2.5 px-3">Distance</th>
  1476. <th class="py-2.5 px-3">Table / Mark</th>
  1477. <th class="py-2.5 px-3">Interface</th>
  1478. <th class="py-2.5 px-3">Comment</th>
  1479. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1480. </tr>
  1481. </thead>
  1482. <tbody id="routes-table-body" class="divide-y divide-slate-800/80"></tbody>
  1483. </table>
  1484. </div>
  1485. <div id="routes-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1486. No routes found.
  1487. </div>
  1488. </div>
  1489. <!-- Sub-Tab 2: Policy Rules (/ip route rule) -->
  1490. <div id="routes-subtab-rules" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1491. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1492. <h3 class="text-sm font-bold text-white">Policy Routing Rules (ip rule)</h3>
  1493. <span id="rules-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1494. </div>
  1495. <div class="overflow-x-auto">
  1496. <table class="w-full text-left text-xs font-mono">
  1497. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1498. <tr>
  1499. <th class="py-2.5 px-3 w-16">Pref</th>
  1500. <th class="py-2.5 px-3">Src. Address</th>
  1501. <th class="py-2.5 px-3">Dst. Address</th>
  1502. <th class="py-2.5 px-3">Routing Mark (fwmark)</th>
  1503. <th class="py-2.5 px-3">Lookup Table</th>
  1504. <th class="py-2.5 px-3">Action</th>
  1505. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1506. </tr>
  1507. </thead>
  1508. <tbody id="rules-table-body" class="divide-y divide-slate-800/80"></tbody>
  1509. </table>
  1510. </div>
  1511. <div id="rules-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1512. No policy rules configured. Click "+ Add Rule" to route traffic based on routing-mark or source IP.
  1513. </div>
  1514. </div>
  1515. <!-- Sub-Tab 3: Routing Tables -->
  1516. <div id="routes-subtab-tables" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1517. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1518. <h3 class="text-sm font-bold text-white">Defined Routing Tables (/etc/iproute2/rt_tables)</h3>
  1519. <span id="tables-count-badge" class="text-xs font-mono text-slate-400">0 Tables</span>
  1520. </div>
  1521. <div class="overflow-x-auto">
  1522. <table class="w-full text-left text-xs font-mono">
  1523. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1524. <tr>
  1525. <th class="py-2.5 px-3 w-20">FIB ID</th>
  1526. <th class="py-2.5 px-3">Table Name</th>
  1527. <th class="py-2.5 px-3">Comment / Purpose</th>
  1528. </tr>
  1529. </thead>
  1530. <tbody id="tables-table-body" class="divide-y divide-slate-800/80"></tbody>
  1531. </table>
  1532. </div>
  1533. </div>
  1534. </section>
  1535. <!-- ================= SECTION: DYNAMIC ROUTING (BGP & OSPF) ================= -->
  1536. <section id="section-dynamic-routing" class="hidden space-y-6">
  1537. <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">
  1538. <div>
  1539. <div class="flex items-center gap-2 mb-1">
  1540. <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>
  1541. <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>
  1542. <h2 class="text-base font-bold text-white">Dynamic Routing Engine (BGP & OSPF)</h2>
  1543. </div>
  1544. <p class="text-xs text-slate-400">Enterprise FRRouting stack providing BGP peering, network advertisement, and OSPFv2 link-state routing.</p>
  1545. </div>
  1546. <div class="flex items-center space-x-2 flex-wrap gap-y-2">
  1547. <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">
  1548. <span>⚙ BGP Settings</span>
  1549. </button>
  1550. <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">
  1551. <span>⚙ OSPF Settings</span>
  1552. </button>
  1553. <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">
  1554. + Add BGP Peer
  1555. </button>
  1556. <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">
  1557. + Add OSPF Interface
  1558. </button>
  1559. </div>
  1560. </div>
  1561. <!-- Dynamic Routing Sub-Tabs -->
  1562. <div class="flex border-b border-slate-800 space-x-1 overflow-x-auto">
  1563. <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">
  1564. <span>BGP Peers (/routing bgp connection)</span>
  1565. <span id="dyn-badge-bgp-peers" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1566. </button>
  1567. <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">
  1568. <span>BGP Networks</span>
  1569. <span id="dyn-badge-bgp-nets" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1570. </button>
  1571. <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">
  1572. <span>BGP Routes (RIB)</span>
  1573. <span id="dyn-badge-bgp-routes" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1574. </button>
  1575. <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">
  1576. <span>OSPF Interfaces</span>
  1577. <span id="dyn-badge-ospf-ifaces" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1578. </button>
  1579. <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">
  1580. <span>OSPF Areas</span>
  1581. <span id="dyn-badge-ospf-areas" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1582. </button>
  1583. <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">
  1584. <span>OSPF Neighbors</span>
  1585. <span id="dyn-badge-ospf-nbrs" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1586. </button>
  1587. <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">
  1588. <span>OSPF Routes</span>
  1589. <span id="dyn-badge-ospf-routes" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1590. </button>
  1591. </div>
  1592. <!-- Sub-Tab 1: BGP Peers -->
  1593. <div id="dyn-subtab-bgp-peers" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1594. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1595. <div class="flex items-center gap-3">
  1596. <h3 class="text-sm font-bold text-white">Configured BGP Peers</h3>
  1597. <span id="bgp-peers-count-badge" class="text-xs font-mono text-slate-400">0 Peers</span>
  1598. <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>
  1599. </div>
  1600. <div class="flex items-center gap-2">
  1601. <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>
  1602. </div>
  1603. </div>
  1604. <div class="overflow-x-auto">
  1605. <table class="w-full text-left text-xs font-mono">
  1606. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1607. <tr>
  1608. <th class="py-2.5 px-3 w-16 text-center">Flags</th>
  1609. <th class="py-2.5 px-3">Name</th>
  1610. <th class="py-2.5 px-3">Remote Address</th>
  1611. <th class="py-2.5 px-3">Remote AS</th>
  1612. <th class="py-2.5 px-3">State</th>
  1613. <th class="py-2.5 px-3">Uptime</th>
  1614. <th class="py-2.5 px-3">Prefixes (RX/TX)</th>
  1615. <th class="py-2.5 px-3">Comment</th>
  1616. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1617. </tr>
  1618. </thead>
  1619. <tbody id="bgp-peers-table-body" class="divide-y divide-slate-800/80"></tbody>
  1620. </table>
  1621. </div>
  1622. <div id="bgp-peers-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1623. No BGP peers configured. Click "+ Add BGP Peer" to establish an eBGP or iBGP peering session.
  1624. </div>
  1625. </div>
  1626. <!-- Sub-Tab 2: BGP Networks -->
  1627. <div id="dyn-subtab-bgp-nets" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1628. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1629. <div class="flex items-center gap-3">
  1630. <h3 class="text-sm font-bold text-white">Advertised BGP Networks (/routing bgp network)</h3>
  1631. <span id="bgp-nets-count-badge" class="text-xs font-mono text-slate-400">0 Networks</span>
  1632. </div>
  1633. <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">
  1634. + Add Network
  1635. </button>
  1636. </div>
  1637. <div class="overflow-x-auto">
  1638. <table class="w-full text-left text-xs font-mono">
  1639. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1640. <tr>
  1641. <th class="py-2.5 px-3">Network (CIDR)</th>
  1642. <th class="py-2.5 px-3">Status</th>
  1643. <th class="py-2.5 px-3">Comment</th>
  1644. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1645. </tr>
  1646. </thead>
  1647. <tbody id="bgp-nets-table-body" class="divide-y divide-slate-800/80"></tbody>
  1648. </table>
  1649. </div>
  1650. <div id="bgp-nets-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1651. No networks advertised. Click "+ Add Network" to announce your IP prefixes to BGP peers.
  1652. </div>
  1653. </div>
  1654. <!-- Sub-Tab 3: BGP Routes -->
  1655. <div id="dyn-subtab-bgp-routes" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1656. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1657. <h3 class="text-sm font-bold text-white">BGP Routing Information Base (show ip bgp)</h3>
  1658. <span id="bgp-routes-count-badge" class="text-xs font-mono text-slate-400">0 Routes</span>
  1659. </div>
  1660. <div class="overflow-x-auto">
  1661. <table class="w-full text-left text-xs font-mono">
  1662. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1663. <tr>
  1664. <th class="py-2.5 px-3">Prefix</th>
  1665. <th class="py-2.5 px-3">Next Hop</th>
  1666. <th class="py-2.5 px-3">Metric</th>
  1667. <th class="py-2.5 px-3">Weight</th>
  1668. <th class="py-2.5 px-3">AS Path</th>
  1669. <th class="py-2.5 px-3">Origin</th>
  1670. </tr>
  1671. </thead>
  1672. <tbody id="bgp-routes-table-body" class="divide-y divide-slate-800/80"></tbody>
  1673. </table>
  1674. </div>
  1675. <div id="bgp-routes-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1676. No active routes in BGP table. Check peer connections and ensure BGP is enabled.
  1677. </div>
  1678. </div>
  1679. <!-- Sub-Tab 4: OSPF Interfaces -->
  1680. <div id="dyn-subtab-ospf-ifaces" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1681. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1682. <div class="flex items-center gap-3">
  1683. <h3 class="text-sm font-bold text-white">OSPF Interface Templates (/routing ospf interface-template)</h3>
  1684. <span id="ospf-ifaces-count-badge" class="text-xs font-mono text-slate-400">0 Interfaces</span>
  1685. <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>
  1686. </div>
  1687. <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">
  1688. + Add Interface
  1689. </button>
  1690. </div>
  1691. <div class="overflow-x-auto">
  1692. <table class="w-full text-left text-xs font-mono">
  1693. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1694. <tr>
  1695. <th class="py-2.5 px-3 w-16 text-center">Flags</th>
  1696. <th class="py-2.5 px-3">Network (CIDR)</th>
  1697. <th class="py-2.5 px-3">Area</th>
  1698. <th class="py-2.5 px-3">Interface</th>
  1699. <th class="py-2.5 px-3">Cost</th>
  1700. <th class="py-2.5 px-3">Priority</th>
  1701. <th class="py-2.5 px-3">Timers (H/D)</th>
  1702. <th class="py-2.5 px-3">Auth</th>
  1703. <th class="py-2.5 px-3">Comment</th>
  1704. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1705. </tr>
  1706. </thead>
  1707. <tbody id="ospf-ifaces-table-body" class="divide-y divide-slate-800/80"></tbody>
  1708. </table>
  1709. </div>
  1710. <div id="ospf-ifaces-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1711. No OSPF interfaces configured. Click "+ Add OSPF Interface" to enable OSPF on local subnets.
  1712. </div>
  1713. </div>
  1714. <!-- Sub-Tab 5: OSPF Areas -->
  1715. <div id="dyn-subtab-ospf-areas" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1716. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1717. <div class="flex items-center gap-3">
  1718. <h3 class="text-sm font-bold text-white">OSPF Areas (/routing ospf area)</h3>
  1719. <span id="ospf-areas-count-badge" class="text-xs font-mono text-slate-400">0 Areas</span>
  1720. </div>
  1721. <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">
  1722. + Add Area
  1723. </button>
  1724. </div>
  1725. <div class="overflow-x-auto">
  1726. <table class="w-full text-left text-xs font-mono">
  1727. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1728. <tr>
  1729. <th class="py-2.5 px-3">Name</th>
  1730. <th class="py-2.5 px-3">Area ID</th>
  1731. <th class="py-2.5 px-3">Type</th>
  1732. <th class="py-2.5 px-3">Comment</th>
  1733. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1734. </tr>
  1735. </thead>
  1736. <tbody id="ospf-areas-table-body" class="divide-y divide-slate-800/80"></tbody>
  1737. </table>
  1738. </div>
  1739. </div>
  1740. <!-- Sub-Tab 6: OSPF Neighbors -->
  1741. <div id="dyn-subtab-ospf-nbrs" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1742. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1743. <h3 class="text-sm font-bold text-white">Live OSPF Neighbors (show ip ospf neighbor)</h3>
  1744. <span id="ospf-nbrs-count-badge" class="text-xs font-mono text-slate-400">0 Neighbors</span>
  1745. </div>
  1746. <div class="overflow-x-auto">
  1747. <table class="w-full text-left text-xs font-mono">
  1748. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1749. <tr>
  1750. <th class="py-2.5 px-3">Neighbor ID</th>
  1751. <th class="py-2.5 px-3">IP Address</th>
  1752. <th class="py-2.5 px-3">Interface</th>
  1753. <th class="py-2.5 px-3">Area</th>
  1754. <th class="py-2.5 px-3">State</th>
  1755. <th class="py-2.5 px-3">Dead Timer</th>
  1756. </tr>
  1757. </thead>
  1758. <tbody id="ospf-nbrs-table-body" class="divide-y divide-slate-800/80"></tbody>
  1759. </table>
  1760. </div>
  1761. <div id="ospf-nbrs-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1762. No active OSPF neighbors discovered. Ensure neighbors are in the same subnet and hello/dead timers match.
  1763. </div>
  1764. </div>
  1765. <!-- Sub-Tab 7: OSPF Routes -->
  1766. <div id="dyn-subtab-ospf-routes" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1767. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1768. <h3 class="text-sm font-bold text-white">OSPF Routing Table (show ip ospf route)</h3>
  1769. <span id="ospf-routes-count-badge" class="text-xs font-mono text-slate-400">0 Routes</span>
  1770. </div>
  1771. <div class="overflow-x-auto">
  1772. <table class="w-full text-left text-xs font-mono">
  1773. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1774. <tr>
  1775. <th class="py-2.5 px-3">Prefix</th>
  1776. <th class="py-2.5 px-3">Type</th>
  1777. <th class="py-2.5 px-3">Cost</th>
  1778. <th class="py-2.5 px-3">Area</th>
  1779. <th class="py-2.5 px-3">Next Hop / Dev</th>
  1780. </tr>
  1781. </thead>
  1782. <tbody id="ospf-routes-table-body" class="divide-y divide-slate-800/80"></tbody>
  1783. </table>
  1784. </div>
  1785. <div id="ospf-routes-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1786. No OSPF routes calculated.
  1787. </div>
  1788. </div>
  1789. </section>
  1790. <!-- ================= SECTION: DEBIAN CONFIG PERSISTENCE ================= -->
  1791. <section id="section-persistence" class="hidden space-y-6">
  1792. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  1793. <div class="flex flex-wrap items-center justify-between gap-4 mb-4">
  1794. <div>
  1795. <h3 class="text-sm font-bold text-white flex items-center gap-2">
  1796. <span>Debian /etc/network/interfaces.d/ Persistence</span>
  1797. <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>
  1798. </h3>
  1799. <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>
  1800. </div>
  1801. <div class="flex items-center space-x-3">
  1802. <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>
  1803. <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">
  1804. <span>Save to Debian Config</span>
  1805. </button>
  1806. </div>
  1807. </div>
  1808. <div class="relative">
  1809. <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>
  1810. </div>
  1811. </div>
  1812. </section>
  1813. </main>
  1814. </div>
  1815. </div>
  1816. <!-- ================= MODAL: CREATE VLAN ================= -->
  1817. <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">
  1818. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  1819. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  1820. <h3 class="text-sm font-bold text-white">Create New VLAN Interface</h3>
  1821. <button onclick="closeVlanModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  1822. </div>
  1823. <form id="vlan-form" onsubmit="submitCreateVlan(event)" class="p-6 space-y-4">
  1824. <div>
  1825. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Parent Interface *</label>
  1826. <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>
  1827. </div>
  1828. <div class="grid grid-cols-2 gap-4">
  1829. <div>
  1830. <label class="block text-xs font-semibold text-slate-300 mb-1.5">VLAN ID (1-4094) *</label>
  1831. <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">
  1832. </div>
  1833. <div>
  1834. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Interface Name</label>
  1835. <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">
  1836. </div>
  1837. </div>
  1838. <div>
  1839. <div class="flex items-center justify-between mb-1.5">
  1840. <label class="text-xs font-semibold text-slate-300">Router IP Address & CIDR</label>
  1841. <div class="flex space-x-1">
  1842. <button type="button" onclick="setSubnetPreset('/24')" class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded">/24</button>
  1843. <button type="button" onclick="setSubnetPreset('/23')" class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded">/23</button>
  1844. <button type="button" onclick="setSubnetPreset('/16')" class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded">/16</button>
  1845. </div>
  1846. </div>
  1847. <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">
  1848. </div>
  1849. <div class="grid grid-cols-2 gap-4">
  1850. <div>
  1851. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Role Tag</label>
  1852. <select id="vlan-role" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white">
  1853. <option value="LAN">LAN</option>
  1854. <option value="GUEST">Guest Network</option>
  1855. <option value="IOT">IoT / Smart Home</option>
  1856. <option value="DMZ">DMZ / Isolated</option>
  1857. <option value="MGMT">Management</option>
  1858. <option value="WAN">WAN / Uplink</option>
  1859. </select>
  1860. </div>
  1861. <div>
  1862. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Description / Alias</label>
  1863. <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">
  1864. </div>
  1865. </div>
  1866. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  1867. <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>
  1868. <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>
  1869. </div>
  1870. </form>
  1871. </div>
  1872. </div>
  1873. <!-- ================= MODAL: EDIT INTERFACE ================= -->
  1874. <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">
  1875. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  1876. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  1877. <div>
  1878. <h3 class="text-sm font-bold text-white flex items-center gap-2">
  1879. <span id="modal-iface-name">eth0</span>
  1880. <span id="modal-iface-badge" class="text-[10px] font-mono px-2 py-0.5 rounded bg-slate-800 text-slate-300">Ethernet</span>
  1881. </h3>
  1882. </div>
  1883. <button onclick="closeIfaceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  1884. </div>
  1885. <div class="p-6 space-y-5">
  1886. <div class="grid grid-cols-2 gap-4 p-3 bg-slate-950/60 rounded-xl border border-slate-800/80">
  1887. <div>
  1888. <span class="block text-[11px] text-slate-400 mb-1">Administrative Link</span>
  1889. <div class="flex items-center space-x-2">
  1890. <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>
  1891. <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>
  1892. </div>
  1893. </div>
  1894. <div>
  1895. <span class="block text-[11px] text-slate-400 mb-1">MTU Size</span>
  1896. <div class="flex items-center space-x-2">
  1897. <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">
  1898. <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>
  1899. </div>
  1900. </div>
  1901. </div>
  1902. <div>
  1903. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Assigned IP Addresses</label>
  1904. <div id="modal-ip-list" class="space-y-1.5 mb-3 font-mono text-xs"></div>
  1905. <div class="flex space-x-2">
  1906. <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">
  1907. <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>
  1908. </div>
  1909. </div>
  1910. <div class="grid grid-cols-2 gap-4">
  1911. <div>
  1912. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Role Tag</label>
  1913. <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">
  1914. <option value="WAN">WAN / Uplink</option>
  1915. <option value="LAN">LAN</option>
  1916. <option value="DMZ">DMZ</option>
  1917. <option value="GUEST">Guest</option>
  1918. <option value="IOT">IoT</option>
  1919. <option value="MGMT">Management</option>
  1920. </select>
  1921. </div>
  1922. <div>
  1923. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Description</label>
  1924. <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">
  1925. </div>
  1926. </div>
  1927. <div class="pt-4 border-t border-slate-800 flex justify-between items-center">
  1928. <button id="modal-delete-vlan-btn" onclick="confirmDeleteVlan(currentModalIface)" class="hidden text-xs text-rose-400 hover:text-rose-300">Delete VLAN</button>
  1929. <div class="flex space-x-3">
  1930. <button onclick="closeIfaceModal()" class="px-4 py-2 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800">Close</button>
  1931. <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>
  1932. </div>
  1933. </div>
  1934. </div>
  1935. </div>
  1936. </div>
  1937. <!-- ================= MODAL: PPPoE CLIENT ================= -->
  1938. <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">
  1939. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  1940. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  1941. <h3 id="pppoe-modal-title" class="text-sm font-bold text-white">Add PPPoE Client Interface</h3>
  1942. <button onclick="closePPPoEModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  1943. </div>
  1944. <form onsubmit="submitSavePPPoE(event)" class="p-6 space-y-4">
  1945. <input type="hidden" id="pppoe-modal-edit-orig">
  1946. <div class="grid grid-cols-2 gap-4">
  1947. <div>
  1948. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Name *</label>
  1949. <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">
  1950. </div>
  1951. <div>
  1952. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Interface *</label>
  1953. <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>
  1954. </div>
  1955. </div>
  1956. <div class="grid grid-cols-2 gap-4">
  1957. <div>
  1958. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Username *</label>
  1959. <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">
  1960. </div>
  1961. <div>
  1962. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Password *</label>
  1963. <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">
  1964. </div>
  1965. </div>
  1966. <div class="grid grid-cols-2 gap-4">
  1967. <div>
  1968. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Service Name (Optional)</label>
  1969. <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">
  1970. </div>
  1971. <div>
  1972. <label class="block text-xs font-semibold text-slate-300 mb-1.5">MTU</label>
  1973. <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">
  1974. </div>
  1975. </div>
  1976. <div class="grid grid-cols-3 gap-2 pt-2 border-t border-slate-800/80">
  1977. <label class="flex items-center space-x-2 cursor-pointer">
  1978. <input type="checkbox" id="pppoe-modal-defroute" checked class="rounded bg-slate-800 border-slate-700 text-blue-500">
  1979. <span class="text-xs text-slate-300 font-medium">Default Route</span>
  1980. </label>
  1981. <label class="flex items-center space-x-2 cursor-pointer">
  1982. <input type="checkbox" id="pppoe-modal-reconnect" checked class="rounded bg-slate-800 border-slate-700 text-blue-500">
  1983. <span class="text-xs text-slate-300 font-medium">Auto-Reconnect</span>
  1984. </label>
  1985. <label class="flex items-center space-x-2 cursor-pointer">
  1986. <input type="checkbox" id="pppoe-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  1987. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  1988. </label>
  1989. </div>
  1990. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  1991. <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>
  1992. <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>
  1993. </div>
  1994. </form>
  1995. </div>
  1996. </div>
  1997. <!-- ================= MODAL: WIREGUARD INTERFACE ================= -->
  1998. <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">
  1999. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2000. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2001. <h3 id="wg-iface-modal-title" class="text-sm font-bold text-white">Add WireGuard Interface</h3>
  2002. <button onclick="closeAddWGInterfaceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2003. </div>
  2004. <form onsubmit="submitSaveWGInterface(event)" class="p-6 space-y-4">
  2005. <input type="hidden" id="wg-iface-modal-edit-orig">
  2006. <div class="grid grid-cols-2 gap-4">
  2007. <div>
  2008. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Interface Name *</label>
  2009. <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">
  2010. </div>
  2011. <div>
  2012. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Listen Port *</label>
  2013. <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">
  2014. </div>
  2015. </div>
  2016. <div class="grid grid-cols-2 gap-4">
  2017. <div>
  2018. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Tunnel IP (CIDR) *</label>
  2019. <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">
  2020. </div>
  2021. <div>
  2022. <label class="block text-xs font-semibold text-slate-300 mb-1.5">MTU</label>
  2023. <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">
  2024. </div>
  2025. </div>
  2026. <div>
  2027. <div class="flex items-center justify-between mb-1.5">
  2028. <label class="text-xs font-semibold text-slate-300">Public Key</label>
  2029. <button type="button" onclick="generateWGInterfaceKeys()" class="text-[10px] text-cyan-400 hover:text-cyan-300 font-semibold">Generate New Keypair</button>
  2030. </div>
  2031. <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">
  2032. </div>
  2033. <div>
  2034. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Private Key (Secret) *</label>
  2035. <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">
  2036. </div>
  2037. <div class="pt-2">
  2038. <label class="flex items-center space-x-2 cursor-pointer">
  2039. <input type="checkbox" id="wg-iface-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2040. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2041. </label>
  2042. </div>
  2043. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2044. <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>
  2045. <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>
  2046. </div>
  2047. </form>
  2048. </div>
  2049. </div>
  2050. <!-- ================= MODAL: ADD WIREGUARD PEER ================= -->
  2051. <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">
  2052. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2053. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2054. <h3 id="wg-peer-modal-title" class="text-sm font-bold text-white">Add WireGuard Peer</h3>
  2055. <button onclick="closeAddWGPeerModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2056. </div>
  2057. <form onsubmit="submitSaveWGPeer(event)" class="p-6 space-y-4">
  2058. <div class="grid grid-cols-2 gap-4">
  2059. <div>
  2060. <label class="block text-xs font-semibold text-slate-300 mb-1.5">WireGuard Interface *</label>
  2061. <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>
  2062. </div>
  2063. <div>
  2064. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Peer Name / Alias *</label>
  2065. <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">
  2066. </div>
  2067. </div>
  2068. <div>
  2069. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Peer Public Key *</label>
  2070. <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">
  2071. </div>
  2072. <div>
  2073. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Allowed IPs (CIDR) *</label>
  2074. <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">
  2075. </div>
  2076. <div class="grid grid-cols-2 gap-4">
  2077. <div>
  2078. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Endpoint (Optional)</label>
  2079. <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">
  2080. </div>
  2081. <div>
  2082. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Keepalive (sec)</label>
  2083. <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">
  2084. </div>
  2085. </div>
  2086. <div>
  2087. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Preshared Key (Optional)</label>
  2088. <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">
  2089. </div>
  2090. <div class="pt-2">
  2091. <label class="flex items-center space-x-2 cursor-pointer">
  2092. <input type="checkbox" id="wg-peer-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2093. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2094. </label>
  2095. </div>
  2096. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2097. <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>
  2098. <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>
  2099. </div>
  2100. </form>
  2101. </div>
  2102. </div>
  2103. <!-- ================= MODAL: IPSEC TUNNEL ================= -->
  2104. <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">
  2105. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2106. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2107. <h3 id="ipsec-modal-title" class="text-sm font-bold text-white">Configure IPSec IKEv2 Tunnel</h3>
  2108. <button onclick="closeAddIPSecModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2109. </div>
  2110. <form onsubmit="submitSaveIPSec(event)" class="p-6 space-y-4">
  2111. <div>
  2112. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Connection Name *</label>
  2113. <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">
  2114. </div>
  2115. <div class="grid grid-cols-2 gap-4">
  2116. <div>
  2117. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Local Subnet *</label>
  2118. <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">
  2119. </div>
  2120. <div>
  2121. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Remote Subnet *</label>
  2122. <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">
  2123. </div>
  2124. </div>
  2125. <div>
  2126. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Remote Gateway IP / FQDN *</label>
  2127. <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">
  2128. </div>
  2129. <div>
  2130. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Pre-Shared Key (PSK) *</label>
  2131. <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">
  2132. </div>
  2133. <div class="grid grid-cols-2 gap-4">
  2134. <div>
  2135. <label class="block text-xs font-semibold text-slate-300 mb-1.5">IKE Proposals</label>
  2136. <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">
  2137. </div>
  2138. <div>
  2139. <label class="block text-xs font-semibold text-slate-300 mb-1.5">ESP Proposals</label>
  2140. <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">
  2141. </div>
  2142. </div>
  2143. <div class="grid grid-cols-2 gap-4 pt-2">
  2144. <label class="flex items-center space-x-2 cursor-pointer">
  2145. <input type="checkbox" id="ipsec-modal-autostart" checked class="rounded bg-slate-800 border-slate-700 text-amber-500">
  2146. <span class="text-xs text-slate-300 font-medium">Auto-start on boot</span>
  2147. </label>
  2148. <label class="flex items-center space-x-2 cursor-pointer">
  2149. <input type="checkbox" id="ipsec-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2150. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2151. </label>
  2152. </div>
  2153. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2154. <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>
  2155. <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>
  2156. </div>
  2157. </form>
  2158. </div>
  2159. </div>
  2160. <!-- ================= MODAL: L2TP CLIENT ================= -->
  2161. <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">
  2162. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2163. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2164. <h3 id="l2tp-modal-title" class="text-sm font-bold text-white">Add L2TP Client Interface</h3>
  2165. <button onclick="closeL2TPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2166. </div>
  2167. <form onsubmit="submitSaveL2TP(event)" class="p-6 space-y-4">
  2168. <div>
  2169. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Client Interface Name *</label>
  2170. <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">
  2171. </div>
  2172. <div>
  2173. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Connect To (Server IP / Host) *</label>
  2174. <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">
  2175. </div>
  2176. <div class="grid grid-cols-2 gap-4">
  2177. <div>
  2178. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Username *</label>
  2179. <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">
  2180. </div>
  2181. <div>
  2182. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Password *</label>
  2183. <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">
  2184. </div>
  2185. </div>
  2186. <div>
  2187. <label class="block text-xs font-semibold text-slate-300 mb-1.5">IPSec Secret / PSK (Optional for L2TP/IPsec)</label>
  2188. <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">
  2189. </div>
  2190. <div class="grid grid-cols-2 gap-4 pt-2">
  2191. <label class="flex items-center space-x-2 cursor-pointer">
  2192. <input type="checkbox" id="l2tp-modal-defroute" checked class="rounded bg-slate-800 border-slate-700 text-cyan-500">
  2193. <span class="text-xs text-slate-300 font-medium">Default Route</span>
  2194. </label>
  2195. <label class="flex items-center space-x-2 cursor-pointer">
  2196. <input type="checkbox" id="l2tp-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2197. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2198. </label>
  2199. </div>
  2200. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2201. <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>
  2202. <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>
  2203. </div>
  2204. </form>
  2205. </div>
  2206. </div>
  2207. <!-- ================= MODAL: PPTP CLIENT ================= -->
  2208. <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">
  2209. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2210. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2211. <h3 id="pptp-modal-title" class="text-sm font-bold text-white">Add PPTP Client Interface</h3>
  2212. <button onclick="closePPTPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2213. </div>
  2214. <form onsubmit="submitSavePPTP(event)" class="p-6 space-y-4">
  2215. <div>
  2216. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Client Interface Name *</label>
  2217. <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">
  2218. </div>
  2219. <div>
  2220. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Connect To (Server IP / Host) *</label>
  2221. <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">
  2222. </div>
  2223. <div class="grid grid-cols-2 gap-4">
  2224. <div>
  2225. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Username *</label>
  2226. <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">
  2227. </div>
  2228. <div>
  2229. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Password *</label>
  2230. <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">
  2231. </div>
  2232. </div>
  2233. <div class="grid grid-cols-3 gap-2 pt-2 border-t border-slate-800/80">
  2234. <label class="flex items-center space-x-2 cursor-pointer">
  2235. <input type="checkbox" id="pptp-modal-mppe" checked class="rounded bg-slate-800 border-slate-700 text-purple-500">
  2236. <span class="text-xs text-slate-300 font-medium">MPPE-128</span>
  2237. </label>
  2238. <label class="flex items-center space-x-2 cursor-pointer">
  2239. <input type="checkbox" id="pptp-modal-defroute" checked class="rounded bg-slate-800 border-slate-700 text-purple-500">
  2240. <span class="text-xs text-slate-300 font-medium">Default Route</span>
  2241. </label>
  2242. <label class="flex items-center space-x-2 cursor-pointer">
  2243. <input type="checkbox" id="pptp-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2244. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2245. </label>
  2246. </div>
  2247. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2248. <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>
  2249. <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>
  2250. </div>
  2251. </form>
  2252. </div>
  2253. </div>
  2254. <!-- ================= MODAL: FIREWALL FILTER RULE ================= -->
  2255. <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">
  2256. <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">
  2257. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2258. <h3 id="filter-modal-title" class="text-sm font-bold text-white">Add Firewall Filter Rule</h3>
  2259. <button onclick="closeFilterModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2260. </div>
  2261. <form onsubmit="submitSaveFilterRule(event)" class="p-6 space-y-4 overflow-y-auto flex-1 text-xs">
  2262. <input type="hidden" id="filter-modal-id">
  2263. <div class="grid grid-cols-2 gap-4">
  2264. <div>
  2265. <label class="block font-semibold text-slate-300 mb-1">Chain *</label>
  2266. <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">
  2267. <option value="input">input (traffic to router)</option>
  2268. <option value="forward" selected>forward (routed traffic)</option>
  2269. <option value="output">output (traffic from router)</option>
  2270. </select>
  2271. </div>
  2272. <div>
  2273. <label class="block font-semibold text-slate-300 mb-1">Action *</label>
  2274. <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">
  2275. <option value="accept" selected>accept</option>
  2276. <option value="drop">drop</option>
  2277. <option value="reject">reject</option>
  2278. <option value="log">log</option>
  2279. <option value="jump">jump</option>
  2280. <option value="return">return</option>
  2281. </select>
  2282. </div>
  2283. </div>
  2284. <div id="filter-action-reject-box" class="hidden p-3 bg-rose-950/20 border border-rose-900/30 rounded-lg">
  2285. <label class="block font-semibold text-rose-300 mb-1">Reject With</label>
  2286. <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">
  2287. <option value="icmp-network-unreachable">icmp-network-unreachable</option>
  2288. <option value="icmp-host-unreachable">icmp-host-unreachable</option>
  2289. <option value="icmp-port-unreachable">icmp-port-unreachable</option>
  2290. <option value="tcp-reset">tcp-reset (TCP RST)</option>
  2291. </select>
  2292. </div>
  2293. <div class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2294. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Match Properties</span>
  2295. <div class="grid grid-cols-2 gap-3">
  2296. <div>
  2297. <label class="block font-semibold text-slate-300 mb-1">Protocol</label>
  2298. <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">
  2299. <option value="all">all</option>
  2300. <option value="tcp">tcp (6)</option>
  2301. <option value="udp">udp (17)</option>
  2302. <option value="icmp">icmp (1)</option>
  2303. <option value="gre">gre (47)</option>
  2304. <option value="esp">esp (50)</option>
  2305. </select>
  2306. </div>
  2307. <div>
  2308. <label class="block font-semibold text-slate-300 mb-1">Connection Mark</label>
  2309. <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">
  2310. </div>
  2311. </div>
  2312. <div class="grid grid-cols-2 gap-3">
  2313. <div>
  2314. <label class="block font-semibold text-slate-300 mb-1">Src. Address / CIDR</label>
  2315. <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">
  2316. </div>
  2317. <div>
  2318. <label class="block font-semibold text-slate-300 mb-1">Dst. Address / CIDR</label>
  2319. <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">
  2320. </div>
  2321. </div>
  2322. <div class="grid grid-cols-2 gap-3">
  2323. <div>
  2324. <label class="block font-semibold text-slate-300 mb-1">Src. Port(s)</label>
  2325. <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">
  2326. </div>
  2327. <div>
  2328. <label class="block font-semibold text-slate-300 mb-1">Dst. Port(s)</label>
  2329. <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">
  2330. </div>
  2331. </div>
  2332. <div class="grid grid-cols-2 gap-3">
  2333. <div>
  2334. <label class="block font-semibold text-slate-300 mb-1">In. Interface</label>
  2335. <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>
  2336. </div>
  2337. <div>
  2338. <label class="block font-semibold text-slate-300 mb-1">Out. Interface</label>
  2339. <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>
  2340. </div>
  2341. </div>
  2342. <div>
  2343. <label class="block font-semibold text-slate-300 mb-1.5">Connection State</label>
  2344. <div class="flex flex-wrap gap-3">
  2345. <label class="flex items-center space-x-1.5 cursor-pointer">
  2346. <input type="checkbox" id="filter-modal-cs-established" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2347. <span class="text-slate-300">established</span>
  2348. </label>
  2349. <label class="flex items-center space-x-1.5 cursor-pointer">
  2350. <input type="checkbox" id="filter-modal-cs-related" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2351. <span class="text-slate-300">related</span>
  2352. </label>
  2353. <label class="flex items-center space-x-1.5 cursor-pointer">
  2354. <input type="checkbox" id="filter-modal-cs-new" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2355. <span class="text-slate-300">new</span>
  2356. </label>
  2357. <label class="flex items-center space-x-1.5 cursor-pointer">
  2358. <input type="checkbox" id="filter-modal-cs-invalid" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2359. <span class="text-slate-300">invalid</span>
  2360. </label>
  2361. </div>
  2362. </div>
  2363. <div class="grid grid-cols-2 gap-3">
  2364. <div>
  2365. <label class="block font-semibold text-slate-300 mb-1">Src. Address List</label>
  2366. <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">
  2367. <option value="">(None)</option>
  2368. </select>
  2369. </div>
  2370. <div>
  2371. <label class="block font-semibold text-slate-300 mb-1">Dst. Address List</label>
  2372. <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">
  2373. <option value="">(None)</option>
  2374. </select>
  2375. </div>
  2376. </div>
  2377. </div>
  2378. <div>
  2379. <label class="block font-semibold text-slate-300 mb-1">Comment</label>
  2380. <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">
  2381. </div>
  2382. <div class="pt-2">
  2383. <label class="flex items-center space-x-2 cursor-pointer">
  2384. <input type="checkbox" id="filter-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2385. <span class="font-medium text-slate-300">Disabled (X)</span>
  2386. </label>
  2387. </div>
  2388. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2389. <button type="button" onclick="closeFilterModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2390. <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>
  2391. </div>
  2392. </form>
  2393. </div>
  2394. </div>
  2395. <!-- ================= MODAL: FIREWALL NAT RULE ================= -->
  2396. <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">
  2397. <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">
  2398. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2399. <h3 id="nat-modal-title" class="text-sm font-bold text-white">Add NAT Rule</h3>
  2400. <button onclick="closeNATModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2401. </div>
  2402. <form onsubmit="submitSaveNATRule(event)" class="p-6 space-y-4 overflow-y-auto flex-1 text-xs">
  2403. <input type="hidden" id="nat-modal-id">
  2404. <div class="grid grid-cols-2 gap-4">
  2405. <div>
  2406. <label class="block font-semibold text-slate-300 mb-1">Chain *</label>
  2407. <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">
  2408. <option value="srcnat" selected>srcnat (Outgoing / Masquerade)</option>
  2409. <option value="dstnat">dstnat (Incoming / Port Forwarding)</option>
  2410. </select>
  2411. </div>
  2412. <div>
  2413. <label class="block font-semibold text-slate-300 mb-1">Action *</label>
  2414. <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">
  2415. <option value="masquerade" selected>masquerade</option>
  2416. <option value="src-nat">src-nat</option>
  2417. <option value="dst-nat">dst-nat</option>
  2418. <option value="redirect">redirect</option>
  2419. <option value="accept">accept</option>
  2420. </select>
  2421. </div>
  2422. </div>
  2423. <div id="nat-action-to-box" class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2424. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">NAT Target (To Addresses / Ports)</span>
  2425. <div class="grid grid-cols-2 gap-3">
  2426. <div>
  2427. <label class="block font-semibold text-slate-300 mb-1">To Addresses</label>
  2428. <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">
  2429. </div>
  2430. <div>
  2431. <label class="block font-semibold text-slate-300 mb-1">To Ports</label>
  2432. <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">
  2433. </div>
  2434. </div>
  2435. </div>
  2436. <div class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2437. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Match Properties</span>
  2438. <div class="grid grid-cols-2 gap-3">
  2439. <div>
  2440. <label class="block font-semibold text-slate-300 mb-1">Protocol</label>
  2441. <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">
  2442. <option value="all">all</option>
  2443. <option value="tcp">tcp</option>
  2444. <option value="udp">udp</option>
  2445. <option value="icmp">icmp</option>
  2446. </select>
  2447. </div>
  2448. <div>
  2449. <label class="block font-semibold text-slate-300 mb-1">Dst. Port(s)</label>
  2450. <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">
  2451. </div>
  2452. </div>
  2453. <div class="grid grid-cols-2 gap-3">
  2454. <div>
  2455. <label class="block font-semibold text-slate-300 mb-1">Src. Address / CIDR</label>
  2456. <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">
  2457. </div>
  2458. <div>
  2459. <label class="block font-semibold text-slate-300 mb-1">Dst. Address / CIDR</label>
  2460. <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">
  2461. </div>
  2462. </div>
  2463. <div class="grid grid-cols-2 gap-3">
  2464. <div>
  2465. <label class="block font-semibold text-slate-300 mb-1">In. Interface</label>
  2466. <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>
  2467. </div>
  2468. <div>
  2469. <label class="block font-semibold text-slate-300 mb-1">Out. Interface</label>
  2470. <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>
  2471. </div>
  2472. </div>
  2473. <div class="grid grid-cols-2 gap-3">
  2474. <div>
  2475. <div class="flex items-center justify-between mb-1">
  2476. <label class="font-semibold text-slate-300">Src. Address List</label>
  2477. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2478. <input type="checkbox" id="nat-modal-srclist-inv" class="rounded bg-slate-800 border-slate-700">
  2479. <span>! Invert</span>
  2480. </label>
  2481. </div>
  2482. <select id="nat-modal-srclist" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  2483. </div>
  2484. <div>
  2485. <div class="flex items-center justify-between mb-1">
  2486. <label class="font-semibold text-slate-300">Dst. Address List</label>
  2487. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2488. <input type="checkbox" id="nat-modal-dstlist-inv" class="rounded bg-slate-800 border-slate-700">
  2489. <span>! Invert</span>
  2490. </label>
  2491. </div>
  2492. <select id="nat-modal-dstlist" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  2493. </div>
  2494. </div>
  2495. </div>
  2496. <div>
  2497. <label class="block font-semibold text-slate-300 mb-1">Comment</label>
  2498. <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">
  2499. </div>
  2500. <div class="pt-2">
  2501. <label class="flex items-center space-x-2 cursor-pointer">
  2502. <input type="checkbox" id="nat-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2503. <span class="font-medium text-slate-300">Disabled (X)</span>
  2504. </label>
  2505. </div>
  2506. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2507. <button type="button" onclick="closeNATModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2508. <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>
  2509. </div>
  2510. </form>
  2511. </div>
  2512. </div>
  2513. <!-- ================= MODAL: FIREWALL MANGLE RULE ================= -->
  2514. <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">
  2515. <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">
  2516. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2517. <h3 id="mangle-modal-title" class="text-sm font-bold text-white">Add Mangle Rule</h3>
  2518. <button onclick="closeMangleModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2519. </div>
  2520. <form onsubmit="submitSaveMangleRule(event)" class="p-6 space-y-4 overflow-y-auto flex-1 text-xs">
  2521. <input type="hidden" id="mangle-modal-id">
  2522. <div class="grid grid-cols-2 gap-4">
  2523. <div>
  2524. <label class="block font-semibold text-slate-300 mb-1">Chain *</label>
  2525. <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">
  2526. <option value="prerouting" selected>prerouting (Policy Routing / Marks)</option>
  2527. <option value="forward">forward</option>
  2528. <option value="postrouting">postrouting</option>
  2529. <option value="input">input</option>
  2530. <option value="output">output</option>
  2531. </select>
  2532. </div>
  2533. <div>
  2534. <label class="block font-semibold text-slate-300 mb-1">Action *</label>
  2535. <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">
  2536. <option value="mark-connection" selected>mark-connection</option>
  2537. <option value="mark-routing">mark-routing (Policy Routing)</option>
  2538. <option value="mark-packet">mark-packet (QoS / Queues)</option>
  2539. <option value="change-mss">change-mss (TCP MSS Clamp)</option>
  2540. <option value="set-dscp">set-dscp</option>
  2541. <option value="accept">accept</option>
  2542. </select>
  2543. </div>
  2544. </div>
  2545. <div id="mangle-target-box" class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2546. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Mark Target & Passthrough</span>
  2547. <div class="grid grid-cols-2 gap-3">
  2548. <div id="mangle-field-newmark">
  2549. <label class="block font-semibold text-slate-300 mb-1">New Mark Name</label>
  2550. <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">
  2551. </div>
  2552. <div class="flex items-center pt-5">
  2553. <label class="flex items-center space-x-2 cursor-pointer">
  2554. <input type="checkbox" id="mangle-modal-passthrough" checked class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2555. <span class="font-medium text-slate-300">Passthrough</span>
  2556. </label>
  2557. </div>
  2558. </div>
  2559. </div>
  2560. <div class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2561. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Match Criteria</span>
  2562. <div class="grid grid-cols-2 gap-3">
  2563. <div>
  2564. <label class="block font-semibold text-slate-300 mb-1">Src. Address / CIDR</label>
  2565. <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">
  2566. </div>
  2567. <div>
  2568. <label class="block font-semibold text-slate-300 mb-1">Dst. Address / CIDR</label>
  2569. <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">
  2570. </div>
  2571. </div>
  2572. <div class="grid grid-cols-2 gap-3">
  2573. <div>
  2574. <label class="block font-semibold text-slate-300 mb-1">Connection Mark</label>
  2575. <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">
  2576. </div>
  2577. <div>
  2578. <label class="block font-semibold text-slate-300 mb-1">In. Interface</label>
  2579. <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>
  2580. </div>
  2581. </div>
  2582. <div class="grid grid-cols-2 gap-3">
  2583. <div>
  2584. <div class="flex items-center justify-between mb-1">
  2585. <label class="font-semibold text-slate-300">Src. Address List</label>
  2586. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2587. <input type="checkbox" id="mangle-modal-srclist-inv" class="rounded bg-slate-800 border-slate-700">
  2588. <span>! Invert</span>
  2589. </label>
  2590. </div>
  2591. <select id="mangle-modal-srclist" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  2592. </div>
  2593. <div>
  2594. <div class="flex items-center justify-between mb-1">
  2595. <label class="font-semibold text-slate-300">Dst. Address List</label>
  2596. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2597. <input type="checkbox" id="mangle-modal-dstlist-inv" class="rounded bg-slate-800 border-slate-700">
  2598. <span>! Invert</span>
  2599. </label>
  2600. </div>
  2601. <select id="mangle-modal-dstlist" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono"></select>
  2602. </div>
  2603. </div>
  2604. </div>
  2605. <div>
  2606. <label class="block font-semibold text-slate-300 mb-1">Comment</label>
  2607. <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">
  2608. </div>
  2609. <div class="pt-2">
  2610. <label class="flex items-center space-x-2 cursor-pointer">
  2611. <input type="checkbox" id="mangle-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2612. <span class="font-medium text-slate-300">Disabled (X)</span>
  2613. </label>
  2614. </div>
  2615. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2616. <button type="button" onclick="closeMangleModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2617. <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>
  2618. </div>
  2619. </form>
  2620. </div>
  2621. </div>
  2622. <!-- ================= MODAL: ADDRESS LIST ENTRY ================= -->
  2623. <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">
  2624. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  2625. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2626. <h3 id="addrlist-modal-title" class="text-sm font-bold text-white">Add Address List Entry</h3>
  2627. <button onclick="closeAddrListModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2628. </div>
  2629. <form onsubmit="submitSaveAddrList(event)" class="p-6 space-y-4 text-xs">
  2630. <input type="hidden" id="addrlist-modal-id">
  2631. <div>
  2632. <label class="block font-semibold text-slate-300 mb-1.5">List Name *</label>
  2633. <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">
  2634. </div>
  2635. <div>
  2636. <label class="block font-semibold text-slate-300 mb-1.5">IP Address / Subnet (CIDR) *</label>
  2637. <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">
  2638. </div>
  2639. <div>
  2640. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  2641. <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">
  2642. </div>
  2643. <div class="pt-2">
  2644. <label class="flex items-center space-x-2 cursor-pointer">
  2645. <input type="checkbox" id="addrlist-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2646. <span class="font-medium text-slate-300">Disabled (X)</span>
  2647. </label>
  2648. </div>
  2649. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2650. <button type="button" onclick="closeAddrListModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2651. <button type="submit" id="addrlist-modal-submit-btn" class="px-5 py-2 rounded-lg font-semibold bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20">Save Entry</button>
  2652. </div>
  2653. </form>
  2654. </div>
  2655. </div>
  2656. <!-- ================= MODAL: GEO INTERVAL SETTINGS ================= -->
  2657. <div id="geo-interval-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  2658. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  2659. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2660. <h3 class="text-sm font-bold text-white">Geo-Location Auto-Update Settings</h3>
  2661. <button onclick="closeGeoIntervalModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2662. </div>
  2663. <form onsubmit="submitGeoIntervalSettings(event)" class="p-6 space-y-4 text-xs">
  2664. <div class="p-3 bg-slate-950/60 border border-slate-800 rounded-xl space-y-2">
  2665. <label class="flex items-center space-x-2.5 cursor-pointer">
  2666. <input type="checkbox" id="geo-cfg-autoupdate" checked class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2667. <span class="font-semibold text-white">Enable Automatic Background Updates</span>
  2668. </label>
  2669. <p class="text-[11px] text-slate-400 pl-6">Automatically fetches the latest country IP blocks from IPdeny registries and updates active kernel ipsets without service interruption.</p>
  2670. </div>
  2671. <div>
  2672. <label class="block font-semibold text-slate-300 mb-1.5">Update Interval *</label>
  2673. <select id="geo-cfg-interval" onchange="toggleCustomGeoInterval()" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono focus:outline-none focus:border-emerald-500">
  2674. <option value="12">Every 12 Hours</option>
  2675. <option value="24" selected>Every 24 Hours (Daily - Recommended)</option>
  2676. <option value="48">Every 48 Hours (2 Days)</option>
  2677. <option value="72">Every 3 Days</option>
  2678. <option value="168">Every 7 Days (Weekly)</option>
  2679. <option value="720">Every 30 Days (Monthly)</option>
  2680. <option value="custom">Custom Hours...</option>
  2681. </select>
  2682. </div>
  2683. <div id="geo-cfg-custom-box" class="hidden">
  2684. <label class="block font-semibold text-slate-300 mb-1.5">Custom Interval (Hours)</label>
  2685. <input type="number" id="geo-cfg-custom-hours" min="1" max="8760" value="24" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  2686. </div>
  2687. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2688. <button type="button" onclick="closeGeoIntervalModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2689. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-500/20">Save Schedule</button>
  2690. </div>
  2691. </form>
  2692. </div>
  2693. </div>
  2694. <!-- ================= MODAL: GEO SUBNETS PREVIEW ================= -->
  2695. <div id="geo-subnets-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  2696. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2697. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2698. <div>
  2699. <h3 id="geo-subnets-title" class="text-sm font-bold text-white">Country Subnets</h3>
  2700. <span id="geo-subnets-subtitle" class="text-[11px] font-mono text-slate-400">CIDR Blocks</span>
  2701. </div>
  2702. <button onclick="closeGeoSubnetsModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2703. </div>
  2704. <div class="p-6 space-y-3 text-xs">
  2705. <p class="text-slate-400">Showing first 100 subnets in this country zone:</p>
  2706. <div id="geo-subnets-list" class="bg-slate-950 border border-slate-800 rounded-xl p-3 max-h-72 overflow-y-auto font-mono text-[11px] text-emerald-400 space-y-1"></div>
  2707. <div class="pt-3 border-t border-slate-800 flex justify-end">
  2708. <button type="button" onclick="closeGeoSubnetsModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Close</button>
  2709. </div>
  2710. </div>
  2711. </div>
  2712. </div>
  2713. <!-- ================= MODAL: ADD / EDIT ROUTE ================= -->
  2714. <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">
  2715. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2716. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2717. <h3 id="route-modal-title" class="text-sm font-bold text-white">Add Static Route</h3>
  2718. <button onclick="closeRouteModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2719. </div>
  2720. <form onsubmit="submitSaveRoute(event)" class="p-6 space-y-4 text-xs">
  2721. <input type="hidden" id="route-modal-id">
  2722. <input type="hidden" id="route-modal-old-dst">
  2723. <input type="hidden" id="route-modal-old-gw">
  2724. <input type="hidden" id="route-modal-old-distance">
  2725. <input type="hidden" id="route-modal-old-table">
  2726. <input type="hidden" id="route-modal-old-iface">
  2727. <div>
  2728. <label class="block font-semibold text-slate-300 mb-1.5">Dst. Address (CIDR) *</label>
  2729. <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">
  2730. </div>
  2731. <div class="grid grid-cols-2 gap-4">
  2732. <div>
  2733. <label class="block font-semibold text-slate-300 mb-1.5">Gateway (IP or Interface)</label>
  2734. <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">
  2735. </div>
  2736. <div>
  2737. <label class="block font-semibold text-slate-300 mb-1.5">Routing Table / Mark</label>
  2738. <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">
  2739. <option value="main" selected>main</option>
  2740. </select>
  2741. </div>
  2742. </div>
  2743. <div class="grid grid-cols-2 gap-4">
  2744. <div>
  2745. <label class="block font-semibold text-slate-300 mb-1.5">Distance (Metric)</label>
  2746. <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">
  2747. </div>
  2748. <div>
  2749. <label class="block font-semibold text-slate-300 mb-1.5">Interface (Optional)</label>
  2750. <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>
  2751. </div>
  2752. </div>
  2753. <div>
  2754. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  2755. <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">
  2756. </div>
  2757. <div class="pt-2">
  2758. <label class="flex items-center space-x-2 cursor-pointer">
  2759. <input type="checkbox" id="route-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2760. <span class="font-medium text-slate-300">Disabled (X)</span>
  2761. </label>
  2762. </div>
  2763. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2764. <button type="button" onclick="closeRouteModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2765. <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>
  2766. </div>
  2767. </form>
  2768. </div>
  2769. </div>
  2770. <!-- ================= MODAL: ADD POLICY ROUTING RULE ================= -->
  2771. <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">
  2772. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2773. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2774. <h3 id="prule-modal-title" class="text-sm font-bold text-white">Add Policy Routing Rule (/ip route rule)</h3>
  2775. <button onclick="closePolicyRuleModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2776. </div>
  2777. <form onsubmit="submitSavePolicyRule(event)" class="p-6 space-y-4 text-xs">
  2778. <input type="hidden" id="prule-modal-id">
  2779. <div class="grid grid-cols-2 gap-4">
  2780. <div>
  2781. <label class="block font-semibold text-slate-300 mb-1.5">Priority / Preference</label>
  2782. <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">
  2783. </div>
  2784. <div>
  2785. <label class="block font-semibold text-slate-300 mb-1.5">Routing Mark (fwmark)</label>
  2786. <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">
  2787. </div>
  2788. </div>
  2789. <div class="grid grid-cols-2 gap-4">
  2790. <div>
  2791. <label class="block font-semibold text-slate-300 mb-1.5">Src. Address (CIDR)</label>
  2792. <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">
  2793. </div>
  2794. <div>
  2795. <label class="block font-semibold text-slate-300 mb-1.5">Dst. Address (CIDR)</label>
  2796. <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">
  2797. </div>
  2798. </div>
  2799. <div class="grid grid-cols-2 gap-4">
  2800. <div>
  2801. <label class="block font-semibold text-slate-300 mb-1.5">Lookup Table *</label>
  2802. <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>
  2803. </div>
  2804. <div>
  2805. <label class="block font-semibold text-slate-300 mb-1.5">Action</label>
  2806. <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">
  2807. <option value="lookup" selected>lookup (standard)</option>
  2808. <option value="unreachable">unreachable</option>
  2809. <option value="blackhole">blackhole</option>
  2810. </select>
  2811. </div>
  2812. </div>
  2813. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2814. <button type="button" onclick="closePolicyRuleModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2815. <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>
  2816. </div>
  2817. </form>
  2818. </div>
  2819. </div>
  2820. <!-- ================= MODAL: CREATE ROUTING TABLE ================= -->
  2821. <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">
  2822. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  2823. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2824. <h3 class="text-sm font-bold text-white">Create New Routing Table</h3>
  2825. <button onclick="closeTableModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2826. </div>
  2827. <form onsubmit="submitSaveTable(event)" class="p-6 space-y-4 text-xs">
  2828. <div>
  2829. <label class="block font-semibold text-slate-300 mb-1.5">Table Name *</label>
  2830. <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">
  2831. </div>
  2832. <div>
  2833. <label class="block font-semibold text-slate-300 mb-1.5">FIB Table ID (Optional)</label>
  2834. <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">
  2835. </div>
  2836. <div>
  2837. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  2838. <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">
  2839. </div>
  2840. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2841. <button type="button" onclick="closeTableModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2842. <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>
  2843. </div>
  2844. </form>
  2845. </div>
  2846. </div>
  2847. <!-- ================= MODAL: ADD/EDIT EoIP TUNNEL ================= -->
  2848. <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">
  2849. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2850. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2851. <div>
  2852. <h3 id="eoip-modal-title" class="text-sm font-bold text-white">Add EoIP Tunnel</h3>
  2853. <p class="text-[11px] text-slate-400">MikroTik RouterOS Layer 2 GRETAP Tunnel</p>
  2854. </div>
  2855. <button onclick="closeEoIPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2856. </div>
  2857. <form onsubmit="submitSaveEoIP(event)" class="p-6 space-y-4 text-xs font-sans">
  2858. <input type="hidden" id="eoip-modal-id">
  2859. <div class="grid grid-cols-2 gap-4">
  2860. <div>
  2861. <label class="block font-semibold text-slate-300 mb-1.5">Interface Name *</label>
  2862. <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">
  2863. </div>
  2864. <div>
  2865. <label class="block font-semibold text-slate-300 mb-1.5">Tunnel ID (1 - 65535) *</label>
  2866. <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">
  2867. </div>
  2868. </div>
  2869. <div class="grid grid-cols-2 gap-4">
  2870. <div>
  2871. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (Remote Router IP) *</label>
  2872. <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">
  2873. <span class="text-[10px] text-slate-400">Underlay IP of the remote MikroTik router</span>
  2874. </div>
  2875. <div>
  2876. <label class="block font-semibold text-slate-300 mb-1.5">Tunnel IP / Subnet (CIDR)</label>
  2877. <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">
  2878. <span class="text-[10px] text-slate-400">Overlay IPv4 assigned directly to tunnel (/30, /24)</span>
  2879. </div>
  2880. </div>
  2881. <div class="grid grid-cols-2 gap-4">
  2882. <div>
  2883. <label class="block font-semibold text-slate-300 mb-1.5">Underlay Local IP (GRE Source)</label>
  2884. <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">
  2885. <span class="text-[10px] text-slate-400">Local router IP for outer GRE packets</span>
  2886. </div>
  2887. <div>
  2888. <label class="block font-semibold text-slate-300 mb-1.5">MAC Address (Auto if empty)</label>
  2889. <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">
  2890. </div>
  2891. </div>
  2892. <div class="grid grid-cols-2 gap-4">
  2893. <div>
  2894. <label class="block font-semibold text-slate-300 mb-1.5">MTU</label>
  2895. <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">
  2896. </div>
  2897. <div>
  2898. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  2899. <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">
  2900. </div>
  2901. </div>
  2902. <div class="flex items-center justify-between pt-1">
  2903. <label class="flex items-center space-x-2 text-slate-300">
  2904. <input type="checkbox" id="eoip-modal-clampmss" checked class="rounded bg-slate-800 border-slate-700 text-emerald-600">
  2905. <span>Clamp TCP MSS (PMTUD protection)</span>
  2906. </label>
  2907. <label class="flex items-center space-x-2 text-slate-300">
  2908. <input type="checkbox" id="eoip-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-600">
  2909. <span>Disabled</span>
  2910. </label>
  2911. </div>
  2912. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2913. <button type="button" onclick="closeEoIPModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2914. <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>
  2915. </div>
  2916. </form>
  2917. </div>
  2918. </div>
  2919. <!-- ================= MODAL: ADD/EDIT PPP SECRET (USER) ================= -->
  2920. <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">
  2921. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2922. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2923. <div>
  2924. <h3 id="secret-modal-title" class="text-sm font-bold text-white">Add PPP Secret</h3>
  2925. <p class="text-[11px] text-slate-400">User account for PPPoE, PPTP, and L2TP authentication</p>
  2926. </div>
  2927. <button onclick="closePPPSecretModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2928. </div>
  2929. <form onsubmit="submitSavePPPSecret(event)" class="p-6 space-y-4 text-xs font-sans">
  2930. <input type="hidden" id="secret-modal-id">
  2931. <div class="grid grid-cols-2 gap-4">
  2932. <div>
  2933. <label class="block font-semibold text-slate-300 mb-1.5">Username (Name) *</label>
  2934. <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">
  2935. </div>
  2936. <div>
  2937. <label class="block font-semibold text-slate-300 mb-1.5">Password *</label>
  2938. <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">
  2939. </div>
  2940. </div>
  2941. <div class="grid grid-cols-2 gap-4">
  2942. <div>
  2943. <label class="block font-semibold text-slate-300 mb-1.5">Service</label>
  2944. <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">
  2945. <option value="any">any</option>
  2946. <option value="pppoe">pppoe</option>
  2947. <option value="pptp">pptp</option>
  2948. <option value="l2tp">l2tp</option>
  2949. </select>
  2950. </div>
  2951. <div>
  2952. <label class="block font-semibold text-slate-300 mb-1.5">Profile</label>
  2953. <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>
  2954. </div>
  2955. </div>
  2956. <div class="grid grid-cols-2 gap-4">
  2957. <div>
  2958. <label class="block font-semibold text-slate-300 mb-1.5">Local Address (Optional)</label>
  2959. <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">
  2960. </div>
  2961. <div>
  2962. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (Optional Static IP)</label>
  2963. <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">
  2964. </div>
  2965. </div>
  2966. <div>
  2967. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  2968. <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">
  2969. </div>
  2970. <div class="flex items-center space-x-2 pt-1">
  2971. <input type="checkbox" id="secret-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-600">
  2972. <label for="secret-modal-disabled" class="text-slate-300">Disabled</label>
  2973. </div>
  2974. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2975. <button type="button" onclick="closePPPSecretModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2976. <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>
  2977. </div>
  2978. </form>
  2979. </div>
  2980. </div>
  2981. <!-- ================= MODAL: ADD/EDIT PPP PROFILE ================= -->
  2982. <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">
  2983. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2984. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2985. <div>
  2986. <h3 id="profile-modal-title" class="text-sm font-bold text-white">Add PPP Profile</h3>
  2987. <p class="text-[11px] text-slate-400">IP pool and encryption settings for PPP servers</p>
  2988. </div>
  2989. <button onclick="closePPPProfileModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2990. </div>
  2991. <form onsubmit="submitSavePPPProfile(event)" class="p-6 space-y-4 text-xs font-sans">
  2992. <input type="hidden" id="profile-modal-id">
  2993. <div>
  2994. <label class="block font-semibold text-slate-300 mb-1.5">Profile Name *</label>
  2995. <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">
  2996. </div>
  2997. <div class="grid grid-cols-2 gap-4">
  2998. <div>
  2999. <label class="block font-semibold text-slate-300 mb-1.5">Local Address *</label>
  3000. <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">
  3001. </div>
  3002. <div>
  3003. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (Pool) *</label>
  3004. <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">
  3005. </div>
  3006. </div>
  3007. <div class="grid grid-cols-2 gap-4">
  3008. <div>
  3009. <label class="block font-semibold text-slate-300 mb-1.5">DNS Servers</label>
  3010. <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">
  3011. </div>
  3012. <div>
  3013. <label class="block font-semibold text-slate-300 mb-1.5">Use Encryption</label>
  3014. <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">
  3015. <option value="no">no</option>
  3016. <option value="yes">yes</option>
  3017. <option value="required" selected>required (MPPE-128)</option>
  3018. </select>
  3019. </div>
  3020. </div>
  3021. <div>
  3022. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3023. <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">
  3024. </div>
  3025. <div class="flex items-center space-x-2 pt-1">
  3026. <input type="checkbox" id="profile-modal-onlyone" checked class="rounded bg-slate-800 border-slate-700 text-violet-600">
  3027. <label for="profile-modal-onlyone" class="text-slate-300">Only One session per user account</label>
  3028. </div>
  3029. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3030. <button type="button" onclick="closePPPProfileModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3031. <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>
  3032. </div>
  3033. </form>
  3034. </div>
  3035. </div>
  3036. <!-- ================= MODAL: IPSEC ROADWARRIOR SERVER ================= -->
  3037. <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">
  3038. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3039. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3040. <div>
  3041. <h3 class="text-sm font-bold text-white">IPSec (IKEv2) Roadwarrior Server</h3>
  3042. <p class="text-[11px] text-slate-400">Mobile VPN server for Windows, macOS, iOS, Android clients</p>
  3043. </div>
  3044. <button onclick="closeIPSecServerModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3045. </div>
  3046. <form onsubmit="submitSaveIPSecServer(event)" class="p-6 space-y-4 text-xs font-sans">
  3047. <div class="flex items-center justify-between border-b border-slate-800 pb-3">
  3048. <span class="text-slate-300 font-semibold">Server State</span>
  3049. <div class="flex items-center gap-3">
  3050. <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>
  3051. <label class="relative inline-flex items-center cursor-pointer">
  3052. <input type="checkbox" id="modal-ipsec-server-enabled" class="sr-only peer">
  3053. <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>
  3054. </label>
  3055. </div>
  3056. </div>
  3057. <div>
  3058. <label class="block font-semibold text-slate-300 mb-1.5">Pre-Shared Key (PSK) *</label>
  3059. <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">
  3060. </div>
  3061. <div class="grid grid-cols-2 gap-4">
  3062. <div>
  3063. <label class="block font-semibold text-slate-300 mb-1.5">Virtual IP Pool (CIDR) *</label>
  3064. <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">
  3065. </div>
  3066. <div>
  3067. <label class="block font-semibold text-slate-300 mb-1.5">DNS Servers</label>
  3068. <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">
  3069. </div>
  3070. </div>
  3071. <div>
  3072. <label class="block font-semibold text-slate-300 mb-1.5">Local Traffic Selector (Subnet)</label>
  3073. <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">
  3074. </div>
  3075. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3076. <button type="button" onclick="closeIPSecServerModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3077. <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>
  3078. </div>
  3079. </form>
  3080. </div>
  3081. </div>
  3082. <!-- ================= MODAL: WIREGUARD CLIENT CONFIG VIEWER ================= -->
  3083. <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">
  3084. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3085. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3086. <div>
  3087. <h3 class="text-sm font-bold text-white">WireGuard Client Configuration</h3>
  3088. <p class="text-[11px] text-slate-400">Import this .conf into WireGuard on iOS, Android, macOS or Windows</p>
  3089. </div>
  3090. <button onclick="closeWGClientConfModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3091. </div>
  3092. <div class="p-6 space-y-4">
  3093. <div>
  3094. <label class="block text-xs font-semibold text-slate-300 mb-1.5">WireGuard Client Profile (.conf)</label>
  3095. <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>
  3096. </div>
  3097. <div class="flex justify-between items-center pt-2">
  3098. <span class="text-[11px] text-slate-500">Ready for instant import</span>
  3099. <div class="space-x-2">
  3100. <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">
  3101. Copy Config
  3102. </button>
  3103. <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">
  3104. Download .conf
  3105. </button>
  3106. </div>
  3107. </div>
  3108. </div>
  3109. </div>
  3110. </div>
  3111. <!-- ================= MODAL: BGP INSTANCE SETTINGS ================= -->
  3112. <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">
  3113. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3114. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3115. <div>
  3116. <h3 class="text-sm font-bold text-white">BGP Instance Settings (/routing bgp instance)</h3>
  3117. <p class="text-[11px] text-slate-400">Configure global Autonomous System and route redistribution</p>
  3118. </div>
  3119. <button onclick="closeBgpInstanceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3120. </div>
  3121. <form id="bgp-instance-form" onsubmit="submitBgpInstance(event)" class="p-6 space-y-4 text-xs">
  3122. <div class="flex items-center justify-between p-3 rounded-xl bg-slate-800/60 border border-slate-700/60">
  3123. <div>
  3124. <div class="font-semibold text-white">Enable BGP Routing</div>
  3125. <div class="text-[11px] text-slate-400">Run FRRouting bgpd service for dynamic exterior gateway routing</div>
  3126. </div>
  3127. <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">
  3128. </div>
  3129. <div class="grid grid-cols-2 gap-4">
  3130. <div>
  3131. <label class="block font-semibold text-slate-300 mb-1.5">Autonomous System (AS) *</label>
  3132. <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">
  3133. </div>
  3134. <div>
  3135. <label class="block font-semibold text-slate-300 mb-1.5">Router ID</label>
  3136. <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">
  3137. </div>
  3138. </div>
  3139. <div class="grid grid-cols-2 gap-4">
  3140. <div>
  3141. <label class="block font-semibold text-slate-300 mb-1.5">Keepalive Time (s)</label>
  3142. <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">
  3143. </div>
  3144. <div>
  3145. <label class="block font-semibold text-slate-300 mb-1.5">Hold Time (s)</label>
  3146. <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">
  3147. </div>
  3148. </div>
  3149. <div class="border-t border-slate-800 pt-3">
  3150. <label class="block font-semibold text-slate-300 mb-2">Redistribute Routes into BGP</label>
  3151. <div class="space-y-2">
  3152. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3153. <input type="checkbox" id="modal-bgp-redist-conn" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3154. <span>Redistribute Connected Subnets</span>
  3155. </label>
  3156. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3157. <input type="checkbox" id="modal-bgp-redist-static" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3158. <span>Redistribute Static Routes</span>
  3159. </label>
  3160. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3161. <input type="checkbox" id="modal-bgp-redist-ospf" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3162. <span>Redistribute OSPF Routes</span>
  3163. </label>
  3164. </div>
  3165. </div>
  3166. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3167. <button type="button" onclick="closeBgpInstanceModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3168. <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>
  3169. </div>
  3170. </form>
  3171. </div>
  3172. </div>
  3173. <!-- ================= MODAL: BGP PEER ================= -->
  3174. <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">
  3175. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3176. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3177. <div>
  3178. <h3 id="bgp-peer-modal-title" class="text-sm font-bold text-white">Add BGP Peer Connection</h3>
  3179. <p class="text-[11px] text-slate-400">Establish eBGP / iBGP session with remote router</p>
  3180. </div>
  3181. <button onclick="closeBgpPeerModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3182. </div>
  3183. <form id="bgp-peer-form" onsubmit="submitBgpPeer(event)" class="p-6 space-y-4 text-xs">
  3184. <input type="hidden" id="modal-bgp-peer-id">
  3185. <div>
  3186. <label class="block font-semibold text-slate-300 mb-1.5">Connection Name *</label>
  3187. <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">
  3188. </div>
  3189. <div class="grid grid-cols-2 gap-4">
  3190. <div>
  3191. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (IP) *</label>
  3192. <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">
  3193. </div>
  3194. <div>
  3195. <label class="block font-semibold text-slate-300 mb-1.5">Remote AS *</label>
  3196. <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">
  3197. </div>
  3198. </div>
  3199. <div class="grid grid-cols-2 gap-4">
  3200. <div>
  3201. <label class="block font-semibold text-slate-300 mb-1.5">Local Address (Update Source)</label>
  3202. <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">
  3203. </div>
  3204. <div>
  3205. <label class="block font-semibold text-slate-300 mb-1.5">MD5 Password (BGP Auth)</label>
  3206. <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">
  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-bgp-peer-multihop" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3212. <span>eBGP Multi-hop</span>
  3213. </label>
  3214. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3215. <input type="checkbox" id="modal-bgp-peer-nexthop-self" checked class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3216. <span>Next-hop Self</span>
  3217. </label>
  3218. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3219. <input type="checkbox" id="modal-bgp-peer-passive" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3220. <span>Passive Mode</span>
  3221. </label>
  3222. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3223. <input type="checkbox" id="modal-bgp-peer-disabled" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3224. <span>Disabled (X)</span>
  3225. </label>
  3226. </div>
  3227. <div>
  3228. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3229. <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">
  3230. </div>
  3231. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3232. <button type="button" onclick="closeBgpPeerModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3233. <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>
  3234. </div>
  3235. </form>
  3236. </div>
  3237. </div>
  3238. <!-- ================= MODAL: BGP NETWORK ================= -->
  3239. <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">
  3240. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3241. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3242. <h3 id="bgp-network-modal-title" class="text-sm font-bold text-white">Advertise BGP Network</h3>
  3243. <button onclick="closeBgpNetworkModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3244. </div>
  3245. <form id="bgp-network-form" onsubmit="submitBgpNetwork(event)" class="p-6 space-y-4 text-xs">
  3246. <input type="hidden" id="modal-bgp-net-id">
  3247. <div>
  3248. <label class="block font-semibold text-slate-300 mb-1.5">Network Prefix (CIDR) *</label>
  3249. <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">
  3250. </div>
  3251. <div>
  3252. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3253. <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">
  3254. </div>
  3255. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3256. <input type="checkbox" id="modal-bgp-net-disabled" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3257. <span>Disabled</span>
  3258. </label>
  3259. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3260. <button type="button" onclick="closeBgpNetworkModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3261. <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>
  3262. </div>
  3263. </form>
  3264. </div>
  3265. </div>
  3266. <!-- ================= MODAL: OSPF INSTANCE SETTINGS ================= -->
  3267. <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">
  3268. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3269. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3270. <div>
  3271. <h3 class="text-sm font-bold text-white">OSPF Instance Settings (/routing ospf instance)</h3>
  3272. <p class="text-[11px] text-slate-400">Configure OSPFv2 link-state routing daemon and redistributions</p>
  3273. </div>
  3274. <button onclick="closeOspfInstanceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3275. </div>
  3276. <form id="ospf-instance-form" onsubmit="submitOspfInstance(event)" class="p-6 space-y-4 text-xs">
  3277. <div class="flex items-center justify-between p-3 rounded-xl bg-slate-800/60 border border-slate-700/60">
  3278. <div>
  3279. <div class="font-semibold text-white">Enable OSPF Routing</div>
  3280. <div class="text-[11px] text-slate-400">Run FRRouting ospfd service for dynamic interior gateway routing</div>
  3281. </div>
  3282. <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">
  3283. </div>
  3284. <div class="grid grid-cols-2 gap-4">
  3285. <div>
  3286. <label class="block font-semibold text-slate-300 mb-1.5">Router ID</label>
  3287. <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">
  3288. </div>
  3289. <div>
  3290. <label class="block font-semibold text-slate-300 mb-1.5">Default Metric</label>
  3291. <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">
  3292. </div>
  3293. </div>
  3294. <div class="border-t border-slate-800 pt-3">
  3295. <label class="block font-semibold text-slate-300 mb-2">Redistribute Routes into OSPF</label>
  3296. <div class="space-y-2">
  3297. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3298. <input type="checkbox" id="modal-ospf-redist-conn" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3299. <span>Redistribute Connected Subnets</span>
  3300. </label>
  3301. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3302. <input type="checkbox" id="modal-ospf-redist-static" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3303. <span>Redistribute Static Routes</span>
  3304. </label>
  3305. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3306. <input type="checkbox" id="modal-ospf-redist-bgp" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3307. <span>Redistribute BGP Routes</span>
  3308. </label>
  3309. </div>
  3310. </div>
  3311. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3312. <button type="button" onclick="closeOspfInstanceModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3313. <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>
  3314. </div>
  3315. </form>
  3316. </div>
  3317. </div>
  3318. <!-- ================= MODAL: OSPF AREA ================= -->
  3319. <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">
  3320. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3321. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3322. <h3 id="ospf-area-modal-title" class="text-sm font-bold text-white">Add OSPF Area</h3>
  3323. <button onclick="closeOspfAreaModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3324. </div>
  3325. <form id="ospf-area-form" onsubmit="submitOspfArea(event)" class="p-6 space-y-4 text-xs">
  3326. <input type="hidden" id="modal-ospf-area-id">
  3327. <div>
  3328. <label class="block font-semibold text-slate-300 mb-1.5">Area Name *</label>
  3329. <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">
  3330. </div>
  3331. <div class="grid grid-cols-2 gap-4">
  3332. <div>
  3333. <label class="block font-semibold text-slate-300 mb-1.5">Area ID *</label>
  3334. <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">
  3335. </div>
  3336. <div>
  3337. <label class="block font-semibold text-slate-300 mb-1.5">Area Type</label>
  3338. <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">
  3339. <option value="default">Default / Normal</option>
  3340. <option value="stub">Stub</option>
  3341. <option value="nssa">NSSA</option>
  3342. </select>
  3343. </div>
  3344. </div>
  3345. <div>
  3346. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3347. <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">
  3348. </div>
  3349. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3350. <button type="button" onclick="closeOspfAreaModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3351. <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>
  3352. </div>
  3353. </form>
  3354. </div>
  3355. </div>
  3356. <!-- ================= MODAL: OSPF INTERFACE ================= -->
  3357. <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">
  3358. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3359. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3360. <div>
  3361. <h3 id="ospf-interface-modal-title" class="text-sm font-bold text-white">Add OSPF Interface</h3>
  3362. <p class="text-[11px] text-slate-400">Configure OSPF link parameters on a network subnet or interface</p>
  3363. </div>
  3364. <button onclick="closeOspfInterfaceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3365. </div>
  3366. <form id="ospf-interface-form" onsubmit="submitOspfInterface(event)" class="p-6 space-y-4 text-xs">
  3367. <input type="hidden" id="modal-ospf-iface-id">
  3368. <div class="grid grid-cols-2 gap-4">
  3369. <div>
  3370. <label class="block font-semibold text-slate-300 mb-1.5">Subnet Network (CIDR) *</label>
  3371. <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">
  3372. </div>
  3373. <div>
  3374. <label class="block font-semibold text-slate-300 mb-1.5">OSPF Area *</label>
  3375. <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">
  3376. </div>
  3377. </div>
  3378. <div class="grid grid-cols-2 gap-4">
  3379. <div>
  3380. <label class="block font-semibold text-slate-300 mb-1.5">Interface (Optional Device)</label>
  3381. <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">
  3382. <option value="">Any matching interface</option>
  3383. </select>
  3384. </div>
  3385. <div>
  3386. <label class="block font-semibold text-slate-300 mb-1.5">Metric Cost</label>
  3387. <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">
  3388. </div>
  3389. </div>
  3390. <div class="grid grid-cols-3 gap-3">
  3391. <div>
  3392. <label class="block font-semibold text-slate-300 mb-1.5">Priority</label>
  3393. <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">
  3394. </div>
  3395. <div>
  3396. <label class="block font-semibold text-slate-300 mb-1.5">Hello (s)</label>
  3397. <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">
  3398. </div>
  3399. <div>
  3400. <label class="block font-semibold text-slate-300 mb-1.5">Dead (s)</label>
  3401. <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">
  3402. </div>
  3403. </div>
  3404. <div class="grid grid-cols-2 gap-4">
  3405. <div>
  3406. <label class="block font-semibold text-slate-300 mb-1.5">Authentication Type</label>
  3407. <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">
  3408. <option value="none">None</option>
  3409. <option value="simple">Simple Password</option>
  3410. <option value="md5">MD5 Cryptographic</option>
  3411. </select>
  3412. </div>
  3413. <div>
  3414. <label class="block font-semibold text-slate-300 mb-1.5">Auth Secret Key</label>
  3415. <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">
  3416. </div>
  3417. </div>
  3418. <div class="grid grid-cols-2 gap-3 p-3 rounded-xl bg-slate-800/40 border border-slate-700/50">
  3419. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3420. <input type="checkbox" id="modal-ospf-iface-passive" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3421. <span>Passive (Do not form adjs)</span>
  3422. </label>
  3423. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3424. <input type="checkbox" id="modal-ospf-iface-disabled" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3425. <span>Disabled (X)</span>
  3426. </label>
  3427. </div>
  3428. <div>
  3429. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3430. <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">
  3431. </div>
  3432. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3433. <button type="button" onclick="closeOspfInterfaceModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3434. <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>
  3435. </div>
  3436. </form>
  3437. </div>
  3438. </div>
  3439. <script src="app.js?v=2.6"></script>
  3440. </body>
  3441. </html>