(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a62c5c08"],{"154c":function(t,s,i){"use strict";i.r(s);var e=function(){var t=this,s=t.$createElement,i=t._self._c||s;return i("div",[i("div",{staticClass:"card",class:t.item.class},[i("a",{attrs:{href:t.item.url,target:t.item.target,rel:"noreferrer"}},[i("div",{staticClass:"card-content"},[i("div",{staticClass:"media"},[t.item.logo?i("div",{staticClass:"media-left"},[i("figure",{staticClass:"image is-48x48"},[i("img",{attrs:{src:t.item.logo,alt:t.item.name+" logo"}})])]):t._e(),t.item.icon?i("div",{staticClass:"media-left"},[i("figure",{staticClass:"image is-48x48"},[i("i",{class:["fa-fw",t.item.icon],staticStyle:{"font-size":"35px"}})])]):t._e(),i("div",{staticClass:"media-content"},[i("p",{staticClass:"title is-4"},[t._v(t._s(t.item.name))]),i("p",{staticClass:"subtitle is-6"},[t._v(t._s(t.item.subtitle))])]),i("div",{staticClass:"notifs"},[t.activity>0?i("strong",{staticClass:"notif activity",attrs:{title:"Activity"}},[t._v(t._s(t.activity))]):t._e(),t.warnings>0?i("strong",{staticClass:"notif warnings",attrs:{title:"Warning"}},[t._v(t._s(t.warnings))]):t._e(),t.errors>0?i("strong",{staticClass:"notif errors",attrs:{title:"Error"}},[t._v(t._s(t.errors))]):t._e(),t.serverError?i("strong",{staticClass:"notif errors",attrs:{title:"Connection error to Sonarr API, check url and apikey in config.yml"}},[t._v("?")]):t._e()])]),t.item.tag?i("div",{staticClass:"tag",class:t.item.tagstyle},[i("strong",{staticClass:"tag-text"},[t._v("#"+t._s(t.item.tag))])]):t._e()])])])])},r=[],a=(i("d3b7"),i("99af"),{name:"Sonarr",props:{item:Object},data:function(){return{activity:null,warnings:null,errors:null,serverError:!1}},created:function(){this.fetchConfig()},methods:{fetchConfig:function(){var t=this;fetch("".concat(this.item.url,"/api/health?apikey=").concat(this.item.apikey)).then((function(t){if(200!=t.status)throw new Error(t.statusText);return t.json()})).then((function(s){t.warnings=0,t.errors=0;for(var i=0;i<s.length;i++)"warning"==s[i].type?t.warnings++:"error"==s[i].type&&t.errors++})).catch((function(s){console.error(s),t.serverError=!0})),fetch("".concat(this.item.url,"/api/queue?apikey=").concat(this.item.apikey)).then((function(t){if(200!=t.status)throw new Error(t.statusText);return t.json()})).then((function(s){t.activity=0;for(var i=0;i<s.length;i++)s[i].series&&t.activity++})).catch((function(s){console.error(s),t.serverError=!0}))}}}),n=a,c=(i("c746"),i("2877")),o=Object(c["a"])(n,e,r,!1,null,"45e16254",null);s["default"]=o.exports},"37a9":function(t,s,i){},c746:function(t,s,i){"use strict";i("37a9")}}]);
//# sourceMappingURL=chunk-a62c5c08.dac5c35a.js.map