PageSourceSearch

https://bujak-app.netlify.app/_nuxt/admin.ge6_IsUd.js

js bujak-app.netlify.app collected 2026-10-03 10:32:37 UTC 11,401 bytes, 1 lines download raw bytes

1import{_ as P}from"./nuxt-link.xPWBQR0i.js";import{_ as Y}from"./notification.b_Dr5MXR.js";import{a8 as z,u as H,K as C,I as E,Q as m,g as R,r as K,af as V,h as F,c as h,a as n,b as d,w as r,y as l,t as y,L as w,X as G,F as O,E as Q,ag as X,a7 as J,o as f,d as c,N as Z,p as ee,e as se}from"./entry.w44I5x28.js";import{_ as te}from"./logo.HmEGzd35.js";import{g as u}from"./useAppwrite.Nq13-6ua.js";import{_ as ie}from"./_plugin-vue_export-helper.x3n3nnut.js";import{r as U,a as ne,b as oe,c as ae}from"./SunIcon.Pij68XoE.js";import{r as de}from"./UserIcon.qOE16LJ1.js";import"./cancel.w_y4HbDd.js";const b=_=>(ee("data-v-d0af3f51"),_=_(),se(),_),re={class:"drawer drawer-end"},le=b(()=>n("input",{id:"drawer-menu",type:"checkbox",class:"drawer-toggle"},null,-1)),ce={class:"drawer-content flex flex-col"},ue={class:"w-full navbar sticky top-0 z-50 bg-secondary text-white flex justify-between"},me={class:"flex-1 px-2 mx-2"},fe=b(()=>n("img",{class:"w-11",src:te,alt:"Bujak Logo"},null,-1)),he={class:"flex-none lg:hidden"},pe={key:0,class:"badge badge-sm badge-primary absolute bottom-6 left-5"},be={class:"flex-none hidden lg:block"},ge={class:"flex gap-2"},_e={class:"dropdown dropdown-end ml-4"},ve={tabindex:"0",class:"btn btn-ghost rounded-md p-1 no-animation"},ye={tabindex:"0",class:"dropdown-content menu p-2 shadow bg-base-100 text-base-content rounded-md w-52 gap-2"},we={key:0,class:"badge badge-sm badge-primary absolute bottom-6 left-4"},xe={class:"swap swap-rotate btn btn-ghost rounded-md p-1"},ke=["checked"],$e={class:"drawer-side z-[999]"},Te=b(()=>n("label",{for:"drawer-menu",class:"drawer-overlay fixed top-0 bottom-0 left-0 right-0"},null,-1)),We={key:0,class:"menu min-h-full p-4 w-80 bg-base-200 gap-2"},Ie=b(()=>n("h5",null,"Menu",-1)),Ce=b(()=>n("div",{class:"divider divider-vertical"},null,-1)),Re={key:1,class:"menu h-screen flex-nowrap p-4 w-80 bg-base-200 gap-2"},Ue={class:"flex justify-between"},De=b(()=>n("h6",null,"Powiadomienia",-1)),Ae={class:"overflow-x-hidden",style:{"scrollbar-width":"none"}},je={key:0},Ne={__name:"admin",setup(_){const D=z(),s=H(),p=X();typeof Notification<"u"?Notification.requestPermission().then(async a=>{if(a=="granted")try{await p.registerForPushNotifications(),await p.sendTag("user-id",s.currentUser.$id)}catch(o){console.log(o)}}):console.log("Notifications are not supported on this device."),document.addEventListener("visibilitychange",a=>{a.target.hidden||$(!1)}),C(async()=>{await A(),j(),N(),S(),M(),k(),B(),x(),$()});async function A(){try{const a=(await E.listDocuments({databaseId:"bujak-db",collectionId:"settings"})).documents;s.settingsIdDoc=a[0].$id,s.startTimeReservation=a[0].startTimeRes,s.endTimeReservation=a[0].endTimeRes,s.startTimeCar=a[0].startTimeCar,s.endTimeCar=a[0].endTimeCar,s.delayTimeReservation=a[0].delayTimeRes,s.ruleTimeReservation=a[0].ruleTimeRes,s.dayLimitPerUser=a[0].dayLimitPerUser}catch(a){console.log(a)}}function x(){u("reservations",s.reservations,[m.equal("day",s.currentDate.format("YYYY-MM-DD")),m.orderAsc("date")])}function j(){u("users",s.users)}function N(){u("payments",s.payments)}function S(){u("instructors",s.instructors)}function M(){u("cars",s.cars)}function k(){u("hours",s.businessHours,[m.equal("date",s.currentDate.format("YYYY-MM-DD"))])}function B(){u("services",s.services)}async function $(a=!0){u("notifications",s.notifications,[m.equal("isArchive",!1),m.equal("to",s.currentUser.$id),m.orderDesc("date")]),a&&window.location.origin.includes("localhost")==!1&&(await p.setSubscription(!0),await p.sendTag("user-id",s.currentUser.$id))}R(()=>s.currentDate,async(a,o)=>{x(),k()}),R(()=>s.selUser,async(a,o)=>{s.selUserReservations=[],u("reservations",s.selUserReservations,[m.equal("user",s.selUser.$id),m.orderAsc("date")])});let v=K(!1);function T(){v.value=!1}function L(){v.value=!0}function W(){let a=document.getElementsByTagName("html")[0];a.getAttribute("data-theme")=="dark"?(a.setAttribute("data-theme","light"),a.classList.remove("dark"),s.changeDarkMode(!1)):(a.setAttribute("data-theme","dark"),a.classList.add("dark"),s.changeDarkMode(!0))}async function I(){try{await p.setSubscription(!1),await p.sendTag("user-id",""),await J.deleteSession({sessionId:"current"}),s.logout(),g&&g(),D.push("/login")}catch(a){console.log(a)}}let g=null;return C(()=>{g=V.subscribe(["databases.bujak-db.collections.settings.documents","databases.bujak-db.collections.users.documents","databases.bujak-db.collections.payments.documents","databases.bujak-db.collections.instructors.documents","databases.bujak-db.collections.cars.documents","databases.bujak-db.collections.hours.documents","databases.bujak-db.collections.services.documents","databases.bujak-db.collections.reservations.documents","databases.bujak-db.collections.notifications.documents"],a=>{const o=a.events,t=a.payload;if(o.some(e=>e.includes("collections.settings.documents"))){o.some(e=>e.endsWith(".update"))&&(s.startTimeReservation=t.startTimeRes,s.endTimeReservation=t.endTimeRes,s.startTimeCar=t.startTimeCar,s.endTimeCar=t.endTimeCar,s.delayTimeReservation=t.delayTimeRes,s.ruleTimeReservation=t.ruleTimeRes,s.openCalDays=t.openCalDays,s.dayLimitPerUser=t.dayLimitPerUser);return}if(o.some(e=>
1e.includes("collections.users.documents"))){if(o.some(e=>e.endsWith(".create")))s.users.push(t);else if(o.some(e=>e.endsWith(".delete"))){const e=s.users.findIndex(i=>i.$id==t.$id);s.users.splice(e,1)}else if(o.some(e=>e.endsWith(".update"))){const e=s.users.findIndex(i=>i.$id==t.$id);s.users[e]=t}return}if(o.some(e=>e.includes("collections.payments.documents"))){if(o.some(e=>e.endsWith(".create")))s.payments.push(t);else if(o.some(e=>e.endsWith(".delete"))){const e=s.payments.findIndex(i=>i.$id==t.$id);s.payments.splice(e,1)}else if(o.some(e=>e.endsWith(".update"))){const e=s.payments.findIndex(i=>i.$id==t.$id);s.payments[e]=t}return}if(o.some(e=>e.includes("collections.instructors.documents"))){if(o.some(e=>e.endsWith(".create")))s.instructors.push(t);else if(o.some(e=>e.endsWith(".delete"))){const e=s.instructors.findIndex(i=>i.$id==t.$id);s.instructors.splice(e,1)}else if(o.some(e=>e.endsWith(".update"))){const e=s.instructors.findIndex(i=>i.$id==t.$id);s.instructors[e]=t}return}if(o.some(e=>e.includes("collections.cars.documents"))){if(o.some(e=>e.endsWith(".create")))s.cars.push(t);else if(o.some(e=>e.endsWith(".delete"))){const e=s.cars.findIndex(i=>i.$id==t.$id);s.cars.splice(e,1)}else if(o.some(e=>e.endsWith(".update"))){const e=s.cars.findIndex(i=>i.$id==t.$id);s.cars[e]=t}return}if(o.some(e=>e.includes("collections.hours.documents"))){if(o.some(e=>e.endsWith(".create")))s.businessHours.push(t);else if(o.some(e=>e.endsWith(".delete"))){const e=s.businessHours.findIndex(i=>i.$id==t.$id);s.businessHours.splice(e,1)}else if(o.some(e=>e.endsWith(".update"))){const e=s.businessHours.findIndex(i=>i.$id==t.$id);s.businessHours[e]=t}return}if(o.some(e=>e.includes("collections.services.documents"))){if(o.some(e=>e.endsWith(".create")))s.services.push(t);else if(o.some(e=>e.endsWith(".delete"))){const e=s.services.findIndex(i=>i.$id==t.$id);s.services.splice(e,1)}else if(o.some(e=>e.endsWith(".update"))){const e=s.services.findIndex(i=>i.$id==t.$id);s.services[e]=t}return}if(o.some(e=>e.includes("collections.reservations.documents"))){if(o.some(e=>e.endsWith(".create")))s.reservations.push(t);else if(o.some(e=>e.endsWith(".delete"))){const e=s.reservations.findIndex(i=>i.$id==t.$id);s.reservations.splice(e,1)}else if(o.some(e=>e.endsWith(".update"))){const e=s.reservations.findIndex(i=>i.$id==t.$id);s.reservations[e]=t}return}if(o.some(e=>e.includes("collections.notifications.documents"))){if(o.some(e=>e.endsWith(".create")))t.to==s.currentUser.$id&&(s.notifications.push(t),navigator.setAppBadge&&navigator.setAppBadge(s.notifications.length));else if(o.some(e=>e.endsWith(".delete"))){const e=s.notifications.findIndex(i=>i.$id==t.$id);s.notifications.splice(e,1),navigator.setAppBadge&&navigator.setAppBadge(s.notifications.length)}else if(o.some(e=>e.endsWith(".update"))){const e=s.notifications.findIndex(i=>i.$id==t.$id);s.notifications[e]=t}}})}),F(()=>{g&&g()}),(a,o)=>{const t=P,e=Y;return f(),h("div",re,[le,n("div",ce,[n("div",ue,[n("div",me,[d(t,{class:"!bg-transparent",to:"/admin/"},{default:r(()=>[fe]),_:1})]),n("div",he,[n("label",{for:"drawer-menu",onClick:T,class:"btn btn-square btn-ghost relative"},[d(l(U),{class:"inline-block w-6 h-6"}),l(s).notifications.filter(i=>!i.isArchive).length>0?(f(),h("div",pe,y(l(s).notifications.filter(i=>!i.isArchive).length),1)):w("",!0)]),n("label",{for:"drawer-menu",onClick:L,class:"btn btn-square btn-ghost"},[d(l(ne),{class:"inline-block w-6 h-6"})])]),n("div",be,[n("ul",ge,[n("li",null,[d(t,{class:"btn btn-ghost rounded-md no-animation p-2",to:"/admin/"},{default:r(()=>[c("Kalendarz")]),_:1})]),n("li",null,[d(t,{class:"btn btn-ghost rounded-md no-animation p-2",to:"/admin/users"},{default:r(()=>[c("Kursanci")]),_:1})]),n("li",null,[d(t,{class:"btn btn-ghost rounded-md no-animation p-2",to:"/admin/cars"},{default:r(()=>[c("Grafik")]),_:1})]),n("li",null,[d(t,{class:"btn btn-ghost rounded-md no-animation p-2",to:"/admin/services"},{default:r(()=>[c("Usługi")]),_:1})]),n("li",null,[d(t,{class:"btn btn-ghost rounded-md no-animation p-2",to:"/admin/instructors"},{default:r(()=>[c("Instruktorzy")]),_:1})]),n("li",null,[d(t,{class:"btn btn-ghost rounded-md no-animation p-2",to:"/admin/reports"},{default:r(()=>[c("Raporty")]),_:1})]),n("ul",_e,[n("label",ve,[d(l(de),{class:"w-6"})]),n("ul",ye,[n("li",null,[d(t,{class:"w-full",to:"/admin/settings"},{default:r(()=>[c("Ustawienia")]),_:1})]),n("li",null,[n("a",{class:"w-full",onClick:I},"Wyloguj")])])]),n("label",{tabindex:"0",for:"drawer-menu",onClick:T,class:"btn btn-ghost rounded-md p-1 drawer-button relative"},[d(l(U),{class:"w-6"}),l(s).notifications.filter(i=>!i.isArchive).length>0?(f(),h("div",we,y(l(s).notifications.filter(i=>!i.isArchive).length),1)):w("",!0)]),n("label",xe,[n("input",{type:"checkbox",checked:l(s).darkMode,onClick:W},null,8,ke),d(l(oe),{class:"swap-on w-6"}),d(l(ae),{class:"swap-off w-6"})])])])]),n("div",null,[G(a.$slots,"default",{},void 0,!0)])]),n("div",$e,[Te,l(v)?(f(),h("ul",We,[Ie,n("li",null,[d(t,{to:"/admin/"},{default:r(()=>[c("Kalendarz")]),_:1})]),n("li",null,[d(t,{to:"/admin/users"},{default:r(()=>[c("Kursanci")]),_:1})]),n("li",null,[d(t,{to:"/admin/cars"},{default:r(()=>[c("Grafik")]),_:1})]),n("li",null,[d(t,{to:"/admin/services"},{default:r(()=>[c("Usługi")]),_:1})]),n("li",null,[d(t,{to:"/admin/instructors"},{default:r(()=>[c("Instruktorzy")]),_:1})]),n("li",null,[d(t,{to:"/admin/reports"},{default:r(()=>[c("Raporty")]),_:1})]),Ce,n("li",null,[d(t,{to:"/admin/settings"},{default:r(()=>[c("Ustawienia")]),_:1})]),n("li",null,[n("label",{for:"dark-toggle",onClick:W},"Tryb ciemny "+y(l(s).darkMode?"(Wł)":"(Wył)"),1)]),n("li",null,[n("a",{onClick:I}
1,"Wyloguj")])])):(f(),h("div",Re,[n("div",Ue,[De,d(t,{class:"btn btn-primary btn-sm rounded-md no-animation p-2",to:"/admin/notifications"},{default:r(()=>[c("Wszystkie")]),_:1})]),n("div",Ae,[l(s).notifications.filter(i=>!i.isArchive).length>0?(f(),h("div",je,[(f(!0),h(O,null,Q(l(s).notifications.filter(i=>!i.isArchive).sort((i,q)=>new Date(q.date)-new Date(i.date)),i=>(f(),Z(e,{key:i.$id,data:i},null,8,["data"]))),128))])):w("",!0)])]))])])}}},Ee=ie(Ne,[["__scopeId","data-v-d0af3f51"]]);export{Ee 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.