1import{A as a}from"./AdminLayout-57dc5f12.js";import{S as i}from"./StormTable-491a26b1.js";import{P as l}from"./Panel-de5921e6.js";import{n as o,M as m,T as d}from"./TinyLoader-e1334c42.js";import{F as _}from"./FormInputText-cf525302.js";import{F as c}from"./FormLabel-943afb18.js";import{F as p}from"./FormButton-7119406c.js";import{C as u}from"./Copy-89ea34f7.js";import"./SlugMixin-6e7b0b82.js";import"./ContextNav-3fa9c819.js";import"./NavigationMixin-22905720.js";import"./PermissionHelper-5563b281.js";import"./ConfirmedModal-47049401.js";import"./CheckBoxIcon-09a6c1d2.js";import"./FormSelect-6aff47ac.js";const f={name:"NewApiUserModal",components:{Modal:m,FormInputText:_,FormLabel:c,FormButton:p},data(){return{show:!1,name:""}},methods:{openModal(){this.show=!0},closeModal(){this.show=!1,this.name=""},storeApiUser(){this.$http.post(Storm.admin.apiUrl+"/api-users",{name:this.name}).then(s=>{this.$emit("saved",s.data.data),this.closeModal()})}}};var v=function(){var e=this,t=e._self._c;return t("div",[t("button",{staticClass:"button",on:{click:e.openModal}},[e._v(" Add ")]),t("modal",{attrs:{show:e.show,"show-footer":!1},on:{"close-modal":e.closeModal},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" Add new Api User ")]},proxy:!0}])},[t("div",{staticClass:"form"},[t("div",{staticClass:"form-row"},[t("form-label",{attrs:{name:"name"}},[e._v(" Name ")]),t("form-input-text",{attrs:{id:"api_user_name",name:"name",autofocus:""},model:{value:e.name,callback:function(r){e.name=r},expression:"name"}})],1),t("div",{staticClass:"form-row"},[t("form-button",{attrs:{right:""},on:{click:e.storeApiUser}},[e._v(" Save ")])],1)])])],1)},h=[],y=o(f,v,h,!1,null,null,null,null);const A=y.exports;const U={name:"ApiUsers",components:{StormTable:i,Panel:l,NewApiUserModal:A,Copy:u,TinyLoader:d},data(){return{loading:!0,users:[]}},mounted(){this.indexApiUsers()},methods:{addUserToIndex(s){this.users.unshift(s)},indexApiUsers(){this.$http.get(Storm.admin.apiUrl+"/api-users").then(s=>{this.users=s.data.data,this.loading=!1})}}};var x=function(){var e=this,t=e._self._c;return t("panel",{attrs:{"hide-subtitle":""},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(" API Users ")]},proxy:!0},{key:"info",fn:function(){return[e._v(" These users have access to some restricted API end points. ")]},proxy:!0},{key:"side",fn:function(){return[t("new-api-user-modal",{on:{saved:e.addUserToIndex}})]},proxy:!0}])},[t("storm-table",{staticClass:"mt-2",scopedSlots:e._u([{key:"head",fn:function(){return[t("tr",[t("th",[e._v("Name")]),t("th",[e._v("Key")])])]},proxy:!0}])},[e._l(e.users,function(r,n){return!e.loading&&e.users.length?t("tr",{key:n},[t("td",[e._v(e._s(r.name))]),t("td",[t("copy",{attrs:{value:r.key}})],1)]):e._e()}),!e.loading&&!e.users.length?t("tr",[t("td",{attrs:{colspan:"2"}},[e._v(" There are no API Users. ")])]):e._e(),e.loading?t("tr",[t("td",{staticClass:"flex",attrs:{colspan:"2"}},[t("tiny-loader",{staticClass:"mr-2"}),e._v(" Loading... ")],1)]):e._e()],2)],1)},g=[],w=o(U,x,g,!1,null,"5c2f043f",null,null);const $=w.exports;const b={name:"AdminApiUsers",components:{ApiUsers:$,AdminLayout:a}};var k=function(){var e=this,t=e._self._c;return t("admin-layout",[t("api-users")],1)},C=[],F=o(b,k,C,!1,null,"7ba5fd41",null,null);const G=F.exports;export{G 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.