1"use strict";(globalThis["webpackChunkdatabase2ui"]=globalThis["webpackChunkdatabase2ui"]||[]).push([[311],{1311(t,e,a){a.r(e),a.d(e,{default:()=>pt});var s=a(641),i=a(33),o=a(3751);const n={class:"container mt-4 mb-5 text-secondary"},l={class:"row mb-3 align-items-center"},r={class:"col-12 col-md-8"},c={key:0,class:"mb-0"},d={key:1,class:"mb-0"},g={class:"card"},h={class:"card-body"},m={class:"row"},p={class:"col-12"},u=["disabled"],b={key:0,class:"alert alert-danger mt-3 mb-0"},k={key:1,class:"card mt-3"},L={key:2,class:"card mt-3"},v={class:"card-body"},C={class:"table-responsive"},y={class:"table mb-0 align-middle"},f={scope:"col"},w=["disabled"],I={scope:"col"},P=["disabled"],E={scope:"col"},A=["disabled"],_={scope:"col"},T=["disabled"],x={class:"text-nowrap"},S={class:"text-nowrap"},M={class:"text-nowrap"},X={class:"d-block"},$={key:0,class:"small text-muted me-1"},D=["href"],N={class:"text-nowrap"},Q=["href"],W={key:3,class:"card mt-3"},F={class:"card-body py-2"},O={class:"row align-items-center"},U={class:"col-12 col-md-5 mb-2 mb-md-0"},B={class:"text-muted"},R={class:"col-12 col-md-7"},Y={"aria-label":"Change log pages"},K={class:"pagination justify-content-md-end mb-0"},j=["disabled"],z=["disabled"],V=["onClick","disabled"],J=["disabled"],Z=["disabled"];function q(t,e,a,q,G,H){return(0,s.uX)(),(0,s.CE)("div",null,[(0,s.Lk)("div",n,[(0,s.Lk)("div",l,[(0,s.Lk)("div",r,[e[10]||(e[10]=(0,s.Lk)("h2",{class:"decorativeUnderline text-uppercase text-light"},"Change Log",-1)),G.total>0?((0,s.uX)(),(0,s.CE)("p",c," Showing "+(0,i.v_)(H.startItem.toLocaleString())+"-"+(0,i.v_)(H.endItem.toLocaleString())+" of "+(0,i.v_)(G.total.toLocaleString())+" changes ",1)):(0,s.Q3)("",!0),G.loading||0!=G.total?(0,s.Q3)("",!0):((0,s.uX)(),(0,s.CE)("p",d,"No changes found."))]),e[11]||(e[11]=(0,s.Lk)("div",{class:"col-12 col-md-4"},[(0,s.Lk)("a",{href:"/pending",target:"_blank",class:"btn btn-primary float-md-end mt-3 mt-md-0"},"Pending Items")],-1))]),(0,s.Lk)("div",g,[(0,s.Lk)("div",h,[(0,s.Lk)("div",m,[(0,s.Lk)("div",p,[e[12]||(e[12]=(0,s.Lk)("label",{class:"form-label"},"Search:",-1)),(0,s.bo)((0,s.Lk)("input",{type:"text",class:"form-control","onUpdate:modelValue":e[0]||(e[0]=t=>G.search=t),onInput:e[1]||(e[1]=(...t)=>H.onSearchInput&&H.onSearchInput(...t)),disabled:G.loading,placeholder:"Search by item type, item id, or editor",autocomplete:"off"},null,40,u),[[o.Jo,G.search]])])])])]),G.errorMessage?((0,s.uX)(),(0,s.CE)("div",b,(0,i.v_)(G.errorMessage),1)):(0,s.Q3)("",!0),G.loading&&0==G.changes.length?((0,s.uX)(),(0,s.CE)("div",k,[...e[13]||(e[13]=[(0,s.Lk)("div",{class:"card-body text-center"},[(0,s.Lk)("h4",{class:"d-inline-block me-3 text-secondary mb-0"},"Loading..."),(0,s.Lk)("div",{class:"spinner-border text-secondary d-inline-block",role:"status"},[(0,s.Lk)("span",{class:"visually-hidden"},"Loading...")])],-1)])])):(0,s.Q3)("",!0),G.changes.length>0?((0,s.uX)(),(0,s.CE)("div",L,[(0,s.Lk)("div",v,[(0,s.Lk)("div",C,[(0,s.Lk)("table",y,[(0,s.Lk)("thead",null,[(0,s.Lk)("tr",null,[(0,s.Lk)("th",f,[(0,s.Lk)("button",{class:"btn btn-link table-sort-btn p-0",onClick:e[2]||(e[2]=t=>H.setSort("itemType")),disabled:G.loading},[e[14]||(e[14]=(0,s.eW)(" Item Type ",-1)),(0,s.Lk)("i",{class:(0,i.C4)(H.sortIcon("itemType"))},null,2)],8,w)]),(0,s.Lk)("th",I,[(0,s.Lk)("button",{class:"btn btn-link table-sort-btn p-0",onClick:e[3]||(e[3]=t=>H.setSort("itemId")),disabled:G.loading},[e[15]||(e[15]=(0,s.eW)(" Item ID ",-1)),(0,s.Lk)("i",{class:(0,i.C4)(H.sortIcon("itemId"))},null,2)],8,P)]),(0,s.Lk)("th",E,[(0,s.Lk)("button",{class:"btn btn-link table-sort-btn p-0",onClick:e[4]||(e[4]=t=>H.setSort("changedAt")),disabled:G.loading},[e[16]||(e[16]=(0,s.eW)(" Changed When ",-1)),(0,s.Lk)("i",{class:(0,i.C4)(H.sortIcon("changedAt"))},null,2)],8,A)]),(0,s.Lk)("th",_,[(0,s.Lk)("button",{class:"btn btn-link table-sort-btn p-0",onClick:e[5]||(e[5]=t=>H.setSort("actorName")),disabled:G.loading},[e[17]||(e[17]=(0,s.eW)(" Changed By ",-1)),(0,s.Lk)("i",{class:(0,i.C4)(H.sortIcon("actorName"))},null,2)],8,T)]),e[18]||(e[18]=(0,s.Lk)("th",{scope:"col"},"Link To Item",-1))])]),(0,s.Lk)("tbody",null,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(G.changes,t=>((0,s.uX)(),(0,s.CE)("tr",{key:t.eventId},[(0,s.Lk)("td",x,(0,i.v_)(t.itemType),1),(0,s.Lk)("td",S,(0,i.v_)(t.itemId),1),(0,s.Lk)("td",M,(0,i.v_)(H.getDate(t.changedAt)),1),(0,s.Lk)("td",null,[((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(t.actors,(e,a)=>((0,s.uX)(),(0,s.CE)("div",{key:`${t.eventId}-actor-${a}`,class:(0,i.C4)({"mb-1":a<t.actors.length-1})},[(0,s.Lk)("span",X,[H.showActorLabel(t.actors,e)?((0,s.uX)(),(0,s.CE)("span",$,(0,i.v_)(e.label)+": ",1)):(0,s.Q3)("",!0),(0,s.eW)(" "+(0,i.v_)(e.name||"Unknown"),1)]),e.email?((0,s.uX)(),(0,s.CE)("a",{key:0,href:"mailto:"+e.email,class:"small text-decoration-none"},(0,i.v_)(e.email),9,D)):(0,s.Q3)("",!0)],2))),128))]),(0,s.Lk)("td",N,[(0,s.Lk)("a",{href:t.itemPath,target:"_blank",class:"text-decoration-none"}," Open "+(0,i.v_)(t.itemType),9,Q)])]))),128))])])])])])):(0,s.Q3)("",!0),G.changes.length>0?((0,s.uX)(),(0,s.CE)("div",W,[(0,s.Lk)("div",F,[(0,s.Lk)("div",O,[(0,s.Lk)("div",U,[(0,s.Lk)("small",B,"Page "+(0,i.v_)(G.page.toLocaleStr
1ing())+" of "+(0,i.v_)(H.totalPages.toLocaleString()),1)]),(0,s.Lk)("div",R,[(0,s.Lk)("nav",Y,[(0,s.Lk)("ul",K,[(0,s.Lk)("li",{class:(0,i.C4)(["page-item",{disabled:G.page<=1}])},[(0,s.Lk)("button",{class:"page-link",onClick:e[6]||(e[6]=t=>H.goToPage(1)),disabled:G.loading||G.page<=1},"First",8,j)],2),(0,s.Lk)("li",{class:(0,i.C4)(["page-item",{disabled:G.page<=1}])},[(0,s.Lk)("button",{class:"page-link",onClick:e[7]||(e[7]=t=>H.goToPage(G.page-1)),disabled:G.loading||G.page<=1},"Prev",8,z)],2),((0,s.uX)(!0),(0,s.CE)(s.FK,null,(0,s.pI)(H.visiblePages,t=>((0,s.uX)(),(0,s.CE)("li",{class:(0,i.C4)(["page-item",{active:t==G.page}]),key:t},[(0,s.Lk)("button",{class:"page-link",onClick:e=>H.goToPage(t),disabled:G.loading},(0,i.v_)(t),9,V)],2))),128)),(0,s.Lk)("li",{class:(0,i.C4)(["page-item",{disabled:G.page>=H.totalPages}])},[(0,s.Lk)("button",{class:"page-link",onClick:e[8]||(e[8]=t=>H.goToPage(G.page+1)),disabled:G.loading||G.page>=H.totalPages},"Next",8,J)],2),(0,s.Lk)("li",{class:(0,i.C4)(["page-item",{disabled:G.page>=H.totalPages}])},[(0,s.Lk)("button",{class:"page-link",onClick:e[9]||(e[9]=t=>H.goToPage(H.totalPages)),disabled:G.loading||G.page>=H.totalPages},"Last",8,Z)],2)])])])])])])):(0,s.Q3)("",!0)])])}var G=a(6432),H=a(3363),tt=a(120);const et="changes";class at{getAll(t,e,a,s){return G.A.get(et,{params:{page:t,limit:e,sort:a,search:(0,tt.vV)(s)},headers:(0,H.A)()})}}const st=new at;var it=a(5093),ot=a.n(it),nt=a(8123);const lt=25,rt=t=>null===t||void 0===t?"":String(t).trim(),ct=t=>t&&"object"===typeof t&&!Array.isArray(t),dt=t=>{for(const e of t){const t=rt(e);if(t)return t}return""},gt={name:"Change Log",metaInfo(){return{title:"Change Log | Pipe Organ Database",meta:[{property:"og:type",name:"og:type",content:"website"},{property:"og:title",name:"og:title",content:"Change Log | Pipe Organ Database"},{property:"og:description",name:"og:description",content:"Review changes across the Pipe Organ Database."},{property:"og:image",name:"og:image",content:"https://api.pipeorgandatabase.org/uploads/images/blank_sm.png"},{property:"twitter:card",name:"twitter:card",content:"summary_large_image"},{property:"twitter:title",name:"twitter:title",content:"Change Log | Pipe Organ Database"},{property:"twitter:description",name:"twitter:description",content:"Review changes across the Pipe Organ Database."},{property:"twitter:image",name:"twitter:image",content:"https://api.pipeorgandatabase.org/uploads/images/blank_sm.png"}]}},computed:{currentUser(){return this.$store.state.auth.user},authenticated(){return this.$store.state.auth.status.authenticated},canSeeChangeLog(){return(0,nt.OD)(this.currentUser)},totalPages(){return this.total?Math.max(1,Math.ceil(this.total/this.limit)):1},startItem(){return this.total?(this.page-1)*this.limit+1:0},endItem(){return Math.min(this.page*this.limit,this.total)},sortField(){return this.sort.startsWith("-")?this.sort.slice(1):this.sort},sortDirection(){return this.sort.startsWith("-")?"desc":"asc"},visiblePages(){const t=5,e=this.totalPages;let a=Math.max(1,this.page-Math.floor(t/2)),s=Math.min(e,a+t-1);a=Math.max(1,s-t+1);const i=[];for(let o=a;o<=s;o+=1)i.push(o);return i}},data(){return{loading:!0,errorMessage:"",changes:[],total:0,page:1,limit:lt,sort:"-changedAt",search:"",searchTimer:null}},mounted(){this.authenticated?this.canSeeChangeLog?this.loadInitial():this.$router.push("/"):this.$router.push("/login")},beforeUnmount(){clearTimeout(this.searchTimer)},methods:{loadInitial(){this.fetchChanges()},fetchChanges(t=!1){t&&(this.changes=[]),this.loading=!0,this.errorMessage="",st.getAll(this.page,this.limit,this.sort,this.search).then(t=>{this.total=t.data.total||0,this.page=t.data.page||1,this.limit=lt,this.sort=t.data.sort||this.sort,this.changes=(t.data.changes||[]).map(t=>this.normalizeChange(t)),this.loading=!1,window.prerenderReady=!0},t=>{console.log(t),this.loading=!1,window.prerenderReady=!0,t.response&&t.response.status&&403==t.response.status?this.$router.push("/login"):this.errorMessage=t.response&&t.response.data||t.message||t.toString()})},onSearchInput(){this.loading||(clearTimeout(this.searchTimer),(0,tt.Zi)([this.search])||(this.searchTimer=setTimeout(()=>{this.page=1,this.limit=lt,this.fetchChanges()},300)))},setSort(t){this.loading||(this.sortField==t?this.sort="asc"==this.sortDirection?`-${t}`:t:this.sort="changedAt"==t?"-changedAt":t,this.page=1,this.limit=lt,this.fetchChanges())},sortIcon(t){return this.sortField!=t?"bi bi-arrow-down-up ms-1 text-muted":"asc"==this.sortDirection?"bi bi-sort-up ms-1":"bi bi-sort-down ms-1"},goToPage(t){t<1||t>this.totalPages||t==this.page||(this.page=t,this.limit=lt,this.fetchChanges(!0))},buildActor(t,e,a){const s=t[e],i=t[`${e}By`],o=ct(s)?s:{},n=ct(i)?i:{},l=dt([t[`${e}Name`],t[`${e}ActorName`],t[`${e}ByName`],o.name,o.actorName,n.name,n.actorName,"string"===typeof i?i:""]),r=dt([t[`${e}Email`],t[`${e}ActorEmail`],t[`${e}ByEmail`],o.email,o.actorEmail,n.email,n.actorEmail]);return{label:a,name:l,email:r}},normalizeChange(t){const e=this.buildActor(t,"modified","Modified"),a=this.buildActor(t,"approved","Approved"),s=[];return(e.name||e.email)&&s.push(e),(a.name||a.email)&&s.push(a),0===s.length&&s.push({label:"Changed",name:dt([t.actorName,t.editorName,t.changedByName])||"Unknown",email:dt([t.actorEmail,t.editorEmail,t.changedByEmail])}),{...t,actors:s}},showActorLabel(t,e){return t.length>1||"Changed"!==e.label},getDate(t){return t?ot()(t).format("MM/DD/YYYY hh:mm A"):""}}};var ht=a(6262);const mt=(0,ht.A)(gt,[["render",q],["__scopeId","data-v-70287469"]]),pt=mt}}]); 2//# sourceMappingURL=311.3acbf259.js.map
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.