1import{o as y,F as L,b as n,aW as P,X as D,a3 as B,C as M,an as N,V as f,a as c,e as m,g as p,f as b,h as G,_ as d,c as w}from"./index-f5c6f890.js";import{m as x}from"./index-3339eeb3.js";import{h as C}from"./helpers-96750fec.js";import{_ as v}from"./VRow-477f36c2.js";import{_ as r}from"./VCol-4e2e67ec.js";import{_ as R}from"./VSwitch-f22141e3.js";import{_ as S}from"./VTooltip-184ef230.js";import{S as h,p as A,R as E}from"./index-e5fee4e1.js";import{V as o,a as F,_}from"./VTextField-3c24aecf.js";import{B as I}from"./VItemGroup-0e94dc6d.js";import{_ as V}from"./VForm-55d1fac3.js";import{_ as $}from"./VDivider-266197a4.js";import{_ as k}from"./VSpacer-1dacdb07.js";import{t as T}from"./table-params-24e95c2b.js";import{t as z}from"./table-filters-8bf6c1b2.js";import{t as q,P as O}from"./Paginator-ad029ac0.js";import{t as j}from"./table-search-0864eeb9.js";import{r as K,_ as U}from"./resizable-columns-ddc521e5.js";import{T as W}from"./TableSearch-a9992141.js";import"./index-f3fc42ae.js";import"./index-3afa7640.js";import"./index-b5848854.js";import"./VSelect-6efada6f.js";import"./index-f54e2dd6.js";import"./VCheckbox-5d96f5a3.js";const X=y(I,o),H=X.extend({name:"v-radio-group",provide(){return{radioGroup:this}},props:{column:{type:Boolean,default:!0},height:{type:[Number,String],default:"auto"},name:String,row:Boolean,value:null},computed:{classes(){return{...o.options.computed.classes.call(this),"v-input--selection-controls v-input--radio-group":!0,"v-input--radio-group--column":this.column&&!this.row,"v-input--radio-group--row":this.row}}},methods:{genDefaultSlot(){return this.$createElement("div",{staticClass:"v-input--radio-group__input",attrs:{id:this.id,role:"radiogroup","aria-labelledby":this.computedId}},o.options.methods.genDefaultSlot.call(this))},genInputSlot(){const i=o.options.methods.genInputSlot.call(this);return delete i.data.on.click,i},genLabel(){const i=o.options.methods.genLabel.call(this);return i?(i.data.attrs.id=this.computedId,delete i.data.attrs.for,i.tag="legend",i):null},onClick:I.options.methods.onClick},render(i){const t=o.options.render.call(this,i);return this._b(t.data,"div",this.attrs$),t}});const J=y(N,M,E,B("radioGroup"),D),g=J.extend().extend({name:"v-radio",inheritAttrs:!1,props:{disabled:Boolean,id:String,label:String,name:String,offIcon:{type:String,default:"$radioOff"},onIcon:{type:String,default:"$radioOn"},readonly:Boolean,value:{default:null}},data:()=>({isFocused:!1}),computed:{classes(){return{"v-radio--is-disabled":this.isDisabled,"v-radio--is-focused":this.isFocused,...this.themeClasses,...this.groupClasses}},computedColor(){if(!this.isDisabled)return h.options.computed.computedColor.call(this)},computedIcon(){return this.isActive?this.onIcon:this.offIcon},computedId(){return o.options.computed.computedId.call(this)},hasLabel:o.options.computed.hasLabel,hasState(){return(this.radioGroup||{}).hasState},isDisabled(){return this.disabled||!!this.radioGroup&&this.radioGroup.isDisabled},isReadonly(){return this.readonly||!!this.radioGroup&&this.radioGroup.isReadonly},computedName(){return this.name||!this.radioGroup?this.name:this.radioGroup.name||`radio-${this.radioGroup._uid}`},rippleState(){return h.options.computed.rippleState.call(this)},validationState(){return(this.radioGroup||{}).validationState||this.computedColor}},methods:{genInput(i){return h.options.methods.genInput.call(this,"radio",i)},genLabel(){return this.hasLabel?this.$createElement(F,{on:{click:A},attrs:{for:this.computedId},props:{color:this.validationState,focused:this.hasState}},L(this,"label")||this.label):null},genRadio(){const{title:i,...t}=this.attrs$;return this.$createElement("div",{staticClass:"v-input--selection-controls__input"},[this.$createElement(n,this.setTextColor(this.validationState,{props:{dense:this.radioGroup&&this.radioGroup.dense}}),this.computedIcon),this.genInput({name:this.computedName,value:this.value,...t}),this.genRipple(this.setTextColor(this.rippleState))])},onFocus(i){this.isFocused=!0,this.$emit("focus",i)},onBlur(i){this.isFocused=!1,this.$emit("blur",i)},onChange(){this.isDisabled||this.isReadonly||this.isActive||this.toggle()},onKeydown:()=>{}},render(i){const t={staticClass:"v-radio",class:this.classes,on:P({click:this.onChange},this.listeners$),attrs:{title:this.attrs$.title}};return i("div",t,[this.genRadio(),this.genLabel()])}}),Q=f.extend({name:"RightsRadio",props:{rights:{required:!0},selectedRights:{required:!0}},data:()=>({}),watch:{selectedRights:{deep:!0,handler(){this.$emit("update",this.selectedRights)}}},methods:{}});var Y=function(){var t=this,e=t._self._c;return t._self._setupProxy,e(v,t._l(t.rights,function(s,u){return e(r,{key:u,staticClass:"d-flex align-center",attrs:{cols:"12",lg:"
16"}},[e(R,{staticClass:"mt-0",attrs:{label:s.name,dense:"","hide-details":""},model:{value:t.selectedRights[s.id],callback:function(a){t.$set(t.selectedRights,s.id,a)},expression:"selectedRights[item.id]"}}),s.rights?e(S,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:a,attrs:l}){return[e(n,t._g(t._b({staticClass:"ml-2",attrs:{color:"primary"}},"v-icon",l,!1),a),[t._v(" mdi-information-outline ")])]}}],null,!0)},[e("div",t._l(s.rights,function(a,l){return e("p",{key:l,staticClass:"mb-0"},[t._v(" "+t._s(a.name)+" ")])}),0)]):t._e()],1)}),1)},Z=[],tt=c(Q,Y,Z,!1,null,null,null,null);const et=tt.exports,st=f.extend({name:"RightsRadioGroup",props:{rights:{required:!0},overrideRights:{required:!0}}});var it=function(){var t=this,e=t._self._c;return t._self._setupProxy,e(v,t._l(t.rights,function(s,u){return e(r,{key:u,staticClass:"d-flex align-center pt-1 pb-0",attrs:{cols:"12",lg:"6"}},[e(H,{staticClass:"mt-0",attrs:{dense:"","hide-details":"",mandatory:""},model:{value:t.overrideRights[s.id],callback:function(a){t.$set(t.overrideRights,s.id,a)},expression:"overrideRights[item.id]"}},[e("div",{staticClass:"d-flex flex-column-reverse"},[e(g,{staticClass:"my-0",attrs:{label:t.$t("view.label.right.keep"),color:"#666666",dense:"","hide-details":"",mandatory:"",value:"keep"}}),e(g,{staticClass:"my-0",attrs:{label:t.$t("view.label.right.deny"),color:"error",dense:"","hide-details":"",value:"deny"}}),e(g,{staticClass:"my-0",attrs:{label:t.$t("view.label.right.grant"),color:"primary",dense:"","hide-details":"",value:"grant"}})],1)]),e("span",{staticClass:"ml-2"},[t._v(" "+t._s(s.name)+" ")]),s.rights?e(S,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:a,attrs:l}){return[e(n,t._g(t._b({staticClass:"ml-2",attrs:{color:"primary"}},"v-icon",l,!1),a),[t._v(" mdi-information-outline ")])]}}],null,!0)},[e("div",t._l(s.rights,function(a,l){return e("p",{key:l,staticClass:"mb-0"},[t._v(" "+t._s(a.name)+" ")])}),0)]):t._e()],1)}),1)},at=[],rt=c(st,it,at,!1,null,null,null,null);const ot=rt.exports,lt=x(C).extend({name:"RoleCreate",components:{RightsRadioGroup:ot,RightsRadio:et},data:()=>({model:{name:"",publicName:"",roleLevel:0,allowExpiredSubscription:!1},publicName:"",rights:[],groups:{},selectedRights:{},overrideRights:{},editMode:!1,initLoading:!0,loading:!1}),async mounted(){this.initLoading=!0,await this.loadData(),this.initLoading=!1},methods:{async loadData(){this.loading=!0;try{Number(this.$route.params.id)&&(this.editMode=!0);const i=this.editMode?this.$API.auth().getEditByModule("roles",this.$route.params.id):Promise.resolve(),[t,e,s]=await Promise.all([this.$API.auth().getDataByModule("rights"),this.$API.auth().getDataByModule("rightgroups"),i]);this.setServerResponse(t,e,s)}catch(i){await this.$store.dispatch("alert/showError",i.message||i)}this.loading=!1},setServerResponse(i,t,e){if(this.rights=[...t.items,...i.items],this.editMode){this.model=e;for(const s of this.model._embedded.rights)this.selectedRights[s.id]=!0;for(const s of this.model._embedded.denyRights)this.overrideRights[s.id]="deny";for(const s of this.model._embedded.grantRights)this.overrideRights[s.id]="grant";this.$forceUpdate()}},async submit(){this.loading=!0;try{if(this.$refs.form.validate()){const i={id:null,...this.model,roleLevel:Number(this.model.roleLevel),rights:this.getIdsOfType(this.selectedRights),grantRights:this.getIdsOfType(this.overrideRights,"grant"),denyRights:this.getIdsOfType(this.overrideRights,"deny")};this.editMode?await this.$API.auth().updateByModuleName("roles",this.$route.params.id,i):await this.$API.auth().createByModuleName("roles",i),await this.$router.push(`/administration/${this.$route.params.module}`),await this.$store.dispatch("alert/showSuccess",this.$t("administration.message.role_save_success"))}}catch(i){await this.setErrorMessages(i,this.$t("administration.message.role_save_error"))}this.loading=!1},getIdsOfType(i,t){return Object.entries(i).filter(([,e])=>t?e===t:e).map(([e])=>e)}}});var nt=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{staticClass:"pt-2"},[t.initLoading?e("div",{staticClass:"loader-container force-centered"},[e(w,{attrs:{color:"primary",indeterminate:"",size:"56"}})],1):e(m,{staticClass:"transparent",attrs:{flat:""}},[e(p,{staticClass:"px-0"}
1,[e(V,{ref:"form",attrs:{"lazy-validation":""},on:{submit:function(s){s.preventDefault()}}},[e(v,[e(r,{staticClass:"py-0",attrs:{cols:"6"}},[e("custom-input",{attrs:{label:t.$t("view.label.role.name"),required:""}},[e(_,{attrs:{"error-messages":t.errorMessages.publicName,rules:[t.$rules.required()],outlined:"",dense:""},model:{value:t.model.publicName,callback:function(s){t.$set(t.model,"publicName",s)},expression:"model.publicName"}})],1)],1),e(r,{staticClass:"py-0",attrs:{cols:"6"}},[e("custom-input",{attrs:{label:t.$t("view.label.role.internalName"),required:""}},[e(_,{attrs:{"error-messages":t.errorMessages.name,rules:[t.$rules.required()],outlined:"",dense:""},model:{value:t.model.name,callback:function(s){t.$set(t.model,"name",s)},expression:"model.name"}})],1)],1),e(r,{staticClass:"py-0",attrs:{cols:"6"}},[e("custom-input",{attrs:{label:t.$t("view.label.role.roleLevel"),required:""}},[e(_,{attrs:{"error-messages":t.errorMessages.roleLevel,rules:[t.$rules.required()],type:"number",outlined:"",dense:""},model:{value:t.model.roleLevel,callback:function(s){t.$set(t.model,"roleLevel",s)},expression:"model.roleLevel"}})],1)],1),e(r,{staticClass:"py-0",attrs:{cols:"6"}},[e(R,{staticClass:"mt-2",attrs:{label:t.$t("view.label.role.allowExpiredSubscription"),"hide-details":""},model:{value:t.model.allowExpiredSubscription,callback:function(s){t.$set(t.model,"allowExpiredSubscription",s)},expression:"model.allowExpiredSubscription"}})],1),e(r,{attrs:{cols:"12"}},[e(m,{staticClass:"transparent",attrs:{flat:""}},[e(b,[t._v(" "+t._s(t.$t("view.label.right.rights"))+" ")]),e($,{staticClass:"full-width"}),e(p,[e("rights-radio",{attrs:{rights:t.rights,"selected-rights":t.selectedRights}})],1)],1)],1),e(r,{attrs:{cols:"12"}},[e(m,{staticClass:"transparent",attrs:{flat:""}},[e(b,[t._v(" "+t._s(t.$t("view.label.role.explicitRights"))+" ")]),e($,{staticClass:"full-width"}),e(p,[e("rights-radio-group",{attrs:{rights:t.rights,"override-rights":t.overrideRights}}
1)],1)],1)],1)],1)],1)],1),e(G,{staticClass:"px-0"},[e(k),e(d,{attrs:{disabled:t.loading,to:`/administration/${this.$route.params.module}`,link:"",outlined:""}},[t._v(" "+t._s(t.$t("view.label.cancel"))+" ")]),e(d,{directives:[{name:"submit-form",rawName:"v-submit-form"}],attrs:{depressed:"",disabled:t.loading}},[t._v(" "+t._s(t.$t("view.label.save"))+" ")])],1)],1)],1)},dt=[],ct=c(lt,nt,dt,!1,null,null,null,null);const ut=ct.exports,mt=[{text:"name",value:"publicName",sortable:!0},{text:"roleLevel",value:"roleLevel",sortable:!0},{text:"ctime",value:"ctime",sortable:!0},{text:"mtime",value:"mtime",sortable:!0},{text:"",value:"actions",width:"100%",cellClass:"actions"}],pt=x(q,z,T,j,C).extend({name:"RoleOverview",directives:{resizableColumns:K},components:{Paginator:O,TableSearch:W},data:()=>({headers:mt,items:[],searchField:"name",initLoading:!0,loading:!0}),async mounted(){this.initLoading=!0,await this.loadData(),this.initLoading=!1},methods:{async loadData(){this.loading=!0;try{const i=await this.$API.auth().getDataByModule("roles",{limit:50,offset:0});this.items=i.items,this.totalItems=i.total}catch(i){await this.$store.dispatch("alert/showError",i.message||i)}this.loading=!1},async deleteItem(i){this.loading=!0;try{await this.$API.auth().deleteByModule("roles",i),await this.loadData(),await this.$store.dispatch("alert/showSuccess",this.$t("alert.delete_success"))}catch(t){await this.$store.dispatch("alert/showError",t.message||t)}this.loading=!1},editItem(i,{item:t}){this.$router.push(`/administration/role/${t.id}`)}}});var ht=function(){var t=this,e=t._self._c;return t._self._setupProxy,e("div",{staticStyle:{position:"sticky",top:"0","z-index":"3"}},[e("div",{staticClass:"px-1 mb-6 d-flex align-center",staticStyle:{"min-height":"40px"}},[e("table-search",{staticClass:"custom-text-field background ml-3",attrs:{loading:t.loading},model:{value:t.search,callback:function(s){t.search=s},expression:"search"}}),e(k),e(d,{staticClass:"text-normalize custom-button",attrs:{disabled:t.loading,to:"/administration/role/create",link:"",small:"",text:"",tile:""}},[e(n,{staticClass:"mr-1",attrs:{size:"18"}},[t._v(" mdi-plus-circle-outline")]),e("span",{staticClass:"font-12 letter-spacing-none"},[t._v(" "+t._s(t.$t("view.label.add_new"))+" ")])],1)],1),t.initLoading?e("div",{staticClass:"loader-container force-centered"},[e(w,{attrs:{color:"primary",indeterminate:"",size:"56"}})],1):e("div",[e("div",{staticClass:"table-container"},[e(U,{directives:[{name:"resizable-columns",rawName:"v-resizable-columns",value:t.handleSortClick,expression:"handleSortClick"}],key:t.$store.getters["localization/getCurrent"],ref:"table",attrs:{headers:t.headers,items:t.currentItems,"items-per-page":t.pagination.limit,page:t.pagination.number,search:t.search,"visible-items":t.currentItems.length,"sort-by":t.sortBy,"sort-desc":t.sortDesc,"hide-default-footer":"","disable-sort":""},on:{"update:page":function(s){return t.$set(t.pagination,"number",s)},"update:sortBy":function(s){t.sortBy=s},"update:sort-by":function(s){t.sortBy=s},"update:sortDesc":function(s){t.sortDesc=s},"update:sort-desc":function(s){t.sortDesc=s},"dblclick:row":t.editItem},scopedSlots:t._u([{key:"item.ctime",fn:function({item:s}){return[e("span",{attrs:{title:`${t.$moment(s.ctime*1e3).format("lll")}`}},[t._v(" "+t._s(t.$moment(s.ctime*1e3).format("ll"))+" ")])]}},{key:"item.mtime",fn:function({item:s}){return[e("span",{attrs:{title:`${t.$moment(s.mtime*1e3).format("lll")}`}},[t._v(" "+t._s(t.$moment(s.mtime*1e3).format("ll"))+" ")])]}},{key:"item.actions",fn:function({item:s}){return[e("div",{staticClass:"d-inline-flex actions-container"},[e(d,{attrs:{to:`${t.$route.params.module}/${s.id}`,icon:"",link:"",small:"",title:t.$t("view.label.edit")}},[e(n,[t._v(" mdi-pencil")])],1),e(d,{directives:[{name:"confirm",rawName:"v-confirm",value:{title:`${t.$t("view.message.delete_entity_item_new",{entity:t.$t("view.label.role"),item:s.name})}`,message:t.$t("alert.deletion_text"),callback:()=>t.deleteItem(s.id)},expression:`{ 2 title: \`\${$t( 3 'view.message.delete_entity_item_new', 4 { 5 entity: $t('view.label.role'), 6 item: item.name, 7 } 8 )}\`, 9 message: $t('alert.deletion_text'), 10 callback: () => deleteItem(item.id), 11 }`}],attrs:{icon:"",small:"",title:t.$t("view.label.delete")}},[e(n,[t._v(" mdi-delete-empty")])],1)],1)]}}],null,!1,1287462573)})],1),e("paginator",{staticClass:"pl-4",attrs:{items:t.currentItems,"last-page":t.pagesAmount,pagination:t.pagination,"paginator-values":t.itemsPerPageOptions,"total-items":t.totalItems,value:t.pagination.number,"visible-items":t.currentItems.length},on:{input:t.changeTablePagination}})],1)])},_t=[],gt=c(pt,ht,_t,!1,null,"06dc3123",null,null);
11const ft=gt.exports,vt=f.extend({name:"RoleCreate",components:{create:ut,overview:ft},data:()=>({view:""}),watch:{$route(){this.setView()}},mounted(){this.setView()},methods:{setView(){this.$route.params.id?this.view="create":this.view="overview"}}});var bt=function(){var t=this,e=t._self._c;return t._self._setupProxy,t.view?e("div",{staticClass:"pt-4"},[e(t.view,{tag:"component"})],1):t._e()},$t=[],yt=c(vt,bt,$t,!1,null,null,null,null);const Wt=yt.exports;export{Wt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.