1 line
1.3 KiB
JavaScript
1 line
1.3 KiB
JavaScript
import{s as a}from"./service.541fc1e6.js";import{_ as c,G as l,r as f,o as n,c as d,w as g,a as m,b as s,t,e as o}from"./index.868de8fa.js";const u={name:"Medusa",mixins:[a],props:{item:Object},components:{Generic:l},data:()=>({config:null,serverError:!1}),created:function(){this.fetchConfig()},methods:{fetchConfig:function(){this.fetch("/api/v2/config",{headers:{"X-Api-Key":this.item.apikey}}).then(e=>{this.config=e}).catch(e=>{console.log(e),this.serverError=!0})}}},_={class:"notifs"},h={key:0,class:"notif news",title:"News"},p={key:1,class:"notif warnings",title:"Warning"},y={key:2,class:"notif errors",title:"Error"},k={key:3,class:"notif errors",title:"Connection error to Medusa API, check url and apikey in config.yml"};function v(e,w,r,E,C,B){const i=f("Generic");return n(),d(i,{item:r.item},{indicator:g(()=>[m("div",_,[e.config!==null&&e.config.system.news.unread>0?(n(),s("strong",h,t(e.config.system.news.unread),1)):o("",!0),e.config!==null&&e.config.main.logs.numWarnings>0?(n(),s("strong",p,t(e.config.main.logs.numWarnings),1)):o("",!0),e.config!==null&&e.config.main.logs.numErrors>0?(n(),s("strong",y,t(e.config.main.logs.numErrors),1)):o("",!0),e.serverError?(n(),s("strong",k,"?")):o("",!0)])]),_:1},8,["item"])}const N=c(u,[["render",v],["__scopeId","data-v-0ade670a"]]);export{N as default};
|