From 0e3dd9588d4103b5685033534848a8f8997879f3 Mon Sep 17 00:00:00 2001 From: Louis Charette Date: Sat, 26 Oct 2024 14:13:31 -0400 Subject: [PATCH] Add composable entries --- dist/DashboardView-CWp-PKI3.cjs | 1 + dist/DashboardView-Ca9Np1FZ.cjs | 1 - dist/DashboardView-Cgrx0SLr.js | 318 ---------------- dist/DashboardView-DuV7cK9X.js | 280 ++++++++++++++ dist/GroupView-2Qy5dhaD.js | 181 --------- dist/GroupView-B9Zxi1Ld.cjs | 1 - dist/GroupView-C-pLYY6K.js | 146 ++++++++ dist/GroupView-DPKgjvQ-.cjs | 1 + dist/GroupsView-B5AdZnnE.js | 292 +++++++++++++++ dist/GroupsView-BHzd4Ctz.cjs | 1 + dist/GroupsView-BhG4LUoY.cjs | 1 - dist/GroupsView-FYEMxd2t.js | 104 ------ dist/PermissionView-CwSmb9ry.js | 154 ++++++++ dist/PermissionView-D7AlKrvO.cjs | 1 + dist/PermissionView-DA4jSH36.cjs | 1 - dist/PermissionView-DhQK9SjC.js | 187 ---------- dist/RoleView-CuY3whsc.js | 237 ++++++++++++ dist/RoleView-D81Ok2n6.cjs | 1 + dist/RoleView-DVIlQDeW.js | 270 -------------- dist/RoleView-hOODGzy4.cjs | 1 - dist/UserView-BWWqdCs9.js | 373 +++++++++++++++++++ dist/UserView-CWu0vErB.js | 413 --------------------- dist/UserView-CwaDFjUI.cjs | 1 + dist/UserView-DyId2fxr.cjs | 1 - dist/composable/GroupCreateForm.d.ts | 10 + dist/composable/dashboard.cjs | 1 + dist/composable/dashboard.js | 43 +++ dist/composable/group.cjs | 1 + dist/composable/group.js | 40 ++ dist/composable/permission.cjs | 1 + dist/composable/permission.js | 38 ++ dist/composable/role.cjs | 1 + dist/composable/role.js | 38 ++ dist/composable/user.cjs | 1 + dist/composable/user.js | 46 +++ dist/routes.cjs | 2 +- dist/routes.js | 12 +- dist/views/Group/GroupCreateForm.vue.d.ts | 8 + dist/views/Group/GroupCreateModal.vue.d.ts | 2 + package.json | 5 + vite.config.ts | 6 +- 41 files changed, 1735 insertions(+), 1487 deletions(-) create mode 100644 dist/DashboardView-CWp-PKI3.cjs delete mode 100644 dist/DashboardView-Ca9Np1FZ.cjs delete mode 100644 dist/DashboardView-Cgrx0SLr.js create mode 100644 dist/DashboardView-DuV7cK9X.js delete mode 100644 dist/GroupView-2Qy5dhaD.js delete mode 100644 dist/GroupView-B9Zxi1Ld.cjs create mode 100644 dist/GroupView-C-pLYY6K.js create mode 100644 dist/GroupView-DPKgjvQ-.cjs create mode 100644 dist/GroupsView-B5AdZnnE.js create mode 100644 dist/GroupsView-BHzd4Ctz.cjs delete mode 100644 dist/GroupsView-BhG4LUoY.cjs delete mode 100644 dist/GroupsView-FYEMxd2t.js create mode 100644 dist/PermissionView-CwSmb9ry.js create mode 100644 dist/PermissionView-D7AlKrvO.cjs delete mode 100644 dist/PermissionView-DA4jSH36.cjs delete mode 100644 dist/PermissionView-DhQK9SjC.js create mode 100644 dist/RoleView-CuY3whsc.js create mode 100644 dist/RoleView-D81Ok2n6.cjs delete mode 100644 dist/RoleView-DVIlQDeW.js delete mode 100644 dist/RoleView-hOODGzy4.cjs create mode 100644 dist/UserView-BWWqdCs9.js delete mode 100644 dist/UserView-CWu0vErB.js create mode 100644 dist/UserView-CwaDFjUI.cjs delete mode 100644 dist/UserView-DyId2fxr.cjs create mode 100644 dist/composable/GroupCreateForm.d.ts create mode 100644 dist/composable/dashboard.cjs create mode 100644 dist/composable/dashboard.js create mode 100644 dist/composable/group.cjs create mode 100644 dist/composable/group.js create mode 100644 dist/composable/permission.cjs create mode 100644 dist/composable/permission.js create mode 100644 dist/composable/role.cjs create mode 100644 dist/composable/role.js create mode 100644 dist/composable/user.cjs create mode 100644 dist/composable/user.js create mode 100644 dist/views/Group/GroupCreateForm.vue.d.ts create mode 100644 dist/views/Group/GroupCreateModal.vue.d.ts diff --git a/dist/DashboardView-CWp-PKI3.cjs b/dist/DashboardView-CWp-PKI3.cjs new file mode 100644 index 0000000..47fd253 --- /dev/null +++ b/dist/DashboardView-CWp-PKI3.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("./composable/dashboard.cjs"),d=require("./moment-Bp7fbP4q.cjs"),m=e.defineComponent({__name:"DashboardStats",props:{users:{},roles:{},groups:{}},setup(s){return(o,t)=>{const n=e.resolveComponent("UFInfoBox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(n,{value:o.users,label:"Users",faIcon:"user",to:{name:"admin.users"}},null,8,["value"]),e.createVNode(n,{value:o.roles,label:"Roles",faIcon:"address-card",to:{name:"admin.roles"}},null,8,["value"]),e.createVNode(n,{value:o.groups,label:"Groups",faIcon:"users",to:{name:"admin.groups"}},null,8,["value"])],64)}}}),p={class:"uk-grid uk-flex-center","uk-grid":""},V=["src"],N={class:"uk-margin-remove"},_={class:"uk-margin-remove uk-text-meta"},f=e.defineComponent({__name:"DashboardRecentUsers",props:{users:{}},setup(s){return(o,t)=>{const n=e.resolveComponent("RouterLink"),r=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(r,{title:"Latest Users"},{footer:e.withCtx(()=>[e.createVNode(n,{to:{name:"admin.users"},class:"uk-text-center"},{default:e.withCtx(()=>t[0]||(t[0]=[e.createTextVNode("View All Users")])),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",p,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.users,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:"uk-text-center"},[e.createVNode(n,{to:{name:"admin.user",params:{user_name:a.user_name}},class:"uk-text-decoration-none uk-link-text"},{default:e.withCtx(()=>[e.createElementVNode("img",{src:a.avatar,alt:"User Image",class:"uk-border-circle"},null,8,V),e.createElementVNode("p",N,e.toDisplayString(a.full_name),1),e.createElementVNode("p",_,e.toDisplayString(e.unref(d.hooks)(a.created_at).fromNow()),1)]),_:2},1032,["to"])]))),128))])]),_:1})}}}),k={class:"uk-description-list"},E={class:"uk-list uk-list-disc uk-list-collapse"},v=e.defineComponent({__name:"DashboardSystemInfo",props:{info:{},sprinkles:{}},setup(s){return(o,t)=>{const n=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(n,{title:"System Information"},{default:e.withCtx(()=>[e.createElementVNode("dl",k,[t[0]||(t[0]=e.createElementVNode("dt",null,"Framework version",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.frameworkVersion),1)])]),t[1]||(t[1]=e.createElementVNode("dt",null,"PHP version",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.phpVersion),1)])]),t[2]||(t[2]=e.createElementVNode("dt",null,"Webserver software",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.server),1)])]),t[3]||(t[3]=e.createElementVNode("dt",null,"Database connection",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.database.connection),1)])]),t[4]||(t[4]=e.createElementVNode("dt",null,"Database version",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.database.type)+" "+e.toDisplayString(o.info.database.version),1)])]),t[5]||(t[5]=e.createElementVNode("dt",null,"Database name",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.database.name),1)])]),t[6]||(t[6]=e.createElementVNode("dt",null,"Project directory",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.projectPath),1)])]),t[7]||(t[7]=e.createElementVNode("dt",null,"Loaded sprinkles",-1)),e.createElementVNode("dd",null,[e.createElementVNode("ul",E,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.sprinkles,r=>(e.openBlock(),e.createElementBlock("li",{key:r},e.toDisplayString(r),1))),128))])])])]),_:1})}}}),g={class:"uk-text-meta"},C=e.defineComponent({__name:"DashboardActivities",setup(s){return(o,t)=>{const n=e.resolveComponent("UFSprunjeHeader"),r=e.resolveComponent("UFSprunjeColumn"),a=e.resolveComponent("RouterLink"),u=e.resolveComponent("UFSprunjeTable"),i=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(i,{title:"Latest Activities"},{default:e.withCtx(()=>[e.createVNode(u,{dataUrl:"/api/activities",defaultSorts:{occurred_at:"desc"},hidePagination:"",hideFilters:""},{header:e.withCtx(()=>[e.createVNode(n,null,{default:e.withCtx(()=>t[0]||(t[0]=[e.createTextVNode("Activity Time")])),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("User")])),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Description")])),_:1})]),body:e.withCtx(({item:l})=>[e.createVNode(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(d.hooks)(l.occurred_at).format("dddd")),1),e.createElementVNode("div",null,e.toDisplayString(e.unref(d.hooks)(l.occurred_at).format("MMM Do, YYYY h:mm a")),1)]),_:2},1024),e.createVNode(r,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(a,{to:{name:"admin.user",params:{user_name:l.user.user_name}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.user.full_name)+" ("+e.toDisplayString(l.user.user_name)+") ",1)]),_:2},1032,["to"])]),e.createElementVNode("div",g,e.toDisplayString(l.user.email),1)]),_:2},1024),e.createVNode(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(l.ip_address),1),e.createElementVNode("div",null,[e.createElementVNode("i",null,e.toDisplayString(l.description),1)])]),_:2},1024)]),_:1})]),_:1})}}}),h={class:"uk-child-width-expand","uk-grid":""},D={class:"uk-child-width-1-2","uk-grid":""},S={class:"uk-child-width-1-1","uk-grid":""},x=e.defineComponent({__name:"DashboardView",setup(s){const o=c.useDashboardApi();return o.load(),(t,n)=>{const r=e.resolveComponent("UFHeaderPage");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(r,{title:"Dashboard"}),e.createElementVNode("div",h,[e.createVNode(m,{users:e.unref(o).data.counter.users,roles:e.unref(o).data.counter.roles,groups:e.unref(o).data.counter.groups},null,8,["users","roles","groups"])]),e.createElementVNode("div",D,[e.createElementVNode("div",null,[e.createElementVNode("div",S,[e.createElementVNode("div",null,[e.createVNode(f,{users:e.unref(o).data.users},null,8,["users"])]),e.createElementVNode("div",null,[e.createVNode(v,{info:e.unref(o).data.info,sprinkles:e.unref(o).data.sprinkles},null,8,["info","sprinkles"])])])]),e.createElementVNode("div",null,[e.createVNode(C)])])],64)}}});exports.default=x; diff --git a/dist/DashboardView-Ca9Np1FZ.cjs b/dist/DashboardView-Ca9Np1FZ.cjs deleted file mode 100644 index eafa4c6..0000000 --- a/dist/DashboardView-Ca9Np1FZ.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("pinia"),m=require("./axios-tuVKNgv9.cjs"),p=require("./types-D9XxK5BT.cjs"),d=require("./moment-Bp7fbP4q.cjs"),V={counter:{users:0,roles:0,groups:0},info:{frameworkVersion:"",phpVersion:"",database:{connection:"",name:"",type:"",version:""},server:"",projectPath:""},sprinkles:{},users:[]},N=c.defineStore("dashboardApi",{state:()=>({data:V}),actions:{async load(){return m.axios.get("/api/dashboard").then(l=>(this.data=l.data,this.data)).catch(l=>{throw{description:"An error as occurred",style:p.a.Danger,closeBtn:!0,...l.response.data}})}}}),_=e.defineComponent({__name:"DashboardStats",props:{users:{},roles:{},groups:{}},setup(l){return(o,t)=>{const n=e.resolveComponent("UFInfoBox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(n,{value:o.users,label:"Users",faIcon:"user",to:{name:"admin.users"}},null,8,["value"]),e.createVNode(n,{value:o.roles,label:"Roles",faIcon:"address-card",to:{name:"admin.roles"}},null,8,["value"]),e.createVNode(n,{value:o.groups,label:"Groups",faIcon:"users",to:{name:"admin.groups"}},null,8,["value"])],64)}}}),f={class:"uk-grid uk-flex-center","uk-grid":""},k=["src"],E={class:"uk-margin-remove"},v={class:"uk-margin-remove uk-text-meta"},g=e.defineComponent({__name:"DashboardRecentUsers",props:{users:{}},setup(l){return(o,t)=>{const n=e.resolveComponent("RouterLink"),r=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(r,{title:"Latest Users"},{footer:e.withCtx(()=>[e.createVNode(n,{to:{name:"admin.users"},class:"uk-text-center"},{default:e.withCtx(()=>t[0]||(t[0]=[e.createTextVNode("View All Users")])),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",f,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.users,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:"uk-text-center"},[e.createVNode(n,{to:{name:"admin.user",params:{user_name:s.user_name}},class:"uk-text-decoration-none uk-link-text"},{default:e.withCtx(()=>[e.createElementVNode("img",{src:s.avatar,alt:"User Image",class:"uk-border-circle"},null,8,k),e.createElementVNode("p",E,e.toDisplayString(s.full_name),1),e.createElementVNode("p",v,e.toDisplayString(e.unref(d.hooks)(s.created_at).fromNow()),1)]),_:2},1032,["to"])]))),128))])]),_:1})}}}),h={class:"uk-description-list"},C={class:"uk-list uk-list-disc uk-list-collapse"},y=e.defineComponent({__name:"DashboardSystemInfo",props:{info:{},sprinkles:{}},setup(l){return(o,t)=>{const n=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(n,{title:"System Information"},{default:e.withCtx(()=>[e.createElementVNode("dl",h,[t[0]||(t[0]=e.createElementVNode("dt",null,"Framework version",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.frameworkVersion),1)])]),t[1]||(t[1]=e.createElementVNode("dt",null,"PHP version",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.phpVersion),1)])]),t[2]||(t[2]=e.createElementVNode("dt",null,"Webserver software",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.server),1)])]),t[3]||(t[3]=e.createElementVNode("dt",null,"Database connection",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.database.connection),1)])]),t[4]||(t[4]=e.createElementVNode("dt",null,"Database version",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.database.type)+" "+e.toDisplayString(o.info.database.version),1)])]),t[5]||(t[5]=e.createElementVNode("dt",null,"Database name",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.database.name),1)])]),t[6]||(t[6]=e.createElementVNode("dt",null,"Project directory",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.info.projectPath),1)])]),t[7]||(t[7]=e.createElementVNode("dt",null,"Loaded sprinkles",-1)),e.createElementVNode("dd",null,[e.createElementVNode("ul",C,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.sprinkles,r=>(e.openBlock(),e.createElementBlock("li",{key:r},e.toDisplayString(r),1))),128))])])])]),_:1})}}}),D={class:"uk-text-meta"},S=e.defineComponent({__name:"DashboardActivities",setup(l){return(o,t)=>{const n=e.resolveComponent("UFSprunjeHeader"),r=e.resolveComponent("UFSprunjeColumn"),s=e.resolveComponent("RouterLink"),i=e.resolveComponent("UFSprunjeTable"),u=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(u,{title:"Latest Activities"},{default:e.withCtx(()=>[e.createVNode(i,{dataUrl:"/api/activities",defaultSorts:{occurred_at:"desc"},hidePagination:"",hideFilters:""},{header:e.withCtx(()=>[e.createVNode(n,null,{default:e.withCtx(()=>t[0]||(t[0]=[e.createTextVNode("Activity Time")])),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("User")])),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Description")])),_:1})]),body:e.withCtx(({item:a})=>[e.createVNode(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(d.hooks)(a.occurred_at).format("dddd")),1),e.createElementVNode("div",null,e.toDisplayString(e.unref(d.hooks)(a.occurred_at).format("MMM Do, YYYY h:mm a")),1)]),_:2},1024),e.createVNode(r,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(s,{to:{name:"admin.user",params:{user_name:a.user.user_name}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.user.full_name)+" ("+e.toDisplayString(a.user.user_name)+") ",1)]),_:2},1032,["to"])]),e.createElementVNode("div",D,e.toDisplayString(a.user.email),1)]),_:2},1024),e.createVNode(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(a.ip_address),1),e.createElementVNode("div",null,[e.createElementVNode("i",null,e.toDisplayString(a.description),1)])]),_:2},1024)]),_:1})]),_:1})}}}),x={class:"uk-child-width-expand","uk-grid":""},b={class:"uk-child-width-1-2","uk-grid":""},B={class:"uk-child-width-1-1","uk-grid":""},w=e.defineComponent({__name:"DashboardView",setup(l){const o=N();return o.load(),(t,n)=>{const r=e.resolveComponent("UFHeaderPage");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(r,{title:"Dashboard"}),e.createElementVNode("div",x,[e.createVNode(_,{users:e.unref(o).data.counter.users,roles:e.unref(o).data.counter.roles,groups:e.unref(o).data.counter.groups},null,8,["users","roles","groups"])]),e.createElementVNode("div",b,[e.createElementVNode("div",null,[e.createElementVNode("div",B,[e.createElementVNode("div",null,[e.createVNode(g,{users:e.unref(o).data.users},null,8,["users"])]),e.createElementVNode("div",null,[e.createVNode(y,{info:e.unref(o).data.info,sprinkles:e.unref(o).data.sprinkles},null,8,["info","sprinkles"])])])]),e.createElementVNode("div",null,[e.createVNode(S)])])],64)}}});exports.default=w; diff --git a/dist/DashboardView-Cgrx0SLr.js b/dist/DashboardView-Cgrx0SLr.js deleted file mode 100644 index a6721f7..0000000 --- a/dist/DashboardView-Cgrx0SLr.js +++ /dev/null @@ -1,318 +0,0 @@ -import { defineComponent as k, resolveComponent as u, openBlock as i, createElementBlock as _, Fragment as v, createVNode as o, createBlock as g, withCtx as t, createTextVNode as f, createElementVNode as e, renderList as h, toDisplayString as s, unref as d } from "vue"; -import { defineStore as D } from "pinia"; -import { a as w } from "./axios-CXDYiOMX.js"; -import { a as x } from "./types-Daou0lcF.js"; -import { h as b } from "./moment-h96o7c8I.js"; -const y = { - counter: { - users: 0, - roles: 0, - groups: 0 - }, - info: { - frameworkVersion: "", - phpVersion: "", - database: { - connection: "", - name: "", - type: "", - version: "" - }, - server: "", - projectPath: "" - }, - sprinkles: {}, - users: [] -}, B = D("dashboardApi", { - state: () => ({ - data: y - }), - actions: { - async load() { - return w.get("/api/dashboard").then((p) => (this.data = p.data, this.data)).catch((p) => { - throw { - description: "An error as occurred", - style: x.Danger, - closeBtn: !0, - ...p.response.data - }; - }); - } - } -}), S = /* @__PURE__ */ k({ - __name: "DashboardStats", - props: { - users: {}, - roles: {}, - groups: {} - }, - setup(p) { - return (r, n) => { - const l = u("UFInfoBox"); - return i(), _(v, null, [ - o(l, { - value: r.users, - label: "Users", - faIcon: "user", - to: { name: "admin.users" } - }, null, 8, ["value"]), - o(l, { - value: r.roles, - label: "Roles", - faIcon: "address-card", - to: { name: "admin.roles" } - }, null, 8, ["value"]), - o(l, { - value: r.groups, - label: "Groups", - faIcon: "users", - to: { name: "admin.groups" } - }, null, 8, ["value"]) - ], 64); - }; - } -}), C = { - class: "uk-grid uk-flex-center", - "uk-grid": "" -}, $ = ["src"], j = { class: "uk-margin-remove" }, V = { class: "uk-margin-remove uk-text-meta" }, A = /* @__PURE__ */ k({ - __name: "DashboardRecentUsers", - props: { - users: {} - }, - setup(p) { - return (r, n) => { - const l = u("RouterLink"), a = u("UFCardBox"); - return i(), g(a, { title: "Latest Users" }, { - footer: t(() => [ - o(l, { - to: { name: "admin.users" }, - class: "uk-text-center" - }, { - default: t(() => n[0] || (n[0] = [ - f("View All Users") - ])), - _: 1 - }) - ]), - default: t(() => [ - e("div", C, [ - (i(!0), _(v, null, h(r.users, (m) => (i(), _("div", { - key: m.id, - class: "uk-text-center" - }, [ - o(l, { - to: { name: "admin.user", params: { user_name: m.user_name } }, - class: "uk-text-decoration-none uk-link-text" - }, { - default: t(() => [ - e("img", { - src: m.avatar, - alt: "User Image", - class: "uk-border-circle" - }, null, 8, $), - e("p", j, s(m.full_name), 1), - e("p", V, s(d(b)(m.created_at).fromNow()), 1) - ]), - _: 2 - }, 1032, ["to"]) - ]))), 128)) - ]) - ]), - _: 1 - }); - }; - } -}), I = { class: "uk-description-list" }, L = { class: "uk-list uk-list-disc uk-list-collapse" }, P = /* @__PURE__ */ k({ - __name: "DashboardSystemInfo", - props: { - info: {}, - sprinkles: {} - }, - setup(p) { - return (r, n) => { - const l = u("UFCardBox"); - return i(), g(l, { title: "System Information" }, { - default: t(() => [ - e("dl", I, [ - n[0] || (n[0] = e("dt", null, "Framework version", -1)), - e("dd", null, [ - e("pre", null, [ - e("code", null, s(r.info.frameworkVersion), 1) - ]) - ]), - n[1] || (n[1] = e("dt", null, "PHP version", -1)), - e("dd", null, [ - e("pre", null, [ - e("code", null, s(r.info.phpVersion), 1) - ]) - ]), - n[2] || (n[2] = e("dt", null, "Webserver software", -1)), - e("dd", null, [ - e("pre", null, [ - e("code", null, s(r.info.server), 1) - ]) - ]), - n[3] || (n[3] = e("dt", null, "Database connection", -1)), - e("dd", null, [ - e("pre", null, [ - e("code", null, s(r.info.database.connection), 1) - ]) - ]), - n[4] || (n[4] = e("dt", null, "Database version", -1)), - e("dd", null, [ - e("pre", null, [ - e("code", null, s(r.info.database.type) + " " + s(r.info.database.version), 1) - ]) - ]), - n[5] || (n[5] = e("dt", null, "Database name", -1)), - e("dd", null, [ - e("pre", null, [ - e("code", null, s(r.info.database.name), 1) - ]) - ]), - n[6] || (n[6] = e("dt", null, "Project directory", -1)), - e("dd", null, [ - e("pre", null, [ - e("code", null, s(r.info.projectPath), 1) - ]) - ]), - n[7] || (n[7] = e("dt", null, "Loaded sprinkles", -1)), - e("dd", null, [ - e("ul", L, [ - (i(!0), _(v, null, h(r.sprinkles, (a) => (i(), _("li", { key: a }, s(a), 1))), 128)) - ]) - ]) - ]) - ]), - _: 1 - }); - }; - } -}), R = { class: "uk-text-meta" }, H = /* @__PURE__ */ k({ - __name: "DashboardActivities", - setup(p) { - return (r, n) => { - const l = u("UFSprunjeHeader"), a = u("UFSprunjeColumn"), m = u("RouterLink"), U = u("UFSprunjeTable"), F = u("UFCardBox"); - return i(), g(F, { title: "Latest Activities" }, { - default: t(() => [ - o(U, { - dataUrl: "/api/activities", - defaultSorts: { occurred_at: "desc" }, - hidePagination: "", - hideFilters: "" - }, { - header: t(() => [ - o(l, null, { - default: t(() => n[0] || (n[0] = [ - f("Activity Time") - ])), - _: 1 - }), - o(l, null, { - default: t(() => n[1] || (n[1] = [ - f("User") - ])), - _: 1 - }), - o(l, null, { - default: t(() => n[2] || (n[2] = [ - f("Description") - ])), - _: 1 - }) - ]), - body: t(({ item: c }) => [ - o(a, null, { - default: t(() => [ - e("div", null, s(d(b)(c.occurred_at).format("dddd")), 1), - e("div", null, s(d(b)(c.occurred_at).format("MMM Do, YYYY h:mm a")), 1) - ]), - _: 2 - }, 1024), - o(a, null, { - default: t(() => [ - e("strong", null, [ - o(m, { - to: { - name: "admin.user", - params: { user_name: c.user.user_name } - } - }, { - default: t(() => [ - f(s(c.user.full_name) + " (" + s(c.user.user_name) + ") ", 1) - ]), - _: 2 - }, 1032, ["to"]) - ]), - e("div", R, s(c.user.email), 1) - ]), - _: 2 - }, 1024), - o(a, null, { - default: t(() => [ - e("div", null, s(c.ip_address), 1), - e("div", null, [ - e("i", null, s(c.description), 1) - ]) - ]), - _: 2 - }, 1024) - ]), - _: 1 - }) - ]), - _: 1 - }); - }; - } -}), N = { - class: "uk-child-width-expand", - "uk-grid": "" -}, T = { - class: "uk-child-width-1-2", - "uk-grid": "" -}, Y = { - class: "uk-child-width-1-1", - "uk-grid": "" -}, z = /* @__PURE__ */ k({ - __name: "DashboardView", - setup(p) { - const r = B(); - return r.load(), (n, l) => { - const a = u("UFHeaderPage"); - return i(), _(v, null, [ - o(a, { title: "Dashboard" }), - e("div", N, [ - o(S, { - users: d(r).data.counter.users, - roles: d(r).data.counter.roles, - groups: d(r).data.counter.groups - }, null, 8, ["users", "roles", "groups"]) - ]), - e("div", T, [ - e("div", null, [ - e("div", Y, [ - e("div", null, [ - o(A, { - users: d(r).data.users - }, null, 8, ["users"]) - ]), - e("div", null, [ - o(P, { - info: d(r).data.info, - sprinkles: d(r).data.sprinkles - }, null, 8, ["info", "sprinkles"]) - ]) - ]) - ]), - e("div", null, [ - o(H) - ]) - ]) - ], 64); - }; - } -}); -export { - z as default -}; diff --git a/dist/DashboardView-DuV7cK9X.js b/dist/DashboardView-DuV7cK9X.js new file mode 100644 index 0000000..c9ec30d --- /dev/null +++ b/dist/DashboardView-DuV7cK9X.js @@ -0,0 +1,280 @@ +import { defineComponent as f, resolveComponent as a, openBlock as i, createElementBlock as _, Fragment as v, createVNode as o, createBlock as U, withCtx as r, createTextVNode as c, createElementVNode as e, renderList as g, toDisplayString as l, unref as d } from "vue"; +import { useDashboardApi as D } from "./composable/dashboard.js"; +import { h as b } from "./moment-h96o7c8I.js"; +const x = /* @__PURE__ */ f({ + __name: "DashboardStats", + props: { + users: {}, + roles: {}, + groups: {} + }, + setup(k) { + return (s, n) => { + const t = a("UFInfoBox"); + return i(), _(v, null, [ + o(t, { + value: s.users, + label: "Users", + faIcon: "user", + to: { name: "admin.users" } + }, null, 8, ["value"]), + o(t, { + value: s.roles, + label: "Roles", + faIcon: "address-card", + to: { name: "admin.roles" } + }, null, 8, ["value"]), + o(t, { + value: s.groups, + label: "Groups", + faIcon: "users", + to: { name: "admin.groups" } + }, null, 8, ["value"]) + ], 64); + }; + } +}), B = { + class: "uk-grid uk-flex-center", + "uk-grid": "" +}, C = ["src"], S = { class: "uk-margin-remove" }, w = { class: "uk-margin-remove uk-text-meta" }, $ = /* @__PURE__ */ f({ + __name: "DashboardRecentUsers", + props: { + users: {} + }, + setup(k) { + return (s, n) => { + const t = a("RouterLink"), u = a("UFCardBox"); + return i(), U(u, { title: "Latest Users" }, { + footer: r(() => [ + o(t, { + to: { name: "admin.users" }, + class: "uk-text-center" + }, { + default: r(() => n[0] || (n[0] = [ + c("View All Users") + ])), + _: 1 + }) + ]), + default: r(() => [ + e("div", B, [ + (i(!0), _(v, null, g(s.users, (m) => (i(), _("div", { + key: m.id, + class: "uk-text-center" + }, [ + o(t, { + to: { name: "admin.user", params: { user_name: m.user_name } }, + class: "uk-text-decoration-none uk-link-text" + }, { + default: r(() => [ + e("img", { + src: m.avatar, + alt: "User Image", + class: "uk-border-circle" + }, null, 8, C), + e("p", S, l(m.full_name), 1), + e("p", w, l(d(b)(m.created_at).fromNow()), 1) + ]), + _: 2 + }, 1032, ["to"]) + ]))), 128)) + ]) + ]), + _: 1 + }); + }; + } +}), y = { class: "uk-description-list" }, j = { class: "uk-list uk-list-disc uk-list-collapse" }, I = /* @__PURE__ */ f({ + __name: "DashboardSystemInfo", + props: { + info: {}, + sprinkles: {} + }, + setup(k) { + return (s, n) => { + const t = a("UFCardBox"); + return i(), U(t, { title: "System Information" }, { + default: r(() => [ + e("dl", y, [ + n[0] || (n[0] = e("dt", null, "Framework version", -1)), + e("dd", null, [ + e("pre", null, [ + e("code", null, l(s.info.frameworkVersion), 1) + ]) + ]), + n[1] || (n[1] = e("dt", null, "PHP version", -1)), + e("dd", null, [ + e("pre", null, [ + e("code", null, l(s.info.phpVersion), 1) + ]) + ]), + n[2] || (n[2] = e("dt", null, "Webserver software", -1)), + e("dd", null, [ + e("pre", null, [ + e("code", null, l(s.info.server), 1) + ]) + ]), + n[3] || (n[3] = e("dt", null, "Database connection", -1)), + e("dd", null, [ + e("pre", null, [ + e("code", null, l(s.info.database.connection), 1) + ]) + ]), + n[4] || (n[4] = e("dt", null, "Database version", -1)), + e("dd", null, [ + e("pre", null, [ + e("code", null, l(s.info.database.type) + " " + l(s.info.database.version), 1) + ]) + ]), + n[5] || (n[5] = e("dt", null, "Database name", -1)), + e("dd", null, [ + e("pre", null, [ + e("code", null, l(s.info.database.name), 1) + ]) + ]), + n[6] || (n[6] = e("dt", null, "Project directory", -1)), + e("dd", null, [ + e("pre", null, [ + e("code", null, l(s.info.projectPath), 1) + ]) + ]), + n[7] || (n[7] = e("dt", null, "Loaded sprinkles", -1)), + e("dd", null, [ + e("ul", j, [ + (i(!0), _(v, null, g(s.sprinkles, (u) => (i(), _("li", { key: u }, l(u), 1))), 128)) + ]) + ]) + ]) + ]), + _: 1 + }); + }; + } +}), L = { class: "uk-text-meta" }, P = /* @__PURE__ */ f({ + __name: "DashboardActivities", + setup(k) { + return (s, n) => { + const t = a("UFSprunjeHeader"), u = a("UFSprunjeColumn"), m = a("RouterLink"), F = a("UFSprunjeTable"), h = a("UFCardBox"); + return i(), U(h, { title: "Latest Activities" }, { + default: r(() => [ + o(F, { + dataUrl: "/api/activities", + defaultSorts: { occurred_at: "desc" }, + hidePagination: "", + hideFilters: "" + }, { + header: r(() => [ + o(t, null, { + default: r(() => n[0] || (n[0] = [ + c("Activity Time") + ])), + _: 1 + }), + o(t, null, { + default: r(() => n[1] || (n[1] = [ + c("User") + ])), + _: 1 + }), + o(t, null, { + default: r(() => n[2] || (n[2] = [ + c("Description") + ])), + _: 1 + }) + ]), + body: r(({ item: p }) => [ + o(u, null, { + default: r(() => [ + e("div", null, l(d(b)(p.occurred_at).format("dddd")), 1), + e("div", null, l(d(b)(p.occurred_at).format("MMM Do, YYYY h:mm a")), 1) + ]), + _: 2 + }, 1024), + o(u, null, { + default: r(() => [ + e("strong", null, [ + o(m, { + to: { + name: "admin.user", + params: { user_name: p.user.user_name } + } + }, { + default: r(() => [ + c(l(p.user.full_name) + " (" + l(p.user.user_name) + ") ", 1) + ]), + _: 2 + }, 1032, ["to"]) + ]), + e("div", L, l(p.user.email), 1) + ]), + _: 2 + }, 1024), + o(u, null, { + default: r(() => [ + e("div", null, l(p.ip_address), 1), + e("div", null, [ + e("i", null, l(p.description), 1) + ]) + ]), + _: 2 + }, 1024) + ]), + _: 1 + }) + ]), + _: 1 + }); + }; + } +}), V = { + class: "uk-child-width-expand", + "uk-grid": "" +}, R = { + class: "uk-child-width-1-2", + "uk-grid": "" +}, A = { + class: "uk-child-width-1-1", + "uk-grid": "" +}, Y = /* @__PURE__ */ f({ + __name: "DashboardView", + setup(k) { + const s = D(); + return s.load(), (n, t) => { + const u = a("UFHeaderPage"); + return i(), _(v, null, [ + o(u, { title: "Dashboard" }), + e("div", V, [ + o(x, { + users: d(s).data.counter.users, + roles: d(s).data.counter.roles, + groups: d(s).data.counter.groups + }, null, 8, ["users", "roles", "groups"]) + ]), + e("div", R, [ + e("div", null, [ + e("div", A, [ + e("div", null, [ + o($, { + users: d(s).data.users + }, null, 8, ["users"]) + ]), + e("div", null, [ + o(I, { + info: d(s).data.info, + sprinkles: d(s).data.sprinkles + }, null, 8, ["info", "sprinkles"]) + ]) + ]) + ]), + e("div", null, [ + o(P) + ]) + ]) + ], 64); + }; + } +}); +export { + Y as default +}; diff --git a/dist/GroupView-2Qy5dhaD.js b/dist/GroupView-2Qy5dhaD.js deleted file mode 100644 index 2e84d32..0000000 --- a/dist/GroupView-2Qy5dhaD.js +++ /dev/null @@ -1,181 +0,0 @@ -import { ref as k, watch as v, defineComponent as U, resolveComponent as r, openBlock as i, createBlock as g, withCtx as u, createElementVNode as o, createCommentVNode as w, toDisplayString as p, createVNode as n, createTextVNode as c, renderSlot as C, createElementBlock as F, Fragment as $, unref as b } from "vue"; -import { useRoute as y } from "vue-router"; -import { a as G } from "./axios-CXDYiOMX.js"; -import { a as S } from "./types-Daou0lcF.js"; -function x(d) { - const e = k(!1), t = k(), s = k({ - id: 0, - name: "", - slug: "", - description: "", - icon: "", - created_at: "", - updated_at: "", - deleted_at: null, - users_count: 0 - }); - async function a() { - e.value = !0, t.value = null, await G.get("/api/groups/g/" + d.params.slug).then((l) => { - s.value = l.data; - }).catch((l) => { - t.value = { - description: "An error as occurred", - style: S.Danger, - closeBtn: !0, - ...l.response.data - }; - }).finally(() => { - e.value = !1; - }); - } - return v( - () => d.params.slug, - () => { - a(); - }, - { immediate: !0 } - ), { group: s, error: t, loading: e }; -} -const B = { class: "uk-text-center" }, A = { class: "uk-text-center uk-margin-remove" }, j = { class: "uk-text-meta" }, V = { class: "uk-description-list" }, H = { class: "uk-badge" }, N = /* @__PURE__ */ U({ - __name: "GroupInfo", - props: { - group: {} - }, - setup(d) { - return (e, t) => { - const s = r("font-awesome-icon"), a = r("UFCardBox"); - return i(), g(a, null, { - default: u(() => [ - o("div", B, [ - e.group.icon ? (i(), g(s, { - key: 0, - icon: e.group.icon, - class: "fa-5x" - }, null, 8, ["icon"])) : w("", !0) - ]), - o("h3", A, p(e.group.name), 1), - o("p", j, p(e.group.description), 1), - t[1] || (t[1] = o("hr", null, null, -1)), - o("dl", V, [ - o("dt", null, [ - n(s, { icon: "users" }), - t[0] || (t[0] = c(" Users")) - ]), - o("dd", null, [ - o("span", H, p(e.group.users_count), 1) - ]) - ]), - t[2] || (t[2] = o("hr", null, null, -1)), - t[3] || (t[3] = o("button", { class: "uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Edit Group ", -1)), - t[4] || (t[4] = o("button", { class: "uk-button uk-button-danger uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Delete Group ", -1)), - C(e.$slots, "default", { dataTest: "slot" }) - ]), - _: 3 - }); - }; - } -}), T = { class: "uk-button uk-button-default" }, D = { class: "uk-text-meta" }, E = { class: "uk-button uk-button-danger uk-button-small" }, R = /* @__PURE__ */ U({ - __name: "GroupUsers", - props: { - slug: {} - }, - setup(d) { - return (e, t) => { - const s = r("font-awesome-icon"), a = r("UFSprunjeHeader"), l = r("RouterLink"), m = r("UFSprunjeColumn"), f = r("UFSprunjeTable"), h = r("UFCardBox"); - return i(), g(h, { title: "Group Users" }, { - default: u(() => [ - n(f, { - dataUrl: "/api/groups/g/" + e.slug + "/users", - searchColumn: "name", - hideFilters: "" - }, { - actions: u(() => [ - o("button", T, [ - n(s, { icon: "user-plus" }), - t[0] || (t[0] = c(" Add user ")) - ]) - ]), - header: u(() => [ - n(a, { sort: "name" }, { - default: u(() => t[1] || (t[1] = [ - c("User") - ])), - _: 1 - }), - n(a, null, { - default: u(() => t[2] || (t[2] = [ - c("Actions") - ])), - _: 1 - }) - ]), - body: u(({ item: _ }) => [ - n(m, null, { - default: u(() => [ - o("strong", null, [ - n(l, { - to: { - name: "admin.user", - params: { user_name: _.user_name } - } - }, { - default: u(() => [ - c(p(_.full_name) + " (" + p(_.user_name) + ") ", 1) - ]), - _: 2 - }, 1032, ["to"]) - ]), - o("div", D, p(_.email), 1) - ]), - _: 2 - }, 1024), - n(m, null, { - default: u(() => [ - o("button", E, [ - n(s, { icon: "trash" }) - ]) - ]), - _: 1 - }) - ]), - _: 1 - }, 8, ["dataUrl"]) - ]), - _: 1 - }); - }; - } -}), L = { - key: 1, - "uk-grid": "" -}, P = { class: "uk-width-1-3" }, I = { class: "uk-width-2-3" }, M = /* @__PURE__ */ U({ - __name: "GroupView", - setup(d) { - const e = y(), { group: t, error: s } = x(e); - return (a, l) => { - const m = r("UFHeaderPage"), f = r("UFAlert"); - return i(), F($, null, [ - n(m, { - title: "Group details", - caption: "Group information page" - }), - b(s) ? (i(), g(f, { - key: 0, - alert: b(s) - }, null, 8, ["alert"])) : (i(), F("div", L, [ - o("div", P, [ - n(N, { group: b(t) }, null, 8, ["group"]) - ]), - o("div", I, [ - n(R, { - slug: a.$route.params.slug.toString() - }, null, 8, ["slug"]) - ]) - ])) - ], 64); - }; - } -}); -export { - M as default -}; diff --git a/dist/GroupView-B9Zxi1Ld.cjs b/dist/GroupView-B9Zxi1Ld.cjs deleted file mode 100644 index d718244..0000000 --- a/dist/GroupView-B9Zxi1Ld.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("vue-router"),p=require("./axios-tuVKNgv9.cjs"),m=require("./types-D9XxK5BT.cjs");function _(l){const o=e.ref(!1),t=e.ref(),n=e.ref({id:0,name:"",slug:"",description:"",icon:"",created_at:"",updated_at:"",deleted_at:null,users_count:0});async function r(){o.value=!0,t.value=null,await p.axios.get("/api/groups/g/"+l.params.slug).then(s=>{n.value=s.data}).catch(s=>{t.value={description:"An error as occurred",style:m.a.Danger,closeBtn:!0,...s.response.data}}).finally(()=>{o.value=!1})}return e.watch(()=>l.params.slug,()=>{r()},{immediate:!0}),{group:n,error:t,loading:o}}const g={class:"uk-text-center"},k={class:"uk-text-center uk-margin-remove"},f={class:"uk-text-meta"},V={class:"uk-description-list"},N={class:"uk-badge"},C=e.defineComponent({__name:"GroupInfo",props:{group:{}},setup(l){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",g,[o.group.icon?(e.openBlock(),e.createBlock(n,{key:0,icon:o.group.icon,class:"fa-5x"},null,8,["icon"])):e.createCommentVNode("",!0)]),e.createElementVNode("h3",k,e.toDisplayString(o.group.name),1),e.createElementVNode("p",f,e.toDisplayString(o.group.description),1),t[1]||(t[1]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("dl",V,[e.createElementVNode("dt",null,[e.createVNode(n,{icon:"users"}),t[0]||(t[0]=e.createTextVNode(" Users"))]),e.createElementVNode("dd",null,[e.createElementVNode("span",N,e.toDisplayString(o.group.users_count),1)])]),t[2]||(t[2]=e.createElementVNode("hr",null,null,-1)),t[3]||(t[3]=e.createElementVNode("button",{class:"uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Edit Group ",-1)),t[4]||(t[4]=e.createElementVNode("button",{class:"uk-button uk-button-danger uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Delete Group ",-1)),e.renderSlot(o.$slots,"default",{dataTest:"slot"})]),_:3})}}}),v={class:"uk-button uk-button-default"},b={class:"uk-text-meta"},h={class:"uk-button uk-button-danger uk-button-small"},w=e.defineComponent({__name:"GroupUsers",props:{slug:{}},setup(l){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFSprunjeHeader"),s=e.resolveComponent("RouterLink"),a=e.resolveComponent("UFSprunjeColumn"),c=e.resolveComponent("UFSprunjeTable"),d=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(d,{title:"Group Users"},{default:e.withCtx(()=>[e.createVNode(c,{dataUrl:"/api/groups/g/"+o.slug+"/users",searchColumn:"name",hideFilters:""},{actions:e.withCtx(()=>[e.createElementVNode("button",v,[e.createVNode(n,{icon:"user-plus"}),t[0]||(t[0]=e.createTextVNode(" Add user "))])]),header:e.withCtx(()=>[e.createVNode(r,{sort:"name"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("User")])),_:1}),e.createVNode(r,null,{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Actions")])),_:1})]),body:e.withCtx(({item:u})=>[e.createVNode(a,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(s,{to:{name:"admin.user",params:{user_name:u.user_name}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.full_name)+" ("+e.toDisplayString(u.user_name)+") ",1)]),_:2},1032,["to"])]),e.createElementVNode("div",b,e.toDisplayString(u.email),1)]),_:2},1024),e.createVNode(a,null,{default:e.withCtx(()=>[e.createElementVNode("button",h,[e.createVNode(n,{icon:"trash"})])]),_:1})]),_:1},8,["dataUrl"])]),_:1})}}}),x={key:1,"uk-grid":""},E={class:"uk-width-1-3"},U={class:"uk-width-2-3"},y=e.defineComponent({__name:"GroupView",setup(l){const o=i.useRoute(),{group:t,error:n}=_(o);return(r,s)=>{const a=e.resolveComponent("UFHeaderPage"),c=e.resolveComponent("UFAlert");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(a,{title:"Group details",caption:"Group information page"}),e.unref(n)?(e.openBlock(),e.createBlock(c,{key:0,alert:e.unref(n)},null,8,["alert"])):(e.openBlock(),e.createElementBlock("div",x,[e.createElementVNode("div",E,[e.createVNode(C,{group:e.unref(t)},null,8,["group"])]),e.createElementVNode("div",U,[e.createVNode(w,{slug:r.$route.params.slug.toString()},null,8,["slug"])])]))],64)}}});exports.default=y; diff --git a/dist/GroupView-C-pLYY6K.js b/dist/GroupView-C-pLYY6K.js new file mode 100644 index 0000000..5a9e037 --- /dev/null +++ b/dist/GroupView-C-pLYY6K.js @@ -0,0 +1,146 @@ +import { defineComponent as g, resolveComponent as u, openBlock as a, createBlock as _, withCtx as s, createElementVNode as o, createCommentVNode as C, toDisplayString as p, createVNode as e, createTextVNode as i, renderSlot as h, createElementBlock as U, Fragment as w, unref as k } from "vue"; +import { useRoute as $ } from "vue-router"; +import { useGroupApi as G } from "./composable/group.js"; +const S = { class: "uk-text-center" }, v = { class: "uk-text-center uk-margin-remove" }, x = { class: "uk-text-meta" }, B = { class: "uk-description-list" }, j = { class: "uk-badge" }, y = /* @__PURE__ */ g({ + __name: "GroupInfo", + props: { + group: {} + }, + setup(f) { + return (n, t) => { + const r = u("font-awesome-icon"), l = u("UFCardBox"); + return a(), _(l, null, { + default: s(() => [ + o("div", S, [ + n.group.icon ? (a(), _(r, { + key: 0, + icon: n.group.icon, + class: "fa-5x" + }, null, 8, ["icon"])) : C("", !0) + ]), + o("h3", v, p(n.group.name), 1), + o("p", x, p(n.group.description), 1), + t[1] || (t[1] = o("hr", null, null, -1)), + o("dl", B, [ + o("dt", null, [ + e(r, { icon: "users" }), + t[0] || (t[0] = i(" Users")) + ]), + o("dd", null, [ + o("span", j, p(n.group.users_count), 1) + ]) + ]), + t[2] || (t[2] = o("hr", null, null, -1)), + t[3] || (t[3] = o("button", { class: "uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Edit Group ", -1)), + t[4] || (t[4] = o("button", { class: "uk-button uk-button-danger uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Delete Group ", -1)), + h(n.$slots, "default", { dataTest: "slot" }) + ]), + _: 3 + }); + }; + } +}), A = { class: "uk-button uk-button-default" }, V = { class: "uk-text-meta" }, H = { class: "uk-button uk-button-danger uk-button-small" }, N = /* @__PURE__ */ g({ + __name: "GroupUsers", + props: { + slug: {} + }, + setup(f) { + return (n, t) => { + const r = u("font-awesome-icon"), l = u("UFSprunjeHeader"), b = u("RouterLink"), d = u("UFSprunjeColumn"), c = u("UFSprunjeTable"), F = u("UFCardBox"); + return a(), _(F, { title: "Group Users" }, { + default: s(() => [ + e(c, { + dataUrl: "/api/groups/g/" + n.slug + "/users", + searchColumn: "name", + hideFilters: "" + }, { + actions: s(() => [ + o("button", A, [ + e(r, { icon: "user-plus" }), + t[0] || (t[0] = i(" Add user ")) + ]) + ]), + header: s(() => [ + e(l, { sort: "name" }, { + default: s(() => t[1] || (t[1] = [ + i("User") + ])), + _: 1 + }), + e(l, null, { + default: s(() => t[2] || (t[2] = [ + i("Actions") + ])), + _: 1 + }) + ]), + body: s(({ item: m }) => [ + e(d, null, { + default: s(() => [ + o("strong", null, [ + e(b, { + to: { + name: "admin.user", + params: { user_name: m.user_name } + } + }, { + default: s(() => [ + i(p(m.full_name) + " (" + p(m.user_name) + ") ", 1) + ]), + _: 2 + }, 1032, ["to"]) + ]), + o("div", V, p(m.email), 1) + ]), + _: 2 + }, 1024), + e(d, null, { + default: s(() => [ + o("button", H, [ + e(r, { icon: "trash" }) + ]) + ]), + _: 1 + }) + ]), + _: 1 + }, 8, ["dataUrl"]) + ]), + _: 1 + }); + }; + } +}), T = { + key: 1, + "uk-grid": "" +}, E = { class: "uk-width-1-3" }, R = { class: "uk-width-2-3" }, I = /* @__PURE__ */ g({ + __name: "GroupView", + setup(f) { + const n = $(), { group: t, error: r } = G(n); + return (l, b) => { + const d = u("UFHeaderPage"), c = u("UFAlert"); + return a(), U(w, null, [ + e(d, { + title: "Group details", + caption: "Group information page" + }), + k(r) ? (a(), _(c, { + key: 0, + alert: k(r) + }, null, 8, ["alert"])) : (a(), U("div", T, [ + o("div", E, [ + e(y, { group: k(t) }, null, 8, ["group"]) + ]), + o("div", R, [ + e(N, { + slug: l.$route.params.slug.toString() + }, null, 8, ["slug"]) + ]) + ])) + ], 64); + }; + } +}); +export { + I as default +}; diff --git a/dist/GroupView-DPKgjvQ-.cjs b/dist/GroupView-DPKgjvQ-.cjs new file mode 100644 index 0000000..cdcbc48 --- /dev/null +++ b/dist/GroupView-DPKgjvQ-.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("vue-router"),p=require("./composable/group.cjs"),m={class:"uk-text-center"},_={class:"uk-text-center uk-margin-remove"},k={class:"uk-text-meta"},g={class:"uk-description-list"},V={class:"uk-badge"},N=e.defineComponent({__name:"GroupInfo",props:{group:{}},setup(a){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",m,[o.group.icon?(e.openBlock(),e.createBlock(n,{key:0,icon:o.group.icon,class:"fa-5x"},null,8,["icon"])):e.createCommentVNode("",!0)]),e.createElementVNode("h3",_,e.toDisplayString(o.group.name),1),e.createElementVNode("p",k,e.toDisplayString(o.group.description),1),t[1]||(t[1]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("dl",g,[e.createElementVNode("dt",null,[e.createVNode(n,{icon:"users"}),t[0]||(t[0]=e.createTextVNode(" Users"))]),e.createElementVNode("dd",null,[e.createElementVNode("span",V,e.toDisplayString(o.group.users_count),1)])]),t[2]||(t[2]=e.createElementVNode("hr",null,null,-1)),t[3]||(t[3]=e.createElementVNode("button",{class:"uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Edit Group ",-1)),t[4]||(t[4]=e.createElementVNode("button",{class:"uk-button uk-button-danger uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Delete Group ",-1)),e.renderSlot(o.$slots,"default",{dataTest:"slot"})]),_:3})}}}),C={class:"uk-button uk-button-default"},f={class:"uk-text-meta"},b={class:"uk-button uk-button-danger uk-button-small"},E=e.defineComponent({__name:"GroupUsers",props:{slug:{}},setup(a){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFSprunjeHeader"),c=e.resolveComponent("RouterLink"),s=e.resolveComponent("UFSprunjeColumn"),u=e.resolveComponent("UFSprunjeTable"),d=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(d,{title:"Group Users"},{default:e.withCtx(()=>[e.createVNode(u,{dataUrl:"/api/groups/g/"+o.slug+"/users",searchColumn:"name",hideFilters:""},{actions:e.withCtx(()=>[e.createElementVNode("button",C,[e.createVNode(n,{icon:"user-plus"}),t[0]||(t[0]=e.createTextVNode(" Add user "))])]),header:e.withCtx(()=>[e.createVNode(r,{sort:"name"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("User")])),_:1}),e.createVNode(r,null,{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Actions")])),_:1})]),body:e.withCtx(({item:l})=>[e.createVNode(s,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(c,{to:{name:"admin.user",params:{user_name:l.user_name}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.full_name)+" ("+e.toDisplayString(l.user_name)+") ",1)]),_:2},1032,["to"])]),e.createElementVNode("div",f,e.toDisplayString(l.email),1)]),_:2},1024),e.createVNode(s,null,{default:e.withCtx(()=>[e.createElementVNode("button",b,[e.createVNode(n,{icon:"trash"})])]),_:1})]),_:1},8,["dataUrl"])]),_:1})}}}),U={key:1,"uk-grid":""},h={class:"uk-width-1-3"},v={class:"uk-width-2-3"},w=e.defineComponent({__name:"GroupView",setup(a){const o=i.useRoute(),{group:t,error:n}=p.useGroupApi(o);return(r,c)=>{const s=e.resolveComponent("UFHeaderPage"),u=e.resolveComponent("UFAlert");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(s,{title:"Group details",caption:"Group information page"}),e.unref(n)?(e.openBlock(),e.createBlock(u,{key:0,alert:e.unref(n)},null,8,["alert"])):(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",h,[e.createVNode(N,{group:e.unref(t)},null,8,["group"])]),e.createElementVNode("div",v,[e.createVNode(E,{slug:r.$route.params.slug.toString()},null,8,["slug"])])]))],64)}}});exports.default=w; diff --git a/dist/GroupsView-B5AdZnnE.js b/dist/GroupsView-B5AdZnnE.js new file mode 100644 index 0000000..43bcc84 --- /dev/null +++ b/dist/GroupsView-B5AdZnnE.js @@ -0,0 +1,292 @@ +import { defineComponent as x, ref as F, reactive as S, resolveComponent as a, openBlock as v, createElementBlock as y, withModifiers as j, createElementVNode as t, createBlock as D, createCommentVNode as V, createVNode as o, withDirectives as g, unref as i, vModelText as b, inject as $, Fragment as G, createTextVNode as m, withCtx as l, toDisplayString as U } from "vue"; +import { a as h } from "./axios-CXDYiOMX.js"; +import { a as A } from "./types-Daou0lcF.js"; +function C() { + return { + slug: "", + name: "", + description: "", + icon: "users" + }; +} +async function B(_) { + return h.post("/api/groups", _).then((d) => d.data.message).catch((d) => { + throw { + description: "An error as occurred", + style: A.Danger, + closeBtn: !0, + ...d.response.data + }; + }); +} +const N = { class: "uk-fieldset uk-form-stacked" }, H = { class: "uk-margin" }, M = { class: "uk-inline uk-width-1-1" }, P = { class: "uk-margin" }, T = { class: "uk-inline uk-width-1-1" }, E = { class: "uk-margin" }, I = { class: "uk-inline uk-width-1-1" }, L = { class: "uk-margin" }, R = { + class: "uk-text-right", + "uk-margin": "" +}, q = /* @__PURE__ */ x({ + __name: "GroupCreateForm", + emits: ["cancel", "saved"], + setup(_, { emit: d }) { + const n = d, f = F(!1), s = F(); + let r = S(C()); + async function k() { + f.value = !0, s.value = null, await B(r).then((c) => { + n("saved"), r = C(); + }).catch((c) => { + s.value = c; + }).finally(() => { + f.value = !1; + }); + } + return (c, e) => { + const w = a("UFAlert"), p = a("font-awesome-icon"); + return v(), y("form", { + onSubmit: e[5] || (e[5] = j((u) => k(), ["prevent"])) + }, [ + t("fieldset", N, [ + s.value ? (v(), D(w, { + key: 0, + "data-test": "error", + alert: s.value + }, null, 8, ["alert"])) : V("", !0), + t("div", H, [ + e[6] || (e[6] = t("label", { + class: "uk-form-label", + for: "form-stacked-text" + }, "Group name", -1)), + t("div", M, [ + o(p, { + class: "fa-form-icon", + icon: "pen-to-square", + "fixed-width": "" + }), + g(t("input", { + class: "uk-input", + type: "text", + placeholder: "Please enter a name for the group", + "aria-label": "Group Name", + "data-test": "name", + "onUpdate:modelValue": e[0] || (e[0] = (u) => i(r).name = u) + }, null, 512), [ + [b, i(r).name] + ]) + ]) + ]), + t("div", P, [ + e[7] || (e[7] = t("label", { + class: "uk-form-label", + for: "form-stacked-text" + }, "Slug", -1)), + t("div", T, [ + o(p, { + class: "fa-form-icon", + icon: "tag", + "fixed-width": "" + }), + g(t("input", { + class: "uk-input", + type: "text", + placeholder: "Group Slug", + "aria-label": "Group Slug", + "data-test": "slug", + "onUpdate:modelValue": e[1] || (e[1] = (u) => i(r).slug = u) + }, null, 512), [ + [b, i(r).slug] + ]) + ]) + ]), + t("div", E, [ + e[8] || (e[8] = t("label", { + class: "uk-form-label", + for: "form-stacked-text" + }, "Group Icon", -1)), + t("div", I, [ + o(p, { + class: "fa-form-icon", + icon: i(r).icon, + "fixed-width": "" + }, null, 8, ["icon"]), + g(t("input", { + class: "uk-input", + type: "text", + placeholder: "Icon for group members", + "aria-label": "Group Icon", + "data-test": "icon", + "onUpdate:modelValue": e[2] || (e[2] = (u) => i(r).icon = u) + }, null, 512), [ + [b, i(r).icon] + ]) + ]) + ]), + t("div", L, [ + e[9] || (e[9] = t("label", { + class: "uk-form-label", + for: "form-stacked-text" + }, "Description", -1)), + g(t("textarea", { + class: "uk-textarea", + placeholder: "Group Description", + "aria-label": "Description", + "data-test": "description", + rows: "6", + "onUpdate:modelValue": e[3] || (e[3] = (u) => i(r).description = u) + }, null, 512), [ + [b, i(r).description] + ]) + ]), + t("div", R, [ + t("button", { + class: "uk-button uk-button-default", + type: "button", + onClick: e[4] || (e[4] = (u) => c.$emit("cancel")) + }, "Cancel"), + e[10] || (e[10] = t("button", { + class: "uk-button uk-button-primary", + type: "submit" + }, "Save", -1)) + ]) + ]) + ], 32); + }; + } +}), z = { + class: "uk-button uk-button-default", + type: "button", + "uk-toggle": "target: #group-create-form" +}, J = { + id: "group-create-form", + "uk-modal": "" +}, K = { class: "uk-modal-dialog uk-modal-body" }, O = /* @__PURE__ */ x({ + __name: "GroupCreateModal", + setup(_) { + const d = $("sprunjer"), n = () => { + d.fetch(); + }; + return (f, s) => { + const r = a("font-awesome-icon"); + return v(), y(G, null, [ + t("button", z, [ + o(r, { + icon: "plus", + "fixed-width": "" + }), + s[0] || (s[0] = m(" Create Group ")) + ]), + t("div", J, [ + t("div", K, [ + s[1] || (s[1] = t("button", { + class: "uk-modal-close-default", + type: "button", + "uk-close": "" + }, null, -1)), + s[2] || (s[2] = t("h3", { class: "uk-modal-title" }, "Create Group", -1)), + o(q, { + onCancel: n, + onSaved: n + }) + ]) + ]) + ], 64); + }; + } +}), Q = { + class: "uk-button uk-button-default uk-button-small", + type: "button" +}, Z = /* @__PURE__ */ x({ + __name: "GroupsView", + setup(_) { + return (d, n) => { + const f = a("UFHeaderPage"), s = a("UFSprunjeHeader"), r = a("RouterLink"), k = a("UFSprunjeColumn"), c = a("font-awesome-icon"), e = a("UFSprunjeTable"), w = a("UFCardBox"); + return v(), y(G, null, [ + o(f, { + title: "Groups", + caption: "A listing of the groups for your site. Provides management tools for editing and deleting groups." + }), + o(w, null, { + default: l(() => [ + o(e, { + dataUrl: "/api/groups", + searchColumn: "name" + }, { + actions: l(() => [ + o(O) + ]), + header: l(() => [ + o(s, { sort: "name" }, { + default: l(() => n[0] || (n[0] = [ + m("Groups") + ])), + _: 1 + }), + o(s, { sort: "description" }, { + default: l(() => n[1] || (n[1] = [ + m("Description") + ])), + _: 1 + }), + o(s, null, { + default: l(() => n[2] || (n[2] = [ + m("Actions") + ])), + _: 1 + }) + ]), + body: l(({ item: p }) => [ + o(k, null, { + default: l(() => [ + t("strong", null, [ + o(r, { + to: { + name: "admin.group", + params: { slug: p.slug } + } + }, { + default: l(() => [ + m(U(p.name), 1) + ]), + _: 2 + }, 1032, ["to"]) + ]) + ]), + _: 2 + }, 1024), + o(k, null, { + default: l(() => [ + m(U(p.description), 1) + ]), + _: 2 + }, 1024), + o(k, null, { + default: l(() => [ + t("button", Q, [ + n[3] || (n[3] = m(" Actions ")), + o(c, { + icon: "caret-down", + "fixed-width": "" + }) + ]), + n[4] || (n[4] = t("div", { "uk-dropdown": "" }, [ + t("ul", { class: "uk-nav uk-dropdown-nav" }, [ + t("li", null, [ + t("a", { href: "#" }, "Edit Group") + ]), + t("li", null, [ + t("a", { href: "#" }, "Delete Group") + ]) + ]) + ], -1)) + ]), + _: 1 + }) + ]), + _: 1 + }) + ]), + _: 1 + }) + ], 64); + }; + } +}); +export { + Z as default +}; diff --git a/dist/GroupsView-BHzd4Ctz.cjs b/dist/GroupsView-BHzd4Ctz.cjs new file mode 100644 index 0000000..abc8a08 --- /dev/null +++ b/dist/GroupsView-BHzd4Ctz.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),f=require("./axios-tuVKNgv9.cjs"),V=require("./types-D9XxK5BT.cjs");function p(){return{slug:"",name:"",description:"",icon:"users"}}async function k(c){return f.axios.post("/api/groups",c).then(a=>a.data.message).catch(a=>{throw{description:"An error as occurred",style:V.a.Danger,closeBtn:!0,...a.response.data}})}const N={class:"uk-fieldset uk-form-stacked"},v={class:"uk-margin"},g={class:"uk-inline uk-width-1-1"},_={class:"uk-margin"},x={class:"uk-inline uk-width-1-1"},b={class:"uk-margin"},w={class:"uk-inline uk-width-1-1"},C={class:"uk-margin"},E={class:"uk-text-right","uk-margin":""},y=e.defineComponent({__name:"GroupCreateForm",emits:["cancel","saved"],setup(c,{emit:a}){const o=a,d=e.ref(!1),n=e.ref();let r=e.reactive(p());async function i(){d.value=!0,n.value=null,await k(r).then(u=>{o("saved"),r=p()}).catch(u=>{n.value=u}).finally(()=>{d.value=!1})}return(u,t)=>{const m=e.resolveComponent("UFAlert"),s=e.resolveComponent("font-awesome-icon");return e.openBlock(),e.createElementBlock("form",{onSubmit:t[5]||(t[5]=e.withModifiers(l=>i(),["prevent"]))},[e.createElementVNode("fieldset",N,[n.value?(e.openBlock(),e.createBlock(m,{key:0,"data-test":"error",alert:n.value},null,8,["alert"])):e.createCommentVNode("",!0),e.createElementVNode("div",v,[t[6]||(t[6]=e.createElementVNode("label",{class:"uk-form-label",for:"form-stacked-text"},"Group name",-1)),e.createElementVNode("div",g,[e.createVNode(s,{class:"fa-form-icon",icon:"pen-to-square","fixed-width":""}),e.withDirectives(e.createElementVNode("input",{class:"uk-input",type:"text",placeholder:"Please enter a name for the group","aria-label":"Group Name","data-test":"name","onUpdate:modelValue":t[0]||(t[0]=l=>e.unref(r).name=l)},null,512),[[e.vModelText,e.unref(r).name]])])]),e.createElementVNode("div",_,[t[7]||(t[7]=e.createElementVNode("label",{class:"uk-form-label",for:"form-stacked-text"},"Slug",-1)),e.createElementVNode("div",x,[e.createVNode(s,{class:"fa-form-icon",icon:"tag","fixed-width":""}),e.withDirectives(e.createElementVNode("input",{class:"uk-input",type:"text",placeholder:"Group Slug","aria-label":"Group Slug","data-test":"slug","onUpdate:modelValue":t[1]||(t[1]=l=>e.unref(r).slug=l)},null,512),[[e.vModelText,e.unref(r).slug]])])]),e.createElementVNode("div",b,[t[8]||(t[8]=e.createElementVNode("label",{class:"uk-form-label",for:"form-stacked-text"},"Group Icon",-1)),e.createElementVNode("div",w,[e.createVNode(s,{class:"fa-form-icon",icon:e.unref(r).icon,"fixed-width":""},null,8,["icon"]),e.withDirectives(e.createElementVNode("input",{class:"uk-input",type:"text",placeholder:"Icon for group members","aria-label":"Group Icon","data-test":"icon","onUpdate:modelValue":t[2]||(t[2]=l=>e.unref(r).icon=l)},null,512),[[e.vModelText,e.unref(r).icon]])])]),e.createElementVNode("div",C,[t[9]||(t[9]=e.createElementVNode("label",{class:"uk-form-label",for:"form-stacked-text"},"Description",-1)),e.withDirectives(e.createElementVNode("textarea",{class:"uk-textarea",placeholder:"Group Description","aria-label":"Description","data-test":"description",rows:"6","onUpdate:modelValue":t[3]||(t[3]=l=>e.unref(r).description=l)},null,512),[[e.vModelText,e.unref(r).description]])]),e.createElementVNode("div",E,[e.createElementVNode("button",{class:"uk-button uk-button-default",type:"button",onClick:t[4]||(t[4]=l=>u.$emit("cancel"))},"Cancel"),t[10]||(t[10]=e.createElementVNode("button",{class:"uk-button uk-button-primary",type:"submit"},"Save",-1))])])],32)}}}),h={class:"uk-button uk-button-default",type:"button","uk-toggle":"target: #group-create-form"},F={id:"group-create-form","uk-modal":""},U={class:"uk-modal-dialog uk-modal-body"},G=e.defineComponent({__name:"GroupCreateModal",setup(c){const a=e.inject("sprunjer"),o=()=>{a.fetch()};return(d,n)=>{const r=e.resolveComponent("font-awesome-icon");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("button",h,[e.createVNode(r,{icon:"plus","fixed-width":""}),n[0]||(n[0]=e.createTextVNode(" Create Group "))]),e.createElementVNode("div",F,[e.createElementVNode("div",U,[n[1]||(n[1]=e.createElementVNode("button",{class:"uk-modal-close-default",type:"button","uk-close":""},null,-1)),n[2]||(n[2]=e.createElementVNode("h3",{class:"uk-modal-title"},"Create Group",-1)),e.createVNode(y,{onCancel:o,onSaved:o})])])],64)}}}),S={class:"uk-button uk-button-default uk-button-small",type:"button"},T=e.defineComponent({__name:"GroupsView",setup(c){return(a,o)=>{const d=e.resolveComponent("UFHeaderPage"),n=e.resolveComponent("UFSprunjeHeader"),r=e.resolveComponent("RouterLink"),i=e.resolveComponent("UFSprunjeColumn"),u=e.resolveComponent("font-awesome-icon"),t=e.resolveComponent("UFSprunjeTable"),m=e.resolveComponent("UFCardBox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(d,{title:"Groups",caption:"A listing of the groups for your site. Provides management tools for editing and deleting groups."}),e.createVNode(m,null,{default:e.withCtx(()=>[e.createVNode(t,{dataUrl:"/api/groups",searchColumn:"name"},{actions:e.withCtx(()=>[e.createVNode(G)]),header:e.withCtx(()=>[e.createVNode(n,{sort:"name"},{default:e.withCtx(()=>o[0]||(o[0]=[e.createTextVNode("Groups")])),_:1}),e.createVNode(n,{sort:"description"},{default:e.withCtx(()=>o[1]||(o[1]=[e.createTextVNode("Description")])),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>o[2]||(o[2]=[e.createTextVNode("Actions")])),_:1})]),body:e.withCtx(({item:s})=>[e.createVNode(i,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(r,{to:{name:"admin.group",params:{slug:s.slug}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.name),1)]),_:2},1032,["to"])])]),_:2},1024),e.createVNode(i,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.description),1)]),_:2},1024),e.createVNode(i,null,{default:e.withCtx(()=>[e.createElementVNode("button",S,[o[3]||(o[3]=e.createTextVNode(" Actions ")),e.createVNode(u,{icon:"caret-down","fixed-width":""})]),o[4]||(o[4]=e.createElementVNode("div",{"uk-dropdown":""},[e.createElementVNode("ul",{class:"uk-nav uk-dropdown-nav"},[e.createElementVNode("li",null,[e.createElementVNode("a",{href:"#"},"Edit Group")]),e.createElementVNode("li",null,[e.createElementVNode("a",{href:"#"},"Delete Group")])])],-1))]),_:1})]),_:1})]),_:1})],64)}}});exports.default=T; diff --git a/dist/GroupsView-BhG4LUoY.cjs b/dist/GroupsView-BhG4LUoY.cjs deleted file mode 100644 index 96f2b1c..0000000 --- a/dist/GroupsView-BhG4LUoY.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),c={},p={class:"uk-button uk-button-default"},m={class:"uk-button uk-button-default uk-button-small",type:"button"};function V(_,t){const a=e.resolveComponent("UFHeaderPage"),l=e.resolveComponent("font-awesome-icon"),o=e.resolveComponent("UFSprunjeHeader"),u=e.resolveComponent("RouterLink"),n=e.resolveComponent("UFSprunjeColumn"),d=e.resolveComponent("UFSprunjeTable"),s=e.resolveComponent("UFCardBox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(a,{title:"Groups",caption:"A listing of the groups for your site. Provides management tools for editing and deleting groups."}),e.createVNode(s,null,{default:e.withCtx(()=>[e.createVNode(d,{dataUrl:"/api/groups",searchColumn:"name"},{actions:e.withCtx(()=>[e.createElementVNode("button",p,[e.createVNode(l,{icon:"users"}),t[0]||(t[0]=e.createTextVNode(" Create Group "))])]),header:e.withCtx(()=>[e.createVNode(o,{sort:"name"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("Groups")])),_:1}),e.createVNode(o,{sort:"description"},{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Description")])),_:1}),e.createVNode(o,null,{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("Actions")])),_:1})]),body:e.withCtx(({item:r})=>[e.createVNode(n,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(u,{to:{name:"admin.group",params:{slug:r.slug}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.name),1)]),_:2},1032,["to"])])]),_:2},1024),e.createVNode(n,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.description),1)]),_:2},1024),e.createVNode(n,null,{default:e.withCtx(()=>[e.createElementVNode("button",m,[t[4]||(t[4]=e.createTextVNode(" Actions ")),e.createVNode(l,{icon:"caret-down","fixed-width":""})]),t[5]||(t[5]=e.createElementVNode("div",{"uk-dropdown":""},[e.createElementVNode("ul",{class:"uk-nav uk-dropdown-nav"},[e.createElementVNode("li",null,[e.createElementVNode("a",{href:"#"},"Edit Group")]),e.createElementVNode("li",null,[e.createElementVNode("a",{href:"#"},"Delete Group")])])],-1))]),_:1})]),_:1})]),_:1})],64)}const N=i._export_sfc(c,[["render",V]]);exports.default=N; diff --git a/dist/GroupsView-FYEMxd2t.js b/dist/GroupsView-FYEMxd2t.js deleted file mode 100644 index fb2d0c4..0000000 --- a/dist/GroupsView-FYEMxd2t.js +++ /dev/null @@ -1,104 +0,0 @@ -import { resolveComponent as r, openBlock as c, createElementBlock as g, Fragment as k, createVNode as t, withCtx as n, createElementVNode as e, createTextVNode as u, toDisplayString as i } from "vue"; -import { _ as b } from "./_plugin-vue_export-helper-CHgC5LLL.js"; -const F = {}, U = { class: "uk-button uk-button-default" }, w = { - class: "uk-button uk-button-default uk-button-small", - type: "button" -}; -function x(C, o) { - const p = r("UFHeaderPage"), d = r("font-awesome-icon"), l = r("UFSprunjeHeader"), m = r("RouterLink"), s = r("UFSprunjeColumn"), _ = r("UFSprunjeTable"), f = r("UFCardBox"); - return c(), g(k, null, [ - t(p, { - title: "Groups", - caption: "A listing of the groups for your site. Provides management tools for editing and deleting groups." - }), - t(f, null, { - default: n(() => [ - t(_, { - dataUrl: "/api/groups", - searchColumn: "name" - }, { - actions: n(() => [ - e("button", U, [ - t(d, { icon: "users" }), - o[0] || (o[0] = u(" Create Group ")) - ]) - ]), - header: n(() => [ - t(l, { sort: "name" }, { - default: n(() => o[1] || (o[1] = [ - u("Groups") - ])), - _: 1 - }), - t(l, { sort: "description" }, { - default: n(() => o[2] || (o[2] = [ - u("Description") - ])), - _: 1 - }), - t(l, null, { - default: n(() => o[3] || (o[3] = [ - u("Actions") - ])), - _: 1 - }) - ]), - body: n(({ item: a }) => [ - t(s, null, { - default: n(() => [ - e("strong", null, [ - t(m, { - to: { - name: "admin.group", - params: { slug: a.slug } - } - }, { - default: n(() => [ - u(i(a.name), 1) - ]), - _: 2 - }, 1032, ["to"]) - ]) - ]), - _: 2 - }, 1024), - t(s, null, { - default: n(() => [ - u(i(a.description), 1) - ]), - _: 2 - }, 1024), - t(s, null, { - default: n(() => [ - e("button", w, [ - o[4] || (o[4] = u(" Actions ")), - t(d, { - icon: "caret-down", - "fixed-width": "" - }) - ]), - o[5] || (o[5] = e("div", { "uk-dropdown": "" }, [ - e("ul", { class: "uk-nav uk-dropdown-nav" }, [ - e("li", null, [ - e("a", { href: "#" }, "Edit Group") - ]), - e("li", null, [ - e("a", { href: "#" }, "Delete Group") - ]) - ]) - ], -1)) - ]), - _: 1 - }) - ]), - _: 1 - }) - ]), - _: 1 - }) - ], 64); -} -const G = /* @__PURE__ */ b(F, [["render", x]]); -export { - G as default -}; diff --git a/dist/PermissionView-CwSmb9ry.js b/dist/PermissionView-CwSmb9ry.js new file mode 100644 index 0000000..633a205 --- /dev/null +++ b/dist/PermissionView-CwSmb9ry.js @@ -0,0 +1,154 @@ +import { defineComponent as C, resolveComponent as t, openBlock as a, createBlock as _, withCtx as o, createElementVNode as e, createVNode as s, toDisplayString as i, renderSlot as S, createTextVNode as m, createElementBlock as g, Fragment as x, renderList as v, unref as k } from "vue"; +import { useRoute as w } from "vue-router"; +import { usePermissionApi as B } from "./composable/permission.js"; +const P = { class: "uk-text-center" }, $ = { class: "uk-text-center uk-margin-remove" }, y = { class: "uk-text-meta" }, j = { class: "uk-description-list" }, b = { style: { "text-wrap": "wrap" } }, H = /* @__PURE__ */ C({ + __name: "PermissionInfo", + props: { + permission: {} + }, + setup(h) { + return (r, n) => { + const l = t("font-awesome-icon"), u = t("UFCardBox"); + return a(), _(u, null, { + default: o(() => [ + e("div", P, [ + s(l, { + icon: "key", + class: "fa-5x" + }) + ]), + e("h3", $, i(r.permission.name), 1), + e("p", y, i(r.permission.description), 1), + n[2] || (n[2] = e("hr", null, null, -1)), + e("dl", j, [ + n[0] || (n[0] = e("dt", null, "Slug", -1)), + e("dd", null, [ + e("pre", null, [ + e("code", null, i(r.permission.slug), 1) + ]) + ]), + n[1] || (n[1] = e("dt", null, "Conditions", -1)), + e("dd", null, [ + e("pre", b, [ + e("code", null, i(r.permission.conditions), 1) + ]) + ]) + ]), + S(r.$slots, "default", { dataTest: "slot" }) + ]), + _: 3 + }); + }; + } +}), L = { class: "uk-text-meta" }, T = /* @__PURE__ */ C({ + __name: "PermissionUsers", + props: { + id: {} + }, + setup(h) { + return (r, n) => { + const l = t("UFSprunjeHeader"), u = t("RouterLink"), p = t("UFSprunjeColumn"), c = t("UFLabel"), f = t("UFSprunjeTable"), U = t("UFCardBox"); + return a(), _(U, { title: "Users with this permission" }, { + default: o(() => [ + s(f, { + dataUrl: "/api/permissions/p/" + r.id + "/users", + searchColumn: "name", + hideFilters: "" + }, { + header: o(() => [ + s(l, { sort: "name" }, { + default: o(() => n[0] || (n[0] = [ + m("User") + ])), + _: 1 + }), + s(l, null, { + default: o(() => n[1] || (n[1] = [ + m("Has permission via roles") + ])), + _: 1 + }) + ]), + body: o(({ item: d }) => [ + s(p, null, { + default: o(() => [ + e("strong", null, [ + s(u, { + to: { + name: "admin.user", + params: { user_name: d.user_name } + } + }, { + default: o(() => [ + m(i(d.full_name) + " (" + i(d.user_name) + ") ", 1) + ]), + _: 2 + }, 1032, ["to"]) + ]), + e("div", L, i(d.email), 1) + ]), + _: 2 + }, 1024), + s(p, null, { + default: o(() => [ + (a(!0), g(x, null, v(d.roles_via, (F) => (a(), _(u, { + key: F.id, + to: { name: "admin.role", params: { slug: F.slug } } + }, { + default: o(() => [ + s(c, null, { + default: o(() => [ + m(i(F.name), 1) + ]), + _: 2 + }, 1024) + ]), + _: 2 + }, 1032, ["to"]))), 128)) + ]), + _: 2 + }, 1024) + ]), + _: 1 + }, 8, ["dataUrl"]) + ]), + _: 1 + }); + }; + } +}), V = { + key: 1, + "uk-grid": "" +}, A = { class: "uk-width-1-3" }, N = { class: "uk-width-2-3" }, I = /* @__PURE__ */ C({ + __name: "PermissionView", + setup(h) { + const r = w(), { permission: n, error: l } = B(r); + return (u, p) => { + const c = t("UFHeaderPage"), f = t("UFAlert"), U = t("UFCardBox"); + return a(), g(x, null, [ + s(c, { + title: "Permission details", + caption: "Permission information page" + }), + k(l) ? (a(), _(U, { key: 0 }, { + default: o(() => [ + s(f, { alert: k(l) }, null, 8, ["alert"]) + ]), + _: 1 + })) : (a(), g("div", V, [ + e("div", A, [ + s(H, { permission: k(n) }, null, 8, ["permission"]) + ]), + e("div", N, [ + s(T, { + id: u.$route.params.id.toString() + }, null, 8, ["id"]) + ]) + ])) + ], 64); + }; + } +}); +export { + I as default +}; diff --git a/dist/PermissionView-D7AlKrvO.cjs b/dist/PermissionView-D7AlKrvO.cjs new file mode 100644 index 0000000..9a8fba0 --- /dev/null +++ b/dist/PermissionView-D7AlKrvO.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("vue-router"),p=require("./composable/permission.cjs"),_={class:"uk-text-center"},C={class:"uk-text-center uk-margin-remove"},V={class:"uk-text-meta"},N={class:"uk-description-list"},k={style:{"text-wrap":"wrap"}},f=e.defineComponent({__name:"PermissionInfo",props:{permission:{}},setup(m){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",_,[e.createVNode(n,{icon:"key",class:"fa-5x"})]),e.createElementVNode("h3",C,e.toDisplayString(o.permission.name),1),e.createElementVNode("p",V,e.toDisplayString(o.permission.description),1),t[2]||(t[2]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("dl",N,[t[0]||(t[0]=e.createElementVNode("dt",null,"Slug",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.permission.slug),1)])]),t[1]||(t[1]=e.createElementVNode("dt",null,"Conditions",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",k,[e.createElementVNode("code",null,e.toDisplayString(o.permission.conditions),1)])])]),e.renderSlot(o.$slots,"default",{dataTest:"slot"})]),_:3})}}}),x={class:"uk-text-meta"},g=e.defineComponent({__name:"PermissionUsers",props:{id:{}},setup(m){return(o,t)=>{const n=e.resolveComponent("UFSprunjeHeader"),r=e.resolveComponent("RouterLink"),l=e.resolveComponent("UFSprunjeColumn"),a=e.resolveComponent("UFLabel"),i=e.resolveComponent("UFSprunjeTable"),d=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(d,{title:"Users with this permission"},{default:e.withCtx(()=>[e.createVNode(i,{dataUrl:"/api/permissions/p/"+o.id+"/users",searchColumn:"name",hideFilters:""},{header:e.withCtx(()=>[e.createVNode(n,{sort:"name"},{default:e.withCtx(()=>t[0]||(t[0]=[e.createTextVNode("User")])),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("Has permission via roles")])),_:1})]),body:e.withCtx(({item:s})=>[e.createVNode(l,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(r,{to:{name:"admin.user",params:{user_name:s.user_name}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.full_name)+" ("+e.toDisplayString(s.user_name)+") ",1)]),_:2},1032,["to"])]),e.createElementVNode("div",x,e.toDisplayString(s.email),1)]),_:2},1024),e.createVNode(l,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.roles_via,c=>(e.openBlock(),e.createBlock(r,{key:c.id,to:{name:"admin.role",params:{slug:c.slug}}},{default:e.withCtx(()=>[e.createVNode(a,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.name),1)]),_:2},1024)]),_:2},1032,["to"]))),128))]),_:2},1024)]),_:1},8,["dataUrl"])]),_:1})}}}),h={key:1,"uk-grid":""},U={class:"uk-width-1-3"},v={class:"uk-width-2-3"},F=e.defineComponent({__name:"PermissionView",setup(m){const o=u.useRoute(),{permission:t,error:n}=p.usePermissionApi(o);return(r,l)=>{const a=e.resolveComponent("UFHeaderPage"),i=e.resolveComponent("UFAlert"),d=e.resolveComponent("UFCardBox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(a,{title:"Permission details",caption:"Permission information page"}),e.unref(n)?(e.openBlock(),e.createBlock(d,{key:0},{default:e.withCtx(()=>[e.createVNode(i,{alert:e.unref(n)},null,8,["alert"])]),_:1})):(e.openBlock(),e.createElementBlock("div",h,[e.createElementVNode("div",U,[e.createVNode(f,{permission:e.unref(t)},null,8,["permission"])]),e.createElementVNode("div",v,[e.createVNode(g,{id:r.$route.params.id.toString()},null,8,["id"])])]))],64)}}});exports.default=F; diff --git a/dist/PermissionView-DA4jSH36.cjs b/dist/PermissionView-DA4jSH36.cjs deleted file mode 100644 index d87bab8..0000000 --- a/dist/PermissionView-DA4jSH36.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),m=require("vue-router"),p=require("./axios-tuVKNgv9.cjs"),_=require("./types-D9XxK5BT.cjs");function f(a){const o=e.ref(!1),t=e.ref(),n=e.ref({id:0,slug:"",name:"",conditions:"",description:"",created_at:"",updated_at:"",deleted_at:null});async function r(){o.value=!0,t.value=null,await p.axios.get("/api/permissions/p/"+a.params.id).then(s=>{n.value=s.data}).catch(s=>{t.value={description:"An error as occurred",style:_.a.Danger,...s.response.data}}).finally(()=>{o.value=!1})}return e.watch(()=>a.params.id,()=>{r()},{immediate:!0}),{permission:n,error:t,loading:o}}const C={class:"uk-text-center"},V={class:"uk-text-center uk-margin-remove"},N={class:"uk-text-meta"},k={class:"uk-description-list"},g={style:{"text-wrap":"wrap"}},h=e.defineComponent({__name:"PermissionInfo",props:{permission:{}},setup(a){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",C,[e.createVNode(n,{icon:"key",class:"fa-5x"})]),e.createElementVNode("h3",V,e.toDisplayString(o.permission.name),1),e.createElementVNode("p",N,e.toDisplayString(o.permission.description),1),t[2]||(t[2]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("dl",k,[t[0]||(t[0]=e.createElementVNode("dt",null,"Slug",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",null,[e.createElementVNode("code",null,e.toDisplayString(o.permission.slug),1)])]),t[1]||(t[1]=e.createElementVNode("dt",null,"Conditions",-1)),e.createElementVNode("dd",null,[e.createElementVNode("pre",g,[e.createElementVNode("code",null,e.toDisplayString(o.permission.conditions),1)])])]),e.renderSlot(o.$slots,"default",{dataTest:"slot"})]),_:3})}}}),v={class:"uk-text-meta"},x=e.defineComponent({__name:"PermissionUsers",props:{id:{}},setup(a){return(o,t)=>{const n=e.resolveComponent("UFSprunjeHeader"),r=e.resolveComponent("RouterLink"),s=e.resolveComponent("UFSprunjeColumn"),i=e.resolveComponent("UFLabel"),d=e.resolveComponent("UFSprunjeTable"),c=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(c,{title:"Users with this permission"},{default:e.withCtx(()=>[e.createVNode(d,{dataUrl:"/api/permissions/p/"+o.id+"/users",searchColumn:"name",hideFilters:""},{header:e.withCtx(()=>[e.createVNode(n,{sort:"name"},{default:e.withCtx(()=>t[0]||(t[0]=[e.createTextVNode("User")])),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("Has permission via roles")])),_:1})]),body:e.withCtx(({item:l})=>[e.createVNode(s,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(r,{to:{name:"admin.user",params:{user_name:l.user_name}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.full_name)+" ("+e.toDisplayString(l.user_name)+") ",1)]),_:2},1032,["to"])]),e.createElementVNode("div",v,e.toDisplayString(l.email),1)]),_:2},1024),e.createVNode(s,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.roles_via,u=>(e.openBlock(),e.createBlock(r,{key:u.id,to:{name:"admin.role",params:{slug:u.slug}}},{default:e.withCtx(()=>[e.createVNode(i,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.name),1)]),_:2},1024)]),_:2},1032,["to"]))),128))]),_:2},1024)]),_:1},8,["dataUrl"])]),_:1})}}}),U={key:1,"uk-grid":""},w={class:"uk-width-1-3"},F={class:"uk-width-2-3"},y=e.defineComponent({__name:"PermissionView",setup(a){const o=m.useRoute(),{permission:t,error:n}=f(o);return(r,s)=>{const i=e.resolveComponent("UFHeaderPage"),d=e.resolveComponent("UFAlert"),c=e.resolveComponent("UFCardBox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(i,{title:"Permission details",caption:"Permission information page"}),e.unref(n)?(e.openBlock(),e.createBlock(c,{key:0},{default:e.withCtx(()=>[e.createVNode(d,{alert:e.unref(n)},null,8,["alert"])]),_:1})):(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",w,[e.createVNode(h,{permission:e.unref(t)},null,8,["permission"])]),e.createElementVNode("div",F,[e.createVNode(x,{id:r.$route.params.id.toString()},null,8,["id"])])]))],64)}}});exports.default=y; diff --git a/dist/PermissionView-DhQK9SjC.js b/dist/PermissionView-DhQK9SjC.js deleted file mode 100644 index a79abf4..0000000 --- a/dist/PermissionView-DhQK9SjC.js +++ /dev/null @@ -1,187 +0,0 @@ -import { ref as g, watch as w, defineComponent as C, resolveComponent as r, openBlock as d, createBlock as c, withCtx as o, createElementVNode as n, createVNode as s, toDisplayString as l, renderSlot as y, createTextVNode as _, createElementBlock as v, Fragment as x, renderList as S, unref as h } from "vue"; -import { useRoute as B } from "vue-router"; -import { a as P } from "./axios-CXDYiOMX.js"; -import { a as $ } from "./types-Daou0lcF.js"; -function j(m) { - const t = g(!1), e = g(), a = g({ - id: 0, - slug: "", - name: "", - conditions: "", - description: "", - created_at: "", - updated_at: "", - deleted_at: null - }); - async function i() { - t.value = !0, e.value = null, await P.get("/api/permissions/p/" + m.params.id).then((u) => { - a.value = u.data; - }).catch((u) => { - e.value = { - description: "An error as occurred", - style: $.Danger, - ...u.response.data - }; - }).finally(() => { - t.value = !1; - }); - } - return w( - () => m.params.id, - () => { - i(); - }, - { immediate: !0 } - ), { permission: a, error: e, loading: t }; -} -const b = { class: "uk-text-center" }, A = { class: "uk-text-center uk-margin-remove" }, H = { class: "uk-text-meta" }, L = { class: "uk-description-list" }, T = { style: { "text-wrap": "wrap" } }, V = /* @__PURE__ */ C({ - __name: "PermissionInfo", - props: { - permission: {} - }, - setup(m) { - return (t, e) => { - const a = r("font-awesome-icon"), i = r("UFCardBox"); - return d(), c(i, null, { - default: o(() => [ - n("div", b, [ - s(a, { - icon: "key", - class: "fa-5x" - }) - ]), - n("h3", A, l(t.permission.name), 1), - n("p", H, l(t.permission.description), 1), - e[2] || (e[2] = n("hr", null, null, -1)), - n("dl", L, [ - e[0] || (e[0] = n("dt", null, "Slug", -1)), - n("dd", null, [ - n("pre", null, [ - n("code", null, l(t.permission.slug), 1) - ]) - ]), - e[1] || (e[1] = n("dt", null, "Conditions", -1)), - n("dd", null, [ - n("pre", T, [ - n("code", null, l(t.permission.conditions), 1) - ]) - ]) - ]), - y(t.$slots, "default", { dataTest: "slot" }) - ]), - _: 3 - }); - }; - } -}), N = { class: "uk-text-meta" }, R = /* @__PURE__ */ C({ - __name: "PermissionUsers", - props: { - id: {} - }, - setup(m) { - return (t, e) => { - const a = r("UFSprunjeHeader"), i = r("RouterLink"), u = r("UFSprunjeColumn"), f = r("UFLabel"), U = r("UFSprunjeTable"), F = r("UFCardBox"); - return d(), c(F, { title: "Users with this permission" }, { - default: o(() => [ - s(U, { - dataUrl: "/api/permissions/p/" + t.id + "/users", - searchColumn: "name", - hideFilters: "" - }, { - header: o(() => [ - s(a, { sort: "name" }, { - default: o(() => e[0] || (e[0] = [ - _("User") - ])), - _: 1 - }), - s(a, null, { - default: o(() => e[1] || (e[1] = [ - _("Has permission via roles") - ])), - _: 1 - }) - ]), - body: o(({ item: p }) => [ - s(u, null, { - default: o(() => [ - n("strong", null, [ - s(i, { - to: { - name: "admin.user", - params: { user_name: p.user_name } - } - }, { - default: o(() => [ - _(l(p.full_name) + " (" + l(p.user_name) + ") ", 1) - ]), - _: 2 - }, 1032, ["to"]) - ]), - n("div", N, l(p.email), 1) - ]), - _: 2 - }, 1024), - s(u, null, { - default: o(() => [ - (d(!0), v(x, null, S(p.roles_via, (k) => (d(), c(i, { - key: k.id, - to: { name: "admin.role", params: { slug: k.slug } } - }, { - default: o(() => [ - s(f, null, { - default: o(() => [ - _(l(k.name), 1) - ]), - _: 2 - }, 1024) - ]), - _: 2 - }, 1032, ["to"]))), 128)) - ]), - _: 2 - }, 1024) - ]), - _: 1 - }, 8, ["dataUrl"]) - ]), - _: 1 - }); - }; - } -}), D = { - key: 1, - "uk-grid": "" -}, E = { class: "uk-width-1-3" }, I = { class: "uk-width-2-3" }, K = /* @__PURE__ */ C({ - __name: "PermissionView", - setup(m) { - const t = B(), { permission: e, error: a } = j(t); - return (i, u) => { - const f = r("UFHeaderPage"), U = r("UFAlert"), F = r("UFCardBox"); - return d(), v(x, null, [ - s(f, { - title: "Permission details", - caption: "Permission information page" - }), - h(a) ? (d(), c(F, { key: 0 }, { - default: o(() => [ - s(U, { alert: h(a) }, null, 8, ["alert"]) - ]), - _: 1 - })) : (d(), v("div", D, [ - n("div", E, [ - s(V, { permission: h(e) }, null, 8, ["permission"]) - ]), - n("div", I, [ - s(R, { - id: i.$route.params.id.toString() - }, null, 8, ["id"]) - ]) - ])) - ], 64); - }; - } -}); -export { - K as default -}; diff --git a/dist/RoleView-CuY3whsc.js b/dist/RoleView-CuY3whsc.js new file mode 100644 index 0000000..0a3c1bf --- /dev/null +++ b/dist/RoleView-CuY3whsc.js @@ -0,0 +1,237 @@ +import { defineComponent as U, resolveComponent as s, openBlock as m, createBlock as b, withCtx as e, createElementVNode as n, createVNode as t, toDisplayString as _, createTextVNode as r, renderSlot as R, createElementBlock as g, Fragment as C, unref as f } from "vue"; +import { useRoute as S } from "vue-router"; +import { useRoleApi as $ } from "./composable/role.js"; +const w = { class: "uk-text-center" }, x = { class: "uk-text-center uk-margin-remove" }, j = { class: "uk-text-meta" }, h = { class: "uk-description-list" }, B = { class: "uk-badge" }, v = /* @__PURE__ */ U({ + __name: "RoleInfo", + props: { + role: {} + }, + setup(F) { + return (u, o) => { + const l = s("font-awesome-icon"), a = s("UFCardBox"); + return m(), b(a, null, { + default: e(() => [ + n("div", w, [ + t(l, { + icon: "address-card", + class: "fa-5x" + }) + ]), + n("h3", x, _(u.role.name), 1), + n("p", j, _(u.role.description), 1), + o[1] || (o[1] = n("hr", null, null, -1)), + n("dl", h, [ + n("dt", null, [ + t(l, { icon: "users" }), + o[0] || (o[0] = r(" Users")) + ]), + n("dd", null, [ + n("span", B, _(u.role.users_count), 1) + ]) + ]), + o[2] || (o[2] = n("hr", null, null, -1)), + o[3] || (o[3] = n("button", { class: "uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Edit Role ", -1)), + o[4] || (o[4] = n("button", { class: "uk-button uk-button-danger uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Delete Role ", -1)), + R(u.$slots, "default", { dataTest: "slot" }) + ]), + _: 3 + }); + }; + } +}), y = { class: "uk-button uk-button-default" }, A = { class: "uk-text-meta" }, H = { class: "uk-button uk-button-danger uk-button-small" }, T = /* @__PURE__ */ U({ + __name: "RoleUsers", + props: { + slug: {} + }, + setup(F) { + return (u, o) => { + const l = s("font-awesome-icon"), a = s("UFSprunjeHeader"), k = s("RouterLink"), d = s("UFSprunjeColumn"), p = s("UFSprunjeTable"), c = s("UFCardBox"); + return m(), b(c, { title: "Role Users" }, { + default: e(() => [ + t(p, { + dataUrl: "/api/roles/r/" + u.slug + "/users", + searchColumn: "name", + hideFilters: "" + }, { + actions: e(() => [ + n("button", y, [ + t(l, { icon: "user-plus" }), + o[0] || (o[0] = r(" Add user ")) + ]) + ]), + header: e(() => [ + t(a, { sort: "name" }, { + default: e(() => o[1] || (o[1] = [ + r("User") + ])), + _: 1 + }), + t(a, null, { + default: e(() => o[2] || (o[2] = [ + r("Actions") + ])), + _: 1 + }) + ]), + body: e(({ item: i }) => [ + t(d, null, { + default: e(() => [ + n("strong", null, [ + t(k, { + to: { + name: "admin.user", + params: { user_name: i.user_name } + } + }, { + default: e(() => [ + r(_(i.full_name) + " (" + _(i.user_name) + ") ", 1) + ]), + _: 2 + }, 1032, ["to"]) + ]), + n("div", A, _(i.email), 1) + ]), + _: 2 + }, 1024), + t(d, null, { + default: e(() => [ + n("button", H, [ + t(l, { icon: "trash" }) + ]) + ]), + _: 1 + }) + ]), + _: 1 + }, 8, ["dataUrl"]) + ]), + _: 1 + }); + }; + } +}), P = { class: "uk-button uk-button-default" }, L = { class: "uk-button uk-button-danger uk-button-small" }, V = /* @__PURE__ */ U({ + __name: "RolePermissions", + props: { + role: {} + }, + setup(F) { + return (u, o) => { + const l = s("font-awesome-icon"), a = s("UFSprunjeHeader"), k = s("RouterLink"), d = s("UFSprunjeColumn"), p = s("UFSprunjeTable"), c = s("UFCardBox"); + return m(), b(c, { title: "Permissions" }, { + default: e(() => [ + t(p, { + dataUrl: "/api/roles/r/" + u.role + "/permissions", + searchColumn: "name" + }, { + actions: e(() => [ + n("button", P, [ + t(l, { icon: "key" }), + o[0] || (o[0] = r(" Add permission ")) + ]) + ]), + header: e(() => [ + t(a, { sort: "name" }, { + default: e(() => o[1] || (o[1] = [ + r("Permission") + ])), + _: 1 + }), + t(a, { sort: "properties" }, { + default: e(() => o[2] || (o[2] = [ + r("Description") + ])), + _: 1 + }), + t(a, null, { + default: e(() => o[3] || (o[3] = [ + r("Actions") + ])), + _: 1 + }) + ]), + body: e(({ item: i }) => [ + t(d, null, { + default: e(() => [ + n("strong", null, [ + t(k, { + to: { + name: "admin.permission", + params: { id: i.id } + } + }, { + default: e(() => [ + r(_(i.name), 1) + ]), + _: 2 + }, 1032, ["to"]) + ]) + ]), + _: 2 + }, 1024), + t(d, null, { + default: e(() => [ + r(_(i.description), 1) + ]), + _: 2 + }, 1024), + t(d, null, { + default: e(() => [ + n("button", L, [ + t(l, { icon: "trash" }) + ]) + ]), + _: 1 + }) + ]), + _: 1 + }, 8, ["dataUrl"]) + ]), + _: 1 + }); + }; + } +}), D = { "uk-grid": "" }, E = { class: "uk-width-1-3" }, N = { class: "uk-width-2-3" }, I = { + class: "uk-child-width-1-1", + "uk-grid": "" +}, J = /* @__PURE__ */ U({ + __name: "RoleView", + setup(F) { + const u = S(), { role: o, error: l } = $(u); + return (a, k) => { + const d = s("UFHeaderPage"), p = s("UFAlert"), c = s("UFCardBox"); + return m(), g(C, null, [ + t(d, { + title: "Role details", + caption: "Role information page" + }), + f(l) ? (m(), b(c, { key: 0 }, { + default: e(() => [ + t(p, { alert: f(l) }, null, 8, ["alert"]) + ]), + _: 1 + })) : (m(), g(C, { key: 1 }, [ + n("div", D, [ + n("div", E, [ + t(v, { role: f(o) }, null, 8, ["role"]) + ]), + n("div", N, [ + t(T, { + slug: f(o).slug + }, null, 8, ["slug"]) + ]) + ]), + n("div", I, [ + n("div", null, [ + t(V, { + role: a.$route.params.slug.toString() + }, null, 8, ["role"]) + ]) + ]) + ], 64)) + ], 64); + }; + } +}); +export { + J as default +}; diff --git a/dist/RoleView-D81Ok2n6.cjs b/dist/RoleView-D81Ok2n6.cjs new file mode 100644 index 0000000..4a0e4dc --- /dev/null +++ b/dist/RoleView-D81Ok2n6.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("vue-router"),m=require("./composable/role.cjs"),p={class:"uk-text-center"},_={class:"uk-text-center uk-margin-remove"},V={class:"uk-text-meta"},N={class:"uk-description-list"},C={class:"uk-badge"},k=e.defineComponent({__name:"RoleInfo",props:{role:{}},setup(c){return(n,t)=>{const o=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",p,[e.createVNode(o,{icon:"address-card",class:"fa-5x"})]),e.createElementVNode("h3",_,e.toDisplayString(n.role.name),1),e.createElementVNode("p",V,e.toDisplayString(n.role.description),1),t[1]||(t[1]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("dl",N,[e.createElementVNode("dt",null,[e.createVNode(o,{icon:"users"}),t[0]||(t[0]=e.createTextVNode(" Users"))]),e.createElementVNode("dd",null,[e.createElementVNode("span",C,e.toDisplayString(n.role.users_count),1)])]),t[2]||(t[2]=e.createElementVNode("hr",null,null,-1)),t[3]||(t[3]=e.createElementVNode("button",{class:"uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Edit Role ",-1)),t[4]||(t[4]=e.createElementVNode("button",{class:"uk-button uk-button-danger uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Delete Role ",-1)),e.renderSlot(n.$slots,"default",{dataTest:"slot"})]),_:3})}}}),f={class:"uk-button uk-button-default"},x={class:"uk-text-meta"},b={class:"uk-button uk-button-danger uk-button-small"},w=e.defineComponent({__name:"RoleUsers",props:{slug:{}},setup(c){return(n,t)=>{const o=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFSprunjeHeader"),d=e.resolveComponent("RouterLink"),l=e.resolveComponent("UFSprunjeColumn"),a=e.resolveComponent("UFSprunjeTable"),u=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(u,{title:"Role Users"},{default:e.withCtx(()=>[e.createVNode(a,{dataUrl:"/api/roles/r/"+n.slug+"/users",searchColumn:"name",hideFilters:""},{actions:e.withCtx(()=>[e.createElementVNode("button",f,[e.createVNode(o,{icon:"user-plus"}),t[0]||(t[0]=e.createTextVNode(" Add user "))])]),header:e.withCtx(()=>[e.createVNode(r,{sort:"name"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("User")])),_:1}),e.createVNode(r,null,{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Actions")])),_:1})]),body:e.withCtx(({item:s})=>[e.createVNode(l,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(d,{to:{name:"admin.user",params:{user_name:s.user_name}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.full_name)+" ("+e.toDisplayString(s.user_name)+") ",1)]),_:2},1032,["to"])]),e.createElementVNode("div",x,e.toDisplayString(s.email),1)]),_:2},1024),e.createVNode(l,null,{default:e.withCtx(()=>[e.createElementVNode("button",b,[e.createVNode(o,{icon:"trash"})])]),_:1})]),_:1},8,["dataUrl"])]),_:1})}}}),g={class:"uk-button uk-button-default"},h={class:"uk-button uk-button-danger uk-button-small"},U=e.defineComponent({__name:"RolePermissions",props:{role:{}},setup(c){return(n,t)=>{const o=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFSprunjeHeader"),d=e.resolveComponent("RouterLink"),l=e.resolveComponent("UFSprunjeColumn"),a=e.resolveComponent("UFSprunjeTable"),u=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(u,{title:"Permissions"},{default:e.withCtx(()=>[e.createVNode(a,{dataUrl:"/api/roles/r/"+n.role+"/permissions",searchColumn:"name"},{actions:e.withCtx(()=>[e.createElementVNode("button",g,[e.createVNode(o,{icon:"key"}),t[0]||(t[0]=e.createTextVNode(" Add permission "))])]),header:e.withCtx(()=>[e.createVNode(r,{sort:"name"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("Permission")])),_:1}),e.createVNode(r,{sort:"properties"},{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Description")])),_:1}),e.createVNode(r,null,{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("Actions")])),_:1})]),body:e.withCtx(({item:s})=>[e.createVNode(l,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(d,{to:{name:"admin.permission",params:{id:s.id}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.name),1)]),_:2},1032,["to"])])]),_:2},1024),e.createVNode(l,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.description),1)]),_:2},1024),e.createVNode(l,null,{default:e.withCtx(()=>[e.createElementVNode("button",h,[e.createVNode(o,{icon:"trash"})])]),_:1})]),_:1},8,["dataUrl"])]),_:1})}}}),v={"uk-grid":""},F={class:"uk-width-1-3"},E={class:"uk-width-2-3"},S={class:"uk-child-width-1-1","uk-grid":""},B=e.defineComponent({__name:"RoleView",setup(c){const n=i.useRoute(),{role:t,error:o}=m.useRoleApi(n);return(r,d)=>{const l=e.resolveComponent("UFHeaderPage"),a=e.resolveComponent("UFAlert"),u=e.resolveComponent("UFCardBox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(l,{title:"Role details",caption:"Role information page"}),e.unref(o)?(e.openBlock(),e.createBlock(u,{key:0},{default:e.withCtx(()=>[e.createVNode(a,{alert:e.unref(o)},null,8,["alert"])]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",v,[e.createElementVNode("div",F,[e.createVNode(k,{role:e.unref(t)},null,8,["role"])]),e.createElementVNode("div",E,[e.createVNode(w,{slug:e.unref(t).slug},null,8,["slug"])])]),e.createElementVNode("div",S,[e.createElementVNode("div",null,[e.createVNode(U,{role:r.$route.params.slug.toString()},null,8,["role"])])])],64))],64)}}});exports.default=B; diff --git a/dist/RoleView-DVIlQDeW.js b/dist/RoleView-DVIlQDeW.js deleted file mode 100644 index d4bb69d..0000000 --- a/dist/RoleView-DVIlQDeW.js +++ /dev/null @@ -1,270 +0,0 @@ -import { ref as F, watch as w, defineComponent as b, resolveComponent as s, openBlock as c, createBlock as g, withCtx as n, createElementVNode as o, createVNode as e, toDisplayString as m, createTextVNode as a, renderSlot as R, createElementBlock as C, Fragment as h, unref as U } from "vue"; -import { useRoute as S } from "vue-router"; -import { a as v } from "./axios-CXDYiOMX.js"; -import { a as x } from "./types-Daou0lcF.js"; -function $(p) { - const l = F(!1), t = F(), r = F({ - id: 0, - slug: "", - name: "", - description: "", - created_at: "", - updated_at: "", - deleted_at: null, - users_count: 0 - }); - async function u() { - l.value = !0, t.value = null, await v.get("/api/roles/r/" + p.params.slug).then((i) => { - r.value = i.data; - }).catch((i) => { - t.value = { - description: "An error as occurred", - style: x.Danger, - ...i.response.data - }; - }).finally(() => { - l.value = !1; - }); - } - return w( - () => p.params.slug, - () => { - u(); - }, - { immediate: !0 } - ), { role: r, error: t, loading: l }; -} -const j = { class: "uk-text-center" }, B = { class: "uk-text-center uk-margin-remove" }, y = { class: "uk-text-meta" }, A = { class: "uk-description-list" }, H = { class: "uk-badge" }, T = /* @__PURE__ */ b({ - __name: "RoleInfo", - props: { - role: {} - }, - setup(p) { - return (l, t) => { - const r = s("font-awesome-icon"), u = s("UFCardBox"); - return c(), g(u, null, { - default: n(() => [ - o("div", j, [ - e(r, { - icon: "address-card", - class: "fa-5x" - }) - ]), - o("h3", B, m(l.role.name), 1), - o("p", y, m(l.role.description), 1), - t[1] || (t[1] = o("hr", null, null, -1)), - o("dl", A, [ - o("dt", null, [ - e(r, { icon: "users" }), - t[0] || (t[0] = a(" Users")) - ]), - o("dd", null, [ - o("span", H, m(l.role.users_count), 1) - ]) - ]), - t[2] || (t[2] = o("hr", null, null, -1)), - t[3] || (t[3] = o("button", { class: "uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Edit Role ", -1)), - t[4] || (t[4] = o("button", { class: "uk-button uk-button-danger uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Delete Role ", -1)), - R(l.$slots, "default", { dataTest: "slot" }) - ]), - _: 3 - }); - }; - } -}), P = { class: "uk-button uk-button-default" }, D = { class: "uk-text-meta" }, L = { class: "uk-button uk-button-danger uk-button-small" }, V = /* @__PURE__ */ b({ - __name: "RoleUsers", - props: { - slug: {} - }, - setup(p) { - return (l, t) => { - const r = s("font-awesome-icon"), u = s("UFSprunjeHeader"), i = s("RouterLink"), d = s("UFSprunjeColumn"), f = s("UFSprunjeTable"), k = s("UFCardBox"); - return c(), g(k, { title: "Role Users" }, { - default: n(() => [ - e(f, { - dataUrl: "/api/roles/r/" + l.slug + "/users", - searchColumn: "name", - hideFilters: "" - }, { - actions: n(() => [ - o("button", P, [ - e(r, { icon: "user-plus" }), - t[0] || (t[0] = a(" Add user ")) - ]) - ]), - header: n(() => [ - e(u, { sort: "name" }, { - default: n(() => t[1] || (t[1] = [ - a("User") - ])), - _: 1 - }), - e(u, null, { - default: n(() => t[2] || (t[2] = [ - a("Actions") - ])), - _: 1 - }) - ]), - body: n(({ item: _ }) => [ - e(d, null, { - default: n(() => [ - o("strong", null, [ - e(i, { - to: { - name: "admin.user", - params: { user_name: _.user_name } - } - }, { - default: n(() => [ - a(m(_.full_name) + " (" + m(_.user_name) + ") ", 1) - ]), - _: 2 - }, 1032, ["to"]) - ]), - o("div", D, m(_.email), 1) - ]), - _: 2 - }, 1024), - e(d, null, { - default: n(() => [ - o("button", L, [ - e(r, { icon: "trash" }) - ]) - ]), - _: 1 - }) - ]), - _: 1 - }, 8, ["dataUrl"]) - ]), - _: 1 - }); - }; - } -}), E = { class: "uk-button uk-button-default" }, N = { class: "uk-button uk-button-danger uk-button-small" }, I = /* @__PURE__ */ b({ - __name: "RolePermissions", - props: { - role: {} - }, - setup(p) { - return (l, t) => { - const r = s("font-awesome-icon"), u = s("UFSprunjeHeader"), i = s("RouterLink"), d = s("UFSprunjeColumn"), f = s("UFSprunjeTable"), k = s("UFCardBox"); - return c(), g(k, { title: "Permissions" }, { - default: n(() => [ - e(f, { - dataUrl: "/api/roles/r/" + l.role + "/permissions", - searchColumn: "name" - }, { - actions: n(() => [ - o("button", E, [ - e(r, { icon: "key" }), - t[0] || (t[0] = a(" Add permission ")) - ]) - ]), - header: n(() => [ - e(u, { sort: "name" }, { - default: n(() => t[1] || (t[1] = [ - a("Permission") - ])), - _: 1 - }), - e(u, { sort: "properties" }, { - default: n(() => t[2] || (t[2] = [ - a("Description") - ])), - _: 1 - }), - e(u, null, { - default: n(() => t[3] || (t[3] = [ - a("Actions") - ])), - _: 1 - }) - ]), - body: n(({ item: _ }) => [ - e(d, null, { - default: n(() => [ - o("strong", null, [ - e(i, { - to: { - name: "admin.permission", - params: { id: _.id } - } - }, { - default: n(() => [ - a(m(_.name), 1) - ]), - _: 2 - }, 1032, ["to"]) - ]) - ]), - _: 2 - }, 1024), - e(d, null, { - default: n(() => [ - a(m(_.description), 1) - ]), - _: 2 - }, 1024), - e(d, null, { - default: n(() => [ - o("button", N, [ - e(r, { icon: "trash" }) - ]) - ]), - _: 1 - }) - ]), - _: 1 - }, 8, ["dataUrl"]) - ]), - _: 1 - }); - }; - } -}), q = { "uk-grid": "" }, z = { class: "uk-width-1-3" }, G = { class: "uk-width-2-3" }, J = { - class: "uk-child-width-1-1", - "uk-grid": "" -}, W = /* @__PURE__ */ b({ - __name: "RoleView", - setup(p) { - const l = S(), { role: t, error: r } = $(l); - return (u, i) => { - const d = s("UFHeaderPage"), f = s("UFAlert"), k = s("UFCardBox"); - return c(), C(h, null, [ - e(d, { - title: "Role details", - caption: "Role information page" - }), - U(r) ? (c(), g(k, { key: 0 }, { - default: n(() => [ - e(f, { alert: U(r) }, null, 8, ["alert"]) - ]), - _: 1 - })) : (c(), C(h, { key: 1 }, [ - o("div", q, [ - o("div", z, [ - e(T, { role: U(t) }, null, 8, ["role"]) - ]), - o("div", G, [ - e(V, { - slug: U(t).slug - }, null, 8, ["slug"]) - ]) - ]), - o("div", J, [ - o("div", null, [ - e(I, { - role: u.$route.params.slug.toString() - }, null, 8, ["role"]) - ]) - ]) - ], 64)) - ], 64); - }; - } -}); -export { - W as default -}; diff --git a/dist/RoleView-hOODGzy4.cjs b/dist/RoleView-hOODGzy4.cjs deleted file mode 100644 index 2768a09..0000000 --- a/dist/RoleView-hOODGzy4.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("vue-router"),m=require("./axios-tuVKNgv9.cjs"),p=require("./types-D9XxK5BT.cjs");function _(u){const o=e.ref(!1),t=e.ref(),n=e.ref({id:0,slug:"",name:"",description:"",created_at:"",updated_at:"",deleted_at:null,users_count:0});async function r(){o.value=!0,t.value=null,await m.axios.get("/api/roles/r/"+u.params.slug).then(l=>{n.value=l.data}).catch(l=>{t.value={description:"An error as occurred",style:p.a.Danger,...l.response.data}}).finally(()=>{o.value=!1})}return e.watch(()=>u.params.slug,()=>{r()},{immediate:!0}),{role:n,error:t,loading:o}}const V={class:"uk-text-center"},N={class:"uk-text-center uk-margin-remove"},C={class:"uk-text-meta"},f={class:"uk-description-list"},k={class:"uk-badge"},x=e.defineComponent({__name:"RoleInfo",props:{role:{}},setup(u){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",V,[e.createVNode(n,{icon:"address-card",class:"fa-5x"})]),e.createElementVNode("h3",N,e.toDisplayString(o.role.name),1),e.createElementVNode("p",C,e.toDisplayString(o.role.description),1),t[1]||(t[1]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("dl",f,[e.createElementVNode("dt",null,[e.createVNode(n,{icon:"users"}),t[0]||(t[0]=e.createTextVNode(" Users"))]),e.createElementVNode("dd",null,[e.createElementVNode("span",k,e.toDisplayString(o.role.users_count),1)])]),t[2]||(t[2]=e.createElementVNode("hr",null,null,-1)),t[3]||(t[3]=e.createElementVNode("button",{class:"uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Edit Role ",-1)),t[4]||(t[4]=e.createElementVNode("button",{class:"uk-button uk-button-danger uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Delete Role ",-1)),e.renderSlot(o.$slots,"default",{dataTest:"slot"})]),_:3})}}}),g={class:"uk-button uk-button-default"},h={class:"uk-text-meta"},w={class:"uk-button uk-button-danger uk-button-small"},b=e.defineComponent({__name:"RoleUsers",props:{slug:{}},setup(u){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFSprunjeHeader"),l=e.resolveComponent("RouterLink"),s=e.resolveComponent("UFSprunjeColumn"),d=e.resolveComponent("UFSprunjeTable"),i=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(i,{title:"Role Users"},{default:e.withCtx(()=>[e.createVNode(d,{dataUrl:"/api/roles/r/"+o.slug+"/users",searchColumn:"name",hideFilters:""},{actions:e.withCtx(()=>[e.createElementVNode("button",g,[e.createVNode(n,{icon:"user-plus"}),t[0]||(t[0]=e.createTextVNode(" Add user "))])]),header:e.withCtx(()=>[e.createVNode(r,{sort:"name"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("User")])),_:1}),e.createVNode(r,null,{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Actions")])),_:1})]),body:e.withCtx(({item:a})=>[e.createVNode(s,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(l,{to:{name:"admin.user",params:{user_name:a.user_name}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.full_name)+" ("+e.toDisplayString(a.user_name)+") ",1)]),_:2},1032,["to"])]),e.createElementVNode("div",h,e.toDisplayString(a.email),1)]),_:2},1024),e.createVNode(s,null,{default:e.withCtx(()=>[e.createElementVNode("button",w,[e.createVNode(n,{icon:"trash"})])]),_:1})]),_:1},8,["dataUrl"])]),_:1})}}}),v={class:"uk-button uk-button-default"},U={class:"uk-button uk-button-danger uk-button-small"},F=e.defineComponent({__name:"RolePermissions",props:{role:{}},setup(u){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFSprunjeHeader"),l=e.resolveComponent("RouterLink"),s=e.resolveComponent("UFSprunjeColumn"),d=e.resolveComponent("UFSprunjeTable"),i=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(i,{title:"Permissions"},{default:e.withCtx(()=>[e.createVNode(d,{dataUrl:"/api/roles/r/"+o.role+"/permissions",searchColumn:"name"},{actions:e.withCtx(()=>[e.createElementVNode("button",v,[e.createVNode(n,{icon:"key"}),t[0]||(t[0]=e.createTextVNode(" Add permission "))])]),header:e.withCtx(()=>[e.createVNode(r,{sort:"name"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("Permission")])),_:1}),e.createVNode(r,{sort:"properties"},{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Description")])),_:1}),e.createVNode(r,null,{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("Actions")])),_:1})]),body:e.withCtx(({item:a})=>[e.createVNode(s,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(l,{to:{name:"admin.permission",params:{id:a.id}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.name),1)]),_:2},1032,["to"])])]),_:2},1024),e.createVNode(s,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.description),1)]),_:2},1024),e.createVNode(s,null,{default:e.withCtx(()=>[e.createElementVNode("button",U,[e.createVNode(n,{icon:"trash"})])]),_:1})]),_:1},8,["dataUrl"])]),_:1})}}}),E={"uk-grid":""},S={class:"uk-width-1-3"},y={class:"uk-width-2-3"},B={class:"uk-child-width-1-1","uk-grid":""},T=e.defineComponent({__name:"RoleView",setup(u){const o=c.useRoute(),{role:t,error:n}=_(o);return(r,l)=>{const s=e.resolveComponent("UFHeaderPage"),d=e.resolveComponent("UFAlert"),i=e.resolveComponent("UFCardBox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(s,{title:"Role details",caption:"Role information page"}),e.unref(n)?(e.openBlock(),e.createBlock(i,{key:0},{default:e.withCtx(()=>[e.createVNode(d,{alert:e.unref(n)},null,8,["alert"])]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",E,[e.createElementVNode("div",S,[e.createVNode(x,{role:e.unref(t)},null,8,["role"])]),e.createElementVNode("div",y,[e.createVNode(b,{slug:e.unref(t).slug},null,8,["slug"])])]),e.createElementVNode("div",B,[e.createElementVNode("div",null,[e.createVNode(F,{role:r.$route.params.slug.toString()},null,8,["role"])])])],64))],64)}}});exports.default=T; diff --git a/dist/UserView-BWWqdCs9.js b/dist/UserView-BWWqdCs9.js new file mode 100644 index 0000000..05903a4 --- /dev/null +++ b/dist/UserView-BWWqdCs9.js @@ -0,0 +1,373 @@ +import { defineComponent as F, resolveComponent as r, openBlock as d, createBlock as k, withCtx as n, createElementVNode as t, toDisplayString as i, createElementBlock as U, createCommentVNode as w, renderSlot as j, createVNode as o, createTextVNode as s, unref as m, Fragment as S, renderList as B } from "vue"; +import { useRoute as $ } from "vue-router"; +import { useUserAdminApi as x } from "./composable/user.js"; +import { a as C } from "./types-Daou0lcF.js"; +import { h as y } from "./moment-h96o7c8I.js"; +const A = { class: "uk-text-center uk-margin" }, D = ["src"], L = { class: "uk-text-center uk-margin-remove" }, T = { + key: 0, + class: "uk-margin-remove uk-text-meta", + "data-test": "meta" +}, H = { class: "uk-description-list" }, R = { class: "uk-text-meta" }, Y = { + key: 0, + class: "uk-text-meta" +}, M = { + key: 1, + class: "uk-text-meta" +}, P = { class: "uk-text-meta" }, N = { class: "uk-text-meta" }, V = { class: "uk-text-meta" }, E = /* @__PURE__ */ F({ + __name: "UserInfo", + props: { + user: {} + }, + setup(g) { + return (u, e) => { + const l = r("font-awesome-icon"), a = r("UFLabel"), _ = r("UFCardBox"); + return d(), k(_, null, { + default: n(() => [ + t("div", A, [ + t("img", { + src: u.user.avatar, + alt: "avatar", + class: "uk-border-circle" + }, null, 8, D), + t("h3", L, i(u.user.full_name), 1), + u.user.user_name ? (d(), U("p", T, " (" + i(u.user.user_name) + ") ", 1)) : w("", !0), + j(u.$slots, "default", { dataTest: "slot" }) + ]), + e[9] || (e[9] = t("hr", null, null, -1)), + t("dl", H, [ + t("dt", null, [ + o(l, { icon: "envelope" }), + e[0] || (e[0] = s(" Email")) + ]), + t("dd", R, i(u.user.email), 1), + t("dt", null, [ + o(l, { icon: "users" }), + e[1] || (e[1] = s(" Group")) + ]), + u.user.group ? (d(), U("dd", Y, i(u.user.group.name), 1)) : (d(), U("dd", M, e[2] || (e[2] = [ + t("i", null, "None", -1) + ]))), + t("dt", null, [ + o(l, { icon: "language" }), + e[3] || (e[3] = s(" Locale")) + ]), + t("dd", P, i(u.user.locale_name), 1), + t("dt", null, [ + o(l, { icon: "user-shield" }), + e[4] || (e[4] = s(" Status")) + ]), + t("dd", N, [ + u.user.flag_enabled == !1 ? (d(), k(a, { + key: 0, + severity: m(C).Danger + }, { + default: n(() => e[5] || (e[5] = [ + s(" Disabled ") + ])), + _: 1 + }, 8, ["severity"])) : u.user.flag_verified == !1 ? (d(), k(a, { + key: 1, + severity: m(C).Warning + }, { + default: n(() => e[6] || (e[6] = [ + s(" Unactivated ") + ])), + _: 1 + }, 8, ["severity"])) : (d(), k(a, { + key: 2, + severity: m(C).Success + }, { + default: n(() => e[7] || (e[7] = [ + s("Active") + ])), + _: 1 + }, 8, ["severity"])) + ]), + t("dt", null, [ + o(l, { icon: "calendar" }), + e[8] || (e[8] = s(" Created on")) + ]), + t("dd", V, i(m(y)(u.user.created_at).format("MMMM Do, YYYY")), 1) + ]), + e[10] || (e[10] = t("hr", null, null, -1)), + e[11] || (e[11] = t("button", { class: "uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Edit User ", -1)), + e[12] || (e[12] = t("button", { class: "uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Change User Password ", -1)), + e[13] || (e[13] = t("button", { class: "uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Disable User ", -1)), + e[14] || (e[14] = t("button", { class: "uk-button uk-button-danger uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Delete User ", -1)), + j(u.$slots, "default", { dataTest: "slot" }) + ]), + _: 3 + }); + }; + } +}), G = /* @__PURE__ */ F({ + __name: "UserActivities", + props: { + user_name: {} + }, + setup(g) { + return (u, e) => { + const l = r("UFSprunjeHeader"), a = r("UFSprunjeColumn"), _ = r("UFSprunjeTable"), f = r("UFCardBox"); + return d(), k(f, { title: "Activities" }, { + default: n(() => [ + o(_, { + dataUrl: "/api/users/u/" + u.user_name + "/activities", + defaultSorts: { occurred_at: "desc" } + }, { + header: n(() => [ + o(l, { sort: "occurred_at" }, { + default: n(() => e[0] || (e[0] = [ + s("Activity Time") + ])), + _: 1 + }), + o(l, { sort: "description" }, { + default: n(() => e[1] || (e[1] = [ + s("Description") + ])), + _: 1 + }) + ]), + body: n(({ item: p }) => [ + o(a, null, { + default: n(() => [ + t("div", null, i(m(y)(p.occurred_at).format("dddd")), 1), + t("div", null, i(m(y)(p.occurred_at).format("MMM Do, YYYY h:mm a")), 1) + ]), + _: 2 + }, 1024), + o(a, null, { + default: n(() => [ + t("div", null, i(p.ip_address), 1), + t("div", null, [ + t("i", null, i(p.description), 1) + ]) + ]), + _: 2 + }, 1024) + ]), + _: 1 + }, 8, ["dataUrl"]) + ]), + _: 1 + }); + }; + } +}), I = { class: "uk-button uk-button-default" }, W = { class: "uk-button uk-button-danger uk-button-small" }, q = /* @__PURE__ */ F({ + __name: "UserRoles", + props: { + slug: {} + }, + setup(g) { + return (u, e) => { + const l = r("font-awesome-icon"), a = r("UFSprunjeHeader"), _ = r("RouterLink"), f = r("UFSprunjeColumn"), p = r("UFSprunjeTable"), b = r("UFCardBox"); + return d(), k(b, { title: "Roles" }, { + default: n(() => [ + o(p, { + dataUrl: "/api/users/u/" + u.slug + "/roles", + searchColumn: "name", + hideFilters: "" + }, { + actions: n(() => [ + t("button", I, [ + o(l, { icon: "address-card" }), + e[0] || (e[0] = s(" Add role ")) + ]) + ]), + header: n(() => [ + o(a, { sort: "name" }, { + default: n(() => e[1] || (e[1] = [ + s("Role") + ])), + _: 1 + }), + o(a, { sort: "description" }, { + default: n(() => e[2] || (e[2] = [ + s("Description") + ])), + _: 1 + }), + o(a, { sort: "description" }, { + default: n(() => e[3] || (e[3] = [ + s("Actions") + ])), + _: 1 + }) + ]), + body: n(({ item: c }) => [ + o(f, null, { + default: n(() => [ + t("strong", null, [ + o(_, { + to: { + name: "admin.role", + params: { slug: c.slug } + } + }, { + default: n(() => [ + s(i(c.name), 1) + ]), + _: 2 + }, 1032, ["to"]) + ]) + ]), + _: 2 + }, 1024), + o(f, null, { + default: n(() => [ + s(i(c.description), 1) + ]), + _: 2 + }, 1024), + o(f, null, { + default: n(() => [ + t("button", W, [ + o(l, { icon: "trash" }) + ]) + ]), + _: 1 + }) + ]), + _: 1 + }, 8, ["dataUrl"]) + ]), + _: 1 + }); + }; + } +}), z = /* @__PURE__ */ F({ + __name: "UserPermissions", + props: { + user_name: {} + }, + setup(g) { + return (u, e) => { + const l = r("UFSprunjeHeader"), a = r("RouterLink"), _ = r("UFSprunjeColumn"), f = r("UFLabel"), p = r("UFSprunjeTable"), b = r("UFCardBox"); + return d(), k(b, { title: "Permissions" }, { + default: n(() => [ + o(p, { + dataUrl: "/api/users/u/" + u.user_name + "/permissions", + searchColumn: "name" + }, { + header: n(() => [ + o(l, { sort: "name" }, { + default: n(() => e[0] || (e[0] = [ + s("Permission") + ])), + _: 1 + }), + o(l, { sort: "properties" }, { + default: n(() => e[1] || (e[1] = [ + s("Description") + ])), + _: 1 + }), + o(l, null, { + default: n(() => e[2] || (e[2] = [ + s("Has permission via roles") + ])), + _: 1 + }) + ]), + body: n(({ item: c }) => [ + o(_, null, { + default: n(() => [ + t("strong", null, [ + o(a, { + to: { + name: "admin.permission", + params: { id: c.id } + } + }, { + default: n(() => [ + s(i(c.name), 1) + ]), + _: 2 + }, 1032, ["to"]) + ]) + ]), + _: 2 + }, 1024), + o(_, null, { + default: n(() => [ + s(i(c.description), 1) + ]), + _: 2 + }, 1024), + o(_, null, { + default: n(() => [ + (d(!0), U(S, null, B(c.roles_via, (v) => (d(), k(a, { + key: v.id, + to: { name: "admin.role", params: { slug: v.slug } } + }, { + default: n(() => [ + o(f, null, { + default: n(() => [ + s(i(v.name), 1) + ]), + _: 2 + }, 1024) + ]), + _: 2 + }, 1032, ["to"]))), 128)) + ]), + _: 2 + }, 1024) + ]), + _: 1 + }, 8, ["dataUrl"]) + ]), + _: 1 + }); + }; + } +}), J = { "uk-grid": "" }, K = { class: "uk-width-1-3" }, O = { class: "uk-width-2-3" }, Q = { + class: "uk-child-width-1-1", + "uk-grid": "" +}, ne = /* @__PURE__ */ F({ + __name: "UserView", + setup(g) { + const u = $(), { user: e, error: l } = x(u); + return (a, _) => { + const f = r("UFHeaderPage"), p = r("UFAlert"), b = r("UFCardBox"); + return d(), U(S, null, [ + o(f, { + title: "User details", + caption: "User information page" + }), + m(l) ? (d(), k(b, { key: 0 }, { + default: n(() => [ + o(p, { alert: m(l) }, null, 8, ["alert"]) + ]), + _: 1 + })) : (d(), U(S, { key: 1 }, [ + t("div", J, [ + t("div", K, [ + o(E, { user: m(e) }, null, 8, ["user"]) + ]), + t("div", O, [ + o(q, { + slug: m(e).user_name + }, null, 8, ["slug"]) + ]) + ]), + t("div", Q, [ + t("div", null, [ + o(z, { + user_name: m(e).user_name + }, null, 8, ["user_name"]) + ]), + t("div", null, [ + o(G, { + user_name: a.$route.params.user_name.toString() + }, null, 8, ["user_name"]) + ]) + ]) + ], 64)) + ], 64); + }; + } +}); +export { + ne as default +}; diff --git a/dist/UserView-CWu0vErB.js b/dist/UserView-CWu0vErB.js deleted file mode 100644 index 8cdd75b..0000000 --- a/dist/UserView-CWu0vErB.js +++ /dev/null @@ -1,413 +0,0 @@ -import { ref as C, watch as B, defineComponent as v, resolveComponent as u, openBlock as d, createBlock as c, withCtx as n, createElementVNode as t, toDisplayString as i, createElementBlock as b, createCommentVNode as $, renderSlot as w, createVNode as s, createTextVNode as r, unref as _, Fragment as S, renderList as A } from "vue"; -import { useRoute as x } from "vue-router"; -import { a as D } from "./axios-CXDYiOMX.js"; -import { a as F } from "./types-Daou0lcF.js"; -import { h as j } from "./moment-h96o7c8I.js"; -function L(U) { - const o = C(!1), e = C(), l = C({ - id: 0, - user_name: "", - first_name: "", - last_name: "", - full_name: "", - email: "", - avatar: "", - flag_enabled: !1, - flag_verified: !1, - group_id: null, - locale: "", - created_at: "", - updated_at: "", - deleted_at: null, - locale_name: "", - group: null - }); - async function a() { - o.value = !0, e.value = null, await D.get("/api/users/u/" + U.params.user_name).then((m) => { - l.value = m.data; - }).catch((m) => { - e.value = { - description: "An error as occurred", - style: F.Danger, - ...m.response.data - }; - }).finally(() => { - o.value = !1; - }); - } - return B( - () => U.params.user_name, - () => { - a(); - }, - { immediate: !0 } - ), { user: l, error: e, loading: o }; -} -const T = { class: "uk-text-center uk-margin" }, H = ["src"], R = { class: "uk-text-center uk-margin-remove" }, Y = { - key: 0, - class: "uk-margin-remove uk-text-meta", - "data-test": "meta" -}, M = { class: "uk-description-list" }, P = { class: "uk-text-meta" }, N = { - key: 0, - class: "uk-text-meta" -}, V = { - key: 1, - class: "uk-text-meta" -}, E = { class: "uk-text-meta" }, h = { class: "uk-text-meta" }, G = { class: "uk-text-meta" }, I = /* @__PURE__ */ v({ - __name: "UserInfo", - props: { - user: {} - }, - setup(U) { - return (o, e) => { - const l = u("font-awesome-icon"), a = u("UFLabel"), m = u("UFCardBox"); - return d(), c(m, null, { - default: n(() => [ - t("div", T, [ - t("img", { - src: o.user.avatar, - alt: "avatar", - class: "uk-border-circle" - }, null, 8, H), - t("h3", R, i(o.user.full_name), 1), - o.user.user_name ? (d(), b("p", Y, " (" + i(o.user.user_name) + ") ", 1)) : $("", !0), - w(o.$slots, "default", { dataTest: "slot" }) - ]), - e[9] || (e[9] = t("hr", null, null, -1)), - t("dl", M, [ - t("dt", null, [ - s(l, { icon: "envelope" }), - e[0] || (e[0] = r(" Email")) - ]), - t("dd", P, i(o.user.email), 1), - t("dt", null, [ - s(l, { icon: "users" }), - e[1] || (e[1] = r(" Group")) - ]), - o.user.group ? (d(), b("dd", N, i(o.user.group.name), 1)) : (d(), b("dd", V, e[2] || (e[2] = [ - t("i", null, "None", -1) - ]))), - t("dt", null, [ - s(l, { icon: "language" }), - e[3] || (e[3] = r(" Locale")) - ]), - t("dd", E, i(o.user.locale_name), 1), - t("dt", null, [ - s(l, { icon: "user-shield" }), - e[4] || (e[4] = r(" Status")) - ]), - t("dd", h, [ - o.user.flag_enabled == !1 ? (d(), c(a, { - key: 0, - severity: _(F).Danger - }, { - default: n(() => e[5] || (e[5] = [ - r(" Disabled ") - ])), - _: 1 - }, 8, ["severity"])) : o.user.flag_verified == !1 ? (d(), c(a, { - key: 1, - severity: _(F).Warning - }, { - default: n(() => e[6] || (e[6] = [ - r(" Unactivated ") - ])), - _: 1 - }, 8, ["severity"])) : (d(), c(a, { - key: 2, - severity: _(F).Success - }, { - default: n(() => e[7] || (e[7] = [ - r("Active") - ])), - _: 1 - }, 8, ["severity"])) - ]), - t("dt", null, [ - s(l, { icon: "calendar" }), - e[8] || (e[8] = r(" Created on")) - ]), - t("dd", G, i(_(j)(o.user.created_at).format("MMMM Do, YYYY")), 1) - ]), - e[10] || (e[10] = t("hr", null, null, -1)), - e[11] || (e[11] = t("button", { class: "uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Edit User ", -1)), - e[12] || (e[12] = t("button", { class: "uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Change User Password ", -1)), - e[13] || (e[13] = t("button", { class: "uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Disable User ", -1)), - e[14] || (e[14] = t("button", { class: "uk-button uk-button-danger uk-width-1-1 uk-margin-small-bottom uk-button-small" }, " Delete User ", -1)), - w(o.$slots, "default", { dataTest: "slot" }) - ]), - _: 3 - }); - }; - } -}), W = /* @__PURE__ */ v({ - __name: "UserActivities", - props: { - user_name: {} - }, - setup(U) { - return (o, e) => { - const l = u("UFSprunjeHeader"), a = u("UFSprunjeColumn"), m = u("UFSprunjeTable"), f = u("UFCardBox"); - return d(), c(f, { title: "Activities" }, { - default: n(() => [ - s(m, { - dataUrl: "/api/users/u/" + o.user_name + "/activities", - defaultSorts: { occurred_at: "desc" } - }, { - header: n(() => [ - s(l, { sort: "occurred_at" }, { - default: n(() => e[0] || (e[0] = [ - r("Activity Time") - ])), - _: 1 - }), - s(l, { sort: "description" }, { - default: n(() => e[1] || (e[1] = [ - r("Description") - ])), - _: 1 - }) - ]), - body: n(({ item: p }) => [ - s(a, null, { - default: n(() => [ - t("div", null, i(_(j)(p.occurred_at).format("dddd")), 1), - t("div", null, i(_(j)(p.occurred_at).format("MMM Do, YYYY h:mm a")), 1) - ]), - _: 2 - }, 1024), - s(a, null, { - default: n(() => [ - t("div", null, i(p.ip_address), 1), - t("div", null, [ - t("i", null, i(p.description), 1) - ]) - ]), - _: 2 - }, 1024) - ]), - _: 1 - }, 8, ["dataUrl"]) - ]), - _: 1 - }); - }; - } -}), q = { class: "uk-button uk-button-default" }, z = { class: "uk-button uk-button-danger uk-button-small" }, J = /* @__PURE__ */ v({ - __name: "UserRoles", - props: { - slug: {} - }, - setup(U) { - return (o, e) => { - const l = u("font-awesome-icon"), a = u("UFSprunjeHeader"), m = u("RouterLink"), f = u("UFSprunjeColumn"), p = u("UFSprunjeTable"), g = u("UFCardBox"); - return d(), c(g, { title: "Roles" }, { - default: n(() => [ - s(p, { - dataUrl: "/api/users/u/" + o.slug + "/roles", - searchColumn: "name", - hideFilters: "" - }, { - actions: n(() => [ - t("button", q, [ - s(l, { icon: "address-card" }), - e[0] || (e[0] = r(" Add role ")) - ]) - ]), - header: n(() => [ - s(a, { sort: "name" }, { - default: n(() => e[1] || (e[1] = [ - r("Role") - ])), - _: 1 - }), - s(a, { sort: "description" }, { - default: n(() => e[2] || (e[2] = [ - r("Description") - ])), - _: 1 - }), - s(a, { sort: "description" }, { - default: n(() => e[3] || (e[3] = [ - r("Actions") - ])), - _: 1 - }) - ]), - body: n(({ item: k }) => [ - s(f, null, { - default: n(() => [ - t("strong", null, [ - s(m, { - to: { - name: "admin.role", - params: { slug: k.slug } - } - }, { - default: n(() => [ - r(i(k.name), 1) - ]), - _: 2 - }, 1032, ["to"]) - ]) - ]), - _: 2 - }, 1024), - s(f, null, { - default: n(() => [ - r(i(k.description), 1) - ]), - _: 2 - }, 1024), - s(f, null, { - default: n(() => [ - t("button", z, [ - s(l, { icon: "trash" }) - ]) - ]), - _: 1 - }) - ]), - _: 1 - }, 8, ["dataUrl"]) - ]), - _: 1 - }); - }; - } -}), K = /* @__PURE__ */ v({ - __name: "UserPermissions", - props: { - user_name: {} - }, - setup(U) { - return (o, e) => { - const l = u("UFSprunjeHeader"), a = u("RouterLink"), m = u("UFSprunjeColumn"), f = u("UFLabel"), p = u("UFSprunjeTable"), g = u("UFCardBox"); - return d(), c(g, { title: "Permissions" }, { - default: n(() => [ - s(p, { - dataUrl: "/api/users/u/" + o.user_name + "/permissions", - searchColumn: "name" - }, { - header: n(() => [ - s(l, { sort: "name" }, { - default: n(() => e[0] || (e[0] = [ - r("Permission") - ])), - _: 1 - }), - s(l, { sort: "properties" }, { - default: n(() => e[1] || (e[1] = [ - r("Description") - ])), - _: 1 - }), - s(l, null, { - default: n(() => e[2] || (e[2] = [ - r("Has permission via roles") - ])), - _: 1 - }) - ]), - body: n(({ item: k }) => [ - s(m, null, { - default: n(() => [ - t("strong", null, [ - s(a, { - to: { - name: "admin.permission", - params: { id: k.id } - } - }, { - default: n(() => [ - r(i(k.name), 1) - ]), - _: 2 - }, 1032, ["to"]) - ]) - ]), - _: 2 - }, 1024), - s(m, null, { - default: n(() => [ - r(i(k.description), 1) - ]), - _: 2 - }, 1024), - s(m, null, { - default: n(() => [ - (d(!0), b(S, null, A(k.roles_via, (y) => (d(), c(a, { - key: y.id, - to: { name: "admin.role", params: { slug: y.slug } } - }, { - default: n(() => [ - s(f, null, { - default: n(() => [ - r(i(y.name), 1) - ]), - _: 2 - }, 1024) - ]), - _: 2 - }, 1032, ["to"]))), 128)) - ]), - _: 2 - }, 1024) - ]), - _: 1 - }, 8, ["dataUrl"]) - ]), - _: 1 - }); - }; - } -}), O = { "uk-grid": "" }, Q = { class: "uk-width-1-3" }, X = { class: "uk-width-2-3" }, Z = { - class: "uk-child-width-1-1", - "uk-grid": "" -}, re = /* @__PURE__ */ v({ - __name: "UserView", - setup(U) { - const o = x(), { user: e, error: l } = L(o); - return (a, m) => { - const f = u("UFHeaderPage"), p = u("UFAlert"), g = u("UFCardBox"); - return d(), b(S, null, [ - s(f, { - title: "User details", - caption: "User information page" - }), - _(l) ? (d(), c(g, { key: 0 }, { - default: n(() => [ - s(p, { alert: _(l) }, null, 8, ["alert"]) - ]), - _: 1 - })) : (d(), b(S, { key: 1 }, [ - t("div", O, [ - t("div", Q, [ - s(I, { user: _(e) }, null, 8, ["user"]) - ]), - t("div", X, [ - s(J, { - slug: _(e).user_name - }, null, 8, ["slug"]) - ]) - ]), - t("div", Z, [ - t("div", null, [ - s(K, { - user_name: _(e).user_name - }, null, 8, ["user_name"]) - ]), - t("div", null, [ - s(W, { - user_name: a.$route.params.user_name.toString() - }, null, 8, ["user_name"]) - ]) - ]) - ], 64)) - ], 64); - }; - } -}); -export { - re as default -}; diff --git a/dist/UserView-CwaDFjUI.cjs b/dist/UserView-CwaDFjUI.cjs new file mode 100644 index 0000000..3550db9 --- /dev/null +++ b/dist/UserView-CwaDFjUI.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),_=require("vue-router"),N=require("./composable/user.cjs"),m=require("./types-D9XxK5BT.cjs"),p=require("./moment-Bp7fbP4q.cjs"),V={class:"uk-text-center uk-margin"},k=["src"],C={class:"uk-text-center uk-margin-remove"},f={key:0,class:"uk-margin-remove uk-text-meta","data-test":"meta"},x={class:"uk-description-list"},v={class:"uk-text-meta"},g={key:0,class:"uk-text-meta"},U={key:1,class:"uk-text-meta"},w={class:"uk-text-meta"},b={class:"uk-text-meta"},E={class:"uk-text-meta"},S=e.defineComponent({__name:"UserInfo",props:{user:{}},setup(i){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFLabel"),l=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(l,null,{default:e.withCtx(()=>[e.createElementVNode("div",V,[e.createElementVNode("img",{src:o.user.avatar,alt:"avatar",class:"uk-border-circle"},null,8,k),e.createElementVNode("h3",C,e.toDisplayString(o.user.full_name),1),o.user.user_name?(e.openBlock(),e.createElementBlock("p",f," ("+e.toDisplayString(o.user.user_name)+") ",1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default",{dataTest:"slot"})]),t[9]||(t[9]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("dl",x,[e.createElementVNode("dt",null,[e.createVNode(n,{icon:"envelope"}),t[0]||(t[0]=e.createTextVNode(" Email"))]),e.createElementVNode("dd",v,e.toDisplayString(o.user.email),1),e.createElementVNode("dt",null,[e.createVNode(n,{icon:"users"}),t[1]||(t[1]=e.createTextVNode(" Group"))]),o.user.group?(e.openBlock(),e.createElementBlock("dd",g,e.toDisplayString(o.user.group.name),1)):(e.openBlock(),e.createElementBlock("dd",U,t[2]||(t[2]=[e.createElementVNode("i",null,"None",-1)]))),e.createElementVNode("dt",null,[e.createVNode(n,{icon:"language"}),t[3]||(t[3]=e.createTextVNode(" Locale"))]),e.createElementVNode("dd",w,e.toDisplayString(o.user.locale_name),1),e.createElementVNode("dt",null,[e.createVNode(n,{icon:"user-shield"}),t[4]||(t[4]=e.createTextVNode(" Status"))]),e.createElementVNode("dd",b,[o.user.flag_enabled==!1?(e.openBlock(),e.createBlock(r,{key:0,severity:e.unref(m.a).Danger},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode(" Disabled ")])),_:1},8,["severity"])):o.user.flag_verified==!1?(e.openBlock(),e.createBlock(r,{key:1,severity:e.unref(m.a).Warning},{default:e.withCtx(()=>t[6]||(t[6]=[e.createTextVNode(" Unactivated ")])),_:1},8,["severity"])):(e.openBlock(),e.createBlock(r,{key:2,severity:e.unref(m.a).Success},{default:e.withCtx(()=>t[7]||(t[7]=[e.createTextVNode("Active")])),_:1},8,["severity"]))]),e.createElementVNode("dt",null,[e.createVNode(n,{icon:"calendar"}),t[8]||(t[8]=e.createTextVNode(" Created on"))]),e.createElementVNode("dd",E,e.toDisplayString(e.unref(p.hooks)(o.user.created_at).format("MMMM Do, YYYY")),1)]),t[10]||(t[10]=e.createElementVNode("hr",null,null,-1)),t[11]||(t[11]=e.createElementVNode("button",{class:"uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Edit User ",-1)),t[12]||(t[12]=e.createElementVNode("button",{class:"uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Change User Password ",-1)),t[13]||(t[13]=e.createElementVNode("button",{class:"uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Disable User ",-1)),t[14]||(t[14]=e.createElementVNode("button",{class:"uk-button uk-button-danger uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Delete User ",-1)),e.renderSlot(o.$slots,"default",{dataTest:"slot"})]),_:3})}}}),B=e.defineComponent({__name:"UserActivities",props:{user_name:{}},setup(i){return(o,t)=>{const n=e.resolveComponent("UFSprunjeHeader"),r=e.resolveComponent("UFSprunjeColumn"),l=e.resolveComponent("UFSprunjeTable"),a=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(a,{title:"Activities"},{default:e.withCtx(()=>[e.createVNode(l,{dataUrl:"/api/users/u/"+o.user_name+"/activities",defaultSorts:{occurred_at:"desc"}},{header:e.withCtx(()=>[e.createVNode(n,{sort:"occurred_at"},{default:e.withCtx(()=>t[0]||(t[0]=[e.createTextVNode("Activity Time")])),_:1}),e.createVNode(n,{sort:"description"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("Description")])),_:1})]),body:e.withCtx(({item:s})=>[e.createVNode(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(p.hooks)(s.occurred_at).format("dddd")),1),e.createElementVNode("div",null,e.toDisplayString(e.unref(p.hooks)(s.occurred_at).format("MMM Do, YYYY h:mm a")),1)]),_:2},1024),e.createVNode(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(s.ip_address),1),e.createElementVNode("div",null,[e.createElementVNode("i",null,e.toDisplayString(s.description),1)])]),_:2},1024)]),_:1},8,["dataUrl"])]),_:1})}}}),F={class:"uk-button uk-button-default"},y={class:"uk-button uk-button-danger uk-button-small"},h=e.defineComponent({__name:"UserRoles",props:{slug:{}},setup(i){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFSprunjeHeader"),l=e.resolveComponent("RouterLink"),a=e.resolveComponent("UFSprunjeColumn"),s=e.resolveComponent("UFSprunjeTable"),u=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(u,{title:"Roles"},{default:e.withCtx(()=>[e.createVNode(s,{dataUrl:"/api/users/u/"+o.slug+"/roles",searchColumn:"name",hideFilters:""},{actions:e.withCtx(()=>[e.createElementVNode("button",F,[e.createVNode(n,{icon:"address-card"}),t[0]||(t[0]=e.createTextVNode(" Add role "))])]),header:e.withCtx(()=>[e.createVNode(r,{sort:"name"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("Role")])),_:1}),e.createVNode(r,{sort:"description"},{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Description")])),_:1}),e.createVNode(r,{sort:"description"},{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("Actions")])),_:1})]),body:e.withCtx(({item:d})=>[e.createVNode(a,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(l,{to:{name:"admin.role",params:{slug:d.slug}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.name),1)]),_:2},1032,["to"])])]),_:2},1024),e.createVNode(a,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.description),1)]),_:2},1024),e.createVNode(a,null,{default:e.withCtx(()=>[e.createElementVNode("button",y,[e.createVNode(n,{icon:"trash"})])]),_:1})]),_:1},8,["dataUrl"])]),_:1})}}}),T=e.defineComponent({__name:"UserPermissions",props:{user_name:{}},setup(i){return(o,t)=>{const n=e.resolveComponent("UFSprunjeHeader"),r=e.resolveComponent("RouterLink"),l=e.resolveComponent("UFSprunjeColumn"),a=e.resolveComponent("UFLabel"),s=e.resolveComponent("UFSprunjeTable"),u=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(u,{title:"Permissions"},{default:e.withCtx(()=>[e.createVNode(s,{dataUrl:"/api/users/u/"+o.user_name+"/permissions",searchColumn:"name"},{header:e.withCtx(()=>[e.createVNode(n,{sort:"name"},{default:e.withCtx(()=>t[0]||(t[0]=[e.createTextVNode("Permission")])),_:1}),e.createVNode(n,{sort:"properties"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("Description")])),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Has permission via roles")])),_:1})]),body:e.withCtx(({item:d})=>[e.createVNode(l,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(r,{to:{name:"admin.permission",params:{id:d.id}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.name),1)]),_:2},1032,["to"])])]),_:2},1024),e.createVNode(l,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.description),1)]),_:2},1024),e.createVNode(l,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.roles_via,c=>(e.openBlock(),e.createBlock(r,{key:c.id,to:{name:"admin.role",params:{slug:c.slug}}},{default:e.withCtx(()=>[e.createVNode(a,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.name),1)]),_:2},1024)]),_:2},1032,["to"]))),128))]),_:2},1024)]),_:1},8,["dataUrl"])]),_:1})}}}),D={"uk-grid":""},j={class:"uk-width-1-3"},$={class:"uk-width-2-3"},A={class:"uk-child-width-1-1","uk-grid":""},L=e.defineComponent({__name:"UserView",setup(i){const o=_.useRoute(),{user:t,error:n}=N.useUserAdminApi(o);return(r,l)=>{const a=e.resolveComponent("UFHeaderPage"),s=e.resolveComponent("UFAlert"),u=e.resolveComponent("UFCardBox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(a,{title:"User details",caption:"User information page"}),e.unref(n)?(e.openBlock(),e.createBlock(u,{key:0},{default:e.withCtx(()=>[e.createVNode(s,{alert:e.unref(n)},null,8,["alert"])]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",D,[e.createElementVNode("div",j,[e.createVNode(S,{user:e.unref(t)},null,8,["user"])]),e.createElementVNode("div",$,[e.createVNode(h,{slug:e.unref(t).user_name},null,8,["slug"])])]),e.createElementVNode("div",A,[e.createElementVNode("div",null,[e.createVNode(T,{user_name:e.unref(t).user_name},null,8,["user_name"])]),e.createElementVNode("div",null,[e.createVNode(B,{user_name:r.$route.params.user_name.toString()},null,8,["user_name"])])])],64))],64)}}});exports.default=L; diff --git a/dist/UserView-DyId2fxr.cjs b/dist/UserView-DyId2fxr.cjs deleted file mode 100644 index ca2b4a9..0000000 --- a/dist/UserView-DyId2fxr.cjs +++ /dev/null @@ -1 +0,0 @@ -"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),_=require("vue-router"),N=require("./axios-tuVKNgv9.cjs"),c=require("./types-D9XxK5BT.cjs"),p=require("./moment-Bp7fbP4q.cjs");function V(d){const o=e.ref(!1),t=e.ref(),n=e.ref({id:0,user_name:"",first_name:"",last_name:"",full_name:"",email:"",avatar:"",flag_enabled:!1,flag_verified:!1,group_id:null,locale:"",created_at:"",updated_at:"",deleted_at:null,locale_name:"",group:null});async function r(){o.value=!0,t.value=null,await N.axios.get("/api/users/u/"+d.params.user_name).then(a=>{n.value=a.data}).catch(a=>{t.value={description:"An error as occurred",style:c.a.Danger,...a.response.data}}).finally(()=>{o.value=!1})}return e.watch(()=>d.params.user_name,()=>{r()},{immediate:!0}),{user:n,error:t,loading:o}}const k={class:"uk-text-center uk-margin"},f=["src"],C={class:"uk-text-center uk-margin-remove"},x={key:0,class:"uk-margin-remove uk-text-meta","data-test":"meta"},v={class:"uk-description-list"},g={class:"uk-text-meta"},U={key:0,class:"uk-text-meta"},w={key:1,class:"uk-text-meta"},b={class:"uk-text-meta"},E={class:"uk-text-meta"},y={class:"uk-text-meta"},S=e.defineComponent({__name:"UserInfo",props:{user:{}},setup(d){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFLabel"),a=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(a,null,{default:e.withCtx(()=>[e.createElementVNode("div",k,[e.createElementVNode("img",{src:o.user.avatar,alt:"avatar",class:"uk-border-circle"},null,8,f),e.createElementVNode("h3",C,e.toDisplayString(o.user.full_name),1),o.user.user_name?(e.openBlock(),e.createElementBlock("p",x," ("+e.toDisplayString(o.user.user_name)+") ",1)):e.createCommentVNode("",!0),e.renderSlot(o.$slots,"default",{dataTest:"slot"})]),t[9]||(t[9]=e.createElementVNode("hr",null,null,-1)),e.createElementVNode("dl",v,[e.createElementVNode("dt",null,[e.createVNode(n,{icon:"envelope"}),t[0]||(t[0]=e.createTextVNode(" Email"))]),e.createElementVNode("dd",g,e.toDisplayString(o.user.email),1),e.createElementVNode("dt",null,[e.createVNode(n,{icon:"users"}),t[1]||(t[1]=e.createTextVNode(" Group"))]),o.user.group?(e.openBlock(),e.createElementBlock("dd",U,e.toDisplayString(o.user.group.name),1)):(e.openBlock(),e.createElementBlock("dd",w,t[2]||(t[2]=[e.createElementVNode("i",null,"None",-1)]))),e.createElementVNode("dt",null,[e.createVNode(n,{icon:"language"}),t[3]||(t[3]=e.createTextVNode(" Locale"))]),e.createElementVNode("dd",b,e.toDisplayString(o.user.locale_name),1),e.createElementVNode("dt",null,[e.createVNode(n,{icon:"user-shield"}),t[4]||(t[4]=e.createTextVNode(" Status"))]),e.createElementVNode("dd",E,[o.user.flag_enabled==!1?(e.openBlock(),e.createBlock(r,{key:0,severity:e.unref(c.a).Danger},{default:e.withCtx(()=>t[5]||(t[5]=[e.createTextVNode(" Disabled ")])),_:1},8,["severity"])):o.user.flag_verified==!1?(e.openBlock(),e.createBlock(r,{key:1,severity:e.unref(c.a).Warning},{default:e.withCtx(()=>t[6]||(t[6]=[e.createTextVNode(" Unactivated ")])),_:1},8,["severity"])):(e.openBlock(),e.createBlock(r,{key:2,severity:e.unref(c.a).Success},{default:e.withCtx(()=>t[7]||(t[7]=[e.createTextVNode("Active")])),_:1},8,["severity"]))]),e.createElementVNode("dt",null,[e.createVNode(n,{icon:"calendar"}),t[8]||(t[8]=e.createTextVNode(" Created on"))]),e.createElementVNode("dd",y,e.toDisplayString(e.unref(p.hooks)(o.user.created_at).format("MMMM Do, YYYY")),1)]),t[10]||(t[10]=e.createElementVNode("hr",null,null,-1)),t[11]||(t[11]=e.createElementVNode("button",{class:"uk-button uk-button-primary uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Edit User ",-1)),t[12]||(t[12]=e.createElementVNode("button",{class:"uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Change User Password ",-1)),t[13]||(t[13]=e.createElementVNode("button",{class:"uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Disable User ",-1)),t[14]||(t[14]=e.createElementVNode("button",{class:"uk-button uk-button-danger uk-width-1-1 uk-margin-small-bottom uk-button-small"}," Delete User ",-1)),e.renderSlot(o.$slots,"default",{dataTest:"slot"})]),_:3})}}}),B=e.defineComponent({__name:"UserActivities",props:{user_name:{}},setup(d){return(o,t)=>{const n=e.resolveComponent("UFSprunjeHeader"),r=e.resolveComponent("UFSprunjeColumn"),a=e.resolveComponent("UFSprunjeTable"),s=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(s,{title:"Activities"},{default:e.withCtx(()=>[e.createVNode(a,{dataUrl:"/api/users/u/"+o.user_name+"/activities",defaultSorts:{occurred_at:"desc"}},{header:e.withCtx(()=>[e.createVNode(n,{sort:"occurred_at"},{default:e.withCtx(()=>t[0]||(t[0]=[e.createTextVNode("Activity Time")])),_:1}),e.createVNode(n,{sort:"description"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("Description")])),_:1})]),body:e.withCtx(({item:l})=>[e.createVNode(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(e.unref(p.hooks)(l.occurred_at).format("dddd")),1),e.createElementVNode("div",null,e.toDisplayString(e.unref(p.hooks)(l.occurred_at).format("MMM Do, YYYY h:mm a")),1)]),_:2},1024),e.createVNode(r,null,{default:e.withCtx(()=>[e.createElementVNode("div",null,e.toDisplayString(l.ip_address),1),e.createElementVNode("div",null,[e.createElementVNode("i",null,e.toDisplayString(l.description),1)])]),_:2},1024)]),_:1},8,["dataUrl"])]),_:1})}}}),F={class:"uk-button uk-button-default"},h={class:"uk-button uk-button-danger uk-button-small"},T=e.defineComponent({__name:"UserRoles",props:{slug:{}},setup(d){return(o,t)=>{const n=e.resolveComponent("font-awesome-icon"),r=e.resolveComponent("UFSprunjeHeader"),a=e.resolveComponent("RouterLink"),s=e.resolveComponent("UFSprunjeColumn"),l=e.resolveComponent("UFSprunjeTable"),i=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(i,{title:"Roles"},{default:e.withCtx(()=>[e.createVNode(l,{dataUrl:"/api/users/u/"+o.slug+"/roles",searchColumn:"name",hideFilters:""},{actions:e.withCtx(()=>[e.createElementVNode("button",F,[e.createVNode(n,{icon:"address-card"}),t[0]||(t[0]=e.createTextVNode(" Add role "))])]),header:e.withCtx(()=>[e.createVNode(r,{sort:"name"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("Role")])),_:1}),e.createVNode(r,{sort:"description"},{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Description")])),_:1}),e.createVNode(r,{sort:"description"},{default:e.withCtx(()=>t[3]||(t[3]=[e.createTextVNode("Actions")])),_:1})]),body:e.withCtx(({item:u})=>[e.createVNode(s,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(a,{to:{name:"admin.role",params:{slug:u.slug}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.name),1)]),_:2},1032,["to"])])]),_:2},1024),e.createVNode(s,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.description),1)]),_:2},1024),e.createVNode(s,null,{default:e.withCtx(()=>[e.createElementVNode("button",h,[e.createVNode(n,{icon:"trash"})])]),_:1})]),_:1},8,["dataUrl"])]),_:1})}}}),D=e.defineComponent({__name:"UserPermissions",props:{user_name:{}},setup(d){return(o,t)=>{const n=e.resolveComponent("UFSprunjeHeader"),r=e.resolveComponent("RouterLink"),a=e.resolveComponent("UFSprunjeColumn"),s=e.resolveComponent("UFLabel"),l=e.resolveComponent("UFSprunjeTable"),i=e.resolveComponent("UFCardBox");return e.openBlock(),e.createBlock(i,{title:"Permissions"},{default:e.withCtx(()=>[e.createVNode(l,{dataUrl:"/api/users/u/"+o.user_name+"/permissions",searchColumn:"name"},{header:e.withCtx(()=>[e.createVNode(n,{sort:"name"},{default:e.withCtx(()=>t[0]||(t[0]=[e.createTextVNode("Permission")])),_:1}),e.createVNode(n,{sort:"properties"},{default:e.withCtx(()=>t[1]||(t[1]=[e.createTextVNode("Description")])),_:1}),e.createVNode(n,null,{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("Has permission via roles")])),_:1})]),body:e.withCtx(({item:u})=>[e.createVNode(a,null,{default:e.withCtx(()=>[e.createElementVNode("strong",null,[e.createVNode(r,{to:{name:"admin.permission",params:{id:u.id}}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.name),1)]),_:2},1032,["to"])])]),_:2},1024),e.createVNode(a,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.description),1)]),_:2},1024),e.createVNode(a,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.roles_via,m=>(e.openBlock(),e.createBlock(r,{key:m.id,to:{name:"admin.role",params:{slug:m.slug}}},{default:e.withCtx(()=>[e.createVNode(s,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.name),1)]),_:2},1024)]),_:2},1032,["to"]))),128))]),_:2},1024)]),_:1},8,["dataUrl"])]),_:1})}}}),j={"uk-grid":""},$={class:"uk-width-1-3"},A={class:"uk-width-2-3"},L={class:"uk-child-width-1-1","uk-grid":""},H=e.defineComponent({__name:"UserView",setup(d){const o=_.useRoute(),{user:t,error:n}=V(o);return(r,a)=>{const s=e.resolveComponent("UFHeaderPage"),l=e.resolveComponent("UFAlert"),i=e.resolveComponent("UFCardBox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(s,{title:"User details",caption:"User information page"}),e.unref(n)?(e.openBlock(),e.createBlock(i,{key:0},{default:e.withCtx(()=>[e.createVNode(l,{alert:e.unref(n)},null,8,["alert"])]),_:1})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",j,[e.createElementVNode("div",$,[e.createVNode(S,{user:e.unref(t)},null,8,["user"])]),e.createElementVNode("div",A,[e.createVNode(T,{slug:e.unref(t).user_name},null,8,["slug"])])]),e.createElementVNode("div",L,[e.createElementVNode("div",null,[e.createVNode(D,{user_name:e.unref(t).user_name},null,8,["user_name"])]),e.createElementVNode("div",null,[e.createVNode(B,{user_name:r.$route.params.user_name.toString()},null,8,["user_name"])])])],64))],64)}}});exports.default=H; diff --git a/dist/composable/GroupCreateForm.d.ts b/dist/composable/GroupCreateForm.d.ts new file mode 100644 index 0000000..11562bb --- /dev/null +++ b/dist/composable/GroupCreateForm.d.ts @@ -0,0 +1,10 @@ +interface GroupCreateForm { + slug: string; + name: string; + description: string; + icon: string; +} +declare function getDefaultForm(): GroupCreateForm; +declare function sendForm(form: GroupCreateForm): Promise; +export type { GroupCreateForm }; +export { getDefaultForm, sendForm }; diff --git a/dist/composable/dashboard.cjs b/dist/composable/dashboard.cjs new file mode 100644 index 0000000..b0c6e1c --- /dev/null +++ b/dist/composable/dashboard.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("pinia"),s=require("../axios-tuVKNgv9.cjs"),t=require("../types-D9XxK5BT.cjs"),a={counter:{users:0,roles:0,groups:0},info:{frameworkVersion:"",phpVersion:"",database:{connection:"",name:"",type:"",version:""},server:"",projectPath:""},sprinkles:{},users:[]},o=r.defineStore("dashboardApi",{state:()=>({data:a}),actions:{async load(){return s.axios.get("/api/dashboard").then(e=>(this.data=e.data,this.data)).catch(e=>{throw{description:"An error as occurred",style:t.a.Danger,closeBtn:!0,...e.response.data}})}}});exports.useDashboardApi=o; diff --git a/dist/composable/dashboard.js b/dist/composable/dashboard.js new file mode 100644 index 0000000..8d93262 --- /dev/null +++ b/dist/composable/dashboard.js @@ -0,0 +1,43 @@ +import { defineStore as e } from "pinia"; +import { a } from "../axios-CXDYiOMX.js"; +import { a as o } from "../types-Daou0lcF.js"; +const t = { + counter: { + users: 0, + roles: 0, + groups: 0 + }, + info: { + frameworkVersion: "", + phpVersion: "", + database: { + connection: "", + name: "", + type: "", + version: "" + }, + server: "", + projectPath: "" + }, + sprinkles: {}, + users: [] +}, p = e("dashboardApi", { + state: () => ({ + data: t + }), + actions: { + async load() { + return a.get("/api/dashboard").then((r) => (this.data = r.data, this.data)).catch((r) => { + throw { + description: "An error as occurred", + style: o.Danger, + closeBtn: !0, + ...r.response.data + }; + }); + } + } +}); +export { + p as useDashboardApi +}; diff --git a/dist/composable/group.cjs b/dist/composable/group.cjs new file mode 100644 index 0000000..3cbd248 --- /dev/null +++ b/dist/composable/group.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../axios-tuVKNgv9.cjs"),i=require("../types-D9XxK5BT.cjs");function c(u){const t=e.ref(!1),a=e.ref(),s=e.ref({id:0,name:"",slug:"",description:"",icon:"",created_at:"",updated_at:"",deleted_at:null,users_count:0});async function n(){t.value=!0,a.value=null,await o.axios.get("/api/groups/g/"+u.params.slug).then(r=>{s.value=r.data}).catch(r=>{a.value={description:"An error as occurred",style:i.a.Danger,closeBtn:!0,...r.response.data}}).finally(()=>{t.value=!1})}return e.watch(()=>u.params.slug,()=>{n()},{immediate:!0}),{group:s,error:a,loading:t}}exports.useGroupApi=c; diff --git a/dist/composable/group.js b/dist/composable/group.js new file mode 100644 index 0000000..3242eea --- /dev/null +++ b/dist/composable/group.js @@ -0,0 +1,40 @@ +import { ref as r, watch as u } from "vue"; +import { a as i } from "../axios-CXDYiOMX.js"; +import { a as l } from "../types-Daou0lcF.js"; +function m(o) { + const a = r(!1), e = r(), s = r({ + id: 0, + name: "", + slug: "", + description: "", + icon: "", + created_at: "", + updated_at: "", + deleted_at: null, + users_count: 0 + }); + async function n() { + a.value = !0, e.value = null, await i.get("/api/groups/g/" + o.params.slug).then((t) => { + s.value = t.data; + }).catch((t) => { + e.value = { + description: "An error as occurred", + style: l.Danger, + closeBtn: !0, + ...t.response.data + }; + }).finally(() => { + a.value = !1; + }); + } + return u( + () => o.params.slug, + () => { + n(); + }, + { immediate: !0 } + ), { group: s, error: e, loading: a }; +} +export { + m as useGroupApi +}; diff --git a/dist/composable/permission.cjs b/dist/composable/permission.cjs new file mode 100644 index 0000000..c799c40 --- /dev/null +++ b/dist/composable/permission.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../axios-tuVKNgv9.cjs"),u=require("../types-D9XxK5BT.cjs");function c(r){const a=e.ref(!1),i=e.ref(),s=e.ref({id:0,slug:"",name:"",conditions:"",description:"",created_at:"",updated_at:"",deleted_at:null});async function n(){a.value=!0,i.value=null,await o.axios.get("/api/permissions/p/"+r.params.id).then(t=>{s.value=t.data}).catch(t=>{i.value={description:"An error as occurred",style:u.a.Danger,...t.response.data}}).finally(()=>{a.value=!1})}return e.watch(()=>r.params.id,()=>{n()},{immediate:!0}),{permission:s,error:i,loading:a}}exports.usePermissionApi=c; diff --git a/dist/composable/permission.js b/dist/composable/permission.js new file mode 100644 index 0000000..2d89472 --- /dev/null +++ b/dist/composable/permission.js @@ -0,0 +1,38 @@ +import { ref as i, watch as o } from "vue"; +import { a as l } from "../axios-CXDYiOMX.js"; +import { a as c } from "../types-Daou0lcF.js"; +function m(r) { + const a = i(!1), e = i(), s = i({ + id: 0, + slug: "", + name: "", + conditions: "", + description: "", + created_at: "", + updated_at: "", + deleted_at: null + }); + async function n() { + a.value = !0, e.value = null, await l.get("/api/permissions/p/" + r.params.id).then((t) => { + s.value = t.data; + }).catch((t) => { + e.value = { + description: "An error as occurred", + style: c.Danger, + ...t.response.data + }; + }).finally(() => { + a.value = !1; + }); + } + return o( + () => r.params.id, + () => { + n(); + }, + { immediate: !0 } + ), { permission: s, error: e, loading: a }; +} +export { + m as usePermissionApi +}; diff --git a/dist/composable/role.cjs b/dist/composable/role.cjs new file mode 100644 index 0000000..3a5b324 --- /dev/null +++ b/dist/composable/role.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("../axios-tuVKNgv9.cjs"),o=require("../types-D9XxK5BT.cjs");function i(s){const a=e.ref(!1),t=e.ref(),u=e.ref({id:0,slug:"",name:"",description:"",created_at:"",updated_at:"",deleted_at:null,users_count:0});async function l(){a.value=!0,t.value=null,await n.axios.get("/api/roles/r/"+s.params.slug).then(r=>{u.value=r.data}).catch(r=>{t.value={description:"An error as occurred",style:o.a.Danger,...r.response.data}}).finally(()=>{a.value=!1})}return e.watch(()=>s.params.slug,()=>{l()},{immediate:!0}),{role:u,error:t,loading:a}}exports.useRoleApi=i; diff --git a/dist/composable/role.js b/dist/composable/role.js new file mode 100644 index 0000000..9629f23 --- /dev/null +++ b/dist/composable/role.js @@ -0,0 +1,38 @@ +import { ref as t, watch as n } from "vue"; +import { a as i } from "../axios-CXDYiOMX.js"; +import { a as u } from "../types-Daou0lcF.js"; +function m(o) { + const e = t(!1), a = t(), s = t({ + id: 0, + slug: "", + name: "", + description: "", + created_at: "", + updated_at: "", + deleted_at: null, + users_count: 0 + }); + async function l() { + e.value = !0, a.value = null, await i.get("/api/roles/r/" + o.params.slug).then((r) => { + s.value = r.data; + }).catch((r) => { + a.value = { + description: "An error as occurred", + style: u.Danger, + ...r.response.data + }; + }).finally(() => { + e.value = !1; + }); + } + return n( + () => o.params.slug, + () => { + l(); + }, + { immediate: !0 } + ), { role: s, error: a, loading: e }; +} +export { + m as useRoleApi +}; diff --git a/dist/composable/user.cjs b/dist/composable/user.cjs new file mode 100644 index 0000000..329e0a0 --- /dev/null +++ b/dist/composable/user.cjs @@ -0,0 +1 @@ +"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("../axios-tuVKNgv9.cjs"),i=require("../types-D9XxK5BT.cjs");function o(l){const a=e.ref(!1),r=e.ref(),n=e.ref({id:0,user_name:"",first_name:"",last_name:"",full_name:"",email:"",avatar:"",flag_enabled:!1,flag_verified:!1,group_id:null,locale:"",created_at:"",updated_at:"",deleted_at:null,locale_name:"",group:null});async function s(){a.value=!0,r.value=null,await u.axios.get("/api/users/u/"+l.params.user_name).then(t=>{n.value=t.data}).catch(t=>{r.value={description:"An error as occurred",style:i.a.Danger,...t.response.data}}).finally(()=>{a.value=!1})}return e.watch(()=>l.params.user_name,()=>{s()},{immediate:!0}),{user:n,error:r,loading:a}}exports.useUserAdminApi=o; diff --git a/dist/composable/user.js b/dist/composable/user.js new file mode 100644 index 0000000..b1440e4 --- /dev/null +++ b/dist/composable/user.js @@ -0,0 +1,46 @@ +import { ref as l, watch as u } from "vue"; +import { a as i } from "../axios-CXDYiOMX.js"; +import { a as o } from "../types-Daou0lcF.js"; +function d(t) { + const a = l(!1), e = l(), n = l({ + id: 0, + user_name: "", + first_name: "", + last_name: "", + full_name: "", + email: "", + avatar: "", + flag_enabled: !1, + flag_verified: !1, + group_id: null, + locale: "", + created_at: "", + updated_at: "", + deleted_at: null, + locale_name: "", + group: null + }); + async function s() { + a.value = !0, e.value = null, await i.get("/api/users/u/" + t.params.user_name).then((r) => { + n.value = r.data; + }).catch((r) => { + e.value = { + description: "An error as occurred", + style: o.Danger, + ...r.response.data + }; + }).finally(() => { + a.value = !1; + }); + } + return u( + () => t.params.user_name, + () => { + s(); + }, + { immediate: !0 } + ), { user: n, error: e, loading: a }; +} +export { + d as useUserAdminApi +}; diff --git a/dist/routes.cjs b/dist/routes.cjs index a3b991c..6731e25 100644 --- a/dist/routes.cjs +++ b/dist/routes.cjs @@ -1 +1 @@ -"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=[{path:"dashboard",name:"admin.dashboard",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./DashboardView-Ca9Np1FZ.cjs"))}],n=[{path:"activities",name:"admin.activities",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./ActivitiesView-BAJE5Nou.cjs"))}],o=[{path:"groups",meta:{auth:{redirect:{name:"account.login"}}},children:[{path:"",name:"admin.groups",component:()=>Promise.resolve().then(()=>require("./GroupsView-BhG4LUoY.cjs"))},{path:"g/:slug",name:"admin.group",component:()=>Promise.resolve().then(()=>require("./GroupView-B9Zxi1Ld.cjs"))}]}],t=[{path:"permissions",meta:{auth:{redirect:{name:"account.login"}}},children:[{path:"",name:"admin.permissions",component:()=>Promise.resolve().then(()=>require("./PermissionsView-CvCBayBl.cjs"))},{path:"p/:id",name:"admin.permission",component:()=>Promise.resolve().then(()=>require("./PermissionView-DA4jSH36.cjs"))}]}],i=[{path:"roles",meta:{auth:{redirect:{name:"account.login"}}},children:[{path:"",name:"admin.roles",component:()=>Promise.resolve().then(()=>require("./RolesView-QwNbCCiu.cjs"))},{path:"r/:slug",name:"admin.role",component:()=>Promise.resolve().then(()=>require("./RoleView-hOODGzy4.cjs"))}]}],s=[{path:"users",meta:{auth:{redirect:{name:"account.login"}}},children:[{path:"",name:"admin.users",component:()=>Promise.resolve().then(()=>require("./UsersView-pcKDS1c8.cjs"))},{path:"u/:user_name",name:"admin.user",component:()=>Promise.resolve().then(()=>require("./UserView-DyId2fxr.cjs"))}]}],r=[...e,...n,...o,...t,...i,...s];exports.AdminActivitiesRoutes=n;exports.AdminDashboardRoutes=e;exports.AdminGroupsRoutes=o;exports.AdminPermissionsRoutes=t;exports.AdminRolesRoutes=i;exports.AdminUsersRoutes=s;exports.default=r; +"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=[{path:"dashboard",name:"admin.dashboard",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./DashboardView-CWp-PKI3.cjs"))}],n=[{path:"activities",name:"admin.activities",meta:{auth:{redirect:{name:"account.login"}}},component:()=>Promise.resolve().then(()=>require("./ActivitiesView-BAJE5Nou.cjs"))}],o=[{path:"groups",meta:{auth:{redirect:{name:"account.login"}}},children:[{path:"",name:"admin.groups",component:()=>Promise.resolve().then(()=>require("./GroupsView-BHzd4Ctz.cjs"))},{path:"g/:slug",name:"admin.group",component:()=>Promise.resolve().then(()=>require("./GroupView-DPKgjvQ-.cjs"))}]}],t=[{path:"permissions",meta:{auth:{redirect:{name:"account.login"}}},children:[{path:"",name:"admin.permissions",component:()=>Promise.resolve().then(()=>require("./PermissionsView-CvCBayBl.cjs"))},{path:"p/:id",name:"admin.permission",component:()=>Promise.resolve().then(()=>require("./PermissionView-D7AlKrvO.cjs"))}]}],i=[{path:"roles",meta:{auth:{redirect:{name:"account.login"}}},children:[{path:"",name:"admin.roles",component:()=>Promise.resolve().then(()=>require("./RolesView-QwNbCCiu.cjs"))},{path:"r/:slug",name:"admin.role",component:()=>Promise.resolve().then(()=>require("./RoleView-D81Ok2n6.cjs"))}]}],s=[{path:"users",meta:{auth:{redirect:{name:"account.login"}}},children:[{path:"",name:"admin.users",component:()=>Promise.resolve().then(()=>require("./UsersView-pcKDS1c8.cjs"))},{path:"u/:user_name",name:"admin.user",component:()=>Promise.resolve().then(()=>require("./UserView-CwaDFjUI.cjs"))}]}],r=[...e,...n,...o,...t,...i,...s];exports.AdminActivitiesRoutes=n;exports.AdminDashboardRoutes=e;exports.AdminGroupsRoutes=o;exports.AdminPermissionsRoutes=t;exports.AdminRolesRoutes=i;exports.AdminUsersRoutes=s;exports.default=r; diff --git a/dist/routes.js b/dist/routes.js index 3ccaec2..e107505 100644 --- a/dist/routes.js +++ b/dist/routes.js @@ -7,7 +7,7 @@ const n = [ redirect: { name: "account.login" } } }, - component: () => import("./DashboardView-Cgrx0SLr.js") + component: () => import("./DashboardView-DuV7cK9X.js") } ], t = [ { @@ -32,12 +32,12 @@ const n = [ { path: "", name: "admin.groups", - component: () => import("./GroupsView-FYEMxd2t.js") + component: () => import("./GroupsView-B5AdZnnE.js") }, { path: "g/:slug", name: "admin.group", - component: () => import("./GroupView-2Qy5dhaD.js") + component: () => import("./GroupView-C-pLYY6K.js") } ] } @@ -59,7 +59,7 @@ const n = [ path: "p/:id", // permissions/p/{id} name: "admin.permission", - component: () => import("./PermissionView-DhQK9SjC.js") + component: () => import("./PermissionView-CwSmb9ry.js") } ] } @@ -81,7 +81,7 @@ const n = [ path: "r/:slug", // roles/r/{slug} name: "admin.role", - component: () => import("./RoleView-DVIlQDeW.js") + component: () => import("./RoleView-CuY3whsc.js") } ] } @@ -103,7 +103,7 @@ const n = [ path: "u/:user_name", // users/u/{user_name} name: "admin.user", - component: () => import("./UserView-CWu0vErB.js") + component: () => import("./UserView-BWWqdCs9.js") } ] } diff --git a/dist/views/Group/GroupCreateForm.vue.d.ts b/dist/views/Group/GroupCreateForm.vue.d.ts new file mode 100644 index 0000000..11b55c1 --- /dev/null +++ b/dist/views/Group/GroupCreateForm.vue.d.ts @@ -0,0 +1,8 @@ +declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, { + cancel: (...args: any[]) => void; + saved: (...args: any[]) => void; +}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{ + onCancel?: ((...args: any[]) => any) | undefined; + onSaved?: ((...args: any[]) => any) | undefined; +}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>; +export default _default; diff --git a/dist/views/Group/GroupCreateModal.vue.d.ts b/dist/views/Group/GroupCreateModal.vue.d.ts new file mode 100644 index 0000000..2a9e71a --- /dev/null +++ b/dist/views/Group/GroupCreateModal.vue.d.ts @@ -0,0 +1,2 @@ +declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>; +export default _default; diff --git a/package.json b/package.json index 3b2bd93..3da3718 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,11 @@ "require": "./dist/components.cjs", "types": "./dist/components/index.d.ts" }, + "./composable/*": { + "import": "./dist/composable/*.js", + "require": "./dist/composable/*.cjs", + "types": "./dist/composable/*.d.ts" + }, "./routes": { "import": "./dist/routes.js", "require": "./dist/routes.cjs", diff --git a/vite.config.ts b/vite.config.ts index eef88db..13c4f4a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -15,7 +15,11 @@ export default defineConfig({ entry: { plugin: 'app/assets/plugin.ts', components: 'app/assets/components/index.ts', - // composables: 'app/assets/composables/index.ts', + 'composable/dashboard': 'app/assets/composable/dashboard.ts', + 'composable/group': 'app/assets/composable/group.ts', + 'composable/permission': 'app/assets/composable/permission.ts', + 'composable/role': 'app/assets/composable/role.ts', + 'composable/user': 'app/assets/composable/user.ts', // types: 'app/assets/interfaces/index.ts', // guards: 'app/assets/guards/authGuard.ts', // stores: 'app/assets/stores/auth.ts'