File manager - Edit - /home/autoph/public_html/projects/ahg-connect/assets/index.00b4e836.js
Back
import{L as v}from"./index.d8327ad1.js";import{I as w}from"./index.4b7607b5.js";import{L as S}from"./Loading.6052584f.js";import{A as f}from"./AppService.083ffddb.js";import{_ as A,r as g,o as l,a as h,w as k,d as s,n as I,b as p,c as m,F as D,I as L,f as y,t as b,J as N,j as O}from"./index.c8fd93d6.js";import"./logo-white.e9971405.js";import"./_commonjsHelpers.de833af9.js";const x="/assets/connect-teamwork.cf05c1c1.jpg",_={shortenedText(e,o=5){const a=e.replace(/-/g," ").split(" ");return a.length>o?a.slice(0,o).join(" ")+"...":e},isJSON(e){if(typeof e!="string")return!1;try{const o=JSON.parse(e);return typeof o=="object"&&o!==null}catch{return!1}}};const C={components:{Layout:v,Icon:w,Loading:S,teamworkBg:x},data(){return{apps:[],systemAccess:null,state:{loading:!1,redirecting:!1},teamworkBg:x}},props:{breadcrumbs:{type:Array,default:[{text:"Home",href:"/"}]}},computed:{activeUser:function(){return this.$store.userSettings.getActiveUser??null},LocalStorageData(){return localStorageData},roleGroups(){let e=null,o=this.$store.userSettings.getRoles;return o&&(e=o.map(a=>a.group)),e},systemAccess(){const e=this.$store.userSettings.getSystemAccess;if(e==null)return[];let o=this.apps;return e.includes(99)||(o=this.apps.filter(a=>e.includes(a.id))),o}},methods:{async fetchAppRecords(){this.state.loading=!0,await f.fetchRecords().then(e=>{e.status==200&&(this.apps=e.data.data.filter(o=>o.id!==1))}).catch(e=>{console.log(e)}).finally(()=>this.state.loading=!1)},async goTo(e){this.state.redirecting=!0;let o=null;console.log("data",e),await this.$store.userSettings.fetchMenus({system_id:e.id,app_code:e.code});const a=new Promise((i,c)=>{let n=0;const t=setInterval(()=>{const u=localStorage.getItem("menuItems")?JSON.parse(localStorage.getItem("menuItems")):[];u[e.code]&&(o=u,clearInterval(t),i()),n++,n>=10&&(clearInterval(t),c(new Error("Menu item not found within the timeout period")))},1e3)});try{await a}catch{this.$swal.fire({title:"Ooops!",text:"You do not have access to the modules of this system.",icon:"warning",timer:2e3})}if(o){const i={},c=["activeUser","activeCompany","activeDealership","activeDepartment","companyAccess","dealershipAccess","departmentAccess","capabilities","roles","menuItems"];console.log("localStorage.getItem"),console.log(localStorage.getItem("companyAccess")),console.log(localStorage.getItem("dealershipAccess")),c.forEach(t=>{localStorage.hasOwnProperty(t)&&(t=="companyAccess"&&(console.log("isJson",_.isJSON(localStorage.getItem(t))),console.log("parse",JSON.parse(localStorage.getItem(t)))),i[t]=_.isJSON(localStorage.getItem(t))?JSON.parse(localStorage.getItem(t)):localStorage.getItem(t))}),console.log("localStorageData"),console.log(i);const r=i.companyAccess.filter(t=>t.system_id==e.id||t.system_id==null),n=i.dealershipAccess.filter(t=>t.system_id==e.id||t.system_id==null);i.companyAccess=r,i.dealershipAccess=n;try{(await f.saveAppsStorage({employee_id:this.activeUser?this.activeUser.employee_id:null,system_id:e.id,data:JSON.stringify(i)})).status==201&&window.open(e.url+`/auto-login?e=${this.activeUser.employee_id}&s=${e.id}&c=${e.code}`)}catch(t){console.log(t)}}else this.$swal.fire({title:"Ooops!",text:"You do not have access to the modules of this system.",icon:"warning",timer:2e3});this.state.redirecting=!1}},mounted(){this.fetchAppRecords()}},J={class:"p-8 bg-white bg-opacity-[0.0] h-full"},$={key:0,class:"grid lg:grid-cols-5 grid-cols-1 gap-8"},j=["onClick"],B={class:"mx-auto h-12 w-12 flex flex-col items-center justify-center rounded-full bg-slate-700 text-2xl mb-2"},U={class:"block text-xl font-semibold dark:text-white mb-1"},R={class:"block text-sm font-semibold dark:text-white mb-1"},E={class:"mx-auto h-12 w-12 flex flex-col items-center justify-center rounded-full bg-slate-700 text-2xl mb-2"},F=s("div",{class:"block text-xl font-semibold dark:text-white mb-1"}," Subscriptions ",-1),M=s("div",{class:"block text-sm font-semibold dark:text-white mb-1"}," List of all subscriptions of Autohub Group ",-1),P={key:1,class:"bg-white bg-opacity-[0.8] p-4 text-3xl rounded-lg text-pink-600 w-1/2 mx-auto text-center"},z=s("div",{class:"space-y-4"},[s("div",{class:"italic"},[s("div",{class:"text-4xl font-bold tracking-wide"}," You don't have access to any system. "),s("div",{class:"text-2xl"},[s("div",null," For your system access permission please coordinate with our System Coordinators from the "),s("div",{class:"font-semibold"}," Application Devt and Database (ADD) Department: ")])]),s("div",{class:"tracking-wide text-pink-700"},[s("div",{class:"font-semibold"},"Evelyn Dag-uman"),s("div",{class:"text-lg"},"Project Coordinator")]),s("div",{class:"tracking-wide text-pink-700"},[s("div",{class:"font-semibold"},"Liezle Mangada"),s("div",{class:"text-lg"},"System Analyst")])],-1),T=[z],V={class:"h-full"};function Y(e,o,a,i,c,r){const n=g("Loading"),t=g("Icon"),u=g("Layout");return l(),h(u,{contentNoPadding:""},{default:k(()=>[s("div",{class:"transition-opacity duration-700 left-column bg-cover bg-no-repeat bg-center px-6",style:O({backgroundImage:`url(${c.teamworkBg})`})},[s("div",{class:I(["absolute inset-0 w-full h-full",["bg-white bg-opacity-[0.5] rounded-t-lg"]])}),c.state.loading?(l(),h(n,{key:0,text:"Fetching records"})):p("",!0),c.state.redirecting?(l(),h(n,{key:1,text:"Redirecting..."})):p("",!0),s("div",J,[!c.state.loading&&r.systemAccess&&r.systemAccess.length>0?(l(),m("div",$,[(l(!0),m(D,null,L(r.systemAccess,d=>(l(),m("button",{key:d.id,onClick:q=>r.goTo(d),class:"rounded-md p-4 bg-white bg-opacity-[0.7] border border-slate-700 text-slate-500 dark:bg-opacity-50 text-center drop-shadow hover:animate-pulse"},[s("div",B,[y(t,{icon:"fluent-mdl2:file-request",class:"text-3xl text-pink-600"})]),s("div",U,b(d.name),1),s("div",R,b(d.description),1)],8,j))),128)),e.$ability.can("view","subscription")?(l(),m("button",{key:0,onClick:o[0]||(o[0]=d=>e.$router.push({name:"subscriptions"})),class:"rounded-md p-4 bg-white bg-opacity-[0.7] border border-slate-700 text-slate-500 dark:bg-opacity-50 text-center drop-shadow hover:animate-pulse"},[s("div",E,[y(t,{icon:"fluent-mdl2:file-request",class:"text-3xl text-pink-600"})]),F,M])):p("",!0)])):c.state.loading?p("",!0):(l(),m("div",P,T)),s("div",V,[N(e.$slots,"default")])])],4)]),_:3})}const ee=A(C,[["render",Y]]);export{ee as default};
| ver. 1.4 |
.
| PHP 8.1.32 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings