PageSourceSearch

https://samudranet.co.id/build/assets/Index-D5yFC6Tc.js

js samudranet.co.id collected 2026-10-08 17:31:14 UTC 14,310 bytes, 1 lines download raw bytes

1import{o as C,m as E}from"./runtime-dom.esm-bundler-9q51YtTy.js";import{l as N,r as V}from"./index.esm-A6bOPKe3.js";import{_ as K}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{aJ as w,o as U,aN as Q,aB as d,p as G,bn as q,s as e,z as B,b8 as P,y,a$ as u,bp as g,r as c,F as A,aL as D,q as $}from"./runtime-core.esm-bundler-CCYdSbkE.js";import"./bootstrap-icons-C1NuXDaz.js";const W={class:"container-fluid py-4 min-vh-100 bg-theme-page"},X={class:"d-flex justify-content-between align-items-center mb-4"},Y={class:"d-flex align-items-center gap-3"},Z={class:"d-flex gap-2 align-items-center"},tt=["disabled"],et=["disabled"],st=["disabled"],lt={class:"row g-3 mb-4 align-items-center"},nt={class:"col-md-3"},ot={class:"card border-0 shadow-sm bg-primary text-white h-100"},it={class:"card-body p-3 d-flex justify-content-between align-items-center"},at={class:"mb-0 fw-bold"},rt={class:"col-md-4"},dt={class:"input-group"},ut={class:"col-md-3"},mt={class:"input-group"},pt={class:"col-md-2"},ct={class:"col-md-2 text-end"},bt={class:"d-flex gap-2 justify-content-end"},vt={class:"card border-0 shadow-sm rounded-4 overflow-hidden theme-card"},ft={class:"card-body p-0"},ht={class:"table-responsive"},gt={class:"table table-hover align-middle mb-0"},yt={class:"ps-4"},xt={class:"d-flex align-items-center"},wt={class:"fw-bold theme-text-primary"},kt={class:"badge bg-info-subtle text-info border border-info border-opacity-10"},Ct={class:"theme-text-muted small"},It={class:"theme-text-muted small"},Ut={class:"theme-text-muted small fst-italic"},St={class:"pe-4 text-end"},_t={class:"d-flex gap-1 justify-content-end"},$t=["onClick"],Mt=["onClick"],Et=["onClick"],Vt={key:0},qt={class:"card-footer bg-transparent border-top border-light border-opacity-10 py-3 d-flex justify-content-between align-items-center"},At={class:"small theme-text-muted"},Dt={class:"d-flex gap-2"},Lt=["disabled"],Nt=["disabled"],Bt={key:0,class:"modal-backdrop fade show"},Pt={key:1,class:"modal fade show d-block",tabindex:"-1"},Tt={class:"modal-dialog modal-dialog-centered"},jt={class:"modal-content border-0 shadow-lg rounded-4 theme-card"},Ft={class:"modal-header border-bottom-0 pb-0"},Rt={class:"modal-body p-4"},Ot={class:"row g-3"},zt={class:"col-12"},Jt=["value"],Ht={class:"col-6"},Kt={class:"col-6"},Qt={class:"col-12"},Gt=["value"],Wt={class:"col-6"},Xt={class:"col-6"},Yt={class:"mt-4 d-flex gap-2"},Zt=["disabled"],te={key:0,class:"spinner-border spinner-border-sm me-2"},ee={__name:"Index",props:{router:Object,users:Array,profiles:Array,servers:Array},setup(b){const o=b,k=w(!1),I=w(!1),S=w(""),m=w(1),x=w(10),_=w(""),p=U(()=>{if(!o.users)return[];let l=o.users;if(S.value){const t=S.value.toLowerCase();l=l.filter(n=>{const s=n.name&&String(n.name).toLowerCase().includes(t),r=n.comment&&String(n.comment).toLowerCase().includes(t);return s||r})}if(_.value){const t=_.value.toLowerCase();l=l.filter(n=>n.comment&&String(n.comment).toLowerCase().includes(t))}return l}),T=U(()=>{const l=p.value?p.value.length:0;return Math.max(1,Math.ceil(l/x.value))}),j=U(()=>{if(!p.value)return[];const l=(m.value-1)*x.value;return p.value.slice(l,l+x.value)}),F=U(()=>(p.value?p.value.length:0)===0?0:(m.value-1)*x.value+1),R=U(()=>{const l=p.value?p.value.length:0;return Math.min(m.value*x.value,l)}),a=w({server:"all",name:"",password:"",profile:o.profiles[0]?.name||"default","limit-uptime":"","limit-bytes-total":"",comment:""});function O(l){if(l==null||l===""||isNaN(l))return"-";const t=Number(l);if(t===0)return"-";const n=1024,s=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(t)/Math.log(n));return parseFloat((t/Math.pow(n,r)).toFixed(1))+" "+s[r]}function z(l){if(confirm("Are you sure you want to delete this user?")){const t=o.router?.id;if(!t){alert("Router ID is missing");return}V.delete(`/hotspot/${t}/users/${l}`,{preserveState:!0,preserveScroll:!0})}}function J(){const l=o.router?.id;if(!l){alert("Router ID is missing");return}I.value=!0,V.post(`/hotspot/${l}/users`,a.value,{onSuccess:()=>{k.value=!1,I.value=!1,a.value.name="",a.value.password=""},onError:()=>I.value=!1})}function L(l,t=!1){if(!l||!l.name){alert("User data is missing");return}const n=document.createElement("form");n.method="POST";const s=o.router?.id;if(!s){alert("Router ID is missing");return}n.action=`/hotspot/${s}/generator/quick-print`,n.target="_blank";const r=document.querySelector('meta[name="csrf-token"]')?.getAttribute("content");
1if(r){const i=document.createElement("input");i.type="hidden",i.name="_token",i.value=r,n.appendChild(i)}const v=document.createElement("input");v.type="hidden",v.name="vouchers",v.value=JSON.stringify([{username:l.name,password:l.password||l.name,profile:l.profile,user_mode:l.comment&&l.comment.includes("vc-")?"vc":"up"}]),n.appendChild(v);const f=document.createElement("input");f.type="hidden",f.name="qr",f.value=t?"yes":"no",n.appendChild(f);const h=document.createElement("input");h.type="hidden",h.name="template",h.value="default",n.appendChild(h),document.body.appendChild(n),n.submit(),document.body.removeChild(n)}function M(l="default"){if(!o.users||o.users.length===0){alert("No users to print");return}const t=o.router?.id;if(!t){alert("Router ID is missing");return}const n=o.users.map(i=>({username:i.name,password:i.password||i.name,profile:i.profile,user_mode:i.comment&&i.comment.includes("vc-")?"vc":"up"})),s=document.createElement("form");s.method="POST",s.action=`/hotspot/${t}/generator/quick-print`,s.target="_blank";const r=document.querySelector('meta[name="csrf-token"]')?.getAttribute("content");if(r){const i=document.createElement("input");i.type="hidden",i.name="_token",i.value=r,s.appendChild(i)}const v=document.createElement("input");v.type="hidden",v.name="vouchers",v.value=JSON.stringify(n),s.appendChild(v);const f=document.createElement("input");f.type="hidden",f.name="qr",f.value=l==="qr"?"yes":"no",s.appendChild(f);const h=document.createElement("input");h.type="hidden",h.name="template",h.value=l,s.appendChild(h),document.body.appendChild(s),s.submit(),document.body.removeChild(s)}function H(){const l=o.router?.id;if(!l){alert("Router ID is missing");return}confirm("Are you sure you want to delete all expired users? This action cannot be undone.")&&V.delete(`/hotspot/${l}/users/bulk-delete-expired`,{preserveState:!0,preserveScroll:!0})}return(l,t)=>{const n=Q("AdminLayout");return d(),G(n,null,{default:q(()=>[e("div",W,[e("div",X,[e("div",Y,[B(P(N),{href:b.router&&b.router.id?"/hotspot/"+b.router.id+"/dashboard":"#",class:"btn btn-outline-secondary shadow-sm rounded-3"},{default:q(()=>[...t[20]||(t[20]=[e("i",{class:"bi bi-arrow-left me-2"},null,-1),y(" Kembali ke Dashboard ",-1)])]),_:1},8,["href"]),t[21]||(t[21]=e("div",null,[e("h2",{class:"fw-bold mb-0 theme-text-primary"},[e("i",{class:"bi bi-people-fill me-2"}),y("Hotspot Users ")]),e("p",{class:"theme-text-muted mb-0 small"},"Manage and monitor your hotspot voucher users")],-1))]),e("div",Z,[t[25]||(t[25]=e("span",{class:"text-muted small me-2"},"Print:",-1)),e("button",{onClick:t[0]||(t[0]=s=>M("default")),disabled:!o.users||o.users.length===0,class:"btn btn-primary btn-sm shadow-sm"},[...t[22]||(t[22]=[e("i",{class:"bi bi-printer me-1"},null,-1),y(" Default ",-1)])],8,tt),e("button",{onClick:t[1]||(t[1]=s=>M("qr")),disabled:!o.users||o.users.length===0,class:"btn btn-danger btn-sm shadow-sm"},[...t[23]||(t[23]=[e("i",{class:"bi bi-qr-code me-1"},null,-1),y(" QR ",-1)])],8,et),e("button",{onClick:t[2]||(t[2]=s=>M("small")),disabled:!o.users||o.users.length===0,class:"btn btn-info btn-sm text-white shadow-sm"},[...t[24]||(t[24]=[e("i",{class:"bi bi-file-earmark-text me-1"},null,-1),y(" Small ",-1)])],8,st)])]),e("div",lt,[e("div",nt,[e("div",ot,[e("div",it,[e("div",null,[t[26]||(t[26]=e("small",{class:"opacity-75 text-uppercase fw-bold"},"Total Users",-1)),e("h4",at,u(o.users?o.users.length:0),1)]),t[27]||(t[27]=e("i",{class:"bi bi-people fs-2 opacity-25"},null,-1))])])]),e("div",rt,[e("div",dt,[t[28]||(t[28]=e("span",{class:"input-group-text bg-white border-end-0 theme-input"},[e("i",{class:"bi bi-search text-muted"})],-1)),g(e("input",{type:"text","onUpdate:modelValue":t[3]||(t[3]=s=>S.value=s),placeholder:"Search by name...",class:"form-control border-start-0 theme-input",onInput:t[4]||(t[4]=s=>m.value=1)},null,544),[[C,S.value]])])]),e("div",ut,[e("div",mt,[t[29]||(t[29]=e("span",{class:"input-group-text bg-white border-end-0 theme-input"},[e("i",{class:"bi bi-chat-text text-muted"})],-1)),g(e("input",{type:"text","onUpdate:modelValue":t[5]||(t[5]=s=>_.value=s),placeholder:"Filter by comment...",class:"form-control border-start-0 theme-input",onInput:t[6]||(t[6]=s=>m.value=1)},null,544),[[C,_.value]])])]),e("div",pt,[g(e("select",{"onUpdate:modelValue":t[7]||(t[7]=s=>x.value=s),class:"form-select theme-input",onChange:t[8]||(t[8]=s=>m.value=1)},[...t[30]||(t[30]=[e("option",{value:10},"10 per page",-1),e("option",{value:25},"25 per page",-1),e("option",{value:50},"50 per page",-1),e("option",{value:100},"100 per page",-1)])],544),[[E,x.value]])]),e("div",ct,[e("div",bt,[e("button",{onClick:H,class:"btn btn-danger px-3 fw-bold",title:"Delete Expired Users"},[...t[31]||(t[31]=[e("i",{class:"bi bi-trash"},null,-1)])]),e("button",{onClick:t[9]||(t[9]=s=>k.value=!0),class:"btn btn-primary px-3 fw-bold"},[...t[32]||(t[32]=[e("i",{class:"bi bi-plus-lg"},null,-1)])]),B(P(N),{href:b.router&&b.router.id?"/hotspot/"+b.router.id+"/generator":"#",class:"btn btn-outline-primary px-3 fw-bold theme-btn-outline"},{default:q(()=>[...t[33]||(t[33]=[e("i",{class:"bi bi-lightning-fill"},null,-1)])]),_:1},8,["href"])])])]),e("div",vt,[e("div",ft,[e("div",ht,[e("table",gt,[t[39]||(t[39]=e("thead",{class:"bg-light"},[e("tr",{class:"text-muted text-uppercase small fw-bold"},[e("th",{class:"ps-4"},"Username"),e("th",null,"Profile"),e("th",null,"Uptime Limit"),e("th",null,"Traffic Limit"),e("th",null,"Comment"),e("th",{class:"pe-4 text-end"},"Action")])],-1)),e("tbody",null,[(d(!0),c(A,null,D(j.value,s=>(d(),c("tr",{key:s[".id"]},[e("td",yt,[e("div",xt,[t[34]||(t[34]=e("div",{class:"bg-primary-subtle text-primary rounded-circle me-3 d-flex align-items-center justify-content-center",style:{width:"32px",height:"32px","min-width":"32px"}}
1,[e("i",{class:"bi bi-person"})],-1)),e("span",wt,u(s.name),1)])]),e("td",null,[e("span",kt,u(s.profile),1)]),e("td",Ct,u(s["limit-uptime"]||"-"),1),e("td",It,u(O(s["limit-bytes-total"])),1),e("td",Ut,u(s.comment||"-"),1),e("td",St,[e("div",_t,[e("button",{onClick:r=>L(s,!1),class:"btn btn-sm btn-light theme-btn-light",title:"Print Voucher"},[...t[35]||(t[35]=[e("i",{class:"bi bi-printer"},null,-1)])],8,$t),e("button",{onClick:r=>L(s,!0),class:"btn btn-sm btn-light theme-btn-light text-success",title:"Print QR"},[...t[36]||(t[36]=[e("i",{class:"bi bi-qr-code"},null,-1)])],8,Mt),e("button",{onClick:r=>z(s[".id"]),class:"btn btn-sm btn-light text-danger theme-btn-light"},[...t[37]||(t[37]=[e("i",{class:"bi bi-trash"},null,-1)])],8,Et)])])]))),128)),p.value.length===0?(d(),c("tr",Vt,[...t[38]||(t[38]=[e("td",{colspan:"6",class:"text-center py-5"},[e("i",{class:"bi bi-search text-muted opacity-25",style:{"font-size":"4rem"}}),e("p",{class:"text-muted mt-2 mb-0"},"No matching users found.")],-1)])])):$("",!0)])])])]),e("div",qt,[e("div",At," Showing "+u(F.value)+" - "+u(R.value)+" of "+u(p.value.length)+" users ",1),e("div",Dt,[e("button",{class:"btn btn-sm btn-light theme-btn-light",disabled:m.value===1,onClick:t[10]||(t[10]=s=>m.value--)},[...t[40]||(t[40]=[e("i",{class:"bi bi-chevron-left me-1"},null,-1),y(" Prev ",-1)])],8,Lt),e("button",{class:"btn btn-sm btn-light theme-btn-light",disabled:m.value>=T.value,onClick:t[11]||(t[11]=s=>m.value++)},[...t[41]||(t[41]=[y(" Next ",-1),e("i",{class:"bi bi-chevron-right ms-1"},null,-1)])],8,Nt)])])]),k.value?(d(),c("div",Bt)):$("",!0),k.value?(d(),c("div",Pt,[e("div",Tt,[e("div",jt,[e("div",Ft,[t[42]||(t[42]=e("h5",{class:"modal-title fw-bold theme-text-primary"},"Add Hotspot User",-1)),e("button",{type:"button",class:"btn-close theme-btn-close",onClick:t[12]||(t[12]=s=>k.value=!1)})]),e("div",Rt,[e("div",Ot,[e("div",zt,[t[44]||(t[44]=e("label",{class:"form-label small fw-bold theme-text-muted"},"Server",-1)),g(e("select",{"onUpdate:modelValue":t[13]||(t[13]=s=>a.value.server=s),class:"form-select theme-input"},[t[43]||(t[43]=e("option",{value:"all"},"all",-1)),(d(!0),c(A,null,D(b.servers,s=>(d(),c("option",{key:s.name,value:s.name},u(s.name),9,Jt))),128))],512),[[E,a.value.server]])]),e("div",Ht,[t[45]||(t[45]=e("label",{class:"form-label small fw-bold theme-text-muted"},"Username",-1)),g(e("input",{type:"text","onUpdate:modelValue":t[14]||(t[14]=s=>a.value.name=s),class:"form-control theme-input"},null,512),[[C,a.value.name]])]),e("div",Kt,[t[46]||(t[46]=e("label",{class:"form-label small fw-bold theme-text-muted"},"Password",-1)),g(e("input",{type:"text","onUpdate:modelValue":t[15]||(t[15]=s=>a.value.password=s),class:"form-control theme-input"},null,512),[[C,a.value.password]])]),e("div",Qt,[t[47]||(t[47]=e("label",{class:"form-label small fw-bold theme-text-muted"},"Profile",-1)),g(e("select",{"onUpdate:modelValue":t[16]||(t[16]=s=>a.value.profile=s),class:"form-select theme-input"},[(d(!0),c(A,null,D(b.profiles,s=>(d(),c("option",{key:s.name,value:s.name},u(s.name),9,Gt))),128))],512),[[E,a.value.profile]])]),e("div",Wt,[t[48]||(t[48]=e("label",{class:"form-label small fw-bold theme-text-muted"},"Uptime Limit",-1)),g(e("input",{type:"text","onUpdate:modelValue":t[17]||(t[17]=s=>a.value["limit-uptime"]=s),class:"form-control theme-input",placeholder:"ex: 1h, 1d"},null,512),[[C,a.value["limit-uptime"]]])]),e("div",Xt,[t[49]||(t[49]=e("label",{class:"form-label small fw-bold theme-text-muted"},"Data Limit (MB)",-1)),g(e("input",{type:"number","onUpdate:modelValue":t[18]||(t[18]=s=>a.value["limit-bytes-total"]=s),class:"form-control theme-input"},null,512),[[C,a.value["limit-bytes-total"]]])])]),e("div",Yt,[e("button",{class:"btn btn-light flex-grow-1 theme-btn-light",onClick:t[19]||(t[19]=s=>k.value=!1)},"Cancel"),e("button",{class:"btn btn-primary flex-grow-1",onClick:J,disabled:I.value},[I.value?(d(),c("span",te)):$("",!0),t[50]||(t[50]=y(" Save User ",-1))],8,Zt)])])])])])):$("",!0)])]),_:1})}}},ae=K(ee,[["__scopeId","data-v-7260f4be"]]);export{ae as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.