-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
1 lines (1 loc) · 4.71 KB
/
index.js
1
(function(){"use strict";function h(i,t,e,a,n,l,u,m){var s=typeof i=="function"?i.options:i;t&&(s.render=t,s.staticRenderFns=e,s._compiled=!0),a&&(s.functional=!0),l&&(s._scopeId="data-v-"+l);var o;if(u?(o=function(r){r=r||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!r&&typeof __VUE_SSR_CONTEXT__<"u"&&(r=__VUE_SSR_CONTEXT__),n&&n.call(this,r),r&&r._registeredComponents&&r._registeredComponents.add(u)},s._ssrRegister=o):n&&(o=m?function(){n.call(this,(s.functional?this.parent:this).$root.$options.shadowRoot)}:n),o)if(s.functional){s._injectStyles=o;var g=s.render;s.render=function(k,f){return o.call(f),g(k,f)}}else{var c=s.beforeCreate;s.beforeCreate=c?[].concat(c,o):[o]}return{exports:i,options:s}}const p={name:"fireView",data(){return{isHeatingUp:!1,index:0,items:[]}},created(){this.$api.get("fire/pages").then(i=>{this.items=i})},methods:{stateText(i){return i.replace(/-/g," ")},heatUp(i){this.index=i,i<this.items.length&&this.isHeatingUp===!0&&(this.items[i].state="fire-up",this.$api.post("fire/up",this.items[i]).then(t=>{this.$set(this.items,i,t),setTimeout(()=>{this.heatUp(i+1)},500)}))},start(){this.isHeatingUp=!0,this.heatUp(this.index)},pause(){this.isHeatingUp=!1},reset(){this.isHeatingUp=!1,this.index=0,this.$api.get("fire/pages").then(i=>{this.items=i})}}};var _=function(){var t=this,e=t._self._c;return e("k-inside",[e("k-header",{attrs:{"data-has-buttons":"true"}},[e("k-header-title",[t._v("Fire up your cache!")]),e("k-header-buttons",{attrs:{slot:"buttons"},slot:"buttons"},[e("k-button-group",[!t.isHeatingUp&&t.index===0?e("k-button",{attrs:{variant:"filled",icon:"fire",theme:"positive"},on:{click:function(a){return t.start()}}},[t._v("Fire up")]):t._e(),!t.isHeatingUp&&t.index!==0?e("k-button",{attrs:{variant:"filled",icon:"fire",theme:"positive"},on:{click:function(a){return t.start()}}},[t._v("Continue")]):t._e(),!t.isHeatingUp&&t.index!==0?e("k-button",{attrs:{variant:"filled",icon:"cancel",theme:"negative"},on:{click:function(a){return t.reset()}}},[t._v("Extinguish")]):t._e(),t.isHeatingUp?e("k-button",{attrs:{variant:"filled",icon:"cancel",theme:"negative"},on:{click:function(a){return t.pause()}}},[t._v("Stop")]):t._e()],1)],1)],1),e("k-grid",{staticStyle:{"--columns":"1",gap:"var(--spacing-8)"}},[t.items.length===0?e("k-empty",{attrs:{icon:"boiler",text:"No pages on fire"}}):t._e(),t.items.length>0?e("div",{staticClass:"k-table"},[e("table",[e("thead",[e("tr",[e("th",{staticClass:"k-table-index-column"},[t._v("#")]),e("th",{staticClass:"k-boiler-url",attrs:{"data-mobile":"true"}},[t._v("URL")]),e("th",{staticClass:"k-state-column",attrs:{"data-mobile":"true"}},[t._v("State")])])]),e("tbody",t._l(t.items,function(a,n){return e("tr",{key:n,ref:"row"+n,refInFor:!0},[e("td",{staticClass:"k-table-index-column"},[e("span",{staticClass:"k-table-index"},[t._v(t._s(n+1))])]),e("td",{attrs:{"data-mobile":"true"}},[e("div",{staticClass:"truncate"},[t._v(t._s(a.url))])]),e("td",{staticClass:"k-state-column",attrs:{"data-mobile":"true"}},[e("div",{staticClass:"badge",class:a.state},[a.state==="no-fire"?e("k-icon",{attrs:{type:"blaze"}}):t._e(),a.state==="fire-up"?e("k-icon",{attrs:{type:"fire"}}):t._e(),a.state==="fire-on"?e("k-icon",{attrs:{type:"fireFilled"}}):t._e(),e("span",[t._v(t._s(t.stateText(a.state)))])],1)])])}),0)])]):t._e()],1)],1)},d=[],C=h(p,_,d,!1,null,"93f31384",null,null);const v=C.exports;panel.plugin("e9li/kirby-fire",{icons:{blaze:'<path d="M19 9C19.6667 10.0606 20 11.3939 20 13C20 16 16.5 17 15 22C14.3333 21.4254 14 20.5921 14 19.5C14 16.0181 19 14.2101 19 9ZM14.5 5C15.1667 6.23841 15.5 7.57175 15.5 9C15.5 14 9.5 15 11.5 22C9.83333 20.8392 9 19.1726 9 17C9 13.675 14.5 11 14.5 5ZM10 1C10.6667 2.33333 11 3.83333 11 5.5C11 11.5 2 13 8 22C5.5 21.5 3.5 19 3.5 16C3.5 9.5 10 8.5 10 1Z"></path>',fire:'<path d="M12 23C16.1421 23 19.5 19.6421 19.5 15.5C19.5 14.6345 19.2697 13.8032 19 13.0296C17.3333 14.6765 16.0667 15.5 15.2 15.5C19.1954 8.5 17 5.5 11 1.5C11.5 6.49951 8.20403 8.77375 6.86179 10.0366C5.40786 11.4045 4.5 13.3462 4.5 15.5C4.5 19.6421 7.85786 23 12 23ZM12.7094 5.23498C15.9511 7.98528 15.9666 10.1223 13.463 14.5086C12.702 15.8419 13.6648 17.5 15.2 17.5C15.8884 17.5 16.5841 17.2992 17.3189 16.9051C16.6979 19.262 14.5519 21 12 21C8.96243 21 6.5 18.5376 6.5 15.5C6.5 13.9608 7.13279 12.5276 8.23225 11.4932C8.35826 11.3747 8.99749 10.8081 9.02477 10.7836C9.44862 10.4021 9.7978 10.0663 10.1429 9.69677C11.3733 8.37932 12.2571 6.91631 12.7094 5.23498Z"></path>',fireFilled:'<path d="M12 23C7.85786 23 4.5 19.6421 4.5 15.5C4.5 13.3462 5.40786 11.4045 6.86179 10.0366C8.20403 8.77375 11.5 6.49951 11 1.5C17 5.5 20 9.5 14 15.5C15 15.5 16.5 15.5 19 13.0296C19.2697 13.8032 19.5 14.6345 19.5 15.5C19.5 19.6421 16.1421 23 12 23Z"></path>'},components:{fireView:v}})})();