diff --git a/dist/js/tool.js b/dist/js/tool.js index c2f33d1..32d7d21 100644 --- a/dist/js/tool.js +++ b/dist/js/tool.js @@ -1 +1 @@ -(()=>{"use strict";var e={755:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,"",""]);const a=o},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var a=0;a{var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function s(e){for(var t=-1,n=0;n{t.Z=(e,t)=>{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={id:r,exports:{}};return e[r](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0,(()=>{const e=Vue;var t={class:"mb-6"},r={key:0,class:"error text-error-message mb-6"},o={key:1,class:"mb-6"},a={key:0},i={key:2};const s={mounted:function(){this.updateStatus(),this.startStatusRefresh()},props:{publishing:{type:Boolean,default:!0},lastRun:Object,error:String},data:function(){return{error:"",publishing:!1,lastRun:void 0}},methods:{publish:function(){var e=this;this.publishing=!0,Nova.request().post("/nova-vendor/publish/publish").then((function(t){e.error=""})).catch((function(t){e.error=t.message,e.publishing=!1}))},updateStatus:function(){var e=this;Nova.request().get("/nova-vendor/publish/last-publish-run").then((function(t){console.log(t.data),e.lastRun=t.data,e.publishing="completed"!==t.data.status,e.error=""})).catch((function(t){e.error=t.message}))},startStatusRefresh:function(){var e=this;window.setInterval((function(){e.updateStatus()}),1e4)},formatDate:function(e){return new Intl.DateTimeFormat("nl-NL",{dateStyle:"full",timeStyle:"long"}).format(new Date(e))}}};var c=n(379),l=n.n(c),u=n(755),d={insert:"head",singleton:!1};l()(u.Z,d);u.Z.locals;const f=(0,n(744).Z)(s,[["render",function(n,s,c,l,u,d){var f=(0,e.resolveComponent)("Head"),p=(0,e.resolveComponent)("heading"),m=(0,e.resolveComponent)("default-button");return(0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,[(0,e.createVNode)(f,{title:"title"}),(0,e.createVNode)(p,{class:"mb-6"},{default:(0,e.withCtx)((function(){return[(0,e.createTextVNode)((0,e.toDisplayString)(n.__("heading")),1)]})),_:1}),(0,e.createElementVNode)("p",t,(0,e.toDisplayString)(n.__("explanation")),1),(0,e.createVNode)(m,{onClick:d.publish,disabled:!!u.publishing,class:"mb-6"},{default:(0,e.withCtx)((function(){return[(0,e.createTextVNode)((0,e.toDisplayString)(n.__("button_text")),1)]})),_:1},8,["onClick","disabled"]),u.error?((0,e.openBlock)(),(0,e.createElementBlock)("p",r,(0,e.toDisplayString)(n.__("error",u.error)),1)):(0,e.createCommentVNode)("",!0),u.lastRun&&"completed"===u.lastRun.status?((0,e.openBlock)(),(0,e.createElementBlock)("p",o,[(0,e.createTextVNode)((0,e.toDisplayString)(n.__("completed_message",{last_run:d.formatDate(u.lastRun.updated_at)}))+" ",1),"failure"===u.lastRun.conclusion?((0,e.openBlock)(),(0,e.createElementBlock)("span",a,(0,e.toDisplayString)(n.__("error_short")),1)):(0,e.createCommentVNode)("",!0)])):(0,e.createCommentVNode)("",!0),u.lastRun&&"completed"!==u.lastRun.status?((0,e.openBlock)(),(0,e.createElementBlock)("p",i,(0,e.toDisplayString)(n.__("running_message",{last_run:n.formateDate(u.lastRun.created_at)})),1)):(0,e.createCommentVNode)("",!0)],64)}]]);Nova.booting((function(e){Nova.inertia("PublishTool",f)}))})()})(); \ No newline at end of file +(()=>{"use strict";var e={538:(e,t,n)=>{n.d(t,{Z:()=>a});var r=n(645),o=n.n(r)()((function(e){return e[1]}));o.push([e.id,"",""]);const a=o},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var o={};if(r)for(var a=0;a{var r,o=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},a=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function s(e){for(var t=-1,n=0;n{t.Z=(e,t)=>{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={id:r,exports:{}};return e[r](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0,(()=>{const e=Vue;var t={class:"mb-6"},r={key:0,class:"error text-error-message mb-6"},o={key:1,class:"mb-6"},a={key:0},i={key:2};const s={mounted:function(){this.updateStatus(),this.startStatusRefresh()},props:{publishing:{type:Boolean,default:!0},lastRun:Object,error:String},data:function(){return{error:"",publishing:!1,lastRun:void 0}},methods:{publish:function(){var e=this;this.publishing=!0,Nova.request().post("/nova-vendor/publish/publish").then((function(t){e.error=""})).catch((function(t){e.error=t.message,e.publishing=!1}))},updateStatus:function(){var e=this;Nova.request().get("/nova-vendor/publish/last-publish-run").then((function(t){console.log(t.data),e.lastRun=t.data,e.publishing="completed"!==t.data.status,e.error=""})).catch((function(t){e.error=t.message}))},startStatusRefresh:function(){var e=this;window.setInterval((function(){e.updateStatus()}),1e4)},formatDate:function(e){return new Intl.DateTimeFormat("nl-NL",{dateStyle:"full",timeStyle:"long"}).format(new Date(e))}}};var l=n(379),c=n.n(l),u=n(538),d={insert:"head",singleton:!1};c()(u.Z,d);u.Z.locals;const f=(0,n(744).Z)(s,[["render",function(n,s,l,c,u,d){var f=(0,e.resolveComponent)("Head"),p=(0,e.resolveComponent)("heading"),m=(0,e.resolveComponent)("default-button");return(0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,null,[(0,e.createVNode)(f,{title:n.__("title")},null,8,["title"]),(0,e.createVNode)(p,{class:"mb-6"},{default:(0,e.withCtx)((function(){return[(0,e.createTextVNode)((0,e.toDisplayString)(n.__("heading")),1)]})),_:1}),(0,e.createElementVNode)("p",t,(0,e.toDisplayString)(n.__("explanation")),1),(0,e.createVNode)(m,{onClick:d.publish,disabled:!!u.publishing,class:"mb-6"},{default:(0,e.withCtx)((function(){return[(0,e.createTextVNode)((0,e.toDisplayString)(n.__("button_text")),1)]})),_:1},8,["onClick","disabled"]),u.error?((0,e.openBlock)(),(0,e.createElementBlock)("p",r,(0,e.toDisplayString)(n.__("error",u.error)),1)):(0,e.createCommentVNode)("",!0),u.lastRun&&"completed"===u.lastRun.status?((0,e.openBlock)(),(0,e.createElementBlock)("p",o,[(0,e.createTextVNode)((0,e.toDisplayString)(n.__("completed_message",{last_run:d.formatDate(u.lastRun.updated_at)}))+" ",1),"failure"===u.lastRun.conclusion?((0,e.openBlock)(),(0,e.createElementBlock)("span",a,(0,e.toDisplayString)(n.__("error_short")),1)):(0,e.createCommentVNode)("",!0)])):(0,e.createCommentVNode)("",!0),u.lastRun&&"completed"!==u.lastRun.status?((0,e.openBlock)(),(0,e.createElementBlock)("p",i,(0,e.toDisplayString)(n.__("running_message",{last_run:n.formateDate(u.lastRun.created_at)})),1)):(0,e.createCommentVNode)("",!0)],64)}]]);Nova.booting((function(e){Nova.inertia("PublishTool",f)}))})()})(); \ No newline at end of file diff --git a/resources/js/components/Tool.vue b/resources/js/components/Tool.vue index cccf73f..dc79dbe 100644 --- a/resources/js/components/Tool.vue +++ b/resources/js/components/Tool.vue @@ -1,5 +1,5 @@