Mini Shell

Direktori : /home/ukubnwwt/viewer.ukubona.cloud/assets/
Upload File :
Current File : /home/ukubnwwt/viewer.ukubona.cloud/assets/ResultsView-Bb3wIapl.js

import{_ as D,j as T,i as h,a as g,o as l,c as r,b as e,t as c,k as _,l as f,e as k,p as w,f as b,g as O,h as $,m as P,d as N,v as F,F as I,r as y,n as p,q as C}from"./index-BysVARqB.js";import{r as R,m as V,c as E,e as L}from"./AMER_US_GI_CLI-P_Slim Linear_08.2017-BW0ZLX2u.js";const A={data(){return{moment:T}},props:{currentSelectedDisplayItem:{type:Object,required:!0}},mounted(){},methods:{closeDicomViewer(){this.$emit("closeDicomViewer")},async getFileImage(s){this.showFileTableLoader=!0;let a={};try{s&&(a.uuid=s),await this.$http.get("api/v1/files",{params:a}).then(t=>{const i=t.data;i.status&&(console.log("dataa",i),this.currentSelectedDisplayItem.fileData=i.data,this.showFileTableLoader=!1)})}catch(t){if(this.showFileTableLoader=!1,t.response){const i=t.response.status;i===401?await this.refreshToken(this.getFileImage):(console.error(`Error ${i}: ${t.response.data.message}`),h.error(`Error ${i}: ${t.response.data.message}`,{autoClose:3e3,position:h.POSITION.TOP_RIGHT}))}else t.request?(console.error("No response received:",t.request),h.error("No response received. Please try again later.",{autoClose:3e3,position:h.POSITION.TOP_RIGHT})):(console.error("Error",t),h.error(`Error: ${t.message}`,{autoClose:3e3,position:h.POSITION.TOP_RIGHT}))}},async getFiles(s=null,a=null){this.showFileTableLoader=!0;let t={};try{s&&(t.page=s),a&&(t.search=a),console.log("herte",s),await this.$http.get("api/v1/files",{params:t}).then(i=>{const o=i.data;o.status&&(this.filesData=o,this.showFileTableLoader=!1)})}catch(i){if(this.showFileTableLoader=!1,i.response){const o=i.response.status;o===401?await this.refreshToken(this.getFiles):(console.error(`Error ${o}: ${i.response.data.message}`),h.error(`Error ${o}: ${i.response.data.message}`,{autoClose:3e3,position:h.POSITION.TOP_RIGHT}))}else i.request?(console.error("No response received:",i.request),h.error("No response received. Please try again later.",{autoClose:3e3,position:h.POSITION.TOP_RIGHT})):(console.error("Error",i),h.error(`Error: ${i.message}`,{autoClose:3e3,position:h.POSITION.TOP_RIGHT}))}},async refreshToken(s){try{const a=await this.$http.post("api/token/refresh",{refresh:this.$store.state.refresh});a.data.access?(this.$store.commit("setAccess",a.data.access),g.defaults.headers.common.Authorization=`Bearer ${a.data.access}`,await s()):this.$router.push("/login")}catch(a){console.error("Failed to refresh token",a),this.$router.push("/login")}}}},m=s=>(w("data-v-d1755127"),s=s(),b(),s),x={class:"modal-dicom-viewer"},G={class:"modal-content"},H={class:"close-modal"},U=m(()=>e("span",null,null,-1)),M=m(()=>e("h3",{class:"title"},null,-1)),q={class:"main"},B={class:"sidebar"},z=m(()=>e("div",{class:"sidebar-control"},[e("i",{class:"fa-solid fa-angles-left"})],-1)),Y={class:"basic-info side"},j={key:0},W=m(()=>e("p",null,[e("i",{class:"fa-solid fa-copy"}),f("1")],-1)),J={class:"basic-info"},K=m(()=>e("p",null,"NAME/LABEL:",-1)),Q=m(()=>e("p",null,"Modality:",-1)),X=m(()=>e("p",null,":",-1)),Z={key:0},ee={style:{color:"var(--primary)"}},se=m(()=>e("div",{class:"pic-box"},[e("div",{class:"img-box"})],-1)),te={class:"right"},oe=k('<div class="controls" data-v-d1755127><div class="ruler" data-v-d1755127><button class="length" data-v-d1755127><i class="fa-solid fa-ruler" data-v-d1755127></i></button></div><div class="zoom" data-v-d1755127><button class="zoom-control" data-v-d1755127><i class="fa-solid fa-magnifying-glass" data-v-d1755127></i></button></div><div class="rotate" data-v-d1755127><button class="rotate-left" data-v-d1755127><i class="fas fa-undo" data-v-d1755127></i></button></div><div class="contrast" data-v-d1755127><button class="contrast-minus active" data-v-d1755127><i class="fa-solid fa-circle-half-stroke" data-v-d1755127></i></button></div><div class="move" data-v-d1755127><button class="move" data-v-d1755127><i class="fa-solid fa-up-down-left-right" data-v-d1755127></i></button></div><div class="rotate" data-v-d1755127><button class="rotate-right" data-v-d1755127><i class="fas fa-redo" data-v-d1755127></i></button></div><div class="reset" data-v-d1755127><button data-v-d1755127><i class="fas fa-sync" data-v-d1755127></i></button></div></div>',1),ae={class:"dicom-viewer"},ie={key:0,id:"dicomViewer",ref:"dicomViewer"},le={key:0,class:"split"},re={key:0,class:"left"},ne=["src"],ce={key:0,class:"loading table"},de=m(()=>e("div",{class:"loader"},null,-1)),he=[de],ue={key:1,class:""},_e={class:"right"},me=["src"],fe={key:1,class:"single"},pe={class:"left"},ve=["src"];function ge(s,a,t,i,o,u){return l(),r("div",x,[e("div",G,[e("div",H,[e("i",{class:"fa-solid fa-angles-left",onClick:a[0]||(a[0]=(...v)=>u.closeDicomViewer&&u.closeDicomViewer(...v))}),U]),M,e("div",q,[e("div",B,[z,e("div",Y,[t.currentSelectedDisplayItem?(l(),r("p",j,c(o.moment(t.currentSelectedDisplayItem.date_added).format("DD MMM, YYYY -> hh:mm:ss A")),1)):_("",!0),W]),e("div",J,[K,Q,X,t.currentSelectedDisplayItem.model_name?(l(),r("p",Z,[f("Model Name: "),e("span",ee,c(t.currentSelectedDisplayItem.model_name),1)])):_("",!0)]),se]),e("div",te,[oe,e("div",ae,[t.currentSelectedDisplayItem?(l(),r("div",ie,[t.currentSelectedDisplayItem.mode=="split"?(l(),r("div",le,[t.currentSelectedDisplayItem.fileData?(l(),r("div",re,[e("img",{src:t.currentSelectedDisplayItem.fileData.getFileURL,alt:""},null,8,ne),s.showFileTableLoader?(l(),r("div",ce,he)):_("",!0)])):(l(),r("div",ue,c(u.getFileImage(t.currentSelectedDisplayItem.fileUUID)),1)),e("div",_e,[e("img",{src:t.currentSelectedDisplayItem.getResultURL||s.getResultImage(t.currentSelectedDisplayItem.result.uuid),alt:""},null,8,me)])])):(l(),r("div",fe,[e("div",pe,[e("img",{src:t.currentSelectedDisplayItem.filePath||u.getFileImage(t.currentSelectedDisplayItem.fileUUID)||s.img2,alt:""},null,8,ve)])]))],512)):_("",!0)])])])])])}const Ie=D(A,[["render",ge],["__scopeId","data-v-d1755127"]]),ye={data(){return{img2:O,img1:$,moment:T,radiology:R,microscopy:V,cardiology:E,endoscopy:L,selectedFile:null,scansData:null,showFileTableLoader:!1,userData:null,showDicomViewer:!1,selectedResult:null}},components:{DicomViewer:Ie},mounted(){this.$root.loadScripts(),this.getFiles(),this.getUserData(),this.getAIScans()},methods:{closeDicomViewer(){this.showDicomViewer=!1},redirectTo(s){this.$router.push(s)},async refreshToken(s){try{const a=await this.$http.post("api/token/refresh",{refresh:this.$store.state.refresh});a.data.access?(this.$store.commit("setAccess",a.data.access),g.defaults.headers.common.Authorization=`Bearer ${a.data.access}`,await s()):this.$router.push("/login")}catch(a){console.error("Failed to refresh token",a),this.$router.push("/login")}},async getUserData(){this.$root.isLoading=!0;try{const s=await this.$http.get("accounts/userdata");this.userData=s.data,this.$root.profileInfo={name:this.userData.first_name,image:this.userData.profile_image_url},this.$root.isLoading=!1}catch(s){if(this.$root.isLoading=!1,s.response){const a=s.response.status;a===401?await this.refreshToken(this.getUserData):(console.error(`Error ${a}: ${s.response.data.message}`),toast.error(`Error ${a}: ${s.response.data.message}`,{autoClose:3e3,position:toast.POSITION.TOP_RIGHT}))}else s.request?(console.error("No response received:",s.request),toast.error("No response received. Please try again later.",{autoClose:3e3,position:toast.POSITION.TOP_RIGHT})):(console.error("Error",s),toast.error(`Error: ${s.message}`,{autoClose:3e3,position:toast.POSITION.TOP_RIGHT}))}},async useModel(s){if(!this.selectedFile){alert("Please select a file to use the model");return}const a={fileUUID:this.selectedFile.uuid,model_name:s};try{await g.post("api/v1/model",a).then(t=>{console.log("Model used successfully",t.data),toast.info("AI Model request is Processing",{autoClose:3e3,position:toast.POSITION.TOP_RIGHT})})}catch(t){if(this.$root.isLoading=!1,t.response){const i=t.response.status;i===401?await this.refreshToken(this.useModel):(console.error(`Error ${i}: ${t.response.data.message}`),toast.error(`Error ${i}: ${t.response.data.message}`,{autoClose:3e3,position:toast.POSITION.TOP_RIGHT}))}else t.request?(console.error("No response received:",t.request),toast.error("No response received. Please try again later.",{autoClose:3e3,position:toast.POSITION.TOP_RIGHT})):(console.error("Error",t),toast.error(`Error: ${t.message}`,{autoClose:3e3,position:toast.POSITION.TOP_RIGHT}))}},async getFiles(s=null,a=null){this.showFileTableLoader=!0;let t={};try{s&&(t.page=s),a&&(t.search=a),console.log("herte",s),await this.$http.get("api/v1/files",{params:t}).then(i=>{const o=i.data;o.status&&(this.filesData=o,this.showFileTableLoader=!1)})}catch(i){console.error("Error fetching files",i),this.showFileTableLoader=!1}},async getAIScans(s=null,a=null){this.showFileTableLoader=!0;let t={};try{s&&(t.page=s),a&&(t.search=a);const i=await this.$http.get("api/v1/model",{params:t});this.scansData=i.data,this.showFileTableLoader=!1}catch(i){if(this.showFileTableLoader=!1,i.response){const o=i.response.status;o===401?await this.refreshToken(this.getAIScans):(console.error(`Error ${o}: ${i.response.data.message}`),toast.error(`Error ${o}: ${i.response.data.message}`,{autoClose:3e3,position:toast.POSITION.TOP_RIGHT}))}else i.request?(console.error("No response received:",i.request),toast.error("No response received. Please try again later.",{autoClose:3e3,position:toast.POSITION.TOP_RIGHT})):(console.error("Error",i),toast.error(`Error: ${i.message}`,{autoClose:3e3,position:toast.POSITION.TOP_RIGHT}))}}}},d=s=>(w("data-v-2c263fec"),s=s(),b(),s),De={class:"home"},Te={class:"container"},we={key:0},be=d(()=>e("div",{class:"heading flex1"},[e("h3",null,"Results"),e("p",null,"Dashboard / Results")],-1)),Se={class:"content flex"},ke={class:"content_left"},Oe={class:"top"},$e={class:"wlecome flex1"},Pe=d(()=>e("div",{class:"text"},[e("h3",null,"Welcome Back !"),e("label",null,"Ukubona Dashboard")],-1)),Ne={class:"img"},Fe=["src"],Ce={key:0,class:"profile flex1"},Re={class:"box"},Ve={class:"image"},Ee=["src"],Le={class:"text"},Ae={key:0,class:"box"},xe=d(()=>e("label",null,"Saved FIles",-1)),Ge=d(()=>e("br",null,null,-1)),He=d(()=>e("button",null,[f(" View Profile "),e("i",{class:"fas fa-chevron-down"})],-1)),Ue={class:"content_right"},Me={class:"right_top grid"},qe={class:"rbox flex1"},Be={class:"text"},ze=d(()=>e("h4",null,"total AI Results",-1)),Ye={key:0},je={key:1},We=d(()=>e("div",{class:"icon"},[e("span",{class:"material-icons"}," folder_copy ")],-1)),Je={class:"rbox flex1"},Ke={class:"text"},Qe=d(()=>e("h4",null,"Available AI models",-1)),Xe=d(()=>e("div",{class:"icon"},[e("span",{class:"material-icons"}," file_download ")],-1)),Ze=d(()=>e("section",{class:"models"},null,-1)),es={class:"table"},ss={class:"container"},ts={class:"top-level"},os={class:"left"},as=d(()=>e("h3",null,"Search Results",-1)),is={class:"search-button"},ls=d(()=>e("div",{class:"right"},null,-1)),rs=d(()=>e("thead",null,[e("tr",null,[e("th",null,"ScanID"),e("th",null,"Model"),e("th",null,"Uploaded"),e("th",null,"Status"),e("th")])],-1)),ns={key:0},cs=["onClick"],ds={key:0,class:"loading table"},hs=d(()=>e("div",{class:"loader"},null,-1)),us=[hs],_s={class:"pagination"},ms={key:0},fs=["onClick"],ps={key:1};function vs(s,a,t,i,o,u){const v=P("DicomViewer");return l(),r("main",null,[e("section",De,[e("div",Te,[o.userData?(l(),r("h3",we,c(o.userData.hospital.name),1)):_("",!0),be,e("div",Se,[e("div",ke,[e("div",Oe,[e("div",$e,[Pe,e("div",Ne,[e("img",{src:o.img2,alt:""},null,8,Fe)])]),o.userData?(l(),r("div",Ce,[e("div",Re,[e("div",Ve,[e("img",{src:o.userData.profile_image_url,alt:""},null,8,Ee)]),e("div",Le,[e("p",null,c(o.userData.last_name)+" "+c(o.userData.first_name),1),e("label",null,c(o.userData.role),1)])]),o.userData?(l(),r("div",Ae,[e("p",null,c(o.userData.saved_files),1),xe,f(),Ge,He])):_("",!0)])):_("",!0)])]),e("div",Ue,[e("div",Me,[e("div",qe,[e("div",Be,[ze,o.userData?(l(),r("h2",Ye,c(o.userData.total_scans),1)):(l(),r("h2",je,"..."))]),We]),e("div",Je,[e("div",Ke,[Qe,e("h2",null,c(s.$store.state.total_models),1)]),Xe])])])])])]),Ze,e("section",es,[e("div",ss,[e("div",ts,[e("div",os,[as,N(e("input",{type:"search",name:"",id:"",placeholder:"search files","onUpdate:modelValue":a[0]||(a[0]=n=>s.searchText=n)},null,512),[[F,s.searchText]]),e("span",is,[e("i",{class:"fa-solid fa-magnifying-glass",onClick:a[1]||(a[1]=n=>u.getAIScans(null,s.searchText))})])]),ls]),e("table",null,[rs,o.scansData?(l(),r("tbody",ns,[(l(!0),r(I,null,y(o.scansData.data,n=>(l(),r("tr",{key:n},[e("td",null,c(n.scanID),1),e("td",null,c(n.model_name),1),e("td",null,c(o.moment(n.date_added).fromNow()),1),e("td",null,[e("span",{class:p({green:n.status=="success",yellow:n.status=="pending",red:n.status=="failed"})},c(n.status),3)]),e("td",null,[n.result?(l(),r("button",{key:0,onClick:S=>{o.selectedResult=n,o.selectedResult.mode="split",o.showDicomViewer=!0}},"View Result",8,cs)):_("",!0)])]))),128)),o.showFileTableLoader?(l(),r("div",ds,us)):_("",!0)])):_("",!0)]),e("div",_s,[o.scansData&&o.scansData.data.length>0?(l(),r("ul",ms,[e("li",null,[e("i",{class:p(["fas fa-chevron-left",{disabled:o.scansData.pagination.current_page<=1}]),onClick:a[2]||(a[2]=n=>u.getAIScans(o.scansData.pagination.current_page-1))},null,2)]),(l(!0),r(I,null,y(o.scansData.pagination.total_pages,(n,S)=>(l(),r("li",{key:n,class:p({active:o.scansData.pagination.current_page==n}),onClick:gs=>u.getAIScans(n)},[e("span",null,c(n),1)],10,fs))),128)),e("li",null,[e("i",{class:p(["fas fa-chevron-right",{disabled:o.scansData.pagination.current_page>=o.scansData.pagination.total_pages}]),onClick:a[3]||(a[3]=n=>u.getAIScans(o.scansData.pagination.current_page+1))},null,2)])])):(l(),r("p",ps,[f("No AI Models Used yet. "),e("button",{onClick:a[4]||(a[4]=n=>u.redirectTo("/models"))},"Use a Model")]))])])]),o.showDicomViewer?(l(),C(v,{key:0,onCloseDicomViewer:u.closeDicomViewer,currentSelectedDisplayItem:o.selectedResult},null,8,["onCloseDicomViewer","currentSelectedDisplayItem"])):_("",!0)])}const Ds=D(ye,[["render",vs],["__scopeId","data-v-2c263fec"]]);export{Ds as default};