index.html 296 KB

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