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

1 line
17 KiB
JavaScript
Vendored

(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{0:function(e,t,r){"use strict";function n(e,t,r,n,o,a,s,l){var i,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=r,u._compiled=!0),n&&(u.functional=!0),a&&(u._scopeId="data-v-"+a),s?(i=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},u._ssrRegister=i):o&&(i=l?function(){o.call(this,(u.functional?this.parent:this).$root.$options.shadowRoot)}:o),i)if(u.functional){u._injectStyles=i;var c=u.render;u.render=function(e,t){return i.call(t),c(e,t)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,i):[i]}return{exports:e,options:u}}r.d(t,"a",(function(){return n}))},159:function(e,t,r){"use strict";r.r(t);var n=r(58),o=r(1),a=r(6),s=r(7),l=r(8),i=r(9),u=r(10),c=r(2),d=r(11),p=r(12),f=r(4),v=r(5),m=r(3),h=r(33),_=r(29),g=r(30),b=r(50),x=r(61),w=r(36),y=r(31),C=r(34),I=r(13),B=r(27),S=r(14),$=r(47),z=r(48),k=r(49),P=r(60),T=r(26),O={metaInfo:function(){return{title:"".concat(this.__("Servers"))}},layout:m.a,components:{TopBar:n.default,Container:o.a,Content:a.a,Page:s.a,PageHeader:l.a,PageHeaderTitle:i.a,PageBody:u.a,Button:c.a,List:d.a,IconButton:b.a,IconMore:x.a,ListItem:p.a,StatusBubble:f.a,NotificationBadge:v.a,IconBox:h.a,IconGlobe:_.a,IconStorage:g.a,EmptyImage:w.a,Modal:y.a,ModalContainer:C.a,FormInput:I.a,FormActions:S.a,FormSelect:B.a,Dropdown:$.a,DropdownList:z.a,DropdownListItem:k.a,DropdownListItemButton:P.a},props:{servers:Object,dataProviders:Object},computed:{shouldBePolling:function(){return!!this.servers.data.filter((function(e){return"busy"===e.status})).length}},mounted:function(){this.shouldBePolling&&this.startPollingInterval()},watch:{shouldBePolling:function(e){e?this.pollingInterval||this.startPollingInterval():this.clearPollingInterval()},"form.provider":function(e){var t=this;if(!e)return this.regions=[],void(this.plans=[]);this.loading=!0,window.axios.get(this.route("servers.plans-and-regions",e)).then((function(e){t.loading=!1,t.regions=e.data.regions,t.plans=e.data.plans})).catch((function(e){t.loading=!1}))}},data:function(){return{loading:!1,form:{name:null,provider:null,region:null,plan:null},providers:this.dataProviders,regions:[],plans:[],pollingInterval:null,modalIsOpen:!1,breadcrumbs:[{title:this.$page.props.settings.name,to:"/"},{title:this.__("Servers"),to:this.route("servers.index")}]}},methods:{startPollingInterval:function(){this.pollingInterval=setInterval(function(){this.poll()}.bind(this),12e4)},clearPollingInterval:function(){clearTimeout(this.pollingInterval),this.pollingInterval=null},poll:function(){this.$inertia.replace(this.route("servers.index"),{only:["servers"],preserveScroll:!0})},submit:function(){var e=this;this.$inertia.post(this.route("servers.store"),this.form,{only:["errors","flash","servers"],onStart:function(){return e.loading=!0},onSuccess:function(){Object.keys(e.$page.props.errors).length||(e.form.domain=null,e.modalIsOpen=!1,e.form={name:null,provider:null,region:null,plan:null})},onFinish:function(){return e.loading=!1}})},confirmDelete:function(e){var t=this;Object(T.a)({title:this.__("Are you sure?"),message:"Your server will be deleted completely, this action is irreversible.",onConfirm:function(){return t.delete(e)}})},delete:function(e){this.$inertia.delete(this.route("servers.delete",e.id))}},beforeDestroy:function(){this.clearPollingInterval()}},E=r(0),M=Object(E.a)(O,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("Page",[e.can("servers","create")?r("Portal",{attrs:{to:"modals"}},[r("ModalContainer",[e.modalIsOpen?r("Modal",{on:{close:function(t){e.modalIsOpen=!1},submit:e.submit},scopedSlots:e._u([{key:"title",fn:function(){return[e._v(e._s(e.__("Create a server")))]},proxy:!0},{key:"form",fn:function(){return[r("FormInput",{attrs:{loading:e.loading,label:e.__("Name"),placeholder:"webserver-01",errors:e.$page.props.errors.name},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}}),e._v(" "),r("FormSelect",{attrs:{loading:e.loading,errors:e.$page.props.errors.provider,label:e.__("Select provider")},model:{value:e.form.provider,callback:function(t){e.$set(e.form,"provider",t)},expression:"form.provider"}},[r("option",{domProps:{value:"null"}},[e._v(e._s(e.__("Select random provider")))]),e._v(" "),e._l(e.providers,(function(t,n){return r("option",{domProps:{value:n}},[e._v(e._s(t))])}))],2),e._v(" "),r("FormSelect",{attrs:{loading:e.loading,errors:e.$page.props.errors.region,label:e.__("Select region")},model:{value:e.form.region,callback:function(t){e.$set(e.form,"region",t)},expression:"form.region"}},[r("option",{domProps:{value:"null"}},[e._v(e._s(e.__("Select random region")))]),e._v(" "),e._l(e.regions,(function(t,n){return r("option",{domProps:{value:n}},[e._v(e._s(t))])}))],2),e._v(" "),r("FormSelect",{attrs:{loading:e.loading,errors:e.$page.props.errors.plan,label:e.__("Select plan")},model:{value:e.form.plan,callback:function(t){e.$set(e.form,"plan",t)},expression:"form.plan"}},[r("option",{domProps:{value:"null"}},[e._v(e._s(e.__("Select random plan")))]),e._v(" "),e._l(e.plans,(function(t,n){return r("option",{domProps:{value:n}},[e._v(e._s(t))])}))],2)]},proxy:!0},{key:"form-actions",fn:function(){return[r("Button",{domProps:{textContent:e._s(e.__("Create"))}})]},proxy:!0}],null,!1,2259390341)}):e._e()],1)],1):e._e(),e._v(" "),r("TopBar",{attrs:{breadcrumbs:e.breadcrumbs}}),e._v(" "),r("Content",[r("Container",[r("PageHeader",{scopedSlots:e._u([{key:"start",fn:function(){return[r("PageHeaderTitle",[e._v(e._s(e.__("Servers")))])]},proxy:!0},e.can("servers","create")?{key:"end",fn:function(){return[r("Button",{on:{click:function(t){e.modalIsOpen=!0}}},[e._v(e._s(e.__("Create server")))])]},proxy:!0}:null],null,!0)}),e._v(" "),r("PageBody",[e.servers.meta.total?e._e():r("EmptyImage"),e._v(" "),r("List",e._l(e.servers.data,(function(t){return r("ListItem",{key:t.id,scopedSlots:e._u([{key:"prefix",fn:function(){return[r("StatusBubble",{attrs:{variant:"busy"===t.status?"gray":"success"}})]},proxy:!0},{key:"title",fn:function(){return[r("inertia-link",{staticClass:"text-primary font-medium",attrs:{href:e.route("servers.show",t.id)}},[e._v("\n "+e._s(t.name)+"\n ")])]},proxy:!0},{key:"subtitle",fn:function(){return[e._v(e._s(t.ip)+" "),t.ip?r("span",[e._v("·")]):e._e(),e._v("\n "+e._s(t.sites_count)+" "+e._s(e.__choice("site|sites",t.sites_count))+"\n ")]},proxy:!0},{key:"suffix",fn:function(){return[r("Dropdown",{scopedSlots:e._u([{key:"default",fn:function(n){var o=n.isOpen,a=n.toggle,s=n.position;return[r("IconButton",{on:{click:a}},[r("IconMore",{staticClass:"w-5 h-5"})],1),e._v(" "),o?r("DropdownList",{attrs:{position:s}},[r("DropdownListItem",{attrs:{to:e.route("servers.show",t.id)}},[e._v("View")]),e._v(" "),e.can("servers","delete")?r("DropdownListItemButton",{staticClass:"text-danger",on:{click:function(r){return e.confirmDelete(t)}}},[e._v("\n Delete\n ")]):e._e()],1):e._e()]}}],null,!0)})]},proxy:!0}],null,!0)})})),1)],1)],1)],1)],1)}),[],!1,null,null,null);t.default=M.exports},26:function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));var n=r(62);function o(e){var t=e.title,r=e.message,o=e.onConfirm;return n.a.dispatch("confirmDelete/open",{title:t,message:r,onConfirm:function(){o(),n.a.dispatch("confirmDelete/close")}})}},27:function(e,t,r){"use strict";var n=r(65),o=r(64),a=r(66),s=r(74),l={props:{id:{type:String,required:!1},label:{type:String,required:!0},type:{type:String,default:function(){return"text"}},required:{type:Boolean,default:function(){return!1}},helperText:{type:String},errors:{type:Array},placeholder:{type:String},value:{required:!1,default:""},loading:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1}},components:{FormGroup:n.a,Label:o.a,ErrorText:a.a,HelperText:s.a},data:function(){return{defaultClasses:"w-full border-medium-emphasis text-body h-10 max-w-lg px-2 border rounded bg-surface-1 focus:outline-none focus:border-primary",selected:this.value}},methods:{updateValue:function(e){this.$emit("input",e)}}},i=r(0),u=Object(i.a)(l,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("FormGroup",[r("Label",{attrs:{errors:e.errors,forId:e.id}},[e._v(e._s(e.label))]),e._v(" "),r("select",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],class:[e.defaultClasses,e.disabled||e.loading?"opacity-50":"",e.loading?"cursor-wait":""],attrs:{disabled:e.loading||e.disabled,id:e.id,required:e.required,placeholder:e.placeholder},on:{input:function(t){return e.updateValue(t.target.value)},change:function(t){var r=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){return"_value"in e?e._value:e.value}));e.value=t.target.multiple?r:r[0]}}},[e._t("default")],2),e._v(" "),e.errors?r("ErrorText",[e._v(e._s(e.errors[0]))]):e._e(),e._v(" "),e.helperText&&!e.errors?r("HelperText",[e._v(e._s(e.helperText))]):e._e()],1)}),[],!1,null,null,null);t.a=u.exports},29:function(e,t,r){"use strict";var n=r(0),o=Object(n.a)({},(function(){var e=this.$createElement,t=this._self._c||e;return t("svg",{attrs:{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M1.018 7.5h2.49c.037-1.07.189-2.087.437-3.008a9.124 9.124 0 0 1-1.565-.667A6.964 6.964 0 0 0 1.018 7.5zM3.05 3.049c.362.184.763.349 1.198.49.142-.384.304-.744.481-1.078a6.7 6.7 0 0 1 .597-.933A7.01 7.01 0 0 0 3.051 3.05zM8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm-.5 1.077c-.67.204-1.335.82-1.887 1.855-.143.268-.276.56-.395.872.705.157 1.473.257 2.282.287V1.077zm0 4.014c-.91-.03-1.783-.145-2.591-.332a12.344 12.344 0 0 0-.4 2.741H7.5V5.091zm1 2.409V5.091c.91-.03 1.783-.145 2.591-.332.223.827.364 1.754.4 2.741H8.5zm-1 1H4.51c.035.987.176 1.914.399 2.741A13.596 13.596 0 0 1 7.5 10.91V8.5zm1 2.409V8.5h2.99a12.343 12.343 0 0 1-.399 2.741A13.596 13.596 0 0 0 8.5 10.91zm-1 1c-.81.03-1.577.13-2.282.287.12.312.252.604.395.872.552 1.035 1.218 1.65 1.887 1.855V11.91zm-2.173 2.563a6.695 6.695 0 0 1-.597-.933 8.857 8.857 0 0 1-.481-1.078 8.356 8.356 0 0 0-1.198.49 7.01 7.01 0 0 0 2.276 1.52zM2.38 12.175c.47-.258.995-.482 1.565-.667A13.36 13.36 0 0 1 3.508 8.5h-2.49a6.964 6.964 0 0 0 1.362 3.675zm8.293 2.297a7.01 7.01 0 0 0 2.275-1.521 8.353 8.353 0 0 0-1.197-.49 8.859 8.859 0 0 1-.481 1.078 6.688 6.688 0 0 1-.597.933zm.11-2.276A12.63 12.63 0 0 0 8.5 11.91v3.014c.67-.204 1.335-.82 1.887-1.855.143-.268.276-.56.395-.872zm1.272-.688c.57.185 1.095.409 1.565.667A6.964 6.964 0 0 0 14.982 8.5h-2.49a13.355 13.355 0 0 1-.437 3.008zm.437-4.008h2.49a6.963 6.963 0 0 0-1.362-3.675c-.47.258-.995.482-1.565.667.248.92.4 1.938.437 3.008zm-.74-3.96a8.854 8.854 0 0 0-.482-1.079 6.692 6.692 0 0 0-.597-.933c.857.355 1.63.875 2.275 1.521a8.368 8.368 0 0 1-1.197.49zm-.97.264c-.705.157-1.473.257-2.282.287V1.077c.67.204 1.335.82 1.887 1.855.143.268.276.56.395.872z"}})])}),[],!1,null,null,null);t.a=o.exports},30:function(e,t,r){"use strict";var n=r(0),o=Object(n.a)({},(function(){var e=this.$createElement,t=this._self._c||e;return t("svg",{attrs:{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M14 9H2a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a1 1 0 0 0-1-1zM2 8a2 2 0 0 0-2 2v1a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-1a2 2 0 0 0-2-2H2z"}}),this._v(" "),t("path",{attrs:{d:"M5 10.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0zm-2 0a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0z"}}),this._v(" "),t("path",{attrs:{"fill-rule":"evenodd",d:"M4.094 4a.5.5 0 0 0-.44.26l-2.47 4.532A1.5 1.5 0 0 0 1 9.51v.99H0v-.99c0-.418.105-.83.305-1.197l2.472-4.531A1.5 1.5 0 0 1 4.094 3h7.812a1.5 1.5 0 0 1 1.317.782l2.472 4.53c.2.368.305.78.305 1.198v.99h-1v-.99a1.5 1.5 0 0 0-.183-.718L12.345 4.26a.5.5 0 0 0-.439-.26H4.094z"}})])}),[],!1,null,null,null);t.a=o.exports},31:function(e,t,r){"use strict";var n=r(0),o=Object(n.a)({},(function(){var e=this.$createElement,t=this._self._c||e;return t("svg",{attrs:{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M11.854 4.146a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708-.708l7-7a.5.5 0 0 1 .708 0z"}}),this._v(" "),t("path",{attrs:{"fill-rule":"evenodd",d:"M4.146 4.146a.5.5 0 0 0 0 .708l7 7a.5.5 0 0 0 .708-.708l-7-7a.5.5 0 0 0-.708 0z"}})])}),[],!1,null,null,null).exports,a=r(14),s=r(18),l={components:{IconClose:o,FormActions:a.a,Form:s.a}},i=Object(n.a)(l,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("aside",{directives:[{name:"click-outside",rawName:"v-click-outside",value:function(){return e.$emit("close")},expression:"() => $emit('close')"}],staticClass:"relative w-full h-full max-w-lg p-8 rounded shadow-2xl pointer-events-auto bg-overlay bf-blur"},[r("button",{staticClass:"absolute top-0 right-0 flex items-center justify-center w-12 h-12",on:{click:function(t){return e.$emit("close")}}},[r("IconClose",{staticClass:"w-8 h-8 text-low-emphasis"})],1),e._v(" "),r("Form",{on:{submit:function(t){return e.$emit("submit")}}},[r("div",[r("h2",{staticClass:"font-medium text-title"},[e._t("title")],2),e._v(" "),r("p",{staticClass:"text-medium-emphasis"},[e._t("subtitle")],2)]),e._v(" "),e._t("form"),e._v(" "),r("FormActions",[e._t("form-actions")],2)],2)],1)}),[],!1,null,null,null);t.a=i.exports},33:function(e,t,r){"use strict";var n=r(0),o=Object(n.a)({},(function(){var e=this.$createElement,t=this._self._c||e;return t("svg",{attrs:{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M8.186 1.113a.5.5 0 0 0-.372 0L1.846 3.5l2.404.961L10.404 2l-2.218-.887zm3.564 1.426L5.596 5 8 5.961 14.154 3.5l-2.404-.961zm3.25 1.7l-6.5 2.6v7.922l6.5-2.6V4.24zM7.5 14.762V6.838L1 4.239v7.923l6.5 2.6zM7.443.184a1.5 1.5 0 0 1 1.114 0l7.129 2.852A.5.5 0 0 1 16 3.5v8.662a1 1 0 0 1-.629.928l-7.185 2.874a.5.5 0 0 1-.372 0L.63 13.09a1 1 0 0 1-.63-.928V3.5a.5.5 0 0 1 .314-.464L7.443.184z"}})])}),[],!1,null,null,null);t.a=o.exports},34:function(e,t,r){"use strict";var n=r(0),o=Object(n.a)({},(function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"fixed inset-0 z-50 flex flex-col items-end w-full h-screen p-6 pointer-events-none"},[t("Transition",{attrs:{"enter-active-class":"transition ease-out transform duration-slow","enter-class":"scale-95 translate-x-full","enter-to-class":"scale-100 translate-x-0","leave-active-class":"transition ease-out transform duration-slow","leave-class":"scale-95 translate-x-0","leave-to-class":"scale-95 translate-x-full"}},[this._t("default")],2)],1)}),[],!1,null,null,null);t.a=o.exports},36:function(e,t,r){"use strict";var n=r(0),o=Object(n.a)({},(function(){var e=this.$createElement;return(this._self._c||e)("img",{staticClass:"w-32 md:w-48 m-auto",attrs:{src:"/images/empty.png"}})}),[],!1,null,null,null);t.a=o.exports},58:function(e,t,r){"use strict";r.r(t);var n=r(39),o=r(40),a=r(41),s=r(42),l={components:{TopBar:n.a,Breadcrumbs:o.a,TabBar:a.a,TopBarTabBarContainer:s.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"),active:this.route().current("servers.*")}]}}},i=r(0),u=Object(i.a)(l,(function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("TopBar",{scopedSlots:e._u([{key:"breadcrumbs",fn:function(){return[r("Breadcrumbs",{attrs:{items:e.breadcrumbs}})]},proxy:!0},{key:"tab-bar",fn:function(){return[r("TopBarTabBarContainer",[r("TabBar",{attrs:{items:e.tabBars}})],1)]},proxy:!0}])})}),[],!1,null,null,null);t.default=u.exports},60:function(e,t,r){"use strict";var n={props:{as:{default:"inertia-link"},to:{type:String,required:!1},method:{required:!1,default:"get"}}},o=r(0),a=Object(o.a)(n,(function(){var e=this,t=e.$createElement;return(e._self._c||t)("button",{staticClass:"flex items-center w-full h-10 px-6 whitespace-no-wrap text-medium-emphasis text-small focus:bg-primary focus:text-on-primary hover:text-high-emphasis focus:outline-none",on:{click:function(t){return e.$emit("click")}}},[e._t("default")],2)}),[],!1,null,null,null);t.a=a.exports},61:function(e,t,r){"use strict";var n=r(0),o=Object(n.a)({},(function(){var e=this.$createElement,t=this._self._c||e;return t("svg",{attrs:{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"}},[t("path",{attrs:{"fill-rule":"evenodd",d:"M3 9.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"}})])}),[],!1,null,null,null);t.a=o.exports}}]);