diff --git a/dist/js/tool.js b/dist/js/tool.js index 9d19ea2..1e272f4 100644 --- a/dist/js/tool.js +++ b/dist/js/tool.js @@ -1 +1 @@ -!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e){t.exports=function(t,e,n,r,o,i){var a,s=t=t||{},u=typeof t.default;"object"!==u&&"function"!==u||(a=t,s=t.default);var c,l="function"==typeof s?s.options:s;if(e&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0),n&&(l.functional=!0),o&&(l._scopeId=o),i?(c=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__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},l._ssrRegister=c):r&&(c=r),c){var d=l.functional,p=d?l.render:l.beforeCreate;d?(l._injectStyles=c,l.render=function(t,e){return c.call(e),p(t,e)}):l.beforeCreate=p?[].concat(p,c):[c]}return{esModule:a,exports:s,options:l}}},function(t,e,n){t.exports=n(2)},function(t,e,n){Nova.booting(function(t,e){e.addRoutes([{name:"BackupTool",path:"/backups",component:n(3)}])})},function(t,e,n){var r=n(0)(n(4),n(26),!1,null,null,null);t.exports=r.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),o=n.n(r),i=function(){return window.axios.get("/nova-vendor/spatie/backup-tool/backup-statuses").then(function(t){return t.data})},a=function(t){return window.axios.get("/nova-vendor/spatie/backup-tool/backups?disk="+t).then(function(t){return t.data})},s=function(){return window.axios.post("/nova-vendor/spatie/backup-tool/backups")},u=function(t){return window.axios.post("/nova-vendor/spatie/backup-tool/backups",{option:t})},c=function(t){var e=t.disk,n=t.path;return window.axios.delete("/nova-vendor/spatie/backup-tool/backups",{params:{disk:e,path:n}})},l=n(8),d=n.n(l),p=n(19),f=n.n(p);e.default={metaInfo:function(){return{title:__("Backups")}},components:{Backups:d.a,BackupStatuses:f.a},computed:{disks:function(){return this.backupStatuses.map(function(t){return t.disk})}},data:function(){return{activeDisk:null,activeDiskBackups:[],backupStatuses:[],initialLoading:!0,modalVisibility:!1,loading:!0}},created:function(){var t,e=(t=o.a.mark(function t(){return o.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.initialLoading=!1,t.next=3,this.updateBackupStatuses();case 3:return t.next=5,this.updateActiveDiskBackups();case 5:this.loading=!1,this.startPolling();case 7:case"end":return t.stop()}},t,this)}),function(){var e=t.apply(this,arguments);return new Promise(function(t,n){return function r(o,i){try{var a=e[o](i),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}("next")})});return function(){return e.apply(this,arguments)}}(),methods:{updateBackupStatuses:function(){var t=this;return i().then(function(e){t.backupStatuses=e,t.activeDisk||(t.activeDisk=e[0].disk)})},updateActiveDiskBackups:function(){var t=this;if(this.activeDisk)return a(this.activeDisk).then(function(e){t.activeDiskBackups=e})},createBackup:function(){return this.$toasted.show(this.__("Creating a new backup in the background..."),{type:"success"}),s()},createPartialBackup:function(t){return this.$toasted.show(this.__("Creating a new backup in the background...")+" ("+t+")",{type:"success"}),this.$refs.backupDropdownMenu.toggle(),u(t)},deleteBackup:function(t){var e=t.disk,n=t.path;return c({disk:e,path:n})},startPolling:function(){var t=this;if(Nova.config.nova_backup_tool.polling){var e=window.setInterval(function(){t.modalVisibility||(t.updateBackupStatuses(),t.updateActiveDiskBackups())},1e3*Nova.config.nova_backup_tool.polling_interval);this.$once("hook:beforeDestroy",function(){window.clearInterval(e)})}},setModalVisibility:function(t){this.modalVisibility=t}}}},function(t,e,n){t.exports=n(6)},function(t,e,n){var r=function(){return this}()||Function("return this")(),o=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,i=o&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(7),o)r.regeneratorRuntime=i;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";var n,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag",c="object"==typeof t,l=e.regeneratorRuntime;if(l)c&&(t.exports=l);else{(l=e.regeneratorRuntime=c?t.exports:{}).wrap=k;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",v={},_={};_[a]=function(){return this};var g=Object.getPrototypeOf,m=g&&g(g(O([])));m&&m!==r&&o.call(m,a)&&(_=m);var y=C.prototype=w.prototype=Object.create(_);x.prototype=y.constructor=C,C.constructor=x,C[u]=x.displayName="GeneratorFunction",l.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},l.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,C):(t.__proto__=C,u in t||(t[u]="GeneratorFunction")),t.prototype=Object.create(y),t},l.awrap=function(t){return{__await:t}},D(L.prototype),L.prototype[s]=function(){return this},l.AsyncIterator=L,l.async=function(t,e,n,r){var o=new L(k(t,e,n,r));return l.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},D(y),y[u]="Generator",y[a]=function(){return this},y.toString=function(){return"[object Generator]"},l.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},l.values=O,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return s.type="throw",s.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),c=o.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function k(t,e,n,r){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),a=new M(r||[]);return i._invoke=function(t,e,n){var r=d;return function(o,i){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return R()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=B(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=b(t,e,n);if("normal"===u.type){if(r=n.done?h:p,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}(t,n,a),i}function b(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function w(){}function x(){}function C(){}function D(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(n,r){function i(){return new Promise(function(e,i){!function e(n,r,i,a){var s=b(t[n],t,r);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&o.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(c).then(function(t){u.value=t,i(u)},a)}a(s.arg)}(n,r,e,i)})}return e=e?e.then(i,i):i()}}function B(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,B(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=b(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++rn.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(o=0;o1?n("div",{staticClass:"p-3 flex items-center border-b border-50"},[n("select",{staticClass:"form-control form-select",domProps:{value:t.activeDisk},on:{input:function(e){return t.$emit("update:activeDisk",e.target.value)}}},t._l(t.disks,function(e){return n("option",{key:e,domProps:{value:e}},[t._v("\n "+t._s(e)+"\n ")])}),0)]):t._e(),t._v(" "),n("table",{staticClass:"table w-full",attrs:{cellpadding:"0",cellspacing:"0"}},[n("thead",[n("tr",[n("th",{staticClass:"text-left"},[t._v("\n "+t._s(t.__("Path"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left"},[t._v("\n "+t._s(t.__("Created at"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left"},[t._v("\n "+t._s(t.__("Size"))+"\n ")]),t._v(" "),n("th")])]),t._v(" "),n("tbody",[t._l(t.backups,function(e){return n("backup",t._b({key:e.id,attrs:{disk:t.activeDisk,deletable:t.backups.length>1,deleting:!t.deleteModalOpen&&t.deletingBackup&&e.path===t.deletingBackup.path},on:{delete:function(n){return t.openDeleteModal(e)}}},"backup",e,!1))}),t._v(" "),0===t.backups.length?n("tr",[n("td",{staticClass:"text-center",attrs:{colspan:"4"}},[t._v("\n "+t._s(t.__("No backups present"))+"\n ")])]):t._e()],2)]),t._v(" "),n("portal",{attrs:{to:"modals"}},[n("transition",{attrs:{name:"fade"}},[t.deleteModalOpen?n("delete-resource-modal",{attrs:{mode:"delete"},on:{confirm:t.confirmDelete,close:t.closeDeleteModal}},[n("div",{staticClass:"p-8"},[n("heading",{staticClass:"mb-6",attrs:{level:2}},[t._v("\n "+t._s(t.__("Delete backup"))+"\n ")]),t._v(" "),n("p",{staticClass:"text-80 leading-normal"},[t._v("\n "+t._s(t.__("Are you sure you want to delete the backup created at :date ?",{date:t.deletingBackup.date}))+"\n ")])],1)]):t._e()],1)],1)],1)},staticRenderFns:[]}},function(t,e,n){var r=n(0)(n(20),n(25),!1,null,null,null);t.exports=r.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(21),o=n.n(r),i=n(23),a=n.n(i);e.default={props:{backupStatuses:{required:!0,type:Array}},components:{IconHealthy:o.a,IconUnhealthy:a.a}}},function(t,e,n){var r=n(0)(null,n(22),!1,null,null,null);t.exports=r.exports},function(t,e){t.exports={render:function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M2.93 17.07A10 10 0 1 0 17.07 2.93 10 10 0 0 0 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM4 10l2-2 3 3 5-5 2 2-7 7-5-5z",fill:"var(--success)","fill-rule":"evenodd"}})])},staticRenderFns:[]}},function(t,e,n){var r=n(0)(null,n(24),!1,null,null,null);t.exports=r.exports},function(t,e){t.exports={render:function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M11.41 10l2.83-2.83-1.41-1.41L10 8.59 7.17 5.76 5.76 7.17 8.59 10l-2.83 2.83 1.41 1.41L10 11.41l2.83 2.83 1.41-1.41L11.41 10zm-8.48 7.07A10 10 0 1 0 17.07 2.93 10 10 0 0 0 2.93 17.07zm1.41-1.41A8 8 0 1 0 15.66 4.34 8 8 0 0 0 4.34 15.66z",fill:"var(--danger)","fill-rule":"evenodd"}})])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table w-full",attrs:{cellpadding:"0",cellspacing:"0"}},[n("thead",[n("tr",[n("th",{staticClass:"text-left rounded-tl"},[t._v("\n "+t._s(t.__("Name"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left rounded-tl"},[t._v("\n "+t._s(t.__("Disk"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left"},[t._v("\n "+t._s(t.__("Healthy"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left"},[t._v("\n "+t._s(t.__("Amount of backups"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left"},[t._v("\n "+t._s(t.__("Newest backup"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left rounded-tr"},[t._v("\n "+t._s(t.__("Used Storage"))+"\n ")])])]),t._v(" "),n("tbody",t._l(t.backupStatuses,function(e){return n("tr",{key:e.disk},[n("td",[t._v(t._s(t.__(e.name)))]),t._v(" "),n("td",[t._v(t._s(t.__(e.disk)))]),t._v(" "),n("td",[n(e.healthy?"icon-healthy":"icon-unhealthy",{tag:"svg",attrs:{height:"24px"}})],1),t._v(" "),n("td",[t._v(t._s(e.amount))]),t._v(" "),n("td",[t._v(t._s(e.newest))]),t._v(" "),n("td",[t._v(t._s(e.usedStorage))])])}),0)])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("loading-view",{attrs:{loading:t.initialLoading}},[n("div",{staticClass:"flex mb-6 items-center justify-between"},[n("heading",[t._v("\n "+t._s(t.__("Backups"))+"\n ")]),t._v(" "),n("button",{staticClass:"btn btn-default btn-primary ml-auto mr-3",on:{click:t.createBackup}},[t._v("\n "+t._s(t.__("Create Backup"))+"\n ")]),t._v(" "),n("dropdown",{ref:"backupDropdownMenu",attrs:{dusk:"select-all-dropdown"},scopedSlots:t._u([{key:"default",fn:function(t){var e=t.toggle;return n("dropdown-trigger",{staticClass:"mr-3",attrs:{"show-arrow":!1,handleClick:e}},[n("button",{staticClass:"btn btn-default btn-icon btn-primary font-normal no-text-shadow"},[n("icon",{staticClass:"text-white",attrs:{type:"menu","view-box":"0 0 24 24",width:"20",height:"20"}})],1)])}}])},[t._v(" "),n("dropdown-menu",{attrs:{slot:"menu",direction:"rtl",width:"250"},slot:"menu"},[n("ul",{staticClass:"list-reset"},[n("li",[n("a",{staticClass:"block p-3 text-90 hover:bg-30 cursor-pointer",on:{click:function(e){return e.preventDefault(),t.createPartialBackup("only-db")}}},[t._v("\n "+t._s(t.__("Create database backup"))+"\n ")])]),t._v(" "),n("li",[n("a",{staticClass:"block p-3 text-90 hover:bg-30 cursor-pointer",on:{click:function(e){return e.preventDefault(),t.createPartialBackup("only-files")}}},[t._v("\n "+t._s(t.__("Create files backup"))+"\n ")])])])])],1)],1),t._v(" "),n("loading-card",{staticClass:"mb-6",attrs:{loading:t.loading}},[n("backup-statuses",{attrs:{"backup-statuses":t.backupStatuses}})],1),t._v(" "),n("loading-card",{attrs:{loading:t.loading}},[t.activeDisk?n("backups",{attrs:{disks:t.disks,backups:t.activeDiskBackups,"active-disk":t.activeDisk},on:{"update:activeDisk":function(e){t.activeDisk=e},"update:active-disk":function(e){t.activeDisk=e},delete:t.deleteBackup,setModalVisibility:t.setModalVisibility}}):t._e()],1)],1)},staticRenderFns:[]}}]); \ No newline at end of file +!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(t,e){t.exports=function(t,e,n,r,i,o){var a,s=t=t||{},u=typeof t.default;"object"!==u&&"function"!==u||(a=t,s=t.default);var c,l="function"==typeof s?s.options:s;if(e&&(l.render=e.render,l.staticRenderFns=e.staticRenderFns,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId=i),o?(c=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__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},l._ssrRegister=c):r&&(c=r),c){var d=l.functional,p=d?l.render:l.beforeCreate;d?(l._injectStyles=c,l.render=function(t,e){return c.call(e),p(t,e)}):l.beforeCreate=p?[].concat(p,c):[c]}return{esModule:a,exports:s,options:l}}},function(t,e,n){t.exports=n(2)},function(t,e,n){Nova.booting(function(t,e){e.addRoutes([{name:"BackupTool",path:"/backups",component:n(3)}])})},function(t,e,n){var r=n(0)(n(4),n(26),!1,null,null,null);t.exports=r.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),i=n.n(r),o=function(){return window.axios.get("/nova-vendor/spatie/backup-tool/backup-statuses").then(function(t){return t.data})},a=function(t){return window.axios.get("/nova-vendor/spatie/backup-tool/backups?disk="+t).then(function(t){return t.data})},s=function(){return window.axios.post("/nova-vendor/spatie/backup-tool/backups")},u=function(t){return window.axios.post("/nova-vendor/spatie/backup-tool/backups",{option:t})},c=function(t){var e=t.disk,n=t.path;return window.axios.delete("/nova-vendor/spatie/backup-tool/backups",{params:{disk:e,path:n}})},l=n(8),d=n.n(l),p=n(19),f=n.n(p);e.default={metaInfo:function(){return{title:__("Backups")}},components:{Backups:d.a,BackupStatuses:f.a},computed:{disks:function(){return this.backupStatuses.map(function(t){return t.disk})}},data:function(){return{activeDisk:null,activeDiskBackups:[],backupStatuses:[],initialLoading:!0,modalVisibility:!1,loading:!0}},created:function(){var t,e=(t=i.a.mark(function t(){return i.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return this.initialLoading=!1,t.next=3,this.updateBackupStatuses();case 3:return t.next=5,this.updateActiveDiskBackups();case 5:this.loading=!1,this.startPolling();case 7:case"end":return t.stop()}},t,this)}),function(){var e=t.apply(this,arguments);return new Promise(function(t,n){return function r(i,o){try{var a=e[i](o),s=a.value}catch(t){return void n(t)}if(!a.done)return Promise.resolve(s).then(function(t){r("next",t)},function(t){r("throw",t)});t(s)}("next")})});return function(){return e.apply(this,arguments)}}(),methods:{updateBackupStatuses:function(){var t=this;return o().then(function(e){t.backupStatuses=e,t.activeDisk||(t.activeDisk=e[0].disk)})},updateActiveDiskBackups:function(){var t=this;if(this.activeDisk)return a(this.activeDisk).then(function(e){t.activeDiskBackups=e})},createBackup:function(){return this.$toasted.show(this.__("Creating a new backup in the background..."),{type:"success"}),s()},createPartialBackup:function(t){return this.$toasted.show(this.__("Creating a new backup in the background...")+" ("+t+")",{type:"success"}),this.$refs.backupDropdownMenu.$children[0].hide(),u(t)},deleteBackup:function(t){var e=t.disk,n=t.path;return c({disk:e,path:n})},startPolling:function(){var t=this;if(Nova.config.nova_backup_tool.polling){var e=window.setInterval(function(){t.modalVisibility||(t.updateBackupStatuses(),t.updateActiveDiskBackups())},1e3*Nova.config.nova_backup_tool.polling_interval);this.$once("hook:beforeDestroy",function(){window.clearInterval(e)})}},setModalVisibility:function(t){this.modalVisibility=t}}}},function(t,e,n){t.exports=n(6)},function(t,e,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(7),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";var n,r=Object.prototype,i=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag",c="object"==typeof t,l=e.regeneratorRuntime;if(l)c&&(t.exports=l);else{(l=e.regeneratorRuntime=c?t.exports:{}).wrap=b;var d="suspendedStart",p="suspendedYield",f="executing",h="completed",v={},_={};_[a]=function(){return this};var g=Object.getPrototypeOf,m=g&&g(g(O([])));m&&m!==r&&i.call(m,a)&&(_=m);var y=C.prototype=w.prototype=Object.create(_);x.prototype=y.constructor=C,C.constructor=x,C[u]=x.displayName="GeneratorFunction",l.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===x||"GeneratorFunction"===(e.displayName||e.name))},l.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,C):(t.__proto__=C,u in t||(t[u]="GeneratorFunction")),t.prototype=Object.create(y),t},l.awrap=function(t){return{__await:t}},D(L.prototype),L.prototype[s]=function(){return this},l.AsyncIterator=L,l.async=function(t,e,n,r){var i=new L(b(t,e,n,r));return l.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},D(y),y[u]="Generator",y[a]=function(){return this},y.toString=function(){return"[object Generator]"},l.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},l.values=O,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(M),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,i){return s.type="throw",s.arg=t,e.next=r,i&&(e.method="next",e.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),M(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;M(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function b(t,e,n,r){var i=e&&e.prototype instanceof w?e:w,o=Object.create(i.prototype),a=new S(r||[]);return o._invoke=function(t,e,n){var r=d;return function(i,o){if(r===f)throw new Error("Generator is already running");if(r===h){if("throw"===i)throw o;return R()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=B(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var u=k(t,e,n);if("normal"===u.type){if(r=n.done?h:p,u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=h,n.method="throw",n.arg=u.arg)}}}(t,n,a),o}function k(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function w(){}function x(){}function C(){}function D(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function L(t){var e;this._invoke=function(n,r){function o(){return new Promise(function(e,o){!function e(n,r,o,a){var s=k(t[n],t,r);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==typeof c&&i.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,o,a)},function(t){e("throw",t,o,a)}):Promise.resolve(c).then(function(t){u.value=t,o(u)},a)}a(s.arg)}(n,r,e,o)})}return e=e?e.then(o,o):o()}}function B(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,B(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var i=k(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,v;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,v):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function E(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function M(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++rn.parts.length&&(r.parts.length=n.parts.length)}else{var a=[];for(i=0;i1?n("div",{staticClass:"p-3 flex items-center border-b border-50"},[n("select",{staticClass:"form-control form-select",domProps:{value:t.activeDisk},on:{input:function(e){return t.$emit("update:activeDisk",e.target.value)}}},t._l(t.disks,function(e){return n("option",{key:e,domProps:{value:e}},[t._v("\n "+t._s(e)+"\n ")])}),0)]):t._e(),t._v(" "),n("table",{staticClass:"table w-full",attrs:{cellpadding:"0",cellspacing:"0"}},[n("thead",[n("tr",[n("th",{staticClass:"text-left"},[t._v("\n "+t._s(t.__("Path"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left"},[t._v("\n "+t._s(t.__("Created at"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left"},[t._v("\n "+t._s(t.__("Size"))+"\n ")]),t._v(" "),n("th")])]),t._v(" "),n("tbody",[t._l(t.backups,function(e){return n("backup",t._b({key:e.id,attrs:{disk:t.activeDisk,deletable:t.backups.length>1,deleting:!t.deleteModalOpen&&t.deletingBackup&&e.path===t.deletingBackup.path},on:{delete:function(n){return t.openDeleteModal(e)}}},"backup",e,!1))}),t._v(" "),0===t.backups.length?n("tr",[n("td",{staticClass:"text-center",attrs:{colspan:"4"}},[t._v("\n "+t._s(t.__("No backups present"))+"\n ")])]):t._e()],2)]),t._v(" "),n("portal",{attrs:{to:"modals"}},[n("transition",{attrs:{name:"fade"}},[t.deleteModalOpen?n("delete-resource-modal",{attrs:{mode:"delete"},on:{confirm:t.confirmDelete,close:t.closeDeleteModal}},[n("div",{staticClass:"p-8"},[n("heading",{staticClass:"mb-6",attrs:{level:2}},[t._v("\n "+t._s(t.__("Delete backup"))+"\n ")]),t._v(" "),n("p",{staticClass:"text-80 leading-normal"},[t._v("\n "+t._s(t.__("Are you sure you want to delete the backup created at :date ?",{date:t.deletingBackup.date}))+"\n ")])],1)]):t._e()],1)],1)],1)},staticRenderFns:[]}},function(t,e,n){var r=n(0)(n(20),n(25),!1,null,null,null);t.exports=r.exports},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(21),i=n.n(r),o=n(23),a=n.n(o);e.default={props:{backupStatuses:{required:!0,type:Array}},components:{IconHealthy:i.a,IconUnhealthy:a.a}}},function(t,e,n){var r=n(0)(null,n(22),!1,null,null,null);t.exports=r.exports},function(t,e){t.exports={render:function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M2.93 17.07A10 10 0 1 0 17.07 2.93 10 10 0 0 0 2.93 17.07zm12.73-1.41A8 8 0 1 0 4.34 4.34a8 8 0 0 0 11.32 11.32zM4 10l2-2 3 3 5-5 2 2-7 7-5-5z",fill:"var(--success)","fill-rule":"evenodd"}})])},staticRenderFns:[]}},function(t,e,n){var r=n(0)(null,n(24),!1,null,null,null);t.exports=r.exports},function(t,e){t.exports={render:function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"}},[e("path",{attrs:{d:"M11.41 10l2.83-2.83-1.41-1.41L10 8.59 7.17 5.76 5.76 7.17 8.59 10l-2.83 2.83 1.41 1.41L10 11.41l2.83 2.83 1.41-1.41L11.41 10zm-8.48 7.07A10 10 0 1 0 17.07 2.93 10 10 0 0 0 2.93 17.07zm1.41-1.41A8 8 0 1 0 15.66 4.34 8 8 0 0 0 4.34 15.66z",fill:"var(--danger)","fill-rule":"evenodd"}})])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("table",{staticClass:"table w-full",attrs:{cellpadding:"0",cellspacing:"0"}},[n("thead",[n("tr",[n("th",{staticClass:"text-left rounded-tl"},[t._v("\n "+t._s(t.__("Name"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left rounded-tl"},[t._v("\n "+t._s(t.__("Disk"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left"},[t._v("\n "+t._s(t.__("Healthy"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left"},[t._v("\n "+t._s(t.__("Amount of backups"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left"},[t._v("\n "+t._s(t.__("Newest backup"))+"\n ")]),t._v(" "),n("th",{staticClass:"text-left rounded-tr"},[t._v("\n "+t._s(t.__("Used Storage"))+"\n ")])])]),t._v(" "),n("tbody",t._l(t.backupStatuses,function(e){return n("tr",{key:e.disk},[n("td",[t._v(t._s(t.__(e.name)))]),t._v(" "),n("td",[t._v(t._s(t.__(e.disk)))]),t._v(" "),n("td",[n(e.healthy?"icon-healthy":"icon-unhealthy",{tag:"svg",attrs:{height:"24px"}})],1),t._v(" "),n("td",[t._v(t._s(e.amount))]),t._v(" "),n("td",[t._v(t._s(e.newest))]),t._v(" "),n("td",[t._v(t._s(e.usedStorage))])])}),0)])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("loading-view",{attrs:{loading:t.initialLoading}},[n("div",{staticClass:"flex mb-6 items-center justify-between"},[n("heading",[t._v("\n "+t._s(t.__("Backups"))+"\n ")]),t._v(" "),n("button",{staticClass:"btn btn-default btn-primary ml-auto mr-3",on:{click:t.createBackup}},[t._v("\n "+t._s(t.__("Create Backup"))+"\n ")]),t._v(" "),n("dropdown",{ref:"backupDropdownMenu",attrs:{dusk:"select-all-dropdown"}},[n("dropdown-trigger",{attrs:{"show-arrow":!1}},[n("button",{staticClass:"btn btn-default btn-icon btn-primary font-normal no-text-shadow"},[n("icon",{staticClass:"text-white",attrs:{type:"menu","view-box":"0 0 24 24",width:"20",height:"20"}})],1)]),t._v(" "),n("dropdown-menu",{attrs:{slot:"menu",direction:"rtl",width:"250"},slot:"menu"},[n("ul",{staticClass:"list-reset"},[n("li",[n("a",{staticClass:"block p-3 text-90 hover:bg-30 cursor-pointer",on:{click:function(e){return e.preventDefault(),t.createPartialBackup("only-db")}}},[t._v("\n "+t._s(t.__("Create database backup"))+"\n ")])]),t._v(" "),n("li",[n("a",{staticClass:"block p-3 text-90 hover:bg-30 cursor-pointer",on:{click:function(e){return e.preventDefault(),t.createPartialBackup("only-files")}}},[t._v("\n "+t._s(t.__("Create files backup"))+"\n ")])])])])],1)],1),t._v(" "),n("loading-card",{staticClass:"mb-6",attrs:{loading:t.loading}},[n("backup-statuses",{attrs:{"backup-statuses":t.backupStatuses}})],1),t._v(" "),n("loading-card",{attrs:{loading:t.loading}},[t.activeDisk?n("backups",{attrs:{disks:t.disks,backups:t.activeDiskBackups,"active-disk":t.activeDisk},on:{"update:activeDisk":function(e){t.activeDisk=e},"update:active-disk":function(e){t.activeDisk=e},delete:t.deleteBackup,setModalVisibility:t.setModalVisibility}}):t._e()],1)],1)},staticRenderFns:[]}}]); \ No newline at end of file diff --git a/resources/js/components/BackupTool.vue b/resources/js/components/BackupTool.vue index f989a9c..3604118 100644 --- a/resources/js/components/BackupTool.vue +++ b/resources/js/components/BackupTool.vue @@ -9,7 +9,7 @@ - + @@ -127,7 +127,7 @@ export default { type: 'success', }); - this.$refs.backupDropdownMenu.toggle(); + this.$refs.backupDropdownMenu.$children[0].hide(); return api.createPartialBackup(option); },