services/resources/Mealie.7d08fd6d.js

2 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-07-30 14:45:34 +00:00
import{s as m}from"./service.541fc1e6.js";import{_ as h,G as p,r as d,o as s,c as u,w as f,a as l,t as i,b as o,F as n,d as c,e as _}from"./index.868de8fa.js";const y={name:"Mealie",mixins:[m],props:{item:Object},components:{Generic:p},data:()=>({stats:null,meal:null}),created(){this.fetchStatus()},methods:{fetchStatus:async function(){const e={Authorization:"Bearer "+this.item.apikey,Accept:"application/json"};this.item.subtitle==null&&(this.meal=await this.fetch("/api/meal-plans/today/",{headers:e}).catch(t=>console.log(t)),this.stats=await this.fetch("/api/debug/statistics/",{headers:e}).catch(t=>console.log(t)))}}},k={class:"title is-4"},b={class:"subtitle is-6"};function g(e,t,a,B,w,G){const r=d("Generic");return s(),u(r,{item:a.item},{content:f(()=>[l("p",k,i(a.item.name),1),l("p",b,[a.item.subtitle?(s(),o(n,{key:0},[c(i(a.item.subtitle),1)],64)):e.meal?(s(),o(n,{key:1},[c(" Today: "+i(e.meal.name),1)],64)):e.stats?(s(),o(n,{key:2},[c(" happily keeping "+i(e.stats.totalRecipes)+" recipes organized ",1)],64)):_("",!0)])]),_:1},8,["item"])}const S=h(y,[["render",g]]);export{S as default};