芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/public_html/invoicer.pulsehost.co.uk/public/build/assets/Index-pXSnxIdX.js
import{v as P,k as v,r as o,o as n,c as r,t as c,K as y,b as a,a as e,l as d,Z as z,m as B,w as u,av as J,G as K,f as $,j as Z,N as Q,O as W,q as X,J as Y,p as S,g as j,h as ee,I as te}from"./main-WS8l16KQ.js";const ae={key:0,class:"absolute mt-5 px-6 w-full flex justify-end"},se={key:0,class:"bg-white bg-opacity-75 text-xs px-3 py-1 font-semibold tracking-wide rounded"},ne={key:1,class:"ml-2 bg-white bg-opacity-75 text-xs px-3 py-1 font-semibold tracking-wide rounded"},le={key:0},oe={key:1},re=["src"],ie={class:"px-6 py-5 flex flex-col bg-gray-50 flex-1 justify-between"},de={class:"text-lg sm:text-2xl font-medium whitespace-nowrap truncate text-primary-500"},ce={key:0,class:"flex items-center mt-2"},ue=["src"],me=a("span",null,"by",-1),_e={class:"ml-2 text-base font-semibold truncate"},he={class:"flex justify-between mt-4 flex-col space-y-2 sm:space-y-0 sm:flex-row"},pe={class:"text-xl md:text-2xl font-semibold whitespace-nowrap text-primary-500"},fe={__name:"ModuleCard",props:{data:{type:Object,default:null,required:!0}},setup(s){P.useI18n();const l=s;let m=v(()=>parseInt(l.data.average_rating));return(i,_)=>{const h=o("base-text"),g=o("BaseRating");return n(),r("div",{class:"relative shadow-md border-2 border-gray-200 border-opacity-60 rounded-lg cursor-pointer overflow-hidden h-100",onClick:_[0]||(_[0]=w=>i.$router.push(`/admin/modules/${s.data.slug}`))},[s.data.purchased?(n(),r("div",ae,[s.data.purchased?(n(),r("label",se,c(i.$t("modules.purchased")),1)):y("",!0),s.data.installed?(n(),r("label",ne,[s.data.update_available?(n(),r("span",le,c(i.$t("modules.update_available")),1)):(n(),r("span",oe,c(i.$t("modules.installed")),1))])):y("",!0)])):y("",!0),a("img",{class:"lg:h-64 md:h-48 w-full object-cover object-center",src:s.data.cover,alt:"cover"},null,8,re),a("div",ie,[a("span",de,c(s.data.name),1),s.data.author_avatar?(n(),r("div",ce,[a("img",{class:"hidden h-10 w-10 rounded-full sm:inline-block mr-2",src:s.data.author_avatar?s.data.author_avatar:"http://localhost:3000$images/default-avatar.jpg",alt:""},null,8,ue),me,a("span",_e,c(s.data.author_name),1)])):y("",!0),e(h,{text:s.data.short_description,class:"pt-4 text-gray-500 h-16 line-clamp-2"},null,8,["text"]),a("div",he,[a("div",null,[e(g,{rating:d(m)},null,8,["rating"])]),a("div",pe," $ "+c(s.data.monthly_price?s.data.monthly_price/100:s.data.yearly_price/100),1)])])])}}},ge={},ve={class:"shadow-md border-2 border-gray-200 border-opacity-60 rounded-lg cursor-pointer overflow-hidden h-100"},be={class:"px-6 py-5 flex flex-col bg-gray-50 flex-1 justify-between"},ye={class:"flex items-center mt-2"},xe={class:"flex justify-between mt-4 flex-col space-y-2 sm:space-y-0 sm:flex-row"};function $e(s,l){const m=o("BaseContentPlaceholdersBox"),i=o("BaseContentPlaceholdersText"),_=o("BaseContentPlaceholders");return n(),B(_,null,{default:u(()=>[a("div",ve,[e(m,{class:"h-48 lg:h-64 md:h-48 w-full",rounded:""}),a("div",be,[e(i,{class:"w-32 h-8",lines:1,rounded:""}),a("div",ye,[e(m,{class:"h-10 w-10 rounded-full sm:inline-block mr-2"}),a("div",null,[e(i,{class:"w-32 h-8 ml-2",lines:1,rounded:""})])]),e(i,{class:"pt-4 w-full h-16",lines:1,rounded:""}),a("div",xe,[e(i,{class:"w-32 h-8",lines:1,rounded:""}),e(i,{class:"w-32 h-8",lines:1,rounded:""})])])])]),_:1})}const k=z(ge,[["render",$e]]),ke={key:0},Be={key:0,class:"grid mt-6 w-full grid-cols-1 items-start gap-6 lg:grid-cols-2 xl:grid-cols-3"},we={key:1},Ie={key:0,class:"grid mt-6 w-full grid-cols-1 items-start gap-6 lg:grid-cols-2 xl:grid-cols-3"},Te={key:1,class:"mt-24"},Ce={class:"flex items-center justify-center text-gray-500"},Se={class:"text-gray-900 text-lg font-medium"},je={class:"mt-1 text-sm text-gray-500"},Pe={class:"grid lg:grid-cols-2 mt-6"},Me={class:"flex space-x-2"},Ve=["href"],Le={__name:"Index",setup(s){const l=J(),m=K(),i=$(""),{t:_}=P.useI18n();let h=$(!1),g=$(!1);const w=v(()=>({api_token:{required:j.withMessage(_("validation.required"),ee),minLength:j.withMessage(_("validation.name_min_length",{count:3}),te(3))}})),M=v(()=>l.apiToken?(V(),!0):!1),p=Z(w,v(()=>l.currentUser)),x=v(()=>i.value==="INSTALLED"?l.modules.filter(t=>t.installed):l.modules);async function V(){g.value=!0,await l.fetchModules().then(()=>{g.value=!1})}async function G(){if(p.value.$touch(),p.value.$invalid)return!0;h.value=!0,l.checkApiToken(l.currentUser.api_token).then(t=>{if(t.data.success){L();return}h.value=!1})}async function L(){try{await m.updateGlobalSettings({data:{settings:{api_token:l.currentUser.api_token}},message:"settings.preferences.updated_message"}).then(t=>{if(t.data.success){l.apiToken=l.currentUser.api_token;return}}),h.value=!1}catch(t){h.value=!1,console.error(t);return}}function N(t){i.value=t.filter}return(t,b)=>{const I=o("BaseBreadcrumbItem"),U=o("BaseBreadcrumb"),q=o("BasePageHeader"),T=o("BaseTab"),A=o("BaseTabGroup"),D=o("BaseInput"),E=o("BaseInputGroup"),F=o("BaseIcon"),C=o("BaseButton"),R=o("BaseCard"),H=o("BasePage");return n(),B(H,null,{default:u(()=>[e(q,{title:t.$t("modules.title")},{default:u(()=>[e(U,null,{default:u(()=>[e(I,{title:t.$t("general.home"),to:"dashboard"},null,8,["title"]),e(I,{title:t.$t("modules.module",2),to:"#",active:""},null,8,["title"])]),_:1})]),_:1},8,["title"]),M.value&&d(l).modules?(n(),r("div",ke,[e(A,{class:"-mb-5",onChange:N},{default:u(()=>[e(T,{title:t.$t("general.all"),filter:""},null,8,["title"]),e(T,{title:t.$t("modules.installed"),filter:"INSTALLED"},null,8,["title"])]),_:1}),d(g)?(n(),r("div",Be,[e(k),e(k),e(k)])):(n(),r("div",we,[x.value&&x.value.length?(n(),r("div",Ie,[(n(!0),r(Q,null,W(x.value,(f,O)=>(n(),r("div",{key:O},[e(fe,{data:f},null,8,["data"])]))),128))])):(n(),r("div",Te,[a("label",Ce,c(t.$t("modules.no_modules_installed")),1)]))]))])):(n(),B(R,{key:1,class:"mt-6"},{default:u(()=>[a("h6",Se,c(t.$t("modules.connect_installation")),1),a("p",je,c(t.$t("modules.api_token_description",{url:d(m).config.base_url.replace(/^http:\/\//,"")})),1),a("div",Pe,[a("form",{action:"",class:"mt-6",onSubmit:X(G,["prevent"])},[e(E,{label:t.$t("modules.api_token"),required:"",error:d(p).api_token.$error&&d(p).api_token.$errors[0].$message},{default:u(()=>[e(D,{modelValue:d(l).currentUser.api_token,"onUpdate:modelValue":b[0]||(b[0]=f=>d(l).currentUser.api_token=f),invalid:d(p).api_token.$error,onInput:b[1]||(b[1]=f=>d(p).api_token.$touch())},null,8,["modelValue","invalid"])]),_:1},8,["label","error"]),a("div",Me,[e(C,{class:"mt-6",loading:d(h),type:"submit"},{left:u(f=>[e(F,{name:"SaveIcon",class:Y(f.class)},null,8,["class"])]),default:u(()=>[S(" "+c(t.$t("general.save")),1)]),_:1},8,["loading"]),a("a",{href:`${d(m).config.base_url}/auth/customer/register`,class:"mt-6 block",target:"_blank"},[e(C,{variant:"primary-outline",type:"button"},{default:u(()=>[S(c(t.$t("modules.sign_up_and_get_token")),1)]),_:1})],8,Ve)])],32)])]),_:1}))]),_:1})}}};export{Le as default};