Files
ploi-core/public/js/20.js
2020-11-04 13:42:50 +01:00

1 line
16 KiB
JavaScript
Vendored

(window.webpackJsonp=window.webpackJsonp||[]).push([[20,73],{0:function(t,e,s){"use strict";function i(t,e,s,i,n,r,a,o){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=s,c._compiled=!0),i&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),n&&n.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=l):n&&(l=o?function(){n.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:n),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var m=c.beforeCreate;c.beforeCreate=m?[].concat(m,l):[l]}return{exports:t,options:c}}s.d(e,"a",(function(){return i}))},15:function(t,e,s){"use strict";var i={props:{items:{type:Array,required:!1}}},n=s(0),r=Object(n.a)(i,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"grid grid-cols-4 gap-16"},[e("aside",{staticClass:"col-span-4 md:col-span-1"},[this._t("nav")],2),this._v(" "),e("section",{staticClass:"col-span-4 md:col-span-3"},[e("div",{staticClass:"space-y-16"},[this._t("segments")],2)])])}),[],!1,null,null,null);e.a=r.exports},16:function(t,e,s){"use strict";var i=s(0),n=Object(i.a)({},(function(){var t=this.$createElement,e=this._self._c||t;return e("section",{staticClass:"px-8 pb-8 space-y-6 border rounded border-low-emphasis"},[e("header",{staticClass:"-mt-4"},[e("h2",{staticClass:"inline-flex px-4 -mx-4 font-medium bg-surface-1 text-title"},[this._t("title")],2),this._v(" "),e("p",{staticClass:"mt-1 text-small text-medium-emphasis"},[this._t("subtitle")],2)]),this._v(" "),e("div",{staticClass:"space-y-4"},[this._t("form"),this._v(" "),this._t("content")],2)])}),[],!1,null,null,null);e.a=n.exports},164:function(t,e,s){"use strict";s.r(e);var i=s(35),n=s(1),r=s(6),a=s(7),o=s(8),l=s(9),c=s(10),u=s(2),m=s(11),d=s(12),f=s(4),h=s(5),p=s(3),v=s(15),_=s(16),b=s(13),y=s(18),g=s(28),x=s(36),C=s(14),k=s(19),w=s(26),j=s(37),T=s(20),$=s(22),S=s(23),B=s(24),q=s(25),P=s(21),O={metaInfo:function(){return{title:"Cronjobs - ".concat(this.site.domain)}},layout:p.a,components:{TopBar:i.default,Container:n.a,Content:r.a,Page:a.a,PageHeader:o.a,PageHeaderTitle:l.a,PageBody:c.a,Button:u.a,List:m.a,ListItem:d.a,StatusBubble:f.a,NotificationBadge:h.a,FormInput:b.a,SettingsLayout:v.a,SettingsSegment:_.a,Form:y.a,FormActions:C.a,Pagination:g.a,Tabs:j.default,Table:T.a,TableHead:$.a,TableHeader:S.a,TableRow:B.a,TableBody:q.a,TableData:P.a,EmptyImage:x.a},data:function(){return{sending:!1,form:{command:"php /home/".concat(this.$page.props.auth.user.user_name,"/").concat(this.site.domain,"/script.php"),interval:"minutely",frequency:"* * * * *"},breadcrumbs:[{title:this.$page.props.settings.name,to:"/"},{title:this.__("Sites"),to:this.route("sites.index")},{title:this.site.domain,to:this.route("sites.show",this.site.id)},{title:this.__("Cronjobs"),to:this.route("sites.cronjobs.index",this.site.id)}]}},mounted:function(){this.shouldBePolling&&this.startPollingInterval()},watch:{shouldBePolling:function(t){t?this.pollingInterval||this.startPollingInterval():this.clearPollingInterval()}},computed:{shouldBePolling:function(){return!!this.cronjobs.data.filter((function(t){return"busy"===t.status})).length},convertedFrequency:function(){return"minutely"===this.form.interval?this.form.frequency="* * * * *":"hourly"===this.form.interval?this.form.frequency="0 * * * *":"nightly"===this.form.interval?this.form.frequency="0 2 * * *":"weekly"===this.form.interval?this.form.frequency="0 0 * * 0":"monthly"===this.form.interval?this.form.frequency="0 0 1 * *":this.form.frequency}},props:{site:Object,cronjobs:Object},methods:{useNotification:k.a,startPollingInterval:function(){this.pollingInterval=setInterval(function(){this.poll()}.bind(this),3e3)},clearPollingInterval:function(){clearTimeout(this.pollingInterval),this.pollingInterval=null},poll:function(){this.$inertia.replace(this.route("sites.cronjobs.index",this.site.id),{only:["cronjobs"],preserveScroll:!0})},submit:function(){var t=this;this.sending=!0,this.$inertia.post(this.route("sites.cronjobs.store",this.site.id),this.form).then((function(){t.sending=!1,Object.keys(t.$page.props.errors).length||(t.form={command:"php /home/".concat(t.$page.props.auth.user.user_name,"/domain.com/script.php"),interval:"minutely",frequency:"* * * * *"})}))},confirmDelete:function(t){var e=this;Object(w.a)({title:this.__("Are you sure?"),message:this.__("Your cronjob will be deleted permanently, this action cannot be undone."),onConfirm:function(){return e.delete(t)}})},delete:function(t){this.$inertia.delete(this.route("sites.cronjobs.delete",[this.site.id,t.id]),{preserveScroll:!0})}},beforeDestroy:function(){this.clearPollingInterval()}},E=s(0),I=Object(E.a)(O,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("Page",[s("TopBar",{attrs:{breadcrumbs:t.breadcrumbs}}),t._v(" "),s("Content",[s("Container",[s("PageHeader",{scopedSlots:t._u([{key:"start",fn:function(){return[s("PageHeaderTitle",[t._v("Cronjobs")])]},proxy:!0}])}),t._v(" "),s("PageBody",[s("SettingsLayout",{scopedSlots:t._u([{key:"nav",fn:function(){return[s("Tabs",{attrs:{site:t.site}})]},proxy:!0},{key:"segments",fn:function(){return[s("SettingsSegment",{scopedSlots:t._u([{key:"title",fn:function(){return[t._v(t._s(t.__("Create")))]},proxy:!0},{key:"subtitle",fn:function(){return[t._v("\n "+t._s(t.__("Add a new cronjob here to run your background tasks with."))+"\n ")]},proxy:!0},{key:"form",fn:function(){return[s("form",{staticClass:"space-y-4",on:{submit:function(e){return e.preventDefault(),t.submit(e)}}},[s("FormInput",{attrs:{label:t.__("Command"),errors:t.$page.props.errors.command},model:{value:t.form.command,callback:function(e){t.$set(t.form,"command",e)},expression:"form.command"}}),t._v(" "),s("div",[s("label",{staticClass:"inline-block text-small font-medium"},[t._v("\n Frequency ("+t._s(t.convertedFrequency)+")\n ")]),t._v(" "),s("div",[s("label",{staticClass:"inline-flex items-center"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.form.interval,expression:"form.interval"}],staticClass:"form-radio",attrs:{type:"radio",value:"minutely"},domProps:{checked:t._q(t.form.interval,"minutely")},on:{change:function(e){return t.$set(t.form,"interval","minutely")}}}),t._v(" "),s("span",{staticClass:"ml-2"},[t._v("Every minute")])])]),t._v(" "),s("div",[s("label",{staticClass:"inline-flex items-center"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.form.interval,expression:"form.interval"}],staticClass:"form-radio",attrs:{type:"radio",name:"radio",value:"hourly"},domProps:{checked:t._q(t.form.interval,"hourly")},on:{change:function(e){return t.$set(t.form,"interval","hourly")}}}),t._v(" "),s("span",{staticClass:"ml-2"},[t._v("Hourly")])])]),t._v(" "),s("div",[s("label",{staticClass:"inline-flex items-center"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.form.interval,expression:"form.interval"}],staticClass:"form-radio",attrs:{type:"radio",name:"radio",value:"nightly"},domProps:{checked:t._q(t.form.interval,"nightly")},on:{change:function(e){return t.$set(t.form,"interval","nightly")}}}),t._v(" "),s("span",{staticClass:"ml-2"},[t._v("Nightly (2AM)")])])]),t._v(" "),s("div",[s("label",{staticClass:"inline-flex items-center"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.form.interval,expression:"form.interval"}],staticClass:"form-radio",attrs:{type:"radio",name:"radio",value:"weekly"},domProps:{checked:t._q(t.form.interval,"weekly")},on:{change:function(e){return t.$set(t.form,"interval","weekly")}}}),t._v(" "),s("span",{staticClass:"ml-2"},[t._v("Weekly")])])]),t._v(" "),s("div",[s("label",{staticClass:"inline-flex items-center"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.form.interval,expression:"form.interval"}],staticClass:"form-radio",attrs:{type:"radio",name:"radio",value:"monthly"},domProps:{checked:t._q(t.form.interval,"monthly")},on:{change:function(e){return t.$set(t.form,"interval","monthly")}}}),t._v(" "),s("span",{staticClass:"ml-2"},[t._v("Monthly")])])]),t._v(" "),s("div",[s("label",{staticClass:"inline-flex items-center"},[s("input",{directives:[{name:"model",rawName:"v-model",value:t.form.interval,expression:"form.interval"}],staticClass:"form-radio",attrs:{type:"radio",name:"radio",value:"custom"},domProps:{checked:t._q(t.form.interval,"custom")},on:{change:function(e){return t.$set(t.form,"interval","custom")}}}),t._v(" "),s("span",{staticClass:"ml-2"},[t._v("Custom")])])]),t._v(" "),s("FormInput",{directives:[{name:"show",rawName:"v-show",value:"custom"===t.form.interval,expression:"form.interval === 'custom'"}],attrs:{"helper-text":"min | hour | day/month | month | day/week",errors:t.$page.props.errors.frequency,label:t.__("Custom frequency")},model:{value:t.form.frequency,callback:function(e){t.$set(t.form,"frequency",e)},expression:"form.frequency"}})],1),t._v(" "),s("FormActions",[s("Button",[t._v(t._s(t.__("Save changes")))])],1)],1)]},proxy:!0}])}),t._v(" "),t.cronjobs.meta.total?t._e():s("EmptyImage"),t._v(" "),t.cronjobs.meta.total?s("SettingsSegment",{scopedSlots:t._u([{key:"title",fn:function(){return[t._v(t._s(t.__("Cronjobs")))]},proxy:!0},{key:"content",fn:function(){return[s("div",[s("Table",{attrs:{caption:"Cronjob list overview"}},[s("TableHead",[s("TableRow",[s("TableHeader"),t._v(" "),s("TableHeader",[t._v(t._s(t.__("Command")))]),t._v(" "),s("TableHeader",[t._v(t._s(t.__("Frequency")))]),t._v(" "),s("TableHeader")],1)],1),t._v(" "),s("TableBody",t._l(t.cronjobs.data,(function(e){return s("TableRow",{key:e.id},[s("TableData",[s("StatusBubble",{attrs:{variant:"busy"===e.status?"gray":"success"}})],1),t._v(" "),s("TableData",[t._v(t._s(e.command))]),t._v(" "),s("TableData",[t._v(t._s(e.frequency))]),t._v(" "),s("TableData",[s("Button",{attrs:{disabled:"busy"===e.status,variant:"danger",size:"sm"},on:{click:function(s){return t.confirmDelete(e)}}},[t._v("\n "+t._s(t.__("Delete"))+"\n ")])],1)],1)})),1)],1)],1),t._v(" "),s("pagination",{attrs:{links:t.cronjobs}})]},proxy:!0}],null,!1,723209988)}):t._e()]},proxy:!0}])})],1)],1)],1)],1)}),[],!1,null,null,null);e.default=I.exports},20:function(t,e,s){"use strict";var i={props:{caption:{type:String,required:!0}}},n=s(0),r=Object(n.a)(i,(function(){var t=this.$createElement,e=this._self._c||t;return e("table",{staticClass:"w-full text-left table-auto text-small"},[e("caption",{staticClass:"sr-only"},[this._v(this._s(this.caption))]),this._v(" "),this._t("default")],2)}),[],!1,null,null,null);e.a=r.exports},21:function(t,e,s){"use strict";var i={props:{border:{type:Boolean,default:!0}}},n=s(0),r=Object(n.a)(i,(function(){var t=this.$createElement;return(this._self._c||t)("td",{staticClass:"py-2",class:{"border-t border-low-emphasis":this.border}},[this._t("default")],2)}),[],!1,null,null,null);e.a=r.exports},22:function(t,e,s){"use strict";var i=s(0),n=Object(i.a)({},(function(){var t=this.$createElement;return(this._self._c||t)("thead",[this._t("default")],2)}),[],!1,null,null,null);e.a=n.exports},23:function(t,e,s){"use strict";var i=s(0),n=Object(i.a)({},(function(){var t=this.$createElement;return(this._self._c||t)("th",{staticClass:"pb-2"},[this._t("default")],2)}),[],!1,null,null,null);e.a=n.exports},24:function(t,e,s){"use strict";var i=s(0),n=Object(i.a)({},(function(){var t=this.$createElement;return(this._self._c||t)("tr",[this._t("default")],2)}),[],!1,null,null,null);e.a=n.exports},25:function(t,e,s){"use strict";var i=s(0),n=Object(i.a)({},(function(){var t=this.$createElement;return(this._self._c||t)("tbody",[this._t("default")],2)}),[],!1,null,null,null);e.a=n.exports},26:function(t,e,s){"use strict";s.d(e,"a",(function(){return n}));var i=s(62);function n(t){var e=t.title,s=t.message,n=t.onConfirm;return i.a.dispatch("confirmDelete/open",{title:e,message:s,onConfirm:function(){n(),i.a.dispatch("confirmDelete/close")}})}},28:function(t,e,s){"use strict";var i={props:{links:Object},computed:{determineLinks:function(){return this.links.meta?this.links.meta:this.links}}},n=s(0),r=Object(n.a)(i,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return t.determineLinks.per_page<t.determineLinks.total?s("div",{staticClass:"mt-6 -mb-1 flex flex-wrap"},[t._l(t.determineLinks.links,(function(e,i){return[null===e.url?s("div",{key:i,staticClass:"mr-1 mb-1 px-4 py-3 text-sm border rounded text-gray-400",class:{"ml-auto":"Next"===e.label}},[t._v(t._s(e.label))]):s("inertia-link",{key:i,staticClass:"mr-1 mb-1 px-2 py-1 text-sm rounded",class:{"shadow text-high-emphasis bg-surface-1":e.active,"ml-auto":"Next"===e.label},attrs:{href:e.url}},[t._v(t._s(e.label))])]}))],2):t._e()}),[],!1,null,null,null);e.a=r.exports},35:function(t,e,s){"use strict";s.r(e);var i=s(39),n=s(40),r=s(41),a=s(42),o={components:{TopBar:i.a,Breadcrumbs:n.a,TabBar:r.a,TopBarTabBarContainer:a.a},props:{breadcrumbs:Array},data:function(){return{tabBars:[{title:this.__("Dashboard"),to:this.route("dashboard"),active:this.route().current("dashboard")},{title:this.__("Sites"),to:this.route("sites.index"),active:this.route().current("sites.*")},{title:"Servers",to:this.route("servers.index")}]}}},l=s(0),c=Object(l.a)(o,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("TopBar",{scopedSlots:t._u([{key:"breadcrumbs",fn:function(){return[s("Breadcrumbs",{attrs:{items:t.breadcrumbs}})]},proxy:!0},{key:"tab-bar",fn:function(){return[s("TopBarTabBarContainer",[s("TabBar",{attrs:{items:t.tabBars}})],1)]},proxy:!0}])})}),[],!1,null,null,null);e.default=c.exports},36:function(t,e,s){"use strict";var i=s(0),n=Object(i.a)({},(function(){var t=this.$createElement;return(this._self._c||t)("img",{staticClass:"w-32 md:w-48 m-auto",attrs:{src:"/images/empty.png"}})}),[],!1,null,null,null);e.a=n.exports},37:function(t,e,s){"use strict";s.r(e);var i={props:{site:Object},data:function(){return{items:[{title:this.__("General"),to:this.route("sites.show",this.site.id),active:this.route().current("sites.show")},{title:this.__("Apps"),to:this.route("sites.apps.index",this.site.id),active:this.route().current("sites.apps.index")},{title:this.__("Databases"),to:this.route("sites.databases.index",this.site.id),active:this.route().current("sites.databases.index")},{title:this.__("Cronjobs"),to:this.route("sites.cronjobs.index",this.site.id),active:this.route().current("sites.cronjobs.index")},{title:this.__("Redirects"),to:this.route("sites.redirects.index",this.site.id),active:this.route().current("sites.redirects.index")},{title:this.__("Certificates"),to:this.route("sites.certificates.index",this.site.id),active:this.route().current("sites.certificates.index")},this.site.dns_id?{title:this.__("DNS"),to:this.route("sites.dns.index",this.site.id),active:this.route().current("sites.dns.index")}:null,this.can("sites","update")?{title:this.__("Settings"),to:this.route("sites.settings.show",this.site.id),active:this.route().current("sites.settings.show")}:null,{title:this.__("View site"),to:"http://".concat(this.site.domain),type:"a"}]}}},n=s(0),r=Object(n.a)(i,(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ul",{staticClass:"-ml-4 space-y-1"},t._l(t.items,(function(e){return e?s("li",[s(e.type&&"a"===e.type?"a":"inertia-link",{tag:"component",staticClass:"flex items-center h-10 px-4 font-medium text-medium-emphasis",class:{"rounded shadow text-primary bg-surface-3":e.active},attrs:{target:e.type&&"a"===e.type?"_blank":"_self",href:e.to}},[t._v(t._s(e.title)+" "+t._s(e.route))])],1):t._e()})),0)}),[],!1,null,null,null);e.default=r.exports}}]);