index.html 282 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373
  1. <!DOCTYPE html>
  2. <html lang="el" class="dark">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Proxmox RouterOS | Network Appliance</title>
  7. <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2310b981'><path d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5'/></svg>">
  8. <script src="https://cdn.tailwindcss.com"></script>
  9. <script>
  10. tailwind.config = {
  11. darkMode: 'class',
  12. theme: {
  13. extend: {
  14. colors: {
  15. brand: {
  16. 50: '#ecfdf5',
  17. 100: '#d1fae5',
  18. 400: '#34d399',
  19. 500: '#10b981',
  20. 600: '#059669',
  21. 700: '#047857',
  22. 800: '#065f46',
  23. 900: '#064e3b',
  24. }
  25. }
  26. }
  27. }
  28. }
  29. </script>
  30. <link rel="stylesheet" href="style.css">
  31. </head>
  32. <body class="bg-[#0b101e] text-slate-100 min-h-screen flex flex-col font-sans antialiased selection:bg-brand-500 selection:text-white">
  33. <!-- Toast Notification Container -->
  34. <div id="toast-container" class="fixed top-5 right-5 z-50 flex flex-col space-y-2 pointer-events-none"></div>
  35. <!-- Main Layout -->
  36. <div class="flex flex-1 overflow-hidden h-screen">
  37. <!-- Sidebar -->
  38. <aside id="sidebar" class="w-64 bg-[#0f172a]/95 border-r border-slate-800 flex flex-col flex-shrink-0 transition-all duration-300 z-30">
  39. <!-- Brand Header -->
  40. <div class="h-16 flex items-center px-5 border-b border-slate-800 justify-between">
  41. <div class="flex items-center space-x-3">
  42. <div class="w-9 h-9 rounded-xl bg-gradient-to-tr from-brand-600 to-cyan-500 flex items-center justify-center shadow-lg shadow-brand-500/20 text-white font-bold">
  43. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  44. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
  45. </svg>
  46. </div>
  47. <div>
  48. <div class="font-bold text-sm tracking-wide text-white flex items-center gap-1.5">
  49. <span>RouterOS</span>
  50. <span class="text-[10px] bg-brand-500/20 text-brand-400 font-mono px-1.5 py-0.5 rounded border border-brand-500/30">LXC</span>
  51. </div>
  52. <div class="text-[11px] text-slate-400">Proxmox Gateway</div>
  53. </div>
  54. </div>
  55. </div>
  56. <!-- Live Health Pill -->
  57. <div class="px-4 py-3 border-b border-slate-800/60 bg-slate-900/40">
  58. <div class="flex items-center justify-between text-xs mb-1.5">
  59. <span class="text-slate-400 font-medium">Gateway Status</span>
  60. <span class="flex items-center text-emerald-400 font-medium text-[11px]">
  61. <span class="relative flex h-2 w-2 mr-1.5">
  62. <span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"></span>
  63. <span class="relative inline-flex rounded-full h-2 w-2 bg-emerald-500"></span>
  64. </span>
  65. Online
  66. </span>
  67. </div>
  68. <div class="text-[11px] text-slate-400 font-mono truncate" id="side-gateway-ip">GW: Scanning...</div>
  69. </div>
  70. <!-- Navigation Menu -->
  71. <nav class="flex-1 px-3 py-3 space-y-1 overflow-y-auto">
  72. <!-- CATEGORY: OVERVIEW -->
  73. <div class="px-3 pt-2 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">Overview</div>
  74. <a href="#dashboard" onclick="navigate('dashboard')" id="nav-dashboard"
  75. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group bg-brand-500/10 text-brand-400 border border-brand-500/20">
  76. <div class="flex items-center space-x-2.5">
  77. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  78. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z" />
  79. </svg>
  80. <span>Dashboard</span>
  81. </div>
  82. </a>
  83. <!-- CATEGORY: NETWORKING -->
  84. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">Networking</div>
  85. <a href="#interfaces" onclick="navigate('interfaces')" id="nav-interfaces"
  86. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  87. <div class="flex items-center space-x-2.5">
  88. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  89. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
  90. </svg>
  91. <span>Interfaces</span>
  92. </div>
  93. <span id="badge-ifaces-count" class="text-[10px] bg-slate-800 text-slate-300 px-1.5 py-0.2 rounded-full font-mono">0</span>
  94. </a>
  95. <a href="#bridge" onclick="navigate('bridge')" id="nav-bridge"
  96. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  97. <div class="flex items-center space-x-2.5">
  98. <svg class="w-4 h-4 text-sky-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  99. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M3 14h18M5 14v4a2 2 0 002 2h2a2 2 0 002-2v-4m6 0v4a2 2 0 002 2h2a2 2 0 002-2v-4M4 10V6a2 2 0 012-2h12a2 2 0 012 2v4" />
  100. </svg>
  101. <span>Bridge</span>
  102. </div>
  103. <span id="badge-bridge-count" class="text-[10px] bg-sky-950 text-sky-300 border border-sky-800/40 px-1.5 py-0.2 rounded-full font-mono">0</span>
  104. </a>
  105. <a href="#vlans" onclick="navigate('vlans')" id="nav-vlans"
  106. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  107. <div class="flex items-center space-x-2.5">
  108. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  109. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z" />
  110. </svg>
  111. <span>VLANs (802.1Q)</span>
  112. </div>
  113. <span id="badge-vlans-count" class="text-[10px] bg-cyan-950 text-cyan-400 border border-cyan-800/50 px-1.5 py-0.2 rounded-full font-mono">0</span>
  114. </a>
  115. <a href="#firewall" onclick="navigate('firewall')" id="nav-firewall"
  116. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  117. <div class="flex items-center space-x-2.5">
  118. <svg class="w-4 h-4 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  119. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z" />
  120. </svg>
  121. <span>Firewall</span>
  122. </div>
  123. <span id="badge-firewall-count" class="text-[10px] bg-emerald-950 text-emerald-400 border border-emerald-800/50 px-1.5 py-0.2 rounded-full font-mono">0</span>
  124. </a>
  125. <!-- CATEGORY: ROUTING -->
  126. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">Routing</div>
  127. <a href="#routes" onclick="navigate('routes')" id="nav-routes"
  128. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  129. <div class="flex items-center space-x-2.5">
  130. <svg class="w-4 h-4 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  131. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7" />
  132. </svg>
  133. <span>Routes & Policy</span>
  134. </div>
  135. <span id="badge-routes-count" class="text-[10px] bg-slate-800 text-slate-300 px-1.5 py-0.2 rounded-full font-mono">0</span>
  136. </a>
  137. <a href="#bgp" onclick="navigate('bgp')" id="nav-bgp"
  138. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  139. <div class="flex items-center space-x-2.5">
  140. <svg class="w-4 h-4 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  141. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  142. </svg>
  143. <span>BGP (/routing bgp)</span>
  144. </div>
  145. <div class="flex items-center gap-1.5">
  146. <span id="badge-bgp-dot" class="w-2 h-2 rounded-full bg-slate-600" title="BGP Status"></span>
  147. <span id="badge-bgp-count" class="text-[10px] bg-purple-950 text-purple-300 border border-purple-800/40 px-1.5 py-0.2 rounded-full font-mono">0</span>
  148. </div>
  149. </a>
  150. <a href="#ospf" onclick="navigate('ospf')" id="nav-ospf"
  151. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  152. <div class="flex items-center space-x-2.5">
  153. <svg class="w-4 h-4 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  154. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
  155. </svg>
  156. <span>OSPF (/routing ospf)</span>
  157. </div>
  158. <div class="flex items-center gap-1.5">
  159. <span id="badge-ospf-dot" class="w-2 h-2 rounded-full bg-slate-600" title="OSPF Status"></span>
  160. <span id="badge-ospf-count" class="text-[10px] bg-indigo-950 text-indigo-300 border border-indigo-800/40 px-1.5 py-0.2 rounded-full font-mono">0</span>
  161. </div>
  162. </a>
  163. <!-- CATEGORY: WAN & ACCESS -->
  164. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">WAN & Access</div>
  165. <a href="#pppoe" onclick="navigate('pppoe')" id="nav-pppoe"
  166. 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">
  167. <div class="flex items-center space-x-2.5">
  168. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  169. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
  170. </svg>
  171. <span>PPPoE Client</span>
  172. </div>
  173. <span id="badge-pppoe-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  174. </a>
  175. <!-- CATEGORY: VPN & TUNNELS -->
  176. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">VPN & Tunnels</div>
  177. <a href="#wireguard" onclick="navigate('wireguard')" id="nav-wireguard"
  178. 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">
  179. <div class="flex items-center space-x-2.5">
  180. <svg class="w-4 h-4 text-rose-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  181. <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" />
  182. </svg>
  183. <span>WireGuard</span>
  184. </div>
  185. <span id="badge-wg-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  186. </a>
  187. <a href="#ipsec" onclick="navigate('ipsec')" id="nav-ipsec"
  188. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  189. <div class="flex items-center space-x-2.5">
  190. <svg class="w-4 h-4 text-amber-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  191. <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" />
  192. </svg>
  193. <span>IPSec (IKEv2)</span>
  194. </div>
  195. <span id="badge-ipsec-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  196. </a>
  197. <a href="#l2tp" onclick="navigate('l2tp')" id="nav-l2tp"
  198. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  199. <div class="flex items-center space-x-2.5">
  200. <svg class="w-4 h-4 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  201. <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" />
  202. </svg>
  203. <span>L2TP Client</span>
  204. </div>
  205. <span id="badge-l2tp-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  206. </a>
  207. <a href="#pptp" onclick="navigate('pptp')" id="nav-pptp"
  208. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  209. <div class="flex items-center space-x-2.5">
  210. <svg class="w-4 h-4 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  211. <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" />
  212. </svg>
  213. <span>PPTP Client</span>
  214. </div>
  215. <span id="badge-pptp-status" class="w-2 h-2 rounded-full bg-slate-600"></span>
  216. </a>
  217. <a href="#ppp" onclick="navigate('ppp')" id="nav-ppp"
  218. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  219. <div class="flex items-center space-x-2.5">
  220. <svg class="w-4 h-4 text-violet-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  221. <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" />
  222. </svg>
  223. <span>PPP (Servers & Users)</span>
  224. </div>
  225. <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>
  226. </a>
  227. <a href="#eoip" onclick="navigate('eoip')" id="nav-eoip"
  228. class="nav-link flex items-center justify-between px-3 py-2 rounded-lg text-xs font-medium transition-all group text-slate-300 hover:bg-slate-800/80 hover:text-white">
  229. <div class="flex items-center space-x-2.5">
  230. <svg class="w-4 h-4 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  231. <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" />
  232. </svg>
  233. <span>EoIP Tunnels</span>
  234. </div>
  235. <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>
  236. </a>
  237. <!-- CATEGORY: SYSTEM -->
  238. <div class="px-3 pt-3 pb-1 text-[10px] font-bold text-slate-500 uppercase tracking-wider">System</div>
  239. <a href="#persistence" onclick="navigate('persistence')" id="nav-persistence"
  240. 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">
  241. <div class="flex items-center space-x-2.5">
  242. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  243. <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" />
  244. </svg>
  245. <span>Debian Config</span>
  246. </div>
  247. <span class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.2 rounded">.cfg</span>
  248. </a>
  249. </nav>
  250. <!-- Sidebar Footer: Host System Metrics -->
  251. <div class="p-4 border-t border-slate-800/80 bg-slate-900/60">
  252. <div class="flex items-center justify-between text-xs text-slate-400 mb-2">
  253. <span class="truncate font-mono" id="side-hostname">debian-lxc</span>
  254. <span class="text-[11px] text-slate-500" id="side-uptime">0h 0m</span>
  255. </div>
  256. <div class="mb-2">
  257. <div class="flex justify-between text-[11px] text-slate-400 mb-1">
  258. <span>CPU Usage</span>
  259. <span id="side-cpu-val" class="font-mono text-slate-300">0.0%</span>
  260. </div>
  261. <div class="w-full bg-slate-800 h-1.5 rounded-full overflow-hidden">
  262. <div id="side-cpu-bar" class="bg-brand-500 h-full rounded-full transition-all duration-500" style="width: 5%"></div>
  263. </div>
  264. </div>
  265. <div>
  266. <div class="flex justify-between text-[11px] text-slate-400 mb-1">
  267. <span>RAM Usage</span>
  268. <span id="side-ram-val" class="font-mono text-slate-300">0%</span>
  269. </div>
  270. <div class="w-full bg-slate-800 h-1.5 rounded-full overflow-hidden">
  271. <div id="side-ram-bar" class="bg-cyan-500 h-full rounded-full transition-all duration-500" style="width: 25%"></div>
  272. </div>
  273. </div>
  274. </div>
  275. </aside>
  276. <!-- Main Content Area -->
  277. <div class="flex-1 flex flex-col min-w-0 overflow-hidden">
  278. <!-- Top Navbar -->
  279. <header class="h-16 bg-[#0f172a]/80 backdrop-blur border-b border-slate-800 flex items-center justify-between px-6 z-20">
  280. <div class="flex items-center space-x-4">
  281. <button onclick="toggleSidebar()" class="lg:hidden p-2 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800">
  282. <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  283. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
  284. </svg>
  285. </button>
  286. <div>
  287. <h1 id="page-title" class="text-lg font-bold text-white tracking-tight">Dashboard Overview</h1>
  288. <p id="page-subtitle" class="text-xs text-slate-400">Live router performance and interface management</p>
  289. </div>
  290. </div>
  291. <div class="flex items-center space-x-3">
  292. <!-- Active Tunnels Pill -->
  293. <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">
  294. <span id="tunnels-dot" class="w-2 h-2 rounded-full bg-slate-500"></span>
  295. <span id="tunnels-label" class="font-mono text-[11px]">0 Active VPN Tunnels</span>
  296. </div>
  297. <!-- Quick Actions -->
  298. <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">
  299. <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  300. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
  301. </svg>
  302. <span>+ Create VLAN</span>
  303. </button>
  304. <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">
  305. <svg id="refresh-spinner" class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  306. <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" />
  307. </svg>
  308. </button>
  309. </div>
  310. </header>
  311. <!-- Scrollable Main Viewport -->
  312. <main class="flex-1 overflow-y-auto p-6 space-y-6">
  313. <!-- ================= SECTION: DASHBOARD ================= -->
  314. <section id="section-dashboard" class="space-y-6">
  315. <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
  316. <div class="bg-slate-900/80 border border-slate-800 rounded-xl p-5 relative overflow-hidden group hover:border-slate-700 transition">
  317. <div class="flex items-center justify-between mb-3">
  318. <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">Interfaces</span>
  319. <div class="p-2 bg-brand-500/10 text-brand-400 rounded-lg">
  320. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  321. <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" />
  322. </svg>
  323. </div>
  324. </div>
  325. <div class="flex items-baseline space-x-2">
  326. <span id="stat-ifaces-up" class="text-2xl font-bold text-white">0</span>
  327. <span class="text-xs text-slate-400">UP /</span>
  328. <span id="stat-ifaces-total" class="text-sm font-semibold text-slate-400">0 Total</span>
  329. </div>
  330. <div class="mt-2 text-xs text-slate-400 flex items-center">
  331. <span id="stat-ifaces-down" class="text-rose-400 font-medium mr-1.5">0 DOWN</span>
  332. <span class="text-slate-500">•</span>
  333. <span class="text-slate-400 ml-1.5">Plug & Play</span>
  334. </div>
  335. </div>
  336. <div class="bg-slate-900/80 border border-slate-800 rounded-xl p-5 relative overflow-hidden group hover:border-slate-700 transition">
  337. <div class="flex items-center justify-between mb-3">
  338. <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">802.1Q VLANs</span>
  339. <div class="p-2 bg-cyan-500/10 text-cyan-400 rounded-lg">
  340. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  341. <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" />
  342. </svg>
  343. </div>
  344. </div>
  345. <div class="flex items-baseline space-x-2">
  346. <span id="stat-vlans-count" class="text-2xl font-bold text-cyan-400">0</span>
  347. <span class="text-xs text-slate-400">Virtual Subnets</span>
  348. </div>
  349. <div class="mt-2 text-xs text-slate-400">Kernel Tagging Active</div>
  350. </div>
  351. <div class="bg-slate-900/80 border border-slate-800 rounded-xl p-5 relative overflow-hidden group hover:border-slate-700 transition">
  352. <div class="flex items-center justify-between mb-3">
  353. <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">WAN & VPN Services</span>
  354. <div class="p-2 bg-violet-500/10 text-violet-400 rounded-lg">
  355. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  356. <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" />
  357. </svg>
  358. </div>
  359. </div>
  360. <div class="flex items-baseline space-x-2">
  361. <span id="stat-vpn-active" class="text-2xl font-bold text-violet-400">0</span>
  362. <span class="text-xs text-slate-400">Connected Tunnels</span>
  363. </div>
  364. <div class="mt-2 text-[11px] text-slate-400 flex items-center gap-1.5 font-mono">
  365. <span>WG • IPSec • PPPoE • L2TP</span>
  366. </div>
  367. </div>
  368. <div class="bg-slate-900/80 border border-slate-800 rounded-xl p-5 relative overflow-hidden group hover:border-slate-700 transition">
  369. <div class="flex items-center justify-between mb-3">
  370. <span class="text-xs font-semibold text-slate-400 uppercase tracking-wider">Live Traffic</span>
  371. <div class="p-2 bg-amber-500/10 text-amber-400 rounded-lg">
  372. <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  373. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  374. </svg>
  375. </div>
  376. </div>
  377. <div class="space-y-1">
  378. <div class="flex items-center justify-between text-xs">
  379. <span class="text-slate-400 flex items-center gap-1"><span class="text-emerald-400 font-bold">↓</span> RX:</span>
  380. <span id="stat-traffic-rx" class="font-mono font-semibold text-emerald-400">0 B/s</span>
  381. </div>
  382. <div class="flex items-center justify-between text-xs">
  383. <span class="text-slate-400 flex items-center gap-1"><span class="text-cyan-400 font-bold">↑</span> TX:</span>
  384. <span id="stat-traffic-tx" class="font-mono font-semibold text-cyan-400">0 B/s</span>
  385. </div>
  386. </div>
  387. </div>
  388. </div>
  389. <!-- Port Matrix -->
  390. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  391. <div class="flex items-center justify-between mb-4">
  392. <div>
  393. <h3 class="text-sm font-bold text-white uppercase tracking-wider flex items-center gap-2">
  394. <span>Hardware & Virtual Port Matrix</span>
  395. <span class="text-[10px] bg-slate-800 text-slate-400 font-normal px-2 py-0.5 rounded-full">Live Hardware State</span>
  396. </h3>
  397. </div>
  398. </div>
  399. <div id="port-matrix" class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6 gap-3"></div>
  400. </div>
  401. <!-- Quick Overview Tables -->
  402. <div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
  403. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  404. <div class="flex items-center justify-between mb-4">
  405. <h3 class="text-sm font-bold text-white">Interfaces Overview</h3>
  406. <button onclick="navigate('interfaces')" class="text-xs text-brand-400 hover:text-brand-300 font-medium">View All →</button>
  407. </div>
  408. <div class="overflow-x-auto">
  409. <table class="w-full text-left text-xs">
  410. <thead class="text-slate-400 border-b border-slate-800">
  411. <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>
  412. </thead>
  413. <tbody id="quick-interfaces-table" class="divide-y divide-slate-800/60 font-mono"></tbody>
  414. </table>
  415. </div>
  416. </div>
  417. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  418. <div class="flex items-center justify-between mb-4">
  419. <h3 class="text-sm font-bold text-white">Active VLANs</h3>
  420. <button onclick="navigate('vlans')" class="text-xs text-cyan-400 hover:text-cyan-300 font-medium">Manage →</button>
  421. </div>
  422. <div class="overflow-x-auto">
  423. <table class="w-full text-left text-xs">
  424. <thead class="text-slate-400 border-b border-slate-800">
  425. <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>
  426. </thead>
  427. <tbody id="quick-vlans-table" class="divide-y divide-slate-800/60 font-mono"></tbody>
  428. </table>
  429. </div>
  430. </div>
  431. </div>
  432. </section>
  433. <!-- ================= SECTION: INTERFACES (HIERARCHICAL TREE) ================= -->
  434. <section id="section-interfaces" class="hidden space-y-6">
  435. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-4 flex flex-wrap items-center justify-between gap-4">
  436. <div class="flex items-center space-x-2">
  437. <span class="text-xs font-semibold text-slate-400 mr-2">Filter:</span>
  438. <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>
  439. <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>
  440. <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>
  441. <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>
  442. </div>
  443. <div class="flex items-center space-x-3">
  444. <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>
  445. <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>
  446. <input type="text" id="iface-search" oninput="renderInterfacesList()" placeholder="Search interfaces..."
  447. 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">
  448. </div>
  449. </div>
  450. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden shadow-2xl">
  451. <div class="p-4 border-b border-slate-800 bg-slate-950/40 flex items-center justify-between">
  452. <div>
  453. <h3 class="text-sm font-bold text-white flex items-center gap-2">
  454. <span>Interface Hierarchy & VLAN Sub-interfaces</span>
  455. <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>
  456. </h3>
  457. </div>
  458. <div class="text-xs text-slate-400">
  459. <span id="ifaces-list-summary" class="font-mono">Loading interfaces...</span>
  460. </div>
  461. </div>
  462. <div class="overflow-x-auto">
  463. <table class="w-full text-left text-xs">
  464. <thead class="text-slate-400 bg-slate-950/80 border-b border-slate-800 uppercase tracking-wider text-[11px]">
  465. <tr>
  466. <th class="py-3 px-3 font-semibold w-8 text-center"></th>
  467. <th class="py-3 px-4 font-semibold">Interface / Type</th>
  468. <th class="py-3 px-4 font-semibold">Role & Alias</th>
  469. <th class="py-3 px-4 font-semibold">IP Address (CIDR)</th>
  470. <th class="py-3 px-4 font-semibold">MAC & MTU</th>
  471. <th class="py-3 px-4 font-semibold">Throughput (RX/TX)</th>
  472. <th class="py-3 px-4 font-semibold">Link State</th>
  473. <th class="py-3 px-4 font-semibold text-right">Actions</th>
  474. </tr>
  475. </thead>
  476. <tbody id="interfaces-tree-tbody" class="divide-y divide-slate-800 font-mono"></tbody>
  477. </table>
  478. </div>
  479. <div id="interfaces-empty-state" class="hidden p-12 text-center text-slate-500">
  480. No interfaces found matching your search.
  481. </div>
  482. </div>
  483. </section>
  484. <!-- ================= SECTION: BRIDGE (/interface bridge) ================= -->
  485. <section id="section-bridge" class="hidden space-y-6">
  486. <!-- Bridge Navigation Header -->
  487. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-4 flex flex-wrap items-center justify-between gap-4">
  488. <div class="flex items-center space-x-3">
  489. <div class="p-2.5 rounded-lg bg-sky-500/10 border border-sky-500/20 text-sky-400">
  490. <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  491. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M3 14h18M5 14v4a2 2 0 002 2h2a2 2 0 002-2v-4m6 0v4a2 2 0 002 2h2a2 2 0 002-2v-4M4 10V6a2 2 0 012-2h12a2 2 0 012 2v4" />
  492. </svg>
  493. </div>
  494. <div>
  495. <div class="flex items-center gap-2">
  496. <h2 class="text-base font-bold text-white">Bridge Interfaces</h2>
  497. <span class="px-2 py-0.5 rounded text-[10px] font-mono bg-sky-500/20 text-sky-300 border border-sky-500/30 font-semibold">IEEE 802.1D / 802.1Q</span>
  498. </div>
  499. <p class="text-xs text-slate-400">MikroTik RouterOS style bridge with RSTP, VLAN filtering, split-horizon port isolation & dynamic host MAC forwarding table.</p>
  500. </div>
  501. </div>
  502. <div class="flex items-center space-x-3">
  503. <button id="bridge-top-action-btn" onclick="openCurrentBridgeModal()" class="flex items-center space-x-2 bg-gradient-to-r from-sky-600 to-cyan-600 hover:from-sky-500 hover:to-cyan-500 text-white font-semibold text-xs px-4 py-2.5 rounded-lg shadow-lg shadow-sky-500/20 transition">
  504. <span>+ Add Bridge</span>
  505. </button>
  506. </div>
  507. </div>
  508. <!-- Bridge Subtabs Nav -->
  509. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl overflow-hidden p-1 flex flex-wrap items-center justify-between gap-2">
  510. <div class="flex items-center space-x-1">
  511. <button id="bridge-subtab-btn-bridges" onclick="switchBridgeSubTab('bridges')" class="px-4 py-2 text-xs font-bold rounded-lg bg-slate-800 text-white shadow-sm transition flex items-center gap-2">
  512. <span>Bridges</span>
  513. <span id="bridge-badge-bridges" class="px-1.5 py-0.2 rounded text-[10px] bg-sky-950 text-sky-300 border border-sky-800/40">0</span>
  514. </button>
  515. <button id="bridge-subtab-btn-ports" onclick="switchBridgeSubTab('ports')" class="px-4 py-2 text-xs font-bold rounded-lg text-slate-400 hover:text-slate-200 transition flex items-center gap-2">
  516. <span>Ports</span>
  517. <span id="bridge-badge-ports" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  518. </button>
  519. <button id="bridge-subtab-btn-vlans" onclick="switchBridgeSubTab('vlans')" class="px-4 py-2 text-xs font-bold rounded-lg text-slate-400 hover:text-slate-200 transition flex items-center gap-2">
  520. <span>VLANs</span>
  521. <span id="bridge-badge-vlans" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  522. </button>
  523. <button id="bridge-subtab-btn-hosts" onclick="switchBridgeSubTab('hosts')" class="px-4 py-2 text-xs font-bold rounded-lg text-slate-400 hover:text-slate-200 transition flex items-center gap-2">
  524. <span>Hosts (MAC Table)</span>
  525. <span id="bridge-badge-hosts" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  526. </button>
  527. </div>
  528. <!-- Stats Bar -->
  529. <div class="flex items-center space-x-4 px-3 text-xs font-mono text-slate-400">
  530. <div>Bridges: <span id="bridge-stat-bridges" class="font-bold text-white">0</span></div>
  531. <div>Ports: <span id="bridge-stat-ports" class="font-bold text-sky-400">0</span></div>
  532. <div>Learned MACs: <span id="bridge-stat-hosts" class="font-bold text-emerald-400">0</span></div>
  533. </div>
  534. </div>
  535. <!-- ================= SUBTAB 1: BRIDGES ================= -->
  536. <div id="bridge-subtab-bridges" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  537. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  538. <h3 class="text-sm font-bold text-white">Configured Bridges</h3>
  539. <span id="bridge-count-badge" class="text-xs font-mono text-slate-400">0 Bridges</span>
  540. </div>
  541. <div class="overflow-x-auto">
  542. <table class="w-full text-left text-xs font-mono">
  543. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  544. <tr>
  545. <th class="py-2.5 px-3 w-10 text-center">#</th>
  546. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  547. <th class="py-2.5 px-3">Name</th>
  548. <th class="py-2.5 px-3">MTU</th>
  549. <th class="py-2.5 px-3">MAC Address</th>
  550. <th class="py-2.5 px-3">STP</th>
  551. <th class="py-2.5 px-3">VLAN Filtering</th>
  552. <th class="py-2.5 px-3">PVID</th>
  553. <th class="py-2.5 px-3">Ports</th>
  554. <th class="py-2.5 px-3">IP Addresses</th>
  555. <th class="py-2.5 px-3">Traffic</th>
  556. <th class="py-2.5 px-3">Comment</th>
  557. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  558. </tr>
  559. </thead>
  560. <tbody id="bridge-table-body" class="divide-y divide-slate-800/80"></tbody>
  561. </table>
  562. </div>
  563. <div id="bridge-empty-bridges" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  564. No bridge interfaces configured. Click "+ Add Bridge" to create one.
  565. </div>
  566. </div>
  567. <!-- ================= SUBTAB 2: PORTS ================= -->
  568. <div id="bridge-subtab-ports" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  569. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  570. <div class="flex items-center gap-3">
  571. <h3 class="text-sm font-bold text-white">Bridge Ports</h3>
  572. <span id="bridge-ports-count-badge" class="text-xs font-mono text-slate-400">0 Ports</span>
  573. </div>
  574. <div class="flex items-center space-x-2">
  575. <label class="text-xs text-slate-400">Filter Bridge:</label>
  576. <select id="bridge-ports-filter-bridge" onchange="renderBridgePorts()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white">
  577. <option value="">All Bridges</option>
  578. </select>
  579. </div>
  580. </div>
  581. <div class="overflow-x-auto">
  582. <table class="w-full text-left text-xs font-mono">
  583. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  584. <tr>
  585. <th class="py-2.5 px-3 w-10 text-center">#</th>
  586. <th class="py-2.5 px-3 w-12 text-center" title="Flags: X=Disabled">Flag</th>
  587. <th class="py-2.5 px-3">Interface</th>
  588. <th class="py-2.5 px-3">Bridge</th>
  589. <th class="py-2.5 px-3">PVID</th>
  590. <th class="py-2.5 px-3">Frame Types</th>
  591. <th class="py-2.5 px-3">Ingress Filter</th>
  592. <th class="py-2.5 px-3">Horizon</th>
  593. <th class="py-2.5 px-3">Role / Status</th>
  594. <th class="py-2.5 px-3">Comment</th>
  595. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  596. </tr>
  597. </thead>
  598. <tbody id="bridge-ports-table-body" class="divide-y divide-slate-800/80"></tbody>
  599. </table>
  600. </div>
  601. <div id="bridge-empty-ports" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  602. No bridge ports configured. Click "+ Add Port" to attach a physical NIC, VLAN or EoIP tunnel.
  603. </div>
  604. </div>
  605. <!-- ================= SUBTAB 3: VLANS ================= -->
  606. <div id="bridge-subtab-vlans" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  607. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  608. <div class="flex items-center gap-3">
  609. <h3 class="text-sm font-bold text-white">Bridge VLAN Filtering Table</h3>
  610. <span id="bridge-vlans-count-badge" class="text-xs font-mono text-slate-400">0 Entries</span>
  611. </div>
  612. <div class="flex items-center space-x-2">
  613. <label class="text-xs text-slate-400">Filter Bridge:</label>
  614. <select id="bridge-vlans-filter-bridge" onchange="renderBridgeVLANs()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white">
  615. <option value="">All Bridges</option>
  616. </select>
  617. </div>
  618. </div>
  619. <div class="overflow-x-auto">
  620. <table class="w-full text-left text-xs font-mono">
  621. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  622. <tr>
  623. <th class="py-2.5 px-3 w-10 text-center">#</th>
  624. <th class="py-2.5 px-3 w-12 text-center" title="Flags: X=Disabled">Flag</th>
  625. <th class="py-2.5 px-3">Bridge</th>
  626. <th class="py-2.5 px-3">VLAN IDs</th>
  627. <th class="py-2.5 px-3">Tagged Member Ports</th>
  628. <th class="py-2.5 px-3">Untagged Member Ports</th>
  629. <th class="py-2.5 px-3">Comment</th>
  630. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  631. </tr>
  632. </thead>
  633. <tbody id="bridge-vlans-table-body" class="divide-y divide-slate-800/80"></tbody>
  634. </table>
  635. </div>
  636. <div id="bridge-empty-vlans" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  637. No bridge VLAN filtering entries configured. Click "+ Add VLAN Entry" to configure 802.1Q tagged ports.
  638. </div>
  639. </div>
  640. <!-- ================= SUBTAB 4: HOSTS (MAC TABLE) ================= -->
  641. <div id="bridge-subtab-hosts" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  642. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  643. <div class="flex items-center gap-3">
  644. <h3 class="text-sm font-bold text-white">Forwarding Database (MAC Table)</h3>
  645. <span id="bridge-hosts-count-badge" class="text-xs font-mono text-slate-400">0 Entries</span>
  646. </div>
  647. <div class="flex items-center space-x-2">
  648. <input type="text" id="bridge-hosts-search" oninput="renderBridgeHosts()" placeholder="Search MAC or Interface..." class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white">
  649. <select id="bridge-hosts-filter-bridge" onchange="loadBridgeHosts()" class="bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-xs text-white">
  650. <option value="">All Bridges</option>
  651. </select>
  652. <button onclick="loadBridgeHosts()" class="px-2.5 py-1 rounded-lg bg-slate-800 hover:bg-slate-700 text-xs font-semibold text-slate-200 border border-slate-700">🔄 Refresh</button>
  653. <button onclick="flushBridgeHosts()" class="px-2.5 py-1 rounded-lg bg-rose-950/60 hover:bg-rose-900/80 text-rose-300 border border-rose-800/40 text-xs font-semibold">🗑️ Flush Dynamic</button>
  654. </div>
  655. </div>
  656. <div class="overflow-x-auto">
  657. <table class="w-full text-left text-xs font-mono">
  658. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  659. <tr>
  660. <th class="py-2.5 px-3">MAC Address</th>
  661. <th class="py-2.5 px-3">Interface / Port</th>
  662. <th class="py-2.5 px-3">Bridge</th>
  663. <th class="py-2.5 px-3">VLAN</th>
  664. <th class="py-2.5 px-3">Age (s)</th>
  665. <th class="py-2.5 px-3">Flags (L=Local, S=Static, D=Dynamic)</th>
  666. </tr>
  667. </thead>
  668. <tbody id="bridge-hosts-table-body" class="divide-y divide-slate-800/80"></tbody>
  669. </table>
  670. </div>
  671. <div id="bridge-empty-hosts" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  672. No MAC addresses learned in the forwarding database.
  673. </div>
  674. </div>
  675. </section>
  676. <!-- ================= SECTION: VLANS (802.1Q) ================= -->
  677. <section id="section-vlans" class="hidden space-y-6">
  678. <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">
  679. <div class="max-w-xl">
  680. <div class="flex items-center gap-2 mb-1">
  681. <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>
  682. <h2 class="text-base font-bold text-white">VLAN Virtual Sub-interfaces</h2>
  683. </div>
  684. <p class="text-xs text-slate-400 leading-relaxed">
  685. Tagged sub-interfaces on physical parent interfaces (e.g. <code class="text-cyan-300">eth0.10</code>).
  686. </p>
  687. </div>
  688. <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">
  689. <span>+ Create VLAN Sub-interface</span>
  690. </button>
  691. </div>
  692. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  693. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  694. <h3 class="text-sm font-bold text-white">Configured VLANs</h3>
  695. <input type="text" id="vlan-search" oninput="renderVlansList()" placeholder="Filter VLAN ID..."
  696. 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">
  697. </div>
  698. <div class="overflow-x-auto">
  699. <table class="w-full text-left text-xs font-mono">
  700. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[11px] font-sans">
  701. <tr>
  702. <th class="py-3 px-4 font-semibold">VLAN ID</th>
  703. <th class="py-3 px-4 font-semibold">Device</th>
  704. <th class="py-3 px-4 font-semibold">Parent</th>
  705. <th class="py-3 px-4 font-semibold">Subnet (CIDR)</th>
  706. <th class="py-3 px-4 font-semibold">Role</th>
  707. <th class="py-3 px-4 font-semibold">MTU</th>
  708. <th class="py-3 px-4 font-semibold">Status</th>
  709. <th class="py-3 px-4 font-semibold text-right">Actions</th>
  710. </tr>
  711. </thead>
  712. <tbody id="vlans-table-body" class="divide-y divide-slate-800"></tbody>
  713. </table>
  714. </div>
  715. <div id="vlans-empty-state" class="hidden p-12 text-center text-slate-500">
  716. No VLANs configured. Click "+ Create VLAN" to add one.
  717. </div>
  718. </div>
  719. </section>
  720. <!-- ================= SECTION: PPPoE CLIENTS (MikroTik style) ================= -->
  721. <section id="section-pppoe" class="hidden space-y-6">
  722. <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">
  723. <div>
  724. <div class="flex items-center gap-2 mb-1">
  725. <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>
  726. <h2 class="text-base font-bold text-white">PPPoE Client Sessions</h2>
  727. </div>
  728. <p class="text-xs text-slate-400">Manage multiple Point-to-Point Protocol over Ethernet WAN connections (MikroTik RouterOS style).</p>
  729. </div>
  730. <div class="flex items-center gap-2">
  731. <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">
  732. <span>⚙ Server Settings</span>
  733. </button>
  734. <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">
  735. <span>+ Add PPPoE Client</span>
  736. </button>
  737. </div>
  738. </div>
  739. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  740. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  741. <h3 class="text-sm font-bold text-white">Configured PPPoE Interfaces</h3>
  742. <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>
  743. </div>
  744. <div class="overflow-x-auto">
  745. <table class="w-full text-left text-xs font-mono">
  746. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  747. <tr>
  748. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  749. <th class="py-2.5 px-3">Name</th>
  750. <th class="py-2.5 px-3">Interface</th>
  751. <th class="py-2.5 px-3">User</th>
  752. <th class="py-2.5 px-3">Assigned IP</th>
  753. <th class="py-2.5 px-3">Device</th>
  754. <th class="py-2.5 px-3 text-center">Def. Route</th>
  755. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  756. </tr>
  757. </thead>
  758. <tbody id="pppoe-table-body" class="divide-y divide-slate-800/80"></tbody>
  759. </table>
  760. </div>
  761. <div id="pppoe-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  762. No PPPoE clients configured. Click "+ Add PPPoE Client" to add a connection.
  763. </div>
  764. </div>
  765. </section>
  766. <!-- ================= SECTION: WIREGUARD (MikroTik style) ================= -->
  767. <section id="section-wireguard" class="hidden space-y-6">
  768. <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">
  769. <div>
  770. <div class="flex items-center gap-2 mb-1">
  771. <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>
  772. <h2 class="text-base font-bold text-white">WireGuard VPN Suite</h2>
  773. </div>
  774. <p class="text-xs text-slate-400">High-performance multi-interface WireGuard server and peer controller (MikroTik RouterOS v7 style).</p>
  775. </div>
  776. <div class="flex items-center space-x-2.5">
  777. <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">
  778. + Add Interface
  779. </button>
  780. <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">
  781. + Add Peer
  782. </button>
  783. </div>
  784. </div>
  785. <!-- Sub Tabs: Interfaces / Peers -->
  786. <div class="flex border-b border-slate-800 space-x-2">
  787. <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">
  788. <span>Interfaces</span>
  789. <span id="wg-subtab-badge-ifaces" class="px-1.5 py-0.5 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  790. </button>
  791. <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">
  792. <span>Peers</span>
  793. <span id="wg-subtab-badge-peers" class="px-1.5 py-0.5 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  794. </button>
  795. </div>
  796. <!-- Sub-Tab 1: Interfaces -->
  797. <div id="wg-subtab-ifaces" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  798. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  799. <h3 class="text-sm font-bold text-white">WireGuard Interfaces</h3>
  800. <span id="wg-ifaces-count" class="text-xs font-mono text-slate-400">0 Interfaces</span>
  801. </div>
  802. <div class="overflow-x-auto">
  803. <table class="w-full text-left text-xs font-mono">
  804. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  805. <tr>
  806. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  807. <th class="py-2.5 px-3">Name</th>
  808. <th class="py-2.5 px-3">Listen Port</th>
  809. <th class="py-2.5 px-3">Tunnel Address</th>
  810. <th class="py-2.5 px-3">Public Key</th>
  811. <th class="py-2.5 px-3">MTU</th>
  812. <th class="py-2.5 px-3 text-center">Peers</th>
  813. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  814. </tr>
  815. </thead>
  816. <tbody id="wg-ifaces-table-body" class="divide-y divide-slate-800/80"></tbody>
  817. </table>
  818. </div>
  819. <div id="wg-ifaces-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  820. No WireGuard interfaces configured. Click "+ Add Interface" to create wg0.
  821. </div>
  822. </div>
  823. <!-- Sub-Tab 2: Peers -->
  824. <div id="wg-subtab-peers" class="hidden 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 flex-wrap gap-3">
  826. <div class="flex items-center gap-3">
  827. <h3 class="text-sm font-bold text-white">WireGuard Peers</h3>
  828. <span id="wg-peers-count" class="text-xs font-mono text-slate-400">0 Peers</span>
  829. </div>
  830. <div class="flex items-center gap-2">
  831. <label class="text-xs text-slate-400 font-sans">Filter Interface:</label>
  832. <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">
  833. <option value="">All Interfaces</option>
  834. </select>
  835. </div>
  836. </div>
  837. <div class="overflow-x-auto">
  838. <table class="w-full text-left text-xs font-mono">
  839. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  840. <tr>
  841. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Active, X=Disabled">Flag</th>
  842. <th class="py-2.5 px-3">Interface</th>
  843. <th class="py-2.5 px-3">Peer Name</th>
  844. <th class="py-2.5 px-3">Public Key</th>
  845. <th class="py-2.5 px-3">Allowed IPs</th>
  846. <th class="py-2.5 px-3">Endpoint</th>
  847. <th class="py-2.5 px-3">Latest Handshake</th>
  848. <th class="py-2.5 px-3">Traffic (RX/TX)</th>
  849. <th class="py-2.5 px-3 text-right font-sans">Action</th>
  850. </tr>
  851. </thead>
  852. <tbody id="wg-peers-table-body" class="divide-y divide-slate-800/80"></tbody>
  853. </table>
  854. </div>
  855. <div id="wg-peers-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  856. No peers found for the selected interface. Click "+ Add Peer" to add a client or branch.
  857. </div>
  858. </div>
  859. </section>
  860. <!-- ================= SECTION: IPSEC (MikroTik style) ================= -->
  861. <section id="section-ipsec" class="hidden space-y-6">
  862. <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">
  863. <div>
  864. <div class="flex items-center gap-2 mb-1">
  865. <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>
  866. <h2 class="text-base font-bold text-white">IPSec (IKEv2) Tunnels</h2>
  867. </div>
  868. <p class="text-xs text-slate-400">Enterprise strongSwan 6 Site-to-Site and Remote Gateway connections.</p>
  869. </div>
  870. <div class="flex items-center gap-2">
  871. <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">
  872. <span>⚙ Roadwarrior Server</span>
  873. </button>
  874. <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">
  875. + Add IPSec Tunnel
  876. </button>
  877. </div>
  878. </div>
  879. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  880. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  881. <h3 class="text-sm font-bold text-white">Configured IPSec Tunnels</h3>
  882. <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>
  883. </div>
  884. <div class="overflow-x-auto">
  885. <table class="w-full text-left text-xs font-mono">
  886. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  887. <tr>
  888. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Established, X=Disabled">Flag</th>
  889. <th class="py-2.5 px-4">Connection Name</th>
  890. <th class="py-2.5 px-4">Local Subnet</th>
  891. <th class="py-2.5 px-4">Remote Gateway</th>
  892. <th class="py-2.5 px-4">Remote Subnet</th>
  893. <th class="py-2.5 px-4">Status</th>
  894. <th class="py-2.5 px-4 text-right font-sans">Actions</th>
  895. </tr>
  896. </thead>
  897. <tbody id="ipsec-table-body" class="divide-y divide-slate-800"></tbody>
  898. </table>
  899. </div>
  900. <div id="ipsec-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  901. No IPSec tunnels configured. Click "+ Add IPSec Tunnel" to set up site-to-site networking.
  902. </div>
  903. </div>
  904. </section>
  905. <!-- ================= SECTION: L2TP CLIENT (MikroTik style) ================= -->
  906. <section id="section-l2tp" class="hidden space-y-6">
  907. <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">
  908. <div>
  909. <div class="flex items-center gap-2 mb-1">
  910. <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>
  911. <h2 class="text-base font-bold text-white">L2TP Client Sessions</h2>
  912. </div>
  913. <p class="text-xs text-slate-400">Multiple Layer 2 Tunneling Protocol clients with optional IPSec PSK encryption.</p>
  914. </div>
  915. <div class="flex items-center gap-2">
  916. <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">
  917. <span>⚙ Server Settings</span>
  918. </button>
  919. <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">
  920. + Add L2TP Client
  921. </button>
  922. </div>
  923. </div>
  924. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  925. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  926. <h3 class="text-sm font-bold text-white">Configured L2TP Clients</h3>
  927. <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>
  928. </div>
  929. <div class="overflow-x-auto">
  930. <table class="w-full text-left text-xs font-mono">
  931. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  932. <tr>
  933. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  934. <th class="py-2.5 px-3">Name</th>
  935. <th class="py-2.5 px-3">Server Address</th>
  936. <th class="py-2.5 px-3">User</th>
  937. <th class="py-2.5 px-3">Assigned IP</th>
  938. <th class="py-2.5 px-3">Device</th>
  939. <th class="py-2.5 px-3 text-center">Def. Route</th>
  940. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  941. </tr>
  942. </thead>
  943. <tbody id="l2tp-table-body" class="divide-y divide-slate-800/80"></tbody>
  944. </table>
  945. </div>
  946. <div id="l2tp-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  947. No L2TP clients configured. Click "+ Add L2TP Client" to add a tunnel.
  948. </div>
  949. </div>
  950. </section>
  951. <!-- ================= SECTION: PPTP CLIENT (MikroTik style) ================= -->
  952. <section id="section-pptp" class="hidden space-y-6">
  953. <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">
  954. <div>
  955. <div class="flex items-center gap-2 mb-1">
  956. <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>
  957. <h2 class="text-base font-bold text-white">PPTP Client Sessions</h2>
  958. </div>
  959. <p class="text-xs text-slate-400">Multiple Point-to-Point Tunneling Protocol clients with MPPE-128 encryption.</p>
  960. </div>
  961. <div class="flex items-center gap-2">
  962. <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">
  963. <span>⚙ Server Settings</span>
  964. </button>
  965. <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">
  966. + Add PPTP Client
  967. </button>
  968. </div>
  969. </div>
  970. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  971. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  972. <h3 class="text-sm font-bold text-white">Configured PPTP Clients</h3>
  973. <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>
  974. </div>
  975. <div class="overflow-x-auto">
  976. <table class="w-full text-left text-xs font-mono">
  977. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  978. <tr>
  979. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  980. <th class="py-2.5 px-3">Name</th>
  981. <th class="py-2.5 px-3">Server Address</th>
  982. <th class="py-2.5 px-3">User</th>
  983. <th class="py-2.5 px-3">Assigned IP</th>
  984. <th class="py-2.5 px-3">Device</th>
  985. <th class="py-2.5 px-3 text-center">MPPE</th>
  986. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  987. </tr>
  988. </thead>
  989. <tbody id="pptp-table-body" class="divide-y divide-slate-800/80"></tbody>
  990. </table>
  991. </div>
  992. <div id="pptp-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  993. No PPTP clients configured. Click "+ Add PPTP Client" to add a tunnel.
  994. </div>
  995. </div>
  996. </section>
  997. <!-- ================= SECTION: PPP SERVERS & SECRETS (/ppp) ================= -->
  998. <section id="section-ppp" class="hidden space-y-6">
  999. <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">
  1000. <div>
  1001. <div class="flex items-center gap-2 mb-1">
  1002. <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>
  1003. <h2 class="text-base font-bold text-white">PPP Servers, Secrets & Profiles</h2>
  1004. </div>
  1005. <p class="text-xs text-slate-400">MikroTik RouterOS centralized user authentication database, IP pools and VPN server concentrators.</p>
  1006. </div>
  1007. <div class="flex items-center space-x-2.5">
  1008. <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">
  1009. <span>+ Add User (Secret)</span>
  1010. </button>
  1011. </div>
  1012. </div>
  1013. <!-- Sub Tabs: Secrets / Profiles / PPPoE Server / PPTP Server / L2TP Server / Active Sessions -->
  1014. <div class="flex border-b border-slate-800 space-x-1 overflow-x-auto">
  1015. <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">
  1016. <span>Secrets (Users)</span>
  1017. <span id="ppp-badge-secrets" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1018. </button>
  1019. <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">
  1020. <span>Profiles (Pools)</span>
  1021. <span id="ppp-badge-profiles" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1022. </button>
  1023. <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">
  1024. <span>PPPoE Server</span>
  1025. <span id="ppp-badge-pppoe-state" class="w-2 h-2 rounded-full bg-slate-600"></span>
  1026. </button>
  1027. <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">
  1028. <span>PPTP Server</span>
  1029. <span id="ppp-badge-pptp-state" class="w-2 h-2 rounded-full bg-slate-600"></span>
  1030. </button>
  1031. <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">
  1032. <span>L2TP Server</span>
  1033. <span id="ppp-badge-l2tp-state" class="w-2 h-2 rounded-full bg-slate-600"></span>
  1034. </button>
  1035. <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">
  1036. <span>Active Sessions</span>
  1037. <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>
  1038. </button>
  1039. </div>
  1040. <!-- TAB 1: SECRETS (USERS) -->
  1041. <div id="ppp-subtab-secrets" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1042. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1043. <h3 class="text-sm font-bold text-white">PPP Secrets (/ppp secret)</h3>
  1044. <span id="secrets-count-badge" class="text-xs font-mono text-slate-400">0 Users</span>
  1045. </div>
  1046. <div class="overflow-x-auto">
  1047. <table class="w-full text-left text-xs font-mono">
  1048. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1049. <tr>
  1050. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1051. <th class="py-2.5 px-3">Name (Username)</th>
  1052. <th class="py-2.5 px-3">Service</th>
  1053. <th class="py-2.5 px-3">Profile</th>
  1054. <th class="py-2.5 px-3">Local Address</th>
  1055. <th class="py-2.5 px-3">Remote Address</th>
  1056. <th class="py-2.5 px-3">Comment</th>
  1057. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1058. </tr>
  1059. </thead>
  1060. <tbody id="secrets-table-body" class="divide-y divide-slate-800/80"></tbody>
  1061. </table>
  1062. </div>
  1063. <div id="secrets-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1064. No PPP secrets configured. Click "+ Add User" to define an account.
  1065. </div>
  1066. </div>
  1067. <!-- TAB 2: PROFILES (POOLS) -->
  1068. <div id="ppp-subtab-profiles" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1069. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1070. <h3 class="text-sm font-bold text-white">PPP Profiles (/ppp profile)</h3>
  1071. <span id="profiles-count-badge" class="text-xs font-mono text-slate-400">0 Profiles</span>
  1072. </div>
  1073. <div class="overflow-x-auto">
  1074. <table class="w-full text-left text-xs font-mono">
  1075. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1076. <tr>
  1077. <th class="py-2.5 px-3">Profile Name</th>
  1078. <th class="py-2.5 px-3">Local Address</th>
  1079. <th class="py-2.5 px-3">Remote Address (Pool)</th>
  1080. <th class="py-2.5 px-3">DNS Servers</th>
  1081. <th class="py-2.5 px-3">Encryption</th>
  1082. <th class="py-2.5 px-3 text-center">Only One</th>
  1083. <th class="py-2.5 px-3">Comment</th>
  1084. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1085. </tr>
  1086. </thead>
  1087. <tbody id="profiles-table-body" class="divide-y divide-slate-800/80"></tbody>
  1088. </table>
  1089. </div>
  1090. </div>
  1091. <!-- TAB 3: PPPoE SERVER -->
  1092. <div id="ppp-subtab-pppoe" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl p-6">
  1093. <form onsubmit="savePPPoEServerConfig(event)" class="max-w-2xl space-y-5">
  1094. <div class="flex items-center justify-between border-b border-slate-800 pb-4">
  1095. <div>
  1096. <h3 class="text-sm font-bold text-white">PPPoE Access Concentrator Server</h3>
  1097. <p class="text-xs text-slate-400">Listens on physical interface or VLAN for PPPoE Discovery (PADI) packets</p>
  1098. </div>
  1099. <div class="flex items-center gap-3">
  1100. <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>
  1101. <label class="relative inline-flex items-center cursor-pointer">
  1102. <input type="checkbox" id="pppoe-server-enabled" class="sr-only peer">
  1103. <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>
  1104. </label>
  1105. </div>
  1106. </div>
  1107. <div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs font-sans">
  1108. <div>
  1109. <label class="block text-slate-300 font-medium mb-1">Service Name</label>
  1110. <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">
  1111. </div>
  1112. <div>
  1113. <label class="block text-slate-300 font-medium mb-1">Listen Interface</label>
  1114. <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>
  1115. </div>
  1116. <div>
  1117. <label class="block text-slate-300 font-medium mb-1">Default Profile</label>
  1118. <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>
  1119. </div>
  1120. <div>
  1121. <label class="block text-slate-300 font-medium mb-1">Max MTU / MRU</label>
  1122. <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">
  1123. </div>
  1124. </div>
  1125. <div class="flex items-center space-x-2 pt-2">
  1126. <input type="checkbox" id="pppoe-server-onesession" class="rounded bg-slate-800 border-slate-700 text-blue-600">
  1127. <label for="pppoe-server-onesession" class="text-xs text-slate-300">One Session Per Host (limit 1 PPPoE session per client MAC)</label>
  1128. </div>
  1129. <div class="pt-4 border-t border-slate-800 flex justify-end">
  1130. <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">
  1131. Apply PPPoE Server Settings
  1132. </button>
  1133. </div>
  1134. </form>
  1135. </div>
  1136. <!-- TAB 4: PPTP SERVER -->
  1137. <div id="ppp-subtab-pptp" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl p-6">
  1138. <form onsubmit="savePPTPServerConfig(event)" class="max-w-2xl space-y-5">
  1139. <div class="flex items-center justify-between border-b border-slate-800 pb-4">
  1140. <div>
  1141. <h3 class="text-sm font-bold text-white">PPTP Server (/interface pptp-server server)</h3>
  1142. <p class="text-xs text-slate-400">Point-to-Point Tunneling Server listening on TCP port 1723 with MPPE-128 encryption</p>
  1143. </div>
  1144. <div class="flex items-center gap-3">
  1145. <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>
  1146. <label class="relative inline-flex items-center cursor-pointer">
  1147. <input type="checkbox" id="pptp-server-enabled" class="sr-only peer">
  1148. <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>
  1149. </label>
  1150. </div>
  1151. </div>
  1152. <div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs font-sans">
  1153. <div>
  1154. <label class="block text-slate-300 font-medium mb-1">Port</label>
  1155. <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">
  1156. </div>
  1157. <div>
  1158. <label class="block text-slate-300 font-medium mb-1">Default Profile</label>
  1159. <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>
  1160. </div>
  1161. </div>
  1162. <div class="flex items-center space-x-2 pt-2">
  1163. <input type="checkbox" id="pptp-server-mppe" checked class="rounded bg-slate-800 border-slate-700 text-purple-600">
  1164. <label for="pptp-server-mppe" class="text-xs text-slate-300">Require 128-bit MPPE Encryption (MS-CHAPv2)</label>
  1165. </div>
  1166. <div class="pt-4 border-t border-slate-800 flex justify-end">
  1167. <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">
  1168. Apply PPTP Server Settings
  1169. </button>
  1170. </div>
  1171. </form>
  1172. </div>
  1173. <!-- TAB 5: L2TP SERVER -->
  1174. <div id="ppp-subtab-l2tp" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl p-6">
  1175. <form onsubmit="saveL2TPServerConfig(event)" class="max-w-2xl space-y-5">
  1176. <div class="flex items-center justify-between border-b border-slate-800 pb-4">
  1177. <div>
  1178. <h3 class="text-sm font-bold text-white">L2TP Server (/interface l2tp-server server)</h3>
  1179. <p class="text-xs text-slate-400">Layer 2 Tunneling Protocol Server listening on UDP port 1701 with optional IPSec</p>
  1180. </div>
  1181. <div class="flex items-center gap-3">
  1182. <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>
  1183. <label class="relative inline-flex items-center cursor-pointer">
  1184. <input type="checkbox" id="l2tp-server-enabled" class="sr-only peer">
  1185. <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>
  1186. </label>
  1187. </div>
  1188. </div>
  1189. <div class="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs font-sans">
  1190. <div>
  1191. <label class="block text-slate-300 font-medium mb-1">Port</label>
  1192. <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">
  1193. </div>
  1194. <div>
  1195. <label class="block text-slate-300 font-medium mb-1">Default Profile</label>
  1196. <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>
  1197. </div>
  1198. <div>
  1199. <label class="block text-slate-300 font-medium mb-1">Use IPSec</label>
  1200. <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">
  1201. <option value="no">no</option>
  1202. <option value="yes">yes</option>
  1203. <option value="required">required</option>
  1204. </select>
  1205. </div>
  1206. <div>
  1207. <label class="block text-slate-300 font-medium mb-1">IPSec Secret (PSK)</label>
  1208. <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">
  1209. </div>
  1210. </div>
  1211. <div class="pt-4 border-t border-slate-800 flex justify-end">
  1212. <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">
  1213. Apply L2TP Server Settings
  1214. </button>
  1215. </div>
  1216. </form>
  1217. </div>
  1218. <!-- TAB 6: ACTIVE SESSIONS -->
  1219. <div id="ppp-subtab-active" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1220. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1221. <h3 class="text-sm font-bold text-white">Active PPP Connections (/ppp active)</h3>
  1222. <button onclick="loadPPPSessions()" class="text-xs text-slate-400 hover:text-white px-2 py-1 rounded bg-slate-800">Refresh</button>
  1223. </div>
  1224. <div class="overflow-x-auto">
  1225. <table class="w-full text-left text-xs font-mono">
  1226. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1227. <tr>
  1228. <th class="py-2.5 px-3">Interface</th>
  1229. <th class="py-2.5 px-3">Username</th>
  1230. <th class="py-2.5 px-3">Service</th>
  1231. <th class="py-2.5 px-3">Client IP Address</th>
  1232. <th class="py-2.5 px-3">Uptime</th>
  1233. <th class="py-2.5 px-3">RX / TX Traffic</th>
  1234. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1235. </tr>
  1236. </thead>
  1237. <tbody id="active-ppp-table-body" class="divide-y divide-slate-800/80"></tbody>
  1238. </table>
  1239. </div>
  1240. <div id="active-ppp-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1241. No active PPP sessions currently connected.
  1242. </div>
  1243. </div>
  1244. </section>
  1245. <!-- ================= SECTION: EoIP TUNNELS (/interface eoip) ================= -->
  1246. <section id="section-eoip" class="hidden space-y-6">
  1247. <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">
  1248. <div>
  1249. <div class="flex items-center gap-2 mb-1">
  1250. <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>
  1251. <h2 class="text-base font-bold text-white">EoIP Tunnels (Ethernet over IP)</h2>
  1252. </div>
  1253. <p class="text-xs text-slate-400">MikroTik RouterOS Layer 2 GRETAP tunneling over IP. Transparently bridge Ethernet subnets across the Internet.</p>
  1254. </div>
  1255. <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">
  1256. <span>+ Add EoIP Tunnel</span>
  1257. </button>
  1258. </div>
  1259. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1260. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1261. <h3 class="text-sm font-bold text-white">Configured EoIP Interfaces</h3>
  1262. <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>
  1263. </div>
  1264. <div class="overflow-x-auto">
  1265. <table class="w-full text-left text-xs font-mono">
  1266. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1267. <tr>
  1268. <th class="py-2.5 px-3 w-12 text-center" title="Flags: R=Running, X=Disabled">Flag</th>
  1269. <th class="py-2.5 px-3">Name</th>
  1270. <th class="py-2.5 px-3">Tunnel ID</th>
  1271. <th class="py-2.5 px-3">Tunnel IP</th>
  1272. <th class="py-2.5 px-3">Remote Address</th>
  1273. <th class="py-2.5 px-3">Local Address</th>
  1274. <th class="py-2.5 px-3">MAC Address</th>
  1275. <th class="py-2.5 px-3">MTU</th>
  1276. <th class="py-2.5 px-3">RX / TX Traffic</th>
  1277. <th class="py-2.5 px-3">Comment</th>
  1278. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1279. </tr>
  1280. </thead>
  1281. <tbody id="eoip-table-body" class="divide-y divide-slate-800/80"></tbody>
  1282. </table>
  1283. </div>
  1284. <div id="eoip-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1285. No EoIP tunnels configured. Click "+ Add EoIP Tunnel" to create one.
  1286. </div>
  1287. </div>
  1288. </section>
  1289. <!-- ================= SECTION: FIREWALL (/ip firewall) ================= -->
  1290. <section id="section-firewall" class="hidden space-y-6">
  1291. <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">
  1292. <div>
  1293. <div class="flex items-center gap-2 mb-1">
  1294. <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>
  1295. <h2 class="text-base font-bold text-white">Firewall & Traffic Controller</h2>
  1296. </div>
  1297. <p class="text-xs text-slate-400">Complete MikroTik-grade stateful filter, NAT, packet/connection marking (Mangle), address lists and live connection tracker.</p>
  1298. </div>
  1299. <div class="flex items-center space-x-2.5">
  1300. <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">
  1301. <span>+ Add Rule</span>
  1302. </button>
  1303. <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">
  1304. Reset Counters
  1305. </button>
  1306. </div>
  1307. </div>
  1308. <!-- Sub Tabs: Filter / NAT / Mangle / Address Lists / Connections -->
  1309. <div class="flex border-b border-slate-800 space-x-1 overflow-x-auto">
  1310. <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">
  1311. <span>Filter Rules</span>
  1312. <span id="fw-badge-filter" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1313. </button>
  1314. <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">
  1315. <span>NAT</span>
  1316. <span id="fw-badge-nat" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1317. </button>
  1318. <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">
  1319. <span>Mangle</span>
  1320. <span id="fw-badge-mangle" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1321. </button>
  1322. <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">
  1323. <span>Address Lists</span>
  1324. <span id="fw-badge-addrlist" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1325. </button>
  1326. <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">
  1327. <span>Geo-Location</span>
  1328. <span id="fw-badge-geo" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1329. </button>
  1330. <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">
  1331. <span>Connections</span>
  1332. <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>
  1333. </button>
  1334. </div>
  1335. <!-- ================= TAB 1: FILTER RULES ================= -->
  1336. <div id="fw-subtab-filter" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1337. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1338. <div class="flex items-center gap-3">
  1339. <h3 class="text-sm font-bold text-white">Firewall Filter Rules</h3>
  1340. <span id="filter-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1341. </div>
  1342. <div class="flex items-center gap-2">
  1343. <label class="text-xs text-slate-400 font-sans">Chain:</label>
  1344. <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">
  1345. <option value="">All Chains</option>
  1346. <option value="input">input</option>
  1347. <option value="forward">forward</option>
  1348. <option value="output">output</option>
  1349. </select>
  1350. </div>
  1351. </div>
  1352. <div class="overflow-x-auto">
  1353. <table class="w-full text-left text-xs font-mono">
  1354. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1355. <tr>
  1356. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1357. <th class="py-2.5 px-3 w-12 text-center" title="Flags: X=Disabled, C=Comment">Flag</th>
  1358. <th class="py-2.5 px-3">Chain</th>
  1359. <th class="py-2.5 px-3">Src. Address</th>
  1360. <th class="py-2.5 px-3">Dst. Address</th>
  1361. <th class="py-2.5 px-3">Protocol</th>
  1362. <th class="py-2.5 px-3">Ports</th>
  1363. <th class="py-2.5 px-3">In / Out</th>
  1364. <th class="py-2.5 px-3">Action</th>
  1365. <th class="py-2.5 px-3">Packets / Bytes</th>
  1366. <th class="py-2.5 px-3">Comment</th>
  1367. <th class="py-2.5 px-3 text-right font-sans">Order & Actions</th>
  1368. </tr>
  1369. </thead>
  1370. <tbody id="filter-table-body" class="divide-y divide-slate-800/80"></tbody>
  1371. </table>
  1372. </div>
  1373. <div id="filter-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1374. No filter rules found in this chain. Click "+ Add Rule" to create one.
  1375. </div>
  1376. </div>
  1377. <!-- ================= TAB 2: NAT RULES ================= -->
  1378. <div id="fw-subtab-nat" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1379. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1380. <div class="flex items-center gap-3">
  1381. <h3 class="text-sm font-bold text-white">NAT Rules</h3>
  1382. <span id="nat-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1383. </div>
  1384. <div class="flex items-center gap-2">
  1385. <label class="text-xs text-slate-400 font-sans">Chain:</label>
  1386. <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">
  1387. <option value="">All Chains</option>
  1388. <option value="srcnat">srcnat (SNAT / Masquerade)</option>
  1389. <option value="dstnat">dstnat (Port Forwarding)</option>
  1390. </select>
  1391. </div>
  1392. </div>
  1393. <div class="overflow-x-auto">
  1394. <table class="w-full text-left text-xs font-mono">
  1395. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1396. <tr>
  1397. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1398. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1399. <th class="py-2.5 px-3">Chain</th>
  1400. <th class="py-2.5 px-3">Src. Address</th>
  1401. <th class="py-2.5 px-3">Dst. Address</th>
  1402. <th class="py-2.5 px-3">Proto/Port</th>
  1403. <th class="py-2.5 px-3">Out / In</th>
  1404. <th class="py-2.5 px-3">Action</th>
  1405. <th class="py-2.5 px-3">To Address:Port</th>
  1406. <th class="py-2.5 px-3">Packets / Bytes</th>
  1407. <th class="py-2.5 px-3">Comment</th>
  1408. <th class="py-2.5 px-3 text-right font-sans">Order & Actions</th>
  1409. </tr>
  1410. </thead>
  1411. <tbody id="nat-table-body" class="divide-y divide-slate-800/80"></tbody>
  1412. </table>
  1413. </div>
  1414. <div id="nat-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1415. No NAT rules configured. Click "+ Add Rule" to add masquerade or port forwarding.
  1416. </div>
  1417. </div>
  1418. <!-- ================= TAB 3: MANGLE RULES ================= -->
  1419. <div id="fw-subtab-mangle" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1420. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1421. <div class="flex items-center gap-3">
  1422. <h3 class="text-sm font-bold text-white">Mangle Packet & Connection Marking</h3>
  1423. <span id="mangle-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1424. </div>
  1425. <div class="flex items-center gap-2">
  1426. <label class="text-xs text-slate-400 font-sans">Chain:</label>
  1427. <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">
  1428. <option value="">All Chains</option>
  1429. <option value="prerouting">prerouting</option>
  1430. <option value="forward">forward</option>
  1431. <option value="postrouting">postrouting</option>
  1432. <option value="input">input</option>
  1433. <option value="output">output</option>
  1434. </select>
  1435. </div>
  1436. </div>
  1437. <div class="overflow-x-auto">
  1438. <table class="w-full text-left text-xs font-mono">
  1439. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1440. <tr>
  1441. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1442. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1443. <th class="py-2.5 px-3">Chain</th>
  1444. <th class="py-2.5 px-3">Src. Address</th>
  1445. <th class="py-2.5 px-3">Dst. Address</th>
  1446. <th class="py-2.5 px-3">Action</th>
  1447. <th class="py-2.5 px-3">New Mark / Value</th>
  1448. <th class="py-2.5 px-3 text-center">Pass</th>
  1449. <th class="py-2.5 px-3">Packets / Bytes</th>
  1450. <th class="py-2.5 px-3">Comment</th>
  1451. <th class="py-2.5 px-3 text-right font-sans">Order & Actions</th>
  1452. </tr>
  1453. </thead>
  1454. <tbody id="mangle-table-body" class="divide-y divide-slate-800/80"></tbody>
  1455. </table>
  1456. </div>
  1457. <div id="mangle-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1458. No mangle rules configured. Click "+ Add Rule" to mark connections or routing for Multi-WAN.
  1459. </div>
  1460. </div>
  1461. <!-- ================= TAB 4: ADDRESS LISTS ================= -->
  1462. <div id="fw-subtab-addrlist" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1463. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1464. <div class="flex items-center gap-3">
  1465. <h3 class="text-sm font-bold text-white">Address Lists (ipset)</h3>
  1466. <span id="addrlist-count-badge" class="text-xs font-mono text-slate-400">0 Entries</span>
  1467. </div>
  1468. <div class="flex items-center gap-2">
  1469. <label class="text-xs text-slate-400 font-sans">List:</label>
  1470. <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">
  1471. <option value="">All Lists</option>
  1472. </select>
  1473. </div>
  1474. </div>
  1475. <div class="overflow-x-auto">
  1476. <table class="w-full text-left text-xs font-mono">
  1477. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1478. <tr>
  1479. <th class="py-2.5 px-3 w-10 text-center">#</th>
  1480. <th class="py-2.5 px-3 w-12 text-center">Flag</th>
  1481. <th class="py-2.5 px-3">List Name</th>
  1482. <th class="py-2.5 px-3">IP Address / CIDR</th>
  1483. <th class="py-2.5 px-3">Comment</th>
  1484. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1485. </tr>
  1486. </thead>
  1487. <tbody id="addrlist-table-body" class="divide-y divide-slate-800/80"></tbody>
  1488. </table>
  1489. </div>
  1490. <div id="addrlist-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1491. No address list entries configured. Click "+ Add Item" to define a group of IPs/subnets.
  1492. </div>
  1493. </div>
  1494. <!-- ================= TAB 5: ACTIVE CONNECTIONS ================= -->
  1495. <div id="fw-subtab-connections" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1496. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1497. <div class="flex items-center gap-3">
  1498. <h3 class="text-sm font-bold text-white">Active Conntrack Connections</h3>
  1499. <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>
  1500. </div>
  1501. <div class="flex items-center gap-2 flex-wrap">
  1502. <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">
  1503. <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">
  1504. <option value="">All Proto</option>
  1505. <option value="TCP">TCP</option>
  1506. <option value="UDP">UDP</option>
  1507. <option value="ICMP">ICMP</option>
  1508. </select>
  1509. <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>
  1510. </div>
  1511. </div>
  1512. <div class="overflow-x-auto max-h-[550px] overflow-y-auto">
  1513. <table class="w-full text-left text-xs font-mono">
  1514. <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">
  1515. <tr>
  1516. <th class="py-2.5 px-3">Proto</th>
  1517. <th class="py-2.5 px-3">Source Address</th>
  1518. <th class="py-2.5 px-3">Destination Address</th>
  1519. <th class="py-2.5 px-3">Reply Source</th>
  1520. <th class="py-2.5 px-3">Reply Dest</th>
  1521. <th class="py-2.5 px-3">TCP State</th>
  1522. <th class="py-2.5 px-3">Mark</th>
  1523. <th class="py-2.5 px-3">Timeout</th>
  1524. <th class="py-2.5 px-3 text-right font-sans">Action</th>
  1525. </tr>
  1526. </thead>
  1527. <tbody id="conns-table-body" class="divide-y divide-slate-800/60"></tbody>
  1528. </table>
  1529. </div>
  1530. <div id="conns-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1531. No active connections found matching your search.
  1532. </div>
  1533. </div>
  1534. <!-- ================= TAB 5: GEO-LOCATION ================= -->
  1535. <div id="fw-subtab-geo" class="hidden space-y-4">
  1536. <!-- Geo Header & Scheduler Status -->
  1537. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-4 flex flex-wrap items-center justify-between gap-4">
  1538. <div class="flex items-center space-x-3">
  1539. <div class="p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/20 text-emerald-400">
  1540. <span class="text-xl">🌍</span>
  1541. </div>
  1542. <div>
  1543. <div class="flex items-center gap-2">
  1544. <h3 class="text-sm font-bold text-white">Geo-Location IP Filtering</h3>
  1545. <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>
  1546. </div>
  1547. <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>
  1548. </div>
  1549. </div>
  1550. <!-- Controls -->
  1551. <div class="flex items-center flex-wrap gap-2">
  1552. <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">
  1553. <span class="text-slate-400">Schedule:</span>
  1554. <span id="geo-interval-label" class="font-bold text-white">Every 24h</span>
  1555. </div>
  1556. <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">
  1557. ⚙️ Settings
  1558. </button>
  1559. <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">
  1560. <span id="geo-update-spinner" class="hidden animate-spin text-xs">⏳</span>
  1561. <span>🔄 Update Now</span>
  1562. </button>
  1563. </div>
  1564. </div>
  1565. <!-- Stats Bar -->
  1566. <div class="grid grid-cols-2 sm:grid-cols-4 gap-3">
  1567. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl p-3">
  1568. <span class="text-[10px] uppercase font-bold text-slate-500 block">Countries in Rules</span>
  1569. <span id="geo-stat-active-countries" class="text-base font-bold font-mono text-emerald-400">0</span>
  1570. </div>
  1571. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl p-3">
  1572. <span class="text-[10px] uppercase font-bold text-slate-500 block">Total Subnets in Kernel</span>
  1573. <span id="geo-stat-total-subnets" class="text-base font-bold font-mono text-cyan-400">0</span>
  1574. </div>
  1575. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl p-3">
  1576. <span class="text-[10px] uppercase font-bold text-slate-500 block">Last Synced</span>
  1577. <span id="geo-stat-last-sync" class="text-xs font-mono text-slate-300">-</span>
  1578. </div>
  1579. <div class="bg-slate-900/60 border border-slate-800/80 rounded-xl p-3">
  1580. <span class="text-[10px] uppercase font-bold text-slate-500 block">Next Scheduled Run</span>
  1581. <span id="geo-stat-next-sync" class="text-xs font-mono text-slate-300">-</span>
  1582. </div>
  1583. </div>
  1584. <!-- Filters & Country Table -->
  1585. <div class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1586. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1587. <div class="flex items-center flex-wrap gap-2">
  1588. <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">
  1589. <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">
  1590. <option value="">All Continents</option>
  1591. <option value="Europe">Europe</option>
  1592. <option value="Asia">Asia</option>
  1593. <option value="Americas">Americas</option>
  1594. <option value="Africa">Africa</option>
  1595. <option value="Oceania">Oceania</option>
  1596. </select>
  1597. <label class="flex items-center space-x-1.5 text-xs text-slate-300 cursor-pointer ml-2">
  1598. <input type="checkbox" id="geo-filter-inuse-only" onchange="renderGeoCountries()" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  1599. <span>In Use by Rules only</span>
  1600. </label>
  1601. <label class="flex items-center space-x-1.5 text-xs text-slate-300 cursor-pointer ml-2">
  1602. <input type="checkbox" id="geo-filter-cached-only" onchange="renderGeoCountries()" class="rounded bg-slate-800 border-slate-700 text-cyan-500">
  1603. <span>Cached Only</span>
  1604. </label>
  1605. </div>
  1606. <div class="flex items-center space-x-2">
  1607. <span class="text-xs text-slate-400 font-sans">Quick Filter:</span>
  1608. <button onclick="quickFilterGeo('GR')" class="px-2.5 py-1 text-xs rounded bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 font-mono">🇬🇷 GR</button>
  1609. <button onclick="quickFilterGeo('Europe')" class="px-2.5 py-1 text-xs rounded bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 font-mono">🇪🇺 Europe</button>
  1610. <button onclick="quickFilterGeo('HIGHRISK')" class="px-2.5 py-1 text-xs rounded bg-rose-950/40 hover:bg-rose-900/50 text-rose-300 border border-rose-800/50 font-mono">🚫 High-Risk</button>
  1611. <button onclick="quickFilterGeo('')" class="px-2.5 py-1 text-xs rounded bg-slate-800 hover:bg-slate-700 text-slate-400 border border-slate-700 font-mono">Reset</button>
  1612. </div>
  1613. </div>
  1614. <div class="overflow-x-auto max-h-[600px] overflow-y-auto">
  1615. <table class="w-full text-left text-xs font-mono">
  1616. <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">
  1617. <tr>
  1618. <th class="py-2.5 px-3 w-16 text-center">Code</th>
  1619. <th class="py-2.5 px-3">Country Name</th>
  1620. <th class="py-2.5 px-3">Continent</th>
  1621. <th class="py-2.5 px-3">Subnets</th>
  1622. <th class="py-2.5 px-3">Kernel IPSet</th>
  1623. <th class="py-2.5 px-3">Rule Usage</th>
  1624. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1625. </tr>
  1626. </thead>
  1627. <tbody id="geo-table-body" class="divide-y divide-slate-800/60"></tbody>
  1628. </table>
  1629. </div>
  1630. <div id="geo-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1631. No countries found matching your search.
  1632. </div>
  1633. </div>
  1634. </div>
  1635. </section>
  1636. <!-- ================= SECTION: ROUTES & POLICY (/ip route & rules) ================= -->
  1637. <section id="section-routes" class="hidden space-y-6">
  1638. <!-- Top Routing Switcher Bar -->
  1639. <div class="flex items-center gap-1.5 p-1 bg-slate-900/90 border border-slate-800 rounded-xl w-fit">
  1640. <button onclick="navigate('routes')" class="px-3.5 py-1.5 text-xs font-bold rounded-lg transition bg-cyan-600/20 text-cyan-300 border border-cyan-500/40 shadow-sm flex items-center gap-2">
  1641. <svg class="w-3.5 h-3.5 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1642. <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" />
  1643. </svg>
  1644. <span>Routes & Policy (/ip route)</span>
  1645. </button>
  1646. <button onclick="navigate('bgp')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1647. <svg class="w-3.5 h-3.5 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1648. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  1649. </svg>
  1650. <span>BGP (/routing bgp)</span>
  1651. </button>
  1652. <button onclick="navigate('ospf')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1653. <svg class="w-3.5 h-3.5 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1654. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
  1655. </svg>
  1656. <span>OSPF (/routing ospf)</span>
  1657. </button>
  1658. </div>
  1659. <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">
  1660. <div>
  1661. <div class="flex items-center gap-2 mb-1">
  1662. <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>
  1663. <h2 class="text-base font-bold text-white">IP Routes & Policy Rules</h2>
  1664. </div>
  1665. <p class="text-xs text-slate-400">Kernel FIB/RIB routing tables, static gateways, multipath uplinks, and policy routing (ip rule / fwmark lookup).</p>
  1666. </div>
  1667. <div class="flex items-center space-x-2.5">
  1668. <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">
  1669. + Add Route
  1670. </button>
  1671. <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">
  1672. + Add Rule
  1673. </button>
  1674. <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">
  1675. + New Table
  1676. </button>
  1677. </div>
  1678. </div>
  1679. <!-- Sub Tabs: Routes / Policy Rules / Tables -->
  1680. <div class="flex border-b border-slate-800 space-x-1">
  1681. <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">
  1682. <span>Routes</span>
  1683. <span id="routes-badge-routes" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1684. </button>
  1685. <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">
  1686. <span>Policy Rules (/ip route rule)</span>
  1687. <span id="routes-badge-rules" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1688. </button>
  1689. <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">
  1690. <span>Routing Tables</span>
  1691. <span id="routes-badge-tables" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1692. </button>
  1693. </div>
  1694. <!-- Sub-Tab 1: Routes Table -->
  1695. <div id="routes-subtab-routes" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1696. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1697. <div class="flex items-center gap-3">
  1698. <h3 class="text-sm font-bold text-white">Active Routing Table (RIB)</h3>
  1699. <span id="routes-count-badge" class="text-xs font-mono text-slate-400">0 Routes</span>
  1700. </div>
  1701. <div class="flex items-center gap-2">
  1702. <label class="text-xs text-slate-400 font-sans">Table Filter:</label>
  1703. <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">
  1704. <option value="">All Tables</option>
  1705. <option value="main">main</option>
  1706. </select>
  1707. <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>
  1708. </div>
  1709. </div>
  1710. <div class="overflow-x-auto">
  1711. <table class="w-full text-left text-xs font-mono">
  1712. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1713. <tr>
  1714. <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>
  1715. <th class="py-2.5 px-3">Dst. Address</th>
  1716. <th class="py-2.5 px-3">Gateway</th>
  1717. <th class="py-2.5 px-3">Distance</th>
  1718. <th class="py-2.5 px-3">Table / Mark</th>
  1719. <th class="py-2.5 px-3">Interface</th>
  1720. <th class="py-2.5 px-3">Comment</th>
  1721. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1722. </tr>
  1723. </thead>
  1724. <tbody id="routes-table-body" class="divide-y divide-slate-800/80"></tbody>
  1725. </table>
  1726. </div>
  1727. <div id="routes-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1728. No routes found.
  1729. </div>
  1730. </div>
  1731. <!-- Sub-Tab 2: Policy Rules (/ip route rule) -->
  1732. <div id="routes-subtab-rules" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1733. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1734. <h3 class="text-sm font-bold text-white">Policy Routing Rules (ip rule)</h3>
  1735. <span id="rules-count-badge" class="text-xs font-mono text-slate-400">0 Rules</span>
  1736. </div>
  1737. <div class="overflow-x-auto">
  1738. <table class="w-full text-left text-xs font-mono">
  1739. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1740. <tr>
  1741. <th class="py-2.5 px-3 w-16">Pref</th>
  1742. <th class="py-2.5 px-3">Src. Address</th>
  1743. <th class="py-2.5 px-3">Dst. Address</th>
  1744. <th class="py-2.5 px-3">Routing Mark (fwmark)</th>
  1745. <th class="py-2.5 px-3">Lookup Table</th>
  1746. <th class="py-2.5 px-3">Action</th>
  1747. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1748. </tr>
  1749. </thead>
  1750. <tbody id="rules-table-body" class="divide-y divide-slate-800/80"></tbody>
  1751. </table>
  1752. </div>
  1753. <div id="rules-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1754. No policy rules configured. Click "+ Add Rule" to route traffic based on routing-mark or source IP.
  1755. </div>
  1756. </div>
  1757. <!-- Sub-Tab 3: Routing Tables -->
  1758. <div id="routes-subtab-tables" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1759. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1760. <h3 class="text-sm font-bold text-white">Defined Routing Tables (/etc/iproute2/rt_tables)</h3>
  1761. <span id="tables-count-badge" class="text-xs font-mono text-slate-400">0 Tables</span>
  1762. </div>
  1763. <div class="overflow-x-auto">
  1764. <table class="w-full text-left text-xs font-mono">
  1765. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1766. <tr>
  1767. <th class="py-2.5 px-3 w-20">FIB ID</th>
  1768. <th class="py-2.5 px-3">Table Name</th>
  1769. <th class="py-2.5 px-3">Comment / Purpose</th>
  1770. </tr>
  1771. </thead>
  1772. <tbody id="tables-table-body" class="divide-y divide-slate-800/80"></tbody>
  1773. </table>
  1774. </div>
  1775. </div>
  1776. </section>
  1777. <!-- ================= SECTION: BGP ROUTING (/routing bgp) ================= -->
  1778. <section id="section-bgp" class="hidden space-y-6">
  1779. <!-- Top Routing Switcher Bar -->
  1780. <div class="flex items-center gap-1.5 p-1 bg-slate-900/90 border border-slate-800 rounded-xl w-fit">
  1781. <button onclick="navigate('routes')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1782. <svg class="w-3.5 h-3.5 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1783. <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" />
  1784. </svg>
  1785. <span>Routes & Policy (/ip route)</span>
  1786. </button>
  1787. <button onclick="navigate('bgp')" class="px-3.5 py-1.5 text-xs font-bold rounded-lg transition bg-purple-600/20 text-purple-300 border border-purple-500/40 shadow-sm flex items-center gap-2">
  1788. <svg class="w-3.5 h-3.5 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1789. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  1790. </svg>
  1791. <span>BGP (/routing bgp)</span>
  1792. </button>
  1793. <button onclick="navigate('ospf')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1794. <svg class="w-3.5 h-3.5 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1795. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
  1796. </svg>
  1797. <span>OSPF (/routing ospf)</span>
  1798. </button>
  1799. </div>
  1800. <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">
  1801. <div>
  1802. <div class="flex items-center gap-2 mb-1">
  1803. <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>
  1804. <h2 class="text-base font-bold text-white">BGP Dynamic Routing</h2>
  1805. <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>
  1806. </div>
  1807. <p class="text-xs text-slate-400">Enterprise FRRouting BGP stack: Autonomous System peering sessions, prefix announcements, and BGP routing table (RIB).</p>
  1808. </div>
  1809. <div class="flex items-center space-x-2 flex-wrap gap-y-2">
  1810. <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">
  1811. <span>⚙ BGP Settings</span>
  1812. </button>
  1813. <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">
  1814. + Add BGP Peer
  1815. </button>
  1816. <button onclick="openAddBgpNetworkModal()" class="text-xs font-semibold px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 border border-slate-700 transition">
  1817. + Add Network
  1818. </button>
  1819. <button onclick="loadDynamicRouting()" class="text-xs text-slate-400 hover:text-white px-2.5 py-2 bg-slate-800 rounded-lg border border-slate-700 transition">
  1820. Refresh
  1821. </button>
  1822. </div>
  1823. </div>
  1824. <!-- BGP Sub-Tabs -->
  1825. <div class="flex border-b border-slate-800 space-x-1 overflow-x-auto">
  1826. <button id="bgp-subtab-btn-bgp-peers" onclick="switchBgpSubTab('bgp-peers')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-purple-500 text-white transition flex items-center gap-2 whitespace-nowrap">
  1827. <span>BGP Peers (/routing bgp connection)</span>
  1828. <span id="dyn-badge-bgp-peers" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1829. </button>
  1830. <button id="bgp-subtab-btn-bgp-nets" onclick="switchBgpSubTab('bgp-nets')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1831. <span>Advertised Networks (/routing bgp network)</span>
  1832. <span id="dyn-badge-bgp-nets" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1833. </button>
  1834. <button id="bgp-subtab-btn-bgp-routes" onclick="switchBgpSubTab('bgp-routes')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1835. <span>BGP Routes (RIB)</span>
  1836. <span id="dyn-badge-bgp-routes" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1837. </button>
  1838. </div>
  1839. <!-- Sub-Tab 1: BGP Peers -->
  1840. <div id="dyn-subtab-bgp-peers" class="bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1841. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1842. <div class="flex items-center gap-3">
  1843. <h3 class="text-sm font-bold text-white">Configured BGP Peers</h3>
  1844. <span id="bgp-peers-count-badge" class="text-xs font-mono text-slate-400">0 Peers</span>
  1845. <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>
  1846. </div>
  1847. <div class="flex items-center gap-2">
  1848. <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>
  1849. </div>
  1850. </div>
  1851. <div class="overflow-x-auto">
  1852. <table class="w-full text-left text-xs font-mono">
  1853. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1854. <tr>
  1855. <th class="py-2.5 px-3 w-16 text-center">Flags</th>
  1856. <th class="py-2.5 px-3">Name</th>
  1857. <th class="py-2.5 px-3">Remote Address</th>
  1858. <th class="py-2.5 px-3">Remote AS</th>
  1859. <th class="py-2.5 px-3">State</th>
  1860. <th class="py-2.5 px-3">Uptime</th>
  1861. <th class="py-2.5 px-3">Prefixes (RX/TX)</th>
  1862. <th class="py-2.5 px-3">Comment</th>
  1863. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1864. </tr>
  1865. </thead>
  1866. <tbody id="bgp-peers-table-body" class="divide-y divide-slate-800/80"></tbody>
  1867. </table>
  1868. </div>
  1869. <div id="bgp-peers-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1870. No BGP peers configured. Click "+ Add BGP Peer" to establish an eBGP or iBGP peering session.
  1871. </div>
  1872. </div>
  1873. <!-- Sub-Tab 2: BGP Networks -->
  1874. <div id="dyn-subtab-bgp-nets" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1875. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1876. <div class="flex items-center gap-3">
  1877. <h3 class="text-sm font-bold text-white">Advertised BGP Networks (/routing bgp network)</h3>
  1878. <span id="bgp-nets-count-badge" class="text-xs font-mono text-slate-400">0 Networks</span>
  1879. </div>
  1880. <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">
  1881. + Add Network
  1882. </button>
  1883. </div>
  1884. <div class="overflow-x-auto">
  1885. <table class="w-full text-left text-xs font-mono">
  1886. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1887. <tr>
  1888. <th class="py-2.5 px-3">Network (CIDR)</th>
  1889. <th class="py-2.5 px-3">Status</th>
  1890. <th class="py-2.5 px-3">Comment</th>
  1891. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  1892. </tr>
  1893. </thead>
  1894. <tbody id="bgp-nets-table-body" class="divide-y divide-slate-800/80"></tbody>
  1895. </table>
  1896. </div>
  1897. <div id="bgp-nets-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1898. No networks advertised. Click "+ Add Network" to announce your IP prefixes to BGP peers.
  1899. </div>
  1900. </div>
  1901. <!-- Sub-Tab 3: BGP Routes -->
  1902. <div id="dyn-subtab-bgp-routes" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1903. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  1904. <h3 class="text-sm font-bold text-white">BGP Routing Information Base (show ip bgp)</h3>
  1905. <span id="bgp-routes-count-badge" class="text-xs font-mono text-slate-400">0 Routes</span>
  1906. </div>
  1907. <div class="overflow-x-auto">
  1908. <table class="w-full text-left text-xs font-mono">
  1909. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  1910. <tr>
  1911. <th class="py-2.5 px-3">Prefix</th>
  1912. <th class="py-2.5 px-3">Next Hop</th>
  1913. <th class="py-2.5 px-3">Metric</th>
  1914. <th class="py-2.5 px-3">Weight</th>
  1915. <th class="py-2.5 px-3">AS Path</th>
  1916. <th class="py-2.5 px-3">Origin</th>
  1917. </tr>
  1918. </thead>
  1919. <tbody id="bgp-routes-table-body" class="divide-y divide-slate-800/80"></tbody>
  1920. </table>
  1921. </div>
  1922. <div id="bgp-routes-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  1923. No active routes in BGP table. Check peer connections and ensure BGP is enabled.
  1924. </div>
  1925. </div>
  1926. </section>
  1927. <!-- ================= SECTION: OSPF ROUTING (/routing ospf) ================= -->
  1928. <section id="section-ospf" class="hidden space-y-6">
  1929. <!-- Top Routing Switcher Bar -->
  1930. <div class="flex items-center gap-1.5 p-1 bg-slate-900/90 border border-slate-800 rounded-xl w-fit">
  1931. <button onclick="navigate('routes')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1932. <svg class="w-3.5 h-3.5 text-cyan-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1933. <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" />
  1934. </svg>
  1935. <span>Routes & Policy (/ip route)</span>
  1936. </button>
  1937. <button onclick="navigate('bgp')" class="px-3.5 py-1.5 text-xs font-medium rounded-lg text-slate-400 hover:text-white hover:bg-slate-800/60 transition flex items-center gap-2">
  1938. <svg class="w-3.5 h-3.5 text-purple-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1939. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6" />
  1940. </svg>
  1941. <span>BGP (/routing bgp)</span>
  1942. </button>
  1943. <button onclick="navigate('ospf')" class="px-3.5 py-1.5 text-xs font-bold rounded-lg transition bg-indigo-600/20 text-indigo-300 border border-indigo-500/40 shadow-sm flex items-center gap-2">
  1944. <svg class="w-3.5 h-3.5 text-indigo-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
  1945. <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z" />
  1946. </svg>
  1947. <span>OSPF (/routing ospf)</span>
  1948. </button>
  1949. </div>
  1950. <div class="bg-gradient-to-r from-indigo-950/40 via-slate-900 to-slate-900 border border-indigo-900/30 rounded-xl p-5 flex flex-wrap items-center justify-between gap-4">
  1951. <div>
  1952. <div class="flex items-center gap-2 mb-1">
  1953. <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>
  1954. <h2 class="text-base font-bold text-white">OSPF Dynamic Routing</h2>
  1955. <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>
  1956. </div>
  1957. <p class="text-xs text-slate-400">Enterprise FRRouting OSPFv2 stack: Link-state interior gateway routing, multi-area topologies, and neighbor adjacencies.</p>
  1958. </div>
  1959. <div class="flex items-center space-x-2 flex-wrap gap-y-2">
  1960. <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">
  1961. <span>⚙ OSPF Settings</span>
  1962. </button>
  1963. <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">
  1964. + Add OSPF Interface
  1965. </button>
  1966. <button onclick="openAddOspfAreaModal()" class="text-xs font-semibold px-3 py-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 border border-slate-700 transition">
  1967. + Add Area
  1968. </button>
  1969. <button onclick="loadDynamicRouting()" class="text-xs text-slate-400 hover:text-white px-2.5 py-2 bg-slate-800 rounded-lg border border-slate-700 transition">
  1970. Refresh
  1971. </button>
  1972. </div>
  1973. </div>
  1974. <!-- OSPF Sub-Tabs -->
  1975. <div class="flex border-b border-slate-800 space-x-1 overflow-x-auto">
  1976. <button id="ospf-subtab-btn-ospf-ifaces" onclick="switchOspfSubTab('ospf-ifaces')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-indigo-500 text-white transition flex items-center gap-2 whitespace-nowrap">
  1977. <span>OSPF Interfaces</span>
  1978. <span id="dyn-badge-ospf-ifaces" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1979. </button>
  1980. <button id="ospf-subtab-btn-ospf-areas" onclick="switchOspfSubTab('ospf-areas')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1981. <span>OSPF Areas</span>
  1982. <span id="dyn-badge-ospf-areas" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1983. </button>
  1984. <button id="ospf-subtab-btn-ospf-nbrs" onclick="switchOspfSubTab('ospf-nbrs')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1985. <span>OSPF Neighbors</span>
  1986. <span id="dyn-badge-ospf-nbrs" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1987. </button>
  1988. <button id="ospf-subtab-btn-ospf-routes" onclick="switchOspfSubTab('ospf-routes')" class="px-4 py-2.5 text-xs font-bold border-b-2 border-transparent text-slate-400 hover:text-slate-200 transition flex items-center gap-2 whitespace-nowrap">
  1989. <span>OSPF Routes</span>
  1990. <span id="dyn-badge-ospf-routes" class="px-1.5 py-0.2 rounded text-[10px] bg-slate-800 text-slate-300">0</span>
  1991. </button>
  1992. </div>
  1993. <!-- Sub-Tab 4: OSPF Interfaces -->
  1994. <div id="dyn-subtab-ospf-ifaces" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  1995. <div class="p-4 border-b border-slate-800 flex items-center justify-between flex-wrap gap-3">
  1996. <div class="flex items-center gap-3">
  1997. <h3 class="text-sm font-bold text-white">OSPF Interface Templates (/routing ospf interface-template)</h3>
  1998. <span id="ospf-ifaces-count-badge" class="text-xs font-mono text-slate-400">0 Interfaces</span>
  1999. <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>
  2000. </div>
  2001. <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">
  2002. + Add Interface
  2003. </button>
  2004. </div>
  2005. <div class="overflow-x-auto">
  2006. <table class="w-full text-left text-xs font-mono">
  2007. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  2008. <tr>
  2009. <th class="py-2.5 px-3 w-16 text-center">Flags</th>
  2010. <th class="py-2.5 px-3">Network (CIDR)</th>
  2011. <th class="py-2.5 px-3">Area</th>
  2012. <th class="py-2.5 px-3">Interface</th>
  2013. <th class="py-2.5 px-3">Cost</th>
  2014. <th class="py-2.5 px-3">Priority</th>
  2015. <th class="py-2.5 px-3">Timers (H/D)</th>
  2016. <th class="py-2.5 px-3">Auth</th>
  2017. <th class="py-2.5 px-3">Comment</th>
  2018. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  2019. </tr>
  2020. </thead>
  2021. <tbody id="ospf-ifaces-table-body" class="divide-y divide-slate-800/80"></tbody>
  2022. </table>
  2023. </div>
  2024. <div id="ospf-ifaces-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  2025. No OSPF interfaces configured. Click "+ Add OSPF Interface" to enable OSPF on local subnets.
  2026. </div>
  2027. </div>
  2028. <!-- Sub-Tab 5: OSPF Areas -->
  2029. <div id="dyn-subtab-ospf-areas" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  2030. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  2031. <div class="flex items-center gap-3">
  2032. <h3 class="text-sm font-bold text-white">OSPF Areas (/routing ospf area)</h3>
  2033. <span id="ospf-areas-count-badge" class="text-xs font-mono text-slate-400">0 Areas</span>
  2034. </div>
  2035. <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">
  2036. + Add Area
  2037. </button>
  2038. </div>
  2039. <div class="overflow-x-auto">
  2040. <table class="w-full text-left text-xs font-mono">
  2041. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  2042. <tr>
  2043. <th class="py-2.5 px-3">Name</th>
  2044. <th class="py-2.5 px-3">Area ID</th>
  2045. <th class="py-2.5 px-3">Type</th>
  2046. <th class="py-2.5 px-3">Comment</th>
  2047. <th class="py-2.5 px-3 text-right font-sans">Actions</th>
  2048. </tr>
  2049. </thead>
  2050. <tbody id="ospf-areas-table-body" class="divide-y divide-slate-800/80"></tbody>
  2051. </table>
  2052. </div>
  2053. </div>
  2054. <!-- Sub-Tab 6: OSPF Neighbors -->
  2055. <div id="dyn-subtab-ospf-nbrs" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  2056. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  2057. <h3 class="text-sm font-bold text-white">Live OSPF Neighbors (show ip ospf neighbor)</h3>
  2058. <span id="ospf-nbrs-count-badge" class="text-xs font-mono text-slate-400">0 Neighbors</span>
  2059. </div>
  2060. <div class="overflow-x-auto">
  2061. <table class="w-full text-left text-xs font-mono">
  2062. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  2063. <tr>
  2064. <th class="py-2.5 px-3">Neighbor ID</th>
  2065. <th class="py-2.5 px-3">IP Address</th>
  2066. <th class="py-2.5 px-3">Interface</th>
  2067. <th class="py-2.5 px-3">Area</th>
  2068. <th class="py-2.5 px-3">State</th>
  2069. <th class="py-2.5 px-3">Dead Timer</th>
  2070. </tr>
  2071. </thead>
  2072. <tbody id="ospf-nbrs-table-body" class="divide-y divide-slate-800/80"></tbody>
  2073. </table>
  2074. </div>
  2075. <div id="ospf-nbrs-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  2076. No active OSPF neighbors discovered. Ensure neighbors are in the same subnet and hello/dead timers match.
  2077. </div>
  2078. </div>
  2079. <!-- Sub-Tab 7: OSPF Routes -->
  2080. <div id="dyn-subtab-ospf-routes" class="hidden bg-slate-900/90 border border-slate-800 rounded-xl overflow-hidden">
  2081. <div class="p-4 border-b border-slate-800 flex items-center justify-between">
  2082. <h3 class="text-sm font-bold text-white">OSPF Routing Table (show ip ospf route)</h3>
  2083. <span id="ospf-routes-count-badge" class="text-xs font-mono text-slate-400">0 Routes</span>
  2084. </div>
  2085. <div class="overflow-x-auto">
  2086. <table class="w-full text-left text-xs font-mono">
  2087. <thead class="text-slate-400 bg-slate-950/60 border-b border-slate-800 uppercase tracking-wider text-[10px] font-sans">
  2088. <tr>
  2089. <th class="py-2.5 px-3">Prefix</th>
  2090. <th class="py-2.5 px-3">Type</th>
  2091. <th class="py-2.5 px-3">Cost</th>
  2092. <th class="py-2.5 px-3">Area</th>
  2093. <th class="py-2.5 px-3">Next Hop / Dev</th>
  2094. </tr>
  2095. </thead>
  2096. <tbody id="ospf-routes-table-body" class="divide-y divide-slate-800/80"></tbody>
  2097. </table>
  2098. </div>
  2099. <div id="ospf-routes-empty" class="hidden p-10 text-center text-slate-500 text-xs font-sans">
  2100. No OSPF routes calculated.
  2101. </div>
  2102. </div>
  2103. </section>
  2104. <!-- ================= SECTION: DEBIAN CONFIG PERSISTENCE ================= -->
  2105. <section id="section-persistence" class="hidden space-y-6">
  2106. <div class="bg-slate-900/90 border border-slate-800 rounded-xl p-5">
  2107. <div class="flex flex-wrap items-center justify-between gap-4 mb-4">
  2108. <div>
  2109. <h3 class="text-sm font-bold text-white flex items-center gap-2">
  2110. <span>Debian /etc/network/interfaces.d/ Persistence</span>
  2111. <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>
  2112. </h3>
  2113. <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>
  2114. </div>
  2115. <div class="flex items-center space-x-3">
  2116. <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>
  2117. <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">
  2118. <span>Save to Debian Config</span>
  2119. </button>
  2120. </div>
  2121. </div>
  2122. <div class="relative">
  2123. <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>
  2124. </div>
  2125. </div>
  2126. </section>
  2127. </main>
  2128. </div>
  2129. </div>
  2130. <!-- ================= MODAL: CREATE VLAN ================= -->
  2131. <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">
  2132. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2133. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2134. <h3 class="text-sm font-bold text-white">Create New VLAN Interface</h3>
  2135. <button onclick="closeVlanModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2136. </div>
  2137. <form id="vlan-form" onsubmit="submitCreateVlan(event)" class="p-6 space-y-4">
  2138. <div>
  2139. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Parent Interface *</label>
  2140. <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>
  2141. </div>
  2142. <div class="grid grid-cols-2 gap-4">
  2143. <div>
  2144. <label class="block text-xs font-semibold text-slate-300 mb-1.5">VLAN ID (1-4094) *</label>
  2145. <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">
  2146. </div>
  2147. <div>
  2148. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Interface Name</label>
  2149. <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">
  2150. </div>
  2151. </div>
  2152. <div>
  2153. <div class="flex items-center justify-between mb-1.5">
  2154. <label class="text-xs font-semibold text-slate-300">Router IP Address & CIDR</label>
  2155. <div class="flex space-x-1">
  2156. <button type="button" onclick="setSubnetPreset('/24')" class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded">/24</button>
  2157. <button type="button" onclick="setSubnetPreset('/23')" class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded">/23</button>
  2158. <button type="button" onclick="setSubnetPreset('/16')" class="text-[10px] bg-slate-800 text-slate-400 px-1.5 py-0.5 rounded">/16</button>
  2159. </div>
  2160. </div>
  2161. <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">
  2162. </div>
  2163. <div class="grid grid-cols-2 gap-4">
  2164. <div>
  2165. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Role Tag</label>
  2166. <select id="vlan-role" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-xs text-white">
  2167. <option value="LAN">LAN</option>
  2168. <option value="GUEST">Guest Network</option>
  2169. <option value="IOT">IoT / Smart Home</option>
  2170. <option value="DMZ">DMZ / Isolated</option>
  2171. <option value="MGMT">Management</option>
  2172. <option value="WAN">WAN / Uplink</option>
  2173. </select>
  2174. </div>
  2175. <div>
  2176. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Description / Alias</label>
  2177. <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">
  2178. </div>
  2179. </div>
  2180. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2181. <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>
  2182. <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>
  2183. </div>
  2184. </form>
  2185. </div>
  2186. </div>
  2187. <!-- ================= MODAL: EDIT INTERFACE ================= -->
  2188. <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">
  2189. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2190. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2191. <div>
  2192. <h3 class="text-sm font-bold text-white flex items-center gap-2">
  2193. <span id="modal-iface-name">eth0</span>
  2194. <span id="modal-iface-badge" class="text-[10px] font-mono px-2 py-0.5 rounded bg-slate-800 text-slate-300">Ethernet</span>
  2195. </h3>
  2196. </div>
  2197. <button onclick="closeIfaceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2198. </div>
  2199. <div class="p-6 space-y-5">
  2200. <div class="grid grid-cols-2 gap-4 p-3 bg-slate-950/60 rounded-xl border border-slate-800/80">
  2201. <div>
  2202. <span class="block text-[11px] text-slate-400 mb-1">Administrative Link</span>
  2203. <div class="flex items-center space-x-2">
  2204. <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>
  2205. <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>
  2206. </div>
  2207. </div>
  2208. <div>
  2209. <span class="block text-[11px] text-slate-400 mb-1">MTU Size</span>
  2210. <div class="flex items-center space-x-2">
  2211. <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">
  2212. <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>
  2213. </div>
  2214. </div>
  2215. </div>
  2216. <div>
  2217. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Assigned IP Addresses</label>
  2218. <div id="modal-ip-list" class="space-y-1.5 mb-3 font-mono text-xs"></div>
  2219. <div class="flex space-x-2">
  2220. <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">
  2221. <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>
  2222. </div>
  2223. </div>
  2224. <div class="grid grid-cols-2 gap-4">
  2225. <div>
  2226. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Role Tag</label>
  2227. <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">
  2228. <option value="WAN">WAN / Uplink</option>
  2229. <option value="LAN">LAN</option>
  2230. <option value="DMZ">DMZ</option>
  2231. <option value="GUEST">Guest</option>
  2232. <option value="IOT">IoT</option>
  2233. <option value="MGMT">Management</option>
  2234. </select>
  2235. </div>
  2236. <div>
  2237. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Description</label>
  2238. <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">
  2239. </div>
  2240. </div>
  2241. <div class="pt-4 border-t border-slate-800 flex justify-between items-center">
  2242. <button id="modal-delete-vlan-btn" onclick="confirmDeleteVlan(currentModalIface)" class="hidden text-xs text-rose-400 hover:text-rose-300">Delete VLAN</button>
  2243. <div class="flex space-x-3">
  2244. <button onclick="closeIfaceModal()" class="px-4 py-2 rounded-lg text-xs font-medium text-slate-400 hover:bg-slate-800">Close</button>
  2245. <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>
  2246. </div>
  2247. </div>
  2248. </div>
  2249. </div>
  2250. </div>
  2251. <!-- ================= MODAL: PPPoE CLIENT ================= -->
  2252. <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">
  2253. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2254. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2255. <h3 id="pppoe-modal-title" class="text-sm font-bold text-white">Add PPPoE Client Interface</h3>
  2256. <button onclick="closePPPoEModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2257. </div>
  2258. <form onsubmit="submitSavePPPoE(event)" class="p-6 space-y-4">
  2259. <input type="hidden" id="pppoe-modal-edit-orig">
  2260. <div class="grid grid-cols-2 gap-4">
  2261. <div>
  2262. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Name *</label>
  2263. <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">
  2264. </div>
  2265. <div>
  2266. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Interface *</label>
  2267. <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>
  2268. </div>
  2269. </div>
  2270. <div class="grid grid-cols-2 gap-4">
  2271. <div>
  2272. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Username *</label>
  2273. <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">
  2274. </div>
  2275. <div>
  2276. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Password *</label>
  2277. <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">
  2278. </div>
  2279. </div>
  2280. <div class="grid grid-cols-2 gap-4">
  2281. <div>
  2282. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Service Name (Optional)</label>
  2283. <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">
  2284. </div>
  2285. <div>
  2286. <label class="block text-xs font-semibold text-slate-300 mb-1.5">MTU</label>
  2287. <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">
  2288. </div>
  2289. </div>
  2290. <div class="grid grid-cols-3 gap-2 pt-2 border-t border-slate-800/80">
  2291. <label class="flex items-center space-x-2 cursor-pointer">
  2292. <input type="checkbox" id="pppoe-modal-defroute" checked class="rounded bg-slate-800 border-slate-700 text-blue-500">
  2293. <span class="text-xs text-slate-300 font-medium">Default Route</span>
  2294. </label>
  2295. <label class="flex items-center space-x-2 cursor-pointer">
  2296. <input type="checkbox" id="pppoe-modal-reconnect" checked class="rounded bg-slate-800 border-slate-700 text-blue-500">
  2297. <span class="text-xs text-slate-300 font-medium">Auto-Reconnect</span>
  2298. </label>
  2299. <label class="flex items-center space-x-2 cursor-pointer">
  2300. <input type="checkbox" id="pppoe-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2301. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2302. </label>
  2303. </div>
  2304. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2305. <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>
  2306. <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>
  2307. </div>
  2308. </form>
  2309. </div>
  2310. </div>
  2311. <!-- ================= MODAL: WIREGUARD INTERFACE ================= -->
  2312. <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">
  2313. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2314. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2315. <h3 id="wg-iface-modal-title" class="text-sm font-bold text-white">Add WireGuard Interface</h3>
  2316. <button onclick="closeAddWGInterfaceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2317. </div>
  2318. <form onsubmit="submitSaveWGInterface(event)" class="p-6 space-y-4">
  2319. <input type="hidden" id="wg-iface-modal-edit-orig">
  2320. <div class="grid grid-cols-2 gap-4">
  2321. <div>
  2322. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Interface Name *</label>
  2323. <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">
  2324. </div>
  2325. <div>
  2326. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Listen Port *</label>
  2327. <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">
  2328. </div>
  2329. </div>
  2330. <div class="grid grid-cols-2 gap-4">
  2331. <div>
  2332. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Tunnel IP (CIDR) *</label>
  2333. <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">
  2334. </div>
  2335. <div>
  2336. <label class="block text-xs font-semibold text-slate-300 mb-1.5">MTU</label>
  2337. <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">
  2338. </div>
  2339. </div>
  2340. <div>
  2341. <div class="flex items-center justify-between mb-1.5">
  2342. <label class="text-xs font-semibold text-slate-300">Public Key</label>
  2343. <button type="button" onclick="generateWGInterfaceKeys()" class="text-[10px] text-cyan-400 hover:text-cyan-300 font-semibold">Generate New Keypair</button>
  2344. </div>
  2345. <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">
  2346. </div>
  2347. <div>
  2348. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Private Key (Secret) *</label>
  2349. <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">
  2350. </div>
  2351. <div class="pt-2">
  2352. <label class="flex items-center space-x-2 cursor-pointer">
  2353. <input type="checkbox" id="wg-iface-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2354. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2355. </label>
  2356. </div>
  2357. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2358. <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>
  2359. <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>
  2360. </div>
  2361. </form>
  2362. </div>
  2363. </div>
  2364. <!-- ================= MODAL: ADD WIREGUARD PEER ================= -->
  2365. <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">
  2366. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2367. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2368. <h3 id="wg-peer-modal-title" class="text-sm font-bold text-white">Add WireGuard Peer</h3>
  2369. <button onclick="closeAddWGPeerModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2370. </div>
  2371. <form onsubmit="submitSaveWGPeer(event)" class="p-6 space-y-4">
  2372. <div class="grid grid-cols-2 gap-4">
  2373. <div>
  2374. <label class="block text-xs font-semibold text-slate-300 mb-1.5">WireGuard Interface *</label>
  2375. <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>
  2376. </div>
  2377. <div>
  2378. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Peer Name / Alias *</label>
  2379. <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">
  2380. </div>
  2381. </div>
  2382. <div>
  2383. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Peer Public Key *</label>
  2384. <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">
  2385. </div>
  2386. <div>
  2387. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Allowed IPs (CIDR) *</label>
  2388. <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">
  2389. </div>
  2390. <div class="grid grid-cols-2 gap-4">
  2391. <div>
  2392. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Endpoint (Optional)</label>
  2393. <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">
  2394. </div>
  2395. <div>
  2396. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Keepalive (sec)</label>
  2397. <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">
  2398. </div>
  2399. </div>
  2400. <div>
  2401. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Preshared Key (Optional)</label>
  2402. <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">
  2403. </div>
  2404. <div class="pt-2">
  2405. <label class="flex items-center space-x-2 cursor-pointer">
  2406. <input type="checkbox" id="wg-peer-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2407. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2408. </label>
  2409. </div>
  2410. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2411. <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>
  2412. <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>
  2413. </div>
  2414. </form>
  2415. </div>
  2416. </div>
  2417. <!-- ================= MODAL: IPSEC TUNNEL ================= -->
  2418. <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">
  2419. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2420. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2421. <h3 id="ipsec-modal-title" class="text-sm font-bold text-white">Configure IPSec IKEv2 Tunnel</h3>
  2422. <button onclick="closeAddIPSecModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2423. </div>
  2424. <form onsubmit="submitSaveIPSec(event)" class="p-6 space-y-4">
  2425. <div>
  2426. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Connection Name *</label>
  2427. <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">
  2428. </div>
  2429. <div class="grid grid-cols-2 gap-4">
  2430. <div>
  2431. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Local Subnet *</label>
  2432. <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">
  2433. </div>
  2434. <div>
  2435. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Remote Subnet *</label>
  2436. <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">
  2437. </div>
  2438. </div>
  2439. <div>
  2440. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Remote Gateway IP / FQDN *</label>
  2441. <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">
  2442. </div>
  2443. <div>
  2444. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Pre-Shared Key (PSK) *</label>
  2445. <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">
  2446. </div>
  2447. <div class="grid grid-cols-2 gap-4">
  2448. <div>
  2449. <label class="block text-xs font-semibold text-slate-300 mb-1.5">IKE Proposals</label>
  2450. <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">
  2451. </div>
  2452. <div>
  2453. <label class="block text-xs font-semibold text-slate-300 mb-1.5">ESP Proposals</label>
  2454. <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">
  2455. </div>
  2456. </div>
  2457. <div class="grid grid-cols-2 gap-4 pt-2">
  2458. <label class="flex items-center space-x-2 cursor-pointer">
  2459. <input type="checkbox" id="ipsec-modal-autostart" checked class="rounded bg-slate-800 border-slate-700 text-amber-500">
  2460. <span class="text-xs text-slate-300 font-medium">Auto-start on boot</span>
  2461. </label>
  2462. <label class="flex items-center space-x-2 cursor-pointer">
  2463. <input type="checkbox" id="ipsec-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2464. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2465. </label>
  2466. </div>
  2467. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2468. <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>
  2469. <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>
  2470. </div>
  2471. </form>
  2472. </div>
  2473. </div>
  2474. <!-- ================= MODAL: L2TP CLIENT ================= -->
  2475. <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">
  2476. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2477. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2478. <h3 id="l2tp-modal-title" class="text-sm font-bold text-white">Add L2TP Client Interface</h3>
  2479. <button onclick="closeL2TPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2480. </div>
  2481. <form onsubmit="submitSaveL2TP(event)" class="p-6 space-y-4">
  2482. <div>
  2483. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Client Interface Name *</label>
  2484. <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">
  2485. </div>
  2486. <div>
  2487. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Connect To (Server IP / Host) *</label>
  2488. <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">
  2489. </div>
  2490. <div class="grid grid-cols-2 gap-4">
  2491. <div>
  2492. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Username *</label>
  2493. <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">
  2494. </div>
  2495. <div>
  2496. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Password *</label>
  2497. <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">
  2498. </div>
  2499. </div>
  2500. <div>
  2501. <label class="block text-xs font-semibold text-slate-300 mb-1.5">IPSec Secret / PSK (Optional for L2TP/IPsec)</label>
  2502. <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">
  2503. </div>
  2504. <div class="grid grid-cols-2 gap-4 pt-2">
  2505. <label class="flex items-center space-x-2 cursor-pointer">
  2506. <input type="checkbox" id="l2tp-modal-defroute" checked class="rounded bg-slate-800 border-slate-700 text-cyan-500">
  2507. <span class="text-xs text-slate-300 font-medium">Default Route</span>
  2508. </label>
  2509. <label class="flex items-center space-x-2 cursor-pointer">
  2510. <input type="checkbox" id="l2tp-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2511. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2512. </label>
  2513. </div>
  2514. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2515. <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>
  2516. <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>
  2517. </div>
  2518. </form>
  2519. </div>
  2520. </div>
  2521. <!-- ================= MODAL: PPTP CLIENT ================= -->
  2522. <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">
  2523. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  2524. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2525. <h3 id="pptp-modal-title" class="text-sm font-bold text-white">Add PPTP Client Interface</h3>
  2526. <button onclick="closePPTPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2527. </div>
  2528. <form onsubmit="submitSavePPTP(event)" class="p-6 space-y-4">
  2529. <div>
  2530. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Client Interface Name *</label>
  2531. <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">
  2532. </div>
  2533. <div>
  2534. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Connect To (Server IP / Host) *</label>
  2535. <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">
  2536. </div>
  2537. <div class="grid grid-cols-2 gap-4">
  2538. <div>
  2539. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Username *</label>
  2540. <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">
  2541. </div>
  2542. <div>
  2543. <label class="block text-xs font-semibold text-slate-300 mb-1.5">Password *</label>
  2544. <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">
  2545. </div>
  2546. </div>
  2547. <div class="grid grid-cols-3 gap-2 pt-2 border-t border-slate-800/80">
  2548. <label class="flex items-center space-x-2 cursor-pointer">
  2549. <input type="checkbox" id="pptp-modal-mppe" checked class="rounded bg-slate-800 border-slate-700 text-purple-500">
  2550. <span class="text-xs text-slate-300 font-medium">MPPE-128</span>
  2551. </label>
  2552. <label class="flex items-center space-x-2 cursor-pointer">
  2553. <input type="checkbox" id="pptp-modal-defroute" checked class="rounded bg-slate-800 border-slate-700 text-purple-500">
  2554. <span class="text-xs text-slate-300 font-medium">Default Route</span>
  2555. </label>
  2556. <label class="flex items-center space-x-2 cursor-pointer">
  2557. <input type="checkbox" id="pptp-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2558. <span class="text-xs text-slate-300 font-medium">Disabled (X)</span>
  2559. </label>
  2560. </div>
  2561. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2562. <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>
  2563. <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>
  2564. </div>
  2565. </form>
  2566. </div>
  2567. </div>
  2568. <!-- ================= MODAL: FIREWALL FILTER RULE ================= -->
  2569. <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">
  2570. <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">
  2571. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2572. <h3 id="filter-modal-title" class="text-sm font-bold text-white">Add Firewall Filter Rule</h3>
  2573. <button onclick="closeFilterModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2574. </div>
  2575. <form onsubmit="submitSaveFilterRule(event)" class="p-6 space-y-4 overflow-y-auto flex-1 text-xs">
  2576. <input type="hidden" id="filter-modal-id">
  2577. <div class="grid grid-cols-2 gap-4">
  2578. <div>
  2579. <label class="block font-semibold text-slate-300 mb-1">Chain *</label>
  2580. <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">
  2581. <option value="input">input (traffic to router)</option>
  2582. <option value="forward" selected>forward (routed traffic)</option>
  2583. <option value="output">output (traffic from router)</option>
  2584. </select>
  2585. </div>
  2586. <div>
  2587. <label class="block font-semibold text-slate-300 mb-1">Action *</label>
  2588. <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">
  2589. <option value="accept" selected>accept</option>
  2590. <option value="drop">drop</option>
  2591. <option value="reject">reject</option>
  2592. <option value="log">log</option>
  2593. <option value="jump">jump</option>
  2594. <option value="return">return</option>
  2595. </select>
  2596. </div>
  2597. </div>
  2598. <div id="filter-action-reject-box" class="hidden p-3 bg-rose-950/20 border border-rose-900/30 rounded-lg">
  2599. <label class="block font-semibold text-rose-300 mb-1">Reject With</label>
  2600. <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">
  2601. <option value="icmp-network-unreachable">icmp-network-unreachable</option>
  2602. <option value="icmp-host-unreachable">icmp-host-unreachable</option>
  2603. <option value="icmp-port-unreachable">icmp-port-unreachable</option>
  2604. <option value="tcp-reset">tcp-reset (TCP RST)</option>
  2605. </select>
  2606. </div>
  2607. <div class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2608. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Match Properties</span>
  2609. <div class="grid grid-cols-2 gap-3">
  2610. <div>
  2611. <label class="block font-semibold text-slate-300 mb-1">Protocol</label>
  2612. <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">
  2613. <option value="all">all</option>
  2614. <option value="tcp">tcp (6)</option>
  2615. <option value="udp">udp (17)</option>
  2616. <option value="icmp">icmp (1)</option>
  2617. <option value="gre">gre (47)</option>
  2618. <option value="esp">esp (50)</option>
  2619. </select>
  2620. </div>
  2621. <div>
  2622. <label class="block font-semibold text-slate-300 mb-1">Connection Mark</label>
  2623. <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">
  2624. </div>
  2625. </div>
  2626. <div class="grid grid-cols-2 gap-3">
  2627. <div>
  2628. <label class="block font-semibold text-slate-300 mb-1">Src. Address / CIDR</label>
  2629. <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">
  2630. </div>
  2631. <div>
  2632. <label class="block font-semibold text-slate-300 mb-1">Dst. Address / CIDR</label>
  2633. <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">
  2634. </div>
  2635. </div>
  2636. <div class="grid grid-cols-2 gap-3">
  2637. <div>
  2638. <label class="block font-semibold text-slate-300 mb-1">Src. Port(s)</label>
  2639. <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">
  2640. </div>
  2641. <div>
  2642. <label class="block font-semibold text-slate-300 mb-1">Dst. Port(s)</label>
  2643. <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">
  2644. </div>
  2645. </div>
  2646. <div class="grid grid-cols-2 gap-3">
  2647. <div>
  2648. <label class="block font-semibold text-slate-300 mb-1">In. Interface</label>
  2649. <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>
  2650. </div>
  2651. <div>
  2652. <label class="block font-semibold text-slate-300 mb-1">Out. Interface</label>
  2653. <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>
  2654. </div>
  2655. </div>
  2656. <div>
  2657. <label class="block font-semibold text-slate-300 mb-1.5">Connection State</label>
  2658. <div class="flex flex-wrap gap-3">
  2659. <label class="flex items-center space-x-1.5 cursor-pointer">
  2660. <input type="checkbox" id="filter-modal-cs-established" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2661. <span class="text-slate-300">established</span>
  2662. </label>
  2663. <label class="flex items-center space-x-1.5 cursor-pointer">
  2664. <input type="checkbox" id="filter-modal-cs-related" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2665. <span class="text-slate-300">related</span>
  2666. </label>
  2667. <label class="flex items-center space-x-1.5 cursor-pointer">
  2668. <input type="checkbox" id="filter-modal-cs-new" class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2669. <span class="text-slate-300">new</span>
  2670. </label>
  2671. <label class="flex items-center space-x-1.5 cursor-pointer">
  2672. <input type="checkbox" id="filter-modal-cs-invalid" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2673. <span class="text-slate-300">invalid</span>
  2674. </label>
  2675. </div>
  2676. </div>
  2677. <div class="grid grid-cols-2 gap-3">
  2678. <div>
  2679. <div class="flex items-center justify-between mb-1">
  2680. <label class="font-semibold text-slate-300">Src. Address List</label>
  2681. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2682. <input type="checkbox" id="filter-modal-srclist-inv" class="rounded bg-slate-800 border-slate-700">
  2683. <span>! Invert</span>
  2684. </label>
  2685. </div>
  2686. <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">
  2687. <option value="">(None)</option>
  2688. </select>
  2689. </div>
  2690. <div>
  2691. <div class="flex items-center justify-between mb-1">
  2692. <label class="font-semibold text-slate-300">Dst. Address List</label>
  2693. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2694. <input type="checkbox" id="filter-modal-dstlist-inv" class="rounded bg-slate-800 border-slate-700">
  2695. <span>! Invert</span>
  2696. </label>
  2697. </div>
  2698. <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">
  2699. <option value="">(None)</option>
  2700. </select>
  2701. </div>
  2702. </div>
  2703. <div class="grid grid-cols-2 gap-3">
  2704. <div>
  2705. <div class="flex items-center justify-between mb-1">
  2706. <label class="font-semibold text-emerald-400 flex items-center gap-1"><span>🌍</span> <span>Source GEO IP List</span></label>
  2707. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2708. <input type="checkbox" id="filter-modal-srcgeoip-inv" class="rounded bg-slate-800 border-slate-700">
  2709. <span>! Invert</span>
  2710. </label>
  2711. </div>
  2712. <select id="filter-modal-srcgeoip" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2713. <option value="">(None)</option>
  2714. </select>
  2715. </div>
  2716. <div>
  2717. <div class="flex items-center justify-between mb-1">
  2718. <label class="font-semibold text-emerald-400 flex items-center gap-1"><span>🌍</span> <span>Destination GEO IP List</span></label>
  2719. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2720. <input type="checkbox" id="filter-modal-dstgeoip-inv" class="rounded bg-slate-800 border-slate-700">
  2721. <span>! Invert</span>
  2722. </label>
  2723. </div>
  2724. <select id="filter-modal-dstgeoip" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2725. <option value="">(None)</option>
  2726. </select>
  2727. </div>
  2728. </div>
  2729. </div>
  2730. <div>
  2731. <label class="block font-semibold text-slate-300 mb-1">Comment</label>
  2732. <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">
  2733. </div>
  2734. <div class="pt-2">
  2735. <label class="flex items-center space-x-2 cursor-pointer">
  2736. <input type="checkbox" id="filter-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2737. <span class="font-medium text-slate-300">Disabled (X)</span>
  2738. </label>
  2739. </div>
  2740. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2741. <button type="button" onclick="closeFilterModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2742. <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>
  2743. </div>
  2744. </form>
  2745. </div>
  2746. </div>
  2747. <!-- ================= MODAL: FIREWALL NAT RULE ================= -->
  2748. <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">
  2749. <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">
  2750. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2751. <h3 id="nat-modal-title" class="text-sm font-bold text-white">Add NAT Rule</h3>
  2752. <button onclick="closeNATModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2753. </div>
  2754. <form onsubmit="submitSaveNATRule(event)" class="p-6 space-y-4 overflow-y-auto flex-1 text-xs">
  2755. <input type="hidden" id="nat-modal-id">
  2756. <div class="grid grid-cols-2 gap-4">
  2757. <div>
  2758. <label class="block font-semibold text-slate-300 mb-1">Chain *</label>
  2759. <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">
  2760. <option value="srcnat" selected>srcnat (Outgoing / Masquerade)</option>
  2761. <option value="dstnat">dstnat (Incoming / Port Forwarding)</option>
  2762. </select>
  2763. </div>
  2764. <div>
  2765. <label class="block font-semibold text-slate-300 mb-1">Action *</label>
  2766. <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">
  2767. <option value="masquerade" selected>masquerade</option>
  2768. <option value="src-nat">src-nat</option>
  2769. <option value="dst-nat">dst-nat</option>
  2770. <option value="redirect">redirect</option>
  2771. <option value="accept">accept</option>
  2772. </select>
  2773. </div>
  2774. </div>
  2775. <div id="nat-action-to-box" class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2776. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">NAT Target (To Addresses / Ports)</span>
  2777. <div class="grid grid-cols-2 gap-3">
  2778. <div>
  2779. <label class="block font-semibold text-slate-300 mb-1">To Addresses</label>
  2780. <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">
  2781. </div>
  2782. <div>
  2783. <label class="block font-semibold text-slate-300 mb-1">To Ports</label>
  2784. <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">
  2785. </div>
  2786. </div>
  2787. </div>
  2788. <div class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2789. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Match Properties</span>
  2790. <div class="grid grid-cols-2 gap-3">
  2791. <div>
  2792. <label class="block font-semibold text-slate-300 mb-1">Protocol</label>
  2793. <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">
  2794. <option value="all">all</option>
  2795. <option value="tcp">tcp</option>
  2796. <option value="udp">udp</option>
  2797. <option value="icmp">icmp</option>
  2798. </select>
  2799. </div>
  2800. <div>
  2801. <label class="block font-semibold text-slate-300 mb-1">Dst. Port(s)</label>
  2802. <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">
  2803. </div>
  2804. </div>
  2805. <div class="grid grid-cols-2 gap-3">
  2806. <div>
  2807. <label class="block font-semibold text-slate-300 mb-1">Src. Address / CIDR</label>
  2808. <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">
  2809. </div>
  2810. <div>
  2811. <label class="block font-semibold text-slate-300 mb-1">Dst. Address / CIDR</label>
  2812. <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">
  2813. </div>
  2814. </div>
  2815. <div class="grid grid-cols-2 gap-3">
  2816. <div>
  2817. <label class="block font-semibold text-slate-300 mb-1">In. Interface</label>
  2818. <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>
  2819. </div>
  2820. <div>
  2821. <label class="block font-semibold text-slate-300 mb-1">Out. Interface</label>
  2822. <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>
  2823. </div>
  2824. </div>
  2825. <div class="grid grid-cols-2 gap-3">
  2826. <div>
  2827. <div class="flex items-center justify-between mb-1">
  2828. <label class="font-semibold text-slate-300">Src. Address List</label>
  2829. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2830. <input type="checkbox" id="nat-modal-srclist-inv" class="rounded bg-slate-800 border-slate-700">
  2831. <span>! Invert</span>
  2832. </label>
  2833. </div>
  2834. <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>
  2835. </div>
  2836. <div>
  2837. <div class="flex items-center justify-between mb-1">
  2838. <label class="font-semibold text-slate-300">Dst. Address List</label>
  2839. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2840. <input type="checkbox" id="nat-modal-dstlist-inv" class="rounded bg-slate-800 border-slate-700">
  2841. <span>! Invert</span>
  2842. </label>
  2843. </div>
  2844. <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>
  2845. </div>
  2846. </div>
  2847. <div class="grid grid-cols-2 gap-3">
  2848. <div>
  2849. <div class="flex items-center justify-between mb-1">
  2850. <label class="font-semibold text-emerald-400 flex items-center gap-1"><span>🌍</span> <span>Source GEO IP List</span></label>
  2851. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2852. <input type="checkbox" id="nat-modal-srcgeoip-inv" class="rounded bg-slate-800 border-slate-700">
  2853. <span>! Invert</span>
  2854. </label>
  2855. </div>
  2856. <select id="nat-modal-srcgeoip" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2857. <option value="">(None)</option>
  2858. </select>
  2859. </div>
  2860. <div>
  2861. <div class="flex items-center justify-between mb-1">
  2862. <label class="font-semibold text-emerald-400 flex items-center gap-1"><span>🌍</span> <span>Destination GEO IP List</span></label>
  2863. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2864. <input type="checkbox" id="nat-modal-dstgeoip-inv" class="rounded bg-slate-800 border-slate-700">
  2865. <span>! Invert</span>
  2866. </label>
  2867. </div>
  2868. <select id="nat-modal-dstgeoip" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2869. <option value="">(None)</option>
  2870. </select>
  2871. </div>
  2872. </div>
  2873. </div>
  2874. <div>
  2875. <label class="block font-semibold text-slate-300 mb-1">Comment</label>
  2876. <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">
  2877. </div>
  2878. <div class="pt-2">
  2879. <label class="flex items-center space-x-2 cursor-pointer">
  2880. <input type="checkbox" id="nat-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  2881. <span class="font-medium text-slate-300">Disabled (X)</span>
  2882. </label>
  2883. </div>
  2884. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  2885. <button type="button" onclick="closeNATModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  2886. <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>
  2887. </div>
  2888. </form>
  2889. </div>
  2890. </div>
  2891. <!-- ================= MODAL: FIREWALL MANGLE RULE ================= -->
  2892. <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">
  2893. <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">
  2894. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  2895. <h3 id="mangle-modal-title" class="text-sm font-bold text-white">Add Mangle Rule</h3>
  2896. <button onclick="closeMangleModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  2897. </div>
  2898. <form onsubmit="submitSaveMangleRule(event)" class="p-6 space-y-4 overflow-y-auto flex-1 text-xs">
  2899. <input type="hidden" id="mangle-modal-id">
  2900. <div class="grid grid-cols-2 gap-4">
  2901. <div>
  2902. <label class="block font-semibold text-slate-300 mb-1">Chain *</label>
  2903. <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">
  2904. <option value="prerouting" selected>prerouting (Policy Routing / Marks)</option>
  2905. <option value="forward">forward</option>
  2906. <option value="postrouting">postrouting</option>
  2907. <option value="input">input</option>
  2908. <option value="output">output</option>
  2909. </select>
  2910. </div>
  2911. <div>
  2912. <label class="block font-semibold text-slate-300 mb-1">Action *</label>
  2913. <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">
  2914. <option value="mark-connection" selected>mark-connection</option>
  2915. <option value="mark-routing">mark-routing (Policy Routing)</option>
  2916. <option value="mark-packet">mark-packet (QoS / Queues)</option>
  2917. <option value="change-mss">change-mss (TCP MSS Clamp)</option>
  2918. <option value="set-dscp">set-dscp</option>
  2919. <option value="accept">accept</option>
  2920. </select>
  2921. </div>
  2922. </div>
  2923. <div id="mangle-target-box" class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2924. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Mark Target & Passthrough</span>
  2925. <div class="grid grid-cols-2 gap-3">
  2926. <div id="mangle-field-newmark">
  2927. <label class="block font-semibold text-slate-300 mb-1">New Mark Name</label>
  2928. <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">
  2929. </div>
  2930. <div class="flex items-center pt-5">
  2931. <label class="flex items-center space-x-2 cursor-pointer">
  2932. <input type="checkbox" id="mangle-modal-passthrough" checked class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  2933. <span class="font-medium text-slate-300">Passthrough</span>
  2934. </label>
  2935. </div>
  2936. </div>
  2937. </div>
  2938. <div class="p-3 bg-slate-950/60 border border-slate-800/80 rounded-xl space-y-3">
  2939. <span class="block font-bold text-slate-400 uppercase tracking-wider text-[10px]">Match Criteria</span>
  2940. <div class="grid grid-cols-2 gap-3">
  2941. <div>
  2942. <label class="block font-semibold text-slate-300 mb-1">Src. Address / CIDR</label>
  2943. <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">
  2944. </div>
  2945. <div>
  2946. <label class="block font-semibold text-slate-300 mb-1">Dst. Address / CIDR</label>
  2947. <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">
  2948. </div>
  2949. </div>
  2950. <div class="grid grid-cols-2 gap-3">
  2951. <div>
  2952. <label class="block font-semibold text-slate-300 mb-1">Connection Mark</label>
  2953. <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">
  2954. </div>
  2955. <div>
  2956. <label class="block font-semibold text-slate-300 mb-1">In. Interface</label>
  2957. <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>
  2958. </div>
  2959. </div>
  2960. <div class="grid grid-cols-2 gap-3">
  2961. <div>
  2962. <div class="flex items-center justify-between mb-1">
  2963. <label class="font-semibold text-slate-300">Src. Address List</label>
  2964. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2965. <input type="checkbox" id="mangle-modal-srclist-inv" class="rounded bg-slate-800 border-slate-700">
  2966. <span>! Invert</span>
  2967. </label>
  2968. </div>
  2969. <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>
  2970. </div>
  2971. <div>
  2972. <div class="flex items-center justify-between mb-1">
  2973. <label class="font-semibold text-slate-300">Dst. Address List</label>
  2974. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2975. <input type="checkbox" id="mangle-modal-dstlist-inv" class="rounded bg-slate-800 border-slate-700">
  2976. <span>! Invert</span>
  2977. </label>
  2978. </div>
  2979. <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>
  2980. </div>
  2981. </div>
  2982. <div class="grid grid-cols-2 gap-3">
  2983. <div>
  2984. <div class="flex items-center justify-between mb-1">
  2985. <label class="font-semibold text-emerald-400 flex items-center gap-1"><span>🌍</span> <span>Source GEO IP List</span></label>
  2986. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2987. <input type="checkbox" id="mangle-modal-srcgeoip-inv" class="rounded bg-slate-800 border-slate-700">
  2988. <span>! Invert</span>
  2989. </label>
  2990. </div>
  2991. <select id="mangle-modal-srcgeoip" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  2992. <option value="">(None)</option>
  2993. </select>
  2994. </div>
  2995. <div>
  2996. <div class="flex items-center justify-between mb-1">
  2997. <label class="font-semibold text-emerald-400 flex items-center gap-1"><span>🌍</span> <span>Destination GEO IP List</span></label>
  2998. <label class="flex items-center space-x-1 cursor-pointer text-[10px] text-amber-400 font-mono">
  2999. <input type="checkbox" id="mangle-modal-dstgeoip-inv" class="rounded bg-slate-800 border-slate-700">
  3000. <span>! Invert</span>
  3001. </label>
  3002. </div>
  3003. <select id="mangle-modal-dstgeoip" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-1.5 text-white font-mono">
  3004. <option value="">(None)</option>
  3005. </select>
  3006. </div>
  3007. </div>
  3008. </div>
  3009. <div>
  3010. <label class="block font-semibold text-slate-300 mb-1">Comment</label>
  3011. <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">
  3012. </div>
  3013. <div class="pt-2">
  3014. <label class="flex items-center space-x-2 cursor-pointer">
  3015. <input type="checkbox" id="mangle-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  3016. <span class="font-medium text-slate-300">Disabled (X)</span>
  3017. </label>
  3018. </div>
  3019. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3020. <button type="button" onclick="closeMangleModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3021. <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>
  3022. </div>
  3023. </form>
  3024. </div>
  3025. </div>
  3026. <!-- ================= MODAL: ADDRESS LIST ENTRY ================= -->
  3027. <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">
  3028. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3029. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3030. <h3 id="addrlist-modal-title" class="text-sm font-bold text-white">Add Address List Entry</h3>
  3031. <button onclick="closeAddrListModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3032. </div>
  3033. <form onsubmit="submitSaveAddrList(event)" class="p-6 space-y-4 text-xs">
  3034. <input type="hidden" id="addrlist-modal-id">
  3035. <div>
  3036. <label class="block font-semibold text-slate-300 mb-1.5">List Name *</label>
  3037. <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">
  3038. </div>
  3039. <div>
  3040. <label class="block font-semibold text-slate-300 mb-1.5">IP Address / Subnet (CIDR) *</label>
  3041. <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">
  3042. </div>
  3043. <div>
  3044. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3045. <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">
  3046. </div>
  3047. <div class="pt-2">
  3048. <label class="flex items-center space-x-2 cursor-pointer">
  3049. <input type="checkbox" id="addrlist-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  3050. <span class="font-medium text-slate-300">Disabled (X)</span>
  3051. </label>
  3052. </div>
  3053. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3054. <button type="button" onclick="closeAddrListModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3055. <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>
  3056. </div>
  3057. </form>
  3058. </div>
  3059. </div>
  3060. <!-- ================= MODAL: GEO INTERVAL SETTINGS ================= -->
  3061. <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">
  3062. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3063. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3064. <h3 class="text-sm font-bold text-white">Geo-Location Auto-Update Settings</h3>
  3065. <button onclick="closeGeoIntervalModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3066. </div>
  3067. <form onsubmit="submitGeoIntervalSettings(event)" class="p-6 space-y-4 text-xs">
  3068. <div class="p-3 bg-slate-950/60 border border-slate-800 rounded-xl space-y-2">
  3069. <label class="flex items-center space-x-2.5 cursor-pointer">
  3070. <input type="checkbox" id="geo-cfg-autoupdate" checked class="rounded bg-slate-800 border-slate-700 text-emerald-500">
  3071. <span class="font-semibold text-white">Enable Automatic Background Updates</span>
  3072. </label>
  3073. <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>
  3074. </div>
  3075. <div>
  3076. <label class="block font-semibold text-slate-300 mb-1.5">Update Interval *</label>
  3077. <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">
  3078. <option value="12">Every 12 Hours</option>
  3079. <option value="24" selected>Every 24 Hours (Daily - Recommended)</option>
  3080. <option value="48">Every 48 Hours (2 Days)</option>
  3081. <option value="72">Every 3 Days</option>
  3082. <option value="168">Every 7 Days (Weekly)</option>
  3083. <option value="720">Every 30 Days (Monthly)</option>
  3084. <option value="custom">Custom Hours...</option>
  3085. </select>
  3086. </div>
  3087. <div id="geo-cfg-custom-box" class="hidden">
  3088. <label class="block font-semibold text-slate-300 mb-1.5">Custom Interval (Hours)</label>
  3089. <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">
  3090. </div>
  3091. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3092. <button type="button" onclick="closeGeoIntervalModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3093. <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>
  3094. </div>
  3095. </form>
  3096. </div>
  3097. </div>
  3098. <!-- ================= MODAL: GEO SUBNETS PREVIEW ================= -->
  3099. <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">
  3100. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3101. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3102. <div>
  3103. <h3 id="geo-subnets-title" class="text-sm font-bold text-white">Country Subnets</h3>
  3104. <span id="geo-subnets-subtitle" class="text-[11px] font-mono text-slate-400">CIDR Blocks</span>
  3105. </div>
  3106. <button onclick="closeGeoSubnetsModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3107. </div>
  3108. <div class="p-6 space-y-3 text-xs">
  3109. <p class="text-slate-400">Showing first 100 subnets in this country zone:</p>
  3110. <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>
  3111. <div class="pt-3 border-t border-slate-800 flex justify-end">
  3112. <button type="button" onclick="closeGeoSubnetsModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Close</button>
  3113. </div>
  3114. </div>
  3115. </div>
  3116. </div>
  3117. <!-- ================= MODAL: ADD / EDIT ROUTE ================= -->
  3118. <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">
  3119. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3120. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3121. <h3 id="route-modal-title" class="text-sm font-bold text-white">Add Static Route</h3>
  3122. <button onclick="closeRouteModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3123. </div>
  3124. <form onsubmit="submitSaveRoute(event)" class="p-6 space-y-4 text-xs">
  3125. <input type="hidden" id="route-modal-id">
  3126. <input type="hidden" id="route-modal-old-dst">
  3127. <input type="hidden" id="route-modal-old-gw">
  3128. <input type="hidden" id="route-modal-old-distance">
  3129. <input type="hidden" id="route-modal-old-table">
  3130. <input type="hidden" id="route-modal-old-iface">
  3131. <div>
  3132. <label class="block font-semibold text-slate-300 mb-1.5">Dst. Address (CIDR) *</label>
  3133. <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">
  3134. </div>
  3135. <div class="grid grid-cols-2 gap-4">
  3136. <div>
  3137. <label class="block font-semibold text-slate-300 mb-1.5">Gateway (IP or Interface)</label>
  3138. <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">
  3139. </div>
  3140. <div>
  3141. <label class="block font-semibold text-slate-300 mb-1.5">Routing Table / Mark</label>
  3142. <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">
  3143. <option value="main" selected>main</option>
  3144. </select>
  3145. </div>
  3146. </div>
  3147. <div class="grid grid-cols-2 gap-4">
  3148. <div>
  3149. <label class="block font-semibold text-slate-300 mb-1.5">Distance (Metric)</label>
  3150. <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">
  3151. </div>
  3152. <div>
  3153. <label class="block font-semibold text-slate-300 mb-1.5">Interface (Optional)</label>
  3154. <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>
  3155. </div>
  3156. </div>
  3157. <div>
  3158. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3159. <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">
  3160. </div>
  3161. <div class="pt-2">
  3162. <label class="flex items-center space-x-2 cursor-pointer">
  3163. <input type="checkbox" id="route-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  3164. <span class="font-medium text-slate-300">Disabled (X)</span>
  3165. </label>
  3166. </div>
  3167. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3168. <button type="button" onclick="closeRouteModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3169. <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>
  3170. </div>
  3171. </form>
  3172. </div>
  3173. </div>
  3174. <!-- ================= MODAL: ADD POLICY ROUTING RULE ================= -->
  3175. <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">
  3176. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3177. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3178. <h3 id="prule-modal-title" class="text-sm font-bold text-white">Add Policy Routing Rule (/ip route rule)</h3>
  3179. <button onclick="closePolicyRuleModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3180. </div>
  3181. <form onsubmit="submitSavePolicyRule(event)" class="p-6 space-y-4 text-xs">
  3182. <input type="hidden" id="prule-modal-id">
  3183. <div class="grid grid-cols-2 gap-4">
  3184. <div>
  3185. <label class="block font-semibold text-slate-300 mb-1.5">Priority / Preference</label>
  3186. <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">
  3187. </div>
  3188. <div>
  3189. <label class="block font-semibold text-slate-300 mb-1.5">Routing Mark (fwmark)</label>
  3190. <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">
  3191. </div>
  3192. </div>
  3193. <div class="grid grid-cols-2 gap-4">
  3194. <div>
  3195. <label class="block font-semibold text-slate-300 mb-1.5">Src. Address (CIDR)</label>
  3196. <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">
  3197. </div>
  3198. <div>
  3199. <label class="block font-semibold text-slate-300 mb-1.5">Dst. Address (CIDR)</label>
  3200. <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">
  3201. </div>
  3202. </div>
  3203. <div class="grid grid-cols-2 gap-4">
  3204. <div>
  3205. <label class="block font-semibold text-slate-300 mb-1.5">Lookup Table *</label>
  3206. <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>
  3207. </div>
  3208. <div>
  3209. <label class="block font-semibold text-slate-300 mb-1.5">Action</label>
  3210. <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">
  3211. <option value="lookup" selected>lookup (standard)</option>
  3212. <option value="unreachable">unreachable</option>
  3213. <option value="blackhole">blackhole</option>
  3214. </select>
  3215. </div>
  3216. </div>
  3217. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3218. <button type="button" onclick="closePolicyRuleModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3219. <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>
  3220. </div>
  3221. </form>
  3222. </div>
  3223. </div>
  3224. <!-- ================= MODAL: CREATE ROUTING TABLE ================= -->
  3225. <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">
  3226. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3227. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3228. <h3 class="text-sm font-bold text-white">Create New Routing Table</h3>
  3229. <button onclick="closeTableModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3230. </div>
  3231. <form onsubmit="submitSaveTable(event)" class="p-6 space-y-4 text-xs">
  3232. <div>
  3233. <label class="block font-semibold text-slate-300 mb-1.5">Table Name *</label>
  3234. <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">
  3235. </div>
  3236. <div>
  3237. <label class="block font-semibold text-slate-300 mb-1.5">FIB Table ID (Optional)</label>
  3238. <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">
  3239. </div>
  3240. <div>
  3241. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3242. <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">
  3243. </div>
  3244. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3245. <button type="button" onclick="closeTableModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3246. <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>
  3247. </div>
  3248. </form>
  3249. </div>
  3250. </div>
  3251. <!-- ================= MODAL: ADD/EDIT EoIP TUNNEL ================= -->
  3252. <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">
  3253. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3254. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3255. <div>
  3256. <h3 id="eoip-modal-title" class="text-sm font-bold text-white">Add EoIP Tunnel</h3>
  3257. <p class="text-[11px] text-slate-400">MikroTik RouterOS Layer 2 GRETAP Tunnel</p>
  3258. </div>
  3259. <button onclick="closeEoIPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3260. </div>
  3261. <form onsubmit="submitSaveEoIP(event)" class="p-6 space-y-4 text-xs font-sans">
  3262. <input type="hidden" id="eoip-modal-id">
  3263. <div class="grid grid-cols-2 gap-4">
  3264. <div>
  3265. <label class="block font-semibold text-slate-300 mb-1.5">Interface Name *</label>
  3266. <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">
  3267. </div>
  3268. <div>
  3269. <label class="block font-semibold text-slate-300 mb-1.5">Tunnel ID (1 - 65535) *</label>
  3270. <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">
  3271. </div>
  3272. </div>
  3273. <div class="grid grid-cols-2 gap-4">
  3274. <div>
  3275. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (Remote Router IP) *</label>
  3276. <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">
  3277. <span class="text-[10px] text-slate-400">Underlay IP of the remote MikroTik router</span>
  3278. </div>
  3279. <div>
  3280. <label class="block font-semibold text-slate-300 mb-1.5">Tunnel IP / Subnet (CIDR)</label>
  3281. <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">
  3282. <span class="text-[10px] text-slate-400">Overlay IPv4 assigned directly to tunnel (/30, /24)</span>
  3283. </div>
  3284. </div>
  3285. <div class="grid grid-cols-2 gap-4">
  3286. <div>
  3287. <label class="block font-semibold text-slate-300 mb-1.5">Underlay Local IP (GRE Source)</label>
  3288. <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">
  3289. <span class="text-[10px] text-slate-400">Local router IP for outer GRE packets</span>
  3290. </div>
  3291. <div>
  3292. <label class="block font-semibold text-slate-300 mb-1.5">MAC Address (Auto if empty)</label>
  3293. <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">
  3294. </div>
  3295. </div>
  3296. <div class="grid grid-cols-2 gap-4">
  3297. <div>
  3298. <label class="block font-semibold text-slate-300 mb-1.5">MTU</label>
  3299. <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">
  3300. </div>
  3301. <div>
  3302. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3303. <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">
  3304. </div>
  3305. </div>
  3306. <div class="flex items-center justify-between pt-1">
  3307. <label class="flex items-center space-x-2 text-slate-300">
  3308. <input type="checkbox" id="eoip-modal-clampmss" checked class="rounded bg-slate-800 border-slate-700 text-emerald-600">
  3309. <span>Clamp TCP MSS (PMTUD protection)</span>
  3310. </label>
  3311. <label class="flex items-center space-x-2 text-slate-300">
  3312. <input type="checkbox" id="eoip-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-600">
  3313. <span>Disabled</span>
  3314. </label>
  3315. </div>
  3316. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3317. <button type="button" onclick="closeEoIPModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3318. <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>
  3319. </div>
  3320. </form>
  3321. </div>
  3322. </div>
  3323. <!-- ================= MODAL: ADD/EDIT PPP SECRET (USER) ================= -->
  3324. <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">
  3325. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3326. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3327. <div>
  3328. <h3 id="secret-modal-title" class="text-sm font-bold text-white">Add PPP Secret</h3>
  3329. <p class="text-[11px] text-slate-400">User account for PPPoE, PPTP, and L2TP authentication</p>
  3330. </div>
  3331. <button onclick="closePPPSecretModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3332. </div>
  3333. <form onsubmit="submitSavePPPSecret(event)" class="p-6 space-y-4 text-xs font-sans">
  3334. <input type="hidden" id="secret-modal-id">
  3335. <div class="grid grid-cols-2 gap-4">
  3336. <div>
  3337. <label class="block font-semibold text-slate-300 mb-1.5">Username (Name) *</label>
  3338. <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">
  3339. </div>
  3340. <div>
  3341. <label class="block font-semibold text-slate-300 mb-1.5">Password *</label>
  3342. <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">
  3343. </div>
  3344. </div>
  3345. <div class="grid grid-cols-2 gap-4">
  3346. <div>
  3347. <label class="block font-semibold text-slate-300 mb-1.5">Service</label>
  3348. <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">
  3349. <option value="any">any</option>
  3350. <option value="pppoe">pppoe</option>
  3351. <option value="pptp">pptp</option>
  3352. <option value="l2tp">l2tp</option>
  3353. </select>
  3354. </div>
  3355. <div>
  3356. <label class="block font-semibold text-slate-300 mb-1.5">Profile</label>
  3357. <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>
  3358. </div>
  3359. </div>
  3360. <div class="grid grid-cols-2 gap-4">
  3361. <div>
  3362. <label class="block font-semibold text-slate-300 mb-1.5">Local Address (Optional)</label>
  3363. <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">
  3364. </div>
  3365. <div>
  3366. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (Optional Static IP)</label>
  3367. <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">
  3368. </div>
  3369. </div>
  3370. <div>
  3371. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3372. <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">
  3373. </div>
  3374. <div class="flex items-center space-x-2 pt-1">
  3375. <input type="checkbox" id="secret-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-600">
  3376. <label for="secret-modal-disabled" class="text-slate-300">Disabled</label>
  3377. </div>
  3378. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3379. <button type="button" onclick="closePPPSecretModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3380. <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>
  3381. </div>
  3382. </form>
  3383. </div>
  3384. </div>
  3385. <!-- ================= MODAL: ADD/EDIT PPP PROFILE ================= -->
  3386. <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">
  3387. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3388. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3389. <div>
  3390. <h3 id="profile-modal-title" class="text-sm font-bold text-white">Add PPP Profile</h3>
  3391. <p class="text-[11px] text-slate-400">IP pool and encryption settings for PPP servers</p>
  3392. </div>
  3393. <button onclick="closePPPProfileModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3394. </div>
  3395. <form onsubmit="submitSavePPPProfile(event)" class="p-6 space-y-4 text-xs font-sans">
  3396. <input type="hidden" id="profile-modal-id">
  3397. <div>
  3398. <label class="block font-semibold text-slate-300 mb-1.5">Profile Name *</label>
  3399. <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">
  3400. </div>
  3401. <div class="grid grid-cols-2 gap-4">
  3402. <div>
  3403. <label class="block font-semibold text-slate-300 mb-1.5">Local Address *</label>
  3404. <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">
  3405. </div>
  3406. <div>
  3407. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (Pool) *</label>
  3408. <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">
  3409. </div>
  3410. </div>
  3411. <div class="grid grid-cols-2 gap-4">
  3412. <div>
  3413. <label class="block font-semibold text-slate-300 mb-1.5">DNS Servers</label>
  3414. <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">
  3415. </div>
  3416. <div>
  3417. <label class="block font-semibold text-slate-300 mb-1.5">Use Encryption</label>
  3418. <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">
  3419. <option value="no">no</option>
  3420. <option value="yes">yes</option>
  3421. <option value="required" selected>required (MPPE-128)</option>
  3422. </select>
  3423. </div>
  3424. </div>
  3425. <div>
  3426. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3427. <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">
  3428. </div>
  3429. <div class="flex items-center space-x-2 pt-1">
  3430. <input type="checkbox" id="profile-modal-onlyone" checked class="rounded bg-slate-800 border-slate-700 text-violet-600">
  3431. <label for="profile-modal-onlyone" class="text-slate-300">Only One session per user account</label>
  3432. </div>
  3433. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3434. <button type="button" onclick="closePPPProfileModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3435. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-violet-600 hover:bg-violet-500 text-white shadow-lg shadow-violet-500/20">Save Profile</button>
  3436. </div>
  3437. </form>
  3438. </div>
  3439. </div>
  3440. <!-- ================= MODAL: IPSEC ROADWARRIOR SERVER ================= -->
  3441. <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">
  3442. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3443. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3444. <div>
  3445. <h3 class="text-sm font-bold text-white">IPSec (IKEv2) Roadwarrior Server</h3>
  3446. <p class="text-[11px] text-slate-400">Mobile VPN server for Windows, macOS, iOS, Android clients</p>
  3447. </div>
  3448. <button onclick="closeIPSecServerModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3449. </div>
  3450. <form onsubmit="submitSaveIPSecServer(event)" class="p-6 space-y-4 text-xs font-sans">
  3451. <div class="flex items-center justify-between border-b border-slate-800 pb-3">
  3452. <span class="text-slate-300 font-semibold">Server State</span>
  3453. <div class="flex items-center gap-3">
  3454. <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>
  3455. <label class="relative inline-flex items-center cursor-pointer">
  3456. <input type="checkbox" id="modal-ipsec-server-enabled" class="sr-only peer">
  3457. <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>
  3458. </label>
  3459. </div>
  3460. </div>
  3461. <div>
  3462. <label class="block font-semibold text-slate-300 mb-1.5">Pre-Shared Key (PSK) *</label>
  3463. <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">
  3464. </div>
  3465. <div class="grid grid-cols-2 gap-4">
  3466. <div>
  3467. <label class="block font-semibold text-slate-300 mb-1.5">Virtual IP Pool (CIDR) *</label>
  3468. <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">
  3469. </div>
  3470. <div>
  3471. <label class="block font-semibold text-slate-300 mb-1.5">DNS Servers</label>
  3472. <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">
  3473. </div>
  3474. </div>
  3475. <div>
  3476. <label class="block font-semibold text-slate-300 mb-1.5">Local Traffic Selector (Subnet)</label>
  3477. <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">
  3478. </div>
  3479. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3480. <button type="button" onclick="closeIPSecServerModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3481. <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>
  3482. </div>
  3483. </form>
  3484. </div>
  3485. </div>
  3486. <!-- ================= MODAL: WIREGUARD CLIENT CONFIG VIEWER ================= -->
  3487. <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">
  3488. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3489. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3490. <div>
  3491. <h3 class="text-sm font-bold text-white">WireGuard Client Configuration</h3>
  3492. <p class="text-[11px] text-slate-400">Import this .conf into WireGuard on iOS, Android, macOS or Windows</p>
  3493. </div>
  3494. <button onclick="closeWGClientConfModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3495. </div>
  3496. <div class="p-6 space-y-4">
  3497. <div>
  3498. <label class="block text-xs font-semibold text-slate-300 mb-1.5">WireGuard Client Profile (.conf)</label>
  3499. <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>
  3500. </div>
  3501. <div class="flex justify-between items-center pt-2">
  3502. <span class="text-[11px] text-slate-500">Ready for instant import</span>
  3503. <div class="space-x-2">
  3504. <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">
  3505. Copy Config
  3506. </button>
  3507. <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">
  3508. Download .conf
  3509. </button>
  3510. </div>
  3511. </div>
  3512. </div>
  3513. </div>
  3514. </div>
  3515. <!-- ================= MODAL: BGP INSTANCE SETTINGS ================= -->
  3516. <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">
  3517. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3518. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3519. <div>
  3520. <h3 class="text-sm font-bold text-white">BGP Instance Settings (/routing bgp instance)</h3>
  3521. <p class="text-[11px] text-slate-400">Configure global Autonomous System and route redistribution</p>
  3522. </div>
  3523. <button onclick="closeBgpInstanceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3524. </div>
  3525. <form id="bgp-instance-form" onsubmit="submitBgpInstance(event)" class="p-6 space-y-4 text-xs">
  3526. <div class="flex items-center justify-between p-3 rounded-xl bg-slate-800/60 border border-slate-700/60">
  3527. <div>
  3528. <div class="font-semibold text-white">Enable BGP Routing</div>
  3529. <div class="text-[11px] text-slate-400">Run FRRouting bgpd service for dynamic exterior gateway routing</div>
  3530. </div>
  3531. <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">
  3532. </div>
  3533. <div class="grid grid-cols-2 gap-4">
  3534. <div>
  3535. <label class="block font-semibold text-slate-300 mb-1.5">Autonomous System (AS) *</label>
  3536. <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">
  3537. </div>
  3538. <div>
  3539. <label class="block font-semibold text-slate-300 mb-1.5">Router ID</label>
  3540. <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">
  3541. </div>
  3542. </div>
  3543. <div class="grid grid-cols-2 gap-4">
  3544. <div>
  3545. <label class="block font-semibold text-slate-300 mb-1.5">Keepalive Time (s)</label>
  3546. <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">
  3547. </div>
  3548. <div>
  3549. <label class="block font-semibold text-slate-300 mb-1.5">Hold Time (s)</label>
  3550. <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">
  3551. </div>
  3552. </div>
  3553. <div class="border-t border-slate-800 pt-3">
  3554. <label class="block font-semibold text-slate-300 mb-2">Redistribute Routes into BGP</label>
  3555. <div class="space-y-2">
  3556. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3557. <input type="checkbox" id="modal-bgp-redist-conn" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3558. <span>Redistribute Connected Subnets</span>
  3559. </label>
  3560. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3561. <input type="checkbox" id="modal-bgp-redist-static" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3562. <span>Redistribute Static Routes</span>
  3563. </label>
  3564. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3565. <input type="checkbox" id="modal-bgp-redist-ospf" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3566. <span>Redistribute OSPF Routes</span>
  3567. </label>
  3568. </div>
  3569. </div>
  3570. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3571. <button type="button" onclick="closeBgpInstanceModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3572. <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>
  3573. </div>
  3574. </form>
  3575. </div>
  3576. </div>
  3577. <!-- ================= MODAL: BGP PEER ================= -->
  3578. <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">
  3579. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3580. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3581. <div>
  3582. <h3 id="bgp-peer-modal-title" class="text-sm font-bold text-white">Add BGP Peer Connection</h3>
  3583. <p class="text-[11px] text-slate-400">Establish eBGP / iBGP session with remote router</p>
  3584. </div>
  3585. <button onclick="closeBgpPeerModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3586. </div>
  3587. <form id="bgp-peer-form" onsubmit="submitBgpPeer(event)" class="p-6 space-y-4 text-xs">
  3588. <input type="hidden" id="modal-bgp-peer-id">
  3589. <div>
  3590. <label class="block font-semibold text-slate-300 mb-1.5">Connection Name *</label>
  3591. <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">
  3592. </div>
  3593. <div class="grid grid-cols-2 gap-4">
  3594. <div>
  3595. <label class="block font-semibold text-slate-300 mb-1.5">Remote Address (IP) *</label>
  3596. <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">
  3597. </div>
  3598. <div>
  3599. <label class="block font-semibold text-slate-300 mb-1.5">Remote AS *</label>
  3600. <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">
  3601. </div>
  3602. </div>
  3603. <div class="grid grid-cols-2 gap-4">
  3604. <div>
  3605. <label class="block font-semibold text-slate-300 mb-1.5">Local Address (Update Source)</label>
  3606. <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">
  3607. </div>
  3608. <div>
  3609. <label class="block font-semibold text-slate-300 mb-1.5">MD5 Password (BGP Auth)</label>
  3610. <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">
  3611. </div>
  3612. </div>
  3613. <div class="grid grid-cols-2 gap-3 p-3 rounded-xl bg-slate-800/40 border border-slate-700/50">
  3614. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3615. <input type="checkbox" id="modal-bgp-peer-multihop" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3616. <span>eBGP Multi-hop</span>
  3617. </label>
  3618. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3619. <input type="checkbox" id="modal-bgp-peer-nexthop-self" checked class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3620. <span>Next-hop Self</span>
  3621. </label>
  3622. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3623. <input type="checkbox" id="modal-bgp-peer-passive" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3624. <span>Passive Mode</span>
  3625. </label>
  3626. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3627. <input type="checkbox" id="modal-bgp-peer-disabled" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3628. <span>Disabled (X)</span>
  3629. </label>
  3630. </div>
  3631. <div>
  3632. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3633. <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">
  3634. </div>
  3635. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3636. <button type="button" onclick="closeBgpPeerModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3637. <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>
  3638. </div>
  3639. </form>
  3640. </div>
  3641. </div>
  3642. <!-- ================= MODAL: BGP NETWORK ================= -->
  3643. <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">
  3644. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3645. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3646. <h3 id="bgp-network-modal-title" class="text-sm font-bold text-white">Advertise BGP Network</h3>
  3647. <button onclick="closeBgpNetworkModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3648. </div>
  3649. <form id="bgp-network-form" onsubmit="submitBgpNetwork(event)" class="p-6 space-y-4 text-xs">
  3650. <input type="hidden" id="modal-bgp-net-id">
  3651. <div>
  3652. <label class="block font-semibold text-slate-300 mb-1.5">Network Prefix (CIDR) *</label>
  3653. <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">
  3654. </div>
  3655. <div>
  3656. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3657. <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">
  3658. </div>
  3659. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3660. <input type="checkbox" id="modal-bgp-net-disabled" class="rounded text-purple-600 bg-slate-800 border-slate-700">
  3661. <span>Disabled</span>
  3662. </label>
  3663. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3664. <button type="button" onclick="closeBgpNetworkModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3665. <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>
  3666. </div>
  3667. </form>
  3668. </div>
  3669. </div>
  3670. <!-- ================= MODAL: OSPF INSTANCE SETTINGS ================= -->
  3671. <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">
  3672. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3673. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3674. <div>
  3675. <h3 class="text-sm font-bold text-white">OSPF Instance Settings (/routing ospf instance)</h3>
  3676. <p class="text-[11px] text-slate-400">Configure OSPFv2 link-state routing daemon and redistributions</p>
  3677. </div>
  3678. <button onclick="closeOspfInstanceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3679. </div>
  3680. <form id="ospf-instance-form" onsubmit="submitOspfInstance(event)" class="p-6 space-y-4 text-xs">
  3681. <div class="flex items-center justify-between p-3 rounded-xl bg-slate-800/60 border border-slate-700/60">
  3682. <div>
  3683. <div class="font-semibold text-white">Enable OSPF Routing</div>
  3684. <div class="text-[11px] text-slate-400">Run FRRouting ospfd service for dynamic interior gateway routing</div>
  3685. </div>
  3686. <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">
  3687. </div>
  3688. <div class="grid grid-cols-2 gap-4">
  3689. <div>
  3690. <label class="block font-semibold text-slate-300 mb-1.5">Router ID</label>
  3691. <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">
  3692. </div>
  3693. <div>
  3694. <label class="block font-semibold text-slate-300 mb-1.5">Default Metric</label>
  3695. <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">
  3696. </div>
  3697. </div>
  3698. <div class="border-t border-slate-800 pt-3">
  3699. <label class="block font-semibold text-slate-300 mb-2">Redistribute Routes into OSPF</label>
  3700. <div class="space-y-2">
  3701. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3702. <input type="checkbox" id="modal-ospf-redist-conn" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3703. <span>Redistribute Connected Subnets</span>
  3704. </label>
  3705. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3706. <input type="checkbox" id="modal-ospf-redist-static" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3707. <span>Redistribute Static Routes</span>
  3708. </label>
  3709. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3710. <input type="checkbox" id="modal-ospf-redist-bgp" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3711. <span>Redistribute BGP Routes</span>
  3712. </label>
  3713. </div>
  3714. </div>
  3715. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3716. <button type="button" onclick="closeOspfInstanceModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3717. <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>
  3718. </div>
  3719. </form>
  3720. </div>
  3721. </div>
  3722. <!-- ================= MODAL: OSPF AREA ================= -->
  3723. <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">
  3724. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-md shadow-2xl overflow-hidden animate-in">
  3725. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3726. <h3 id="ospf-area-modal-title" class="text-sm font-bold text-white">Add OSPF Area</h3>
  3727. <button onclick="closeOspfAreaModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3728. </div>
  3729. <form id="ospf-area-form" onsubmit="submitOspfArea(event)" class="p-6 space-y-4 text-xs">
  3730. <input type="hidden" id="modal-ospf-area-id">
  3731. <div>
  3732. <label class="block font-semibold text-slate-300 mb-1.5">Area Name *</label>
  3733. <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">
  3734. </div>
  3735. <div class="grid grid-cols-2 gap-4">
  3736. <div>
  3737. <label class="block font-semibold text-slate-300 mb-1.5">Area ID *</label>
  3738. <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">
  3739. </div>
  3740. <div>
  3741. <label class="block font-semibold text-slate-300 mb-1.5">Area Type</label>
  3742. <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">
  3743. <option value="default">Default / Normal</option>
  3744. <option value="stub">Stub</option>
  3745. <option value="nssa">NSSA</option>
  3746. </select>
  3747. </div>
  3748. </div>
  3749. <div>
  3750. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3751. <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">
  3752. </div>
  3753. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3754. <button type="button" onclick="closeOspfAreaModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3755. <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>
  3756. </div>
  3757. </form>
  3758. </div>
  3759. </div>
  3760. <!-- ================= MODAL: OSPF INTERFACE ================= -->
  3761. <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">
  3762. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3763. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3764. <div>
  3765. <h3 id="ospf-interface-modal-title" class="text-sm font-bold text-white">Add OSPF Interface</h3>
  3766. <p class="text-[11px] text-slate-400">Configure OSPF link parameters on a network subnet or interface</p>
  3767. </div>
  3768. <button onclick="closeOspfInterfaceModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3769. </div>
  3770. <form id="ospf-interface-form" onsubmit="submitOspfInterface(event)" class="p-6 space-y-4 text-xs">
  3771. <input type="hidden" id="modal-ospf-iface-id">
  3772. <div class="grid grid-cols-2 gap-4">
  3773. <div>
  3774. <label class="block font-semibold text-slate-300 mb-1.5">Subnet Network (CIDR) *</label>
  3775. <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">
  3776. </div>
  3777. <div>
  3778. <label class="block font-semibold text-slate-300 mb-1.5">OSPF Area *</label>
  3779. <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">
  3780. </div>
  3781. </div>
  3782. <div class="grid grid-cols-2 gap-4">
  3783. <div>
  3784. <label class="block font-semibold text-slate-300 mb-1.5">Interface (Optional Device)</label>
  3785. <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">
  3786. <option value="">Any matching interface</option>
  3787. </select>
  3788. </div>
  3789. <div>
  3790. <label class="block font-semibold text-slate-300 mb-1.5">Metric Cost</label>
  3791. <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">
  3792. </div>
  3793. </div>
  3794. <div class="grid grid-cols-3 gap-3">
  3795. <div>
  3796. <label class="block font-semibold text-slate-300 mb-1.5">Priority</label>
  3797. <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">
  3798. </div>
  3799. <div>
  3800. <label class="block font-semibold text-slate-300 mb-1.5">Hello (s)</label>
  3801. <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">
  3802. </div>
  3803. <div>
  3804. <label class="block font-semibold text-slate-300 mb-1.5">Dead (s)</label>
  3805. <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">
  3806. </div>
  3807. </div>
  3808. <div class="grid grid-cols-2 gap-4">
  3809. <div>
  3810. <label class="block font-semibold text-slate-300 mb-1.5">Authentication Type</label>
  3811. <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">
  3812. <option value="none">None</option>
  3813. <option value="simple">Simple Password</option>
  3814. <option value="md5">MD5 Cryptographic</option>
  3815. </select>
  3816. </div>
  3817. <div>
  3818. <label class="block font-semibold text-slate-300 mb-1.5">Auth Secret Key</label>
  3819. <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">
  3820. </div>
  3821. </div>
  3822. <div class="grid grid-cols-2 gap-3 p-3 rounded-xl bg-slate-800/40 border border-slate-700/50">
  3823. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3824. <input type="checkbox" id="modal-ospf-iface-passive" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3825. <span>Passive (Do not form adjs)</span>
  3826. </label>
  3827. <label class="flex items-center space-x-2 text-slate-300 cursor-pointer">
  3828. <input type="checkbox" id="modal-ospf-iface-disabled" class="rounded text-indigo-600 bg-slate-800 border-slate-700">
  3829. <span>Disabled (X)</span>
  3830. </label>
  3831. </div>
  3832. <div>
  3833. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3834. <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">
  3835. </div>
  3836. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3837. <button type="button" onclick="closeOspfInterfaceModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3838. <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>
  3839. </div>
  3840. </form>
  3841. </div>
  3842. </div>
  3843. <!-- ================= MODAL: ADD / EDIT BRIDGE ================= -->
  3844. <div id="bridge-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3845. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3846. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3847. <h3 id="bridge-modal-title" class="text-sm font-bold text-white">Add Bridge Interface</h3>
  3848. <button onclick="closeBridgeModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3849. </div>
  3850. <form onsubmit="submitSaveBridge(event)" class="p-6 space-y-4 text-xs">
  3851. <input type="hidden" id="bridge-modal-id">
  3852. <div class="grid grid-cols-2 gap-4">
  3853. <div>
  3854. <label class="block font-semibold text-slate-300 mb-1.5">Bridge Name *</label>
  3855. <input type="text" id="bridge-modal-name" required placeholder="e.g. bridge1" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3856. </div>
  3857. <div>
  3858. <label class="block font-semibold text-slate-300 mb-1.5">MTU</label>
  3859. <input type="number" id="bridge-modal-mtu" value="1500" min="68" max="65535" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3860. </div>
  3861. </div>
  3862. <div>
  3863. <label class="block font-semibold text-slate-300 mb-1.5">Admin MAC Address (Optional)</label>
  3864. <input type="text" id="bridge-modal-mac" placeholder="Leave blank for auto MAC" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3865. </div>
  3866. <div class="grid grid-cols-2 gap-4">
  3867. <div>
  3868. <label class="block font-semibold text-slate-300 mb-1.5">STP Protocol</label>
  3869. <select id="bridge-modal-stp" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3870. <option value="rstp" selected>RSTP (Rapid STP - Recommended)</option>
  3871. <option value="stp">STP (IEEE 802.1D)</option>
  3872. <option value="none">none (Disable STP)</option>
  3873. </select>
  3874. </div>
  3875. <div>
  3876. <label class="block font-semibold text-slate-300 mb-1.5">STP Priority</label>
  3877. <input type="number" id="bridge-modal-priority" value="32768" min="0" max="65535" step="4096" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3878. </div>
  3879. </div>
  3880. <!-- VLAN Filtering Box -->
  3881. <div class="p-3.5 bg-slate-950/60 border border-slate-800 rounded-xl space-y-3">
  3882. <label class="flex items-center space-x-2.5 cursor-pointer">
  3883. <input type="checkbox" id="bridge-modal-vlanfiltering" onchange="toggleBridgeModalVlanFiltering()" class="rounded bg-slate-800 border-slate-700 text-sky-500">
  3884. <span class="font-semibold text-white">VLAN Filtering (802.1Q Aware)</span>
  3885. </label>
  3886. <div id="bridge-modal-pvid-box" class="grid grid-cols-2 gap-3 pl-6">
  3887. <div>
  3888. <label class="block text-[11px] text-slate-400 mb-1">Default PVID</label>
  3889. <input type="number" id="bridge-modal-pvid" value="1" min="1" max="4094" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-2.5 py-1 text-white font-mono text-xs">
  3890. </div>
  3891. <div class="flex items-center pt-4">
  3892. <label class="flex items-center space-x-2 text-slate-400 cursor-pointer text-xs">
  3893. <input type="checkbox" id="bridge-modal-fastforward" checked class="rounded bg-slate-800 border-slate-700 text-sky-500">
  3894. <span>Fast Forward</span>
  3895. </label>
  3896. </div>
  3897. </div>
  3898. </div>
  3899. <div>
  3900. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3901. <input type="text" id="bridge-modal-comment" placeholder="e.g. LAN Bridge with EoIP" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  3902. </div>
  3903. <div class="pt-1">
  3904. <label class="flex items-center space-x-2 cursor-pointer">
  3905. <input type="checkbox" id="bridge-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  3906. <span class="font-medium text-slate-300">Disabled (X)</span>
  3907. </label>
  3908. </div>
  3909. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3910. <button type="button" onclick="closeBridgeModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3911. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-sky-600 hover:bg-sky-500 text-white shadow-lg shadow-sky-500/20">Save Bridge</button>
  3912. </div>
  3913. </form>
  3914. </div>
  3915. </div>
  3916. <!-- ================= MODAL: ADD / EDIT BRIDGE PORT ================= -->
  3917. <div id="bridge-port-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3918. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3919. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3920. <h3 id="bridge-port-modal-title" class="text-sm font-bold text-white">Add Port to Bridge</h3>
  3921. <button onclick="closeBridgePortModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3922. </div>
  3923. <form onsubmit="submitSaveBridgePort(event)" class="p-6 space-y-4 text-xs">
  3924. <input type="hidden" id="bridge-port-modal-id">
  3925. <div class="grid grid-cols-2 gap-4">
  3926. <div>
  3927. <label class="block font-semibold text-slate-300 mb-1.5">Target Bridge *</label>
  3928. <select id="bridge-port-modal-bridge" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono"></select>
  3929. </div>
  3930. <div>
  3931. <label class="block font-semibold text-slate-300 mb-1.5">Interface *</label>
  3932. <select id="bridge-port-modal-interface" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono"></select>
  3933. </div>
  3934. </div>
  3935. <div class="grid grid-cols-3 gap-3">
  3936. <div>
  3937. <label class="block font-semibold text-slate-300 mb-1.5">PVID</label>
  3938. <input type="number" id="bridge-port-modal-pvid" value="1" min="1" max="4094" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3939. </div>
  3940. <div>
  3941. <label class="block font-semibold text-slate-300 mb-1.5">Path Cost</label>
  3942. <input type="number" id="bridge-port-modal-pathcost" value="10" min="1" max="65535" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3943. </div>
  3944. <div>
  3945. <label class="block font-semibold text-slate-300 mb-1.5">Horizon (Split)</label>
  3946. <input type="number" id="bridge-port-modal-horizon" value="0" min="0" max="65535" title="0=none. Ports with identical horizon > 0 cannot communicate (split-horizon isolation for EoIP / VPLS)" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3947. </div>
  3948. </div>
  3949. <div class="grid grid-cols-2 gap-4">
  3950. <div>
  3951. <label class="block font-semibold text-slate-300 mb-1.5">Frame Types</label>
  3952. <select id="bridge-port-modal-frametypes" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3953. <option value="admit-all" selected>admit all</option>
  3954. <option value="admit-only-vlan-tagged">admit only VLAN tagged</option>
  3955. <option value="admit-only-untagged-and-priority-tagged">admit only untagged</option>
  3956. </select>
  3957. </div>
  3958. <div>
  3959. <label class="block font-semibold text-slate-300 mb-1.5">Priority</label>
  3960. <input type="number" id="bridge-port-modal-priority" value="128" min="0" max="240" step="16" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  3961. </div>
  3962. </div>
  3963. <div class="grid grid-cols-2 gap-3 p-3 bg-slate-950/60 border border-slate-800 rounded-xl">
  3964. <label class="flex items-center space-x-2 cursor-pointer">
  3965. <input type="checkbox" id="bridge-port-modal-learn" checked class="rounded bg-slate-800 border-slate-700 text-sky-500">
  3966. <span class="text-white font-semibold">MAC Learning</span>
  3967. </label>
  3968. <label class="flex items-center space-x-2 cursor-pointer">
  3969. <input type="checkbox" id="bridge-port-modal-ingressfiltering" class="rounded bg-slate-800 border-slate-700 text-sky-500">
  3970. <span class="text-white font-semibold">Ingress Filtering</span>
  3971. </label>
  3972. </div>
  3973. <div>
  3974. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  3975. <input type="text" id="bridge-port-modal-comment" placeholder="e.g. Uplink to switch" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  3976. </div>
  3977. <div class="pt-1">
  3978. <label class="flex items-center space-x-2 cursor-pointer">
  3979. <input type="checkbox" id="bridge-port-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  3980. <span class="font-medium text-slate-300">Disabled (X)</span>
  3981. </label>
  3982. </div>
  3983. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  3984. <button type="button" onclick="closeBridgePortModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  3985. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-sky-600 hover:bg-sky-500 text-white shadow-lg shadow-sky-500/20">Save Port</button>
  3986. </div>
  3987. </form>
  3988. </div>
  3989. </div>
  3990. <!-- ================= MODAL: ADD / EDIT BRIDGE VLAN ================= -->
  3991. <div id="bridge-vlan-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  3992. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-lg shadow-2xl overflow-hidden animate-in">
  3993. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  3994. <h3 id="bridge-vlan-modal-title" class="text-sm font-bold text-white">Add Bridge VLAN Entry</h3>
  3995. <button onclick="closeBridgeVlanModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  3996. </div>
  3997. <form onsubmit="submitSaveBridgeVLAN(event)" class="p-6 space-y-4 text-xs">
  3998. <input type="hidden" id="bridge-vlan-modal-id">
  3999. <div class="grid grid-cols-2 gap-4">
  4000. <div>
  4001. <label class="block font-semibold text-slate-300 mb-1.5">Target Bridge *</label>
  4002. <select id="bridge-vlan-modal-bridge" onchange="updateBridgeVlanPortCheckboxes()" required class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono"></select>
  4003. </div>
  4004. <div>
  4005. <label class="block font-semibold text-slate-300 mb-1.5">VLAN IDs *</label>
  4006. <input type="text" id="bridge-vlan-modal-vlanids" required placeholder="e.g. 10 or 10,20,30 or 10-20" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4007. </div>
  4008. </div>
  4009. <div>
  4010. <label class="block font-semibold text-slate-300 mb-1.5">Tagged Member Ports (Trunk)</label>
  4011. <div id="bridge-vlan-tagged-ports" class="max-h-36 overflow-y-auto p-2.5 bg-slate-950/60 border border-slate-800 rounded-xl space-y-1 font-mono text-slate-300">
  4012. <span class="text-slate-500 text-xs font-sans">Select a bridge above to view member ports</span>
  4013. </div>
  4014. </div>
  4015. <div>
  4016. <label class="block font-semibold text-slate-300 mb-1.5">Untagged Member Ports (Access)</label>
  4017. <div id="bridge-vlan-untagged-ports" class="max-h-36 overflow-y-auto p-2.5 bg-slate-950/60 border border-slate-800 rounded-xl space-y-1 font-mono text-slate-300">
  4018. <span class="text-slate-500 text-xs font-sans">Select a bridge above to view member ports</span>
  4019. </div>
  4020. </div>
  4021. <div>
  4022. <label class="block font-semibold text-slate-300 mb-1.5">Comment</label>
  4023. <input type="text" id="bridge-vlan-modal-comment" placeholder="e.g. Office & Guest VLANs" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white">
  4024. </div>
  4025. <div class="pt-1">
  4026. <label class="flex items-center space-x-2 cursor-pointer">
  4027. <input type="checkbox" id="bridge-vlan-modal-disabled" class="rounded bg-slate-800 border-slate-700 text-rose-500">
  4028. <span class="font-medium text-slate-300">Disabled (X)</span>
  4029. </label>
  4030. </div>
  4031. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  4032. <button type="button" onclick="closeBridgeVlanModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  4033. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-sky-600 hover:bg-sky-500 text-white shadow-lg shadow-sky-500/20">Save VLAN Entry</button>
  4034. </div>
  4035. </form>
  4036. </div>
  4037. </div>
  4038. <!-- ================= MODAL: ADD IP ADDRESS TO BRIDGE ================= -->
  4039. <div id="bridge-ip-modal" class="fixed inset-0 bg-slate-950/80 backdrop-blur-sm z-50 hidden flex items-center justify-center p-4">
  4040. <div class="bg-slate-900 border border-slate-800 rounded-2xl w-full max-w-sm shadow-2xl overflow-hidden animate-in">
  4041. <div class="px-6 py-4 border-b border-slate-800 flex items-center justify-between bg-slate-950/40">
  4042. <div>
  4043. <h3 class="text-sm font-bold text-white">Assign IP Address to Bridge</h3>
  4044. <span id="bridge-ip-modal-sub" class="text-[11px] font-mono text-sky-400">bridge1</span>
  4045. </div>
  4046. <button onclick="closeBridgeIPModal()" class="text-slate-400 hover:text-white p-1 rounded-lg">✕</button>
  4047. </div>
  4048. <form onsubmit="submitAddBridgeIP(event)" class="p-6 space-y-4 text-xs">
  4049. <input type="hidden" id="bridge-ip-modal-id">
  4050. <div>
  4051. <label class="block font-semibold text-slate-300 mb-1.5">IPv4 / Subnet (CIDR) *</label>
  4052. <input type="text" id="bridge-ip-modal-cidr" required placeholder="e.g. 192.168.88.1/24" class="w-full bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-white font-mono">
  4053. </div>
  4054. <div class="pt-4 border-t border-slate-800 flex justify-end space-x-3">
  4055. <button type="button" onclick="closeBridgeIPModal()" class="px-4 py-2 rounded-lg text-slate-400 hover:bg-slate-800">Cancel</button>
  4056. <button type="submit" class="px-5 py-2 rounded-lg font-semibold bg-sky-600 hover:bg-sky-500 text-white shadow-lg shadow-sky-500/20">Assign IP</button>
  4057. </div>
  4058. </form>
  4059. </div>
  4060. </div>
  4061. <script src="app.js?v=3.3"></script>
  4062. </body>
  4063. </html>