/home/techb158/ileadtechnology.com/SSM/public/js/utility/backup
Edit: /home/techb158/ileadtechnology.com/SSM/public/js/utility/backup/index.js (5321B)
(window.webpackJsonp=window.webpackJsonp||[]).push([[377],{Cc4s:function(t,e,a){"use strict";a.r(e);var s={components:{},data:function(){return{backupForm:new Form({delete_previous:!1}),backups:{total:0,data:[]},filter:{page_length:helper.getConfig("page_length"),sort_by:"created_at",order:"desc"},orderByOptions:[{value:"created_at",translation:i18n.general.created_at}]}},mounted:function(){helper.hasPermission("access-configuration")||(helper.notAccessibleMsg(),this.$router.push("/dashboard")),helper.featureAvailable("backup")||(helper.featureNotAvailableMsg(),this.$router.push("/dashboard")),this.getBackups()},methods:{createBackup:function(){var t=this,e=this.$loading.show();this.backupForm.post("/api/backup").then((function(a){toastr.success(a.message),t.getBackups(),e.hide()})).catch((function(t){e.hide(),helper.showErrorMsg(t)}))},getBackups:function(t){var e=this,a=this.$loading.show();"number"!=typeof t&&(t=1);var s=helper.getFilterURL(this.filter);axios.get("/api/backup?page="+t+s).then((function(t){e.backups=t,a.hide()})).catch((function(t){a.hide(),helper.showErrorMsg(t)}))},confirmDelete:function(t){var e=this;return function(a){return e.deleteBackup(t)}},deleteBackup:function(t){var e=this,a=this.$loading.show();axios.delete("/api/backup/"+t.id).then((function(t){toastr.success(t.message),e.getBackups(),a.hide()})).catch((function(t){a.hide(),helper.showErrorMsg(t)}))},getDownloadLink:function(t){return"/backup/"+t.id+"/download/?token="+helper.getAuthToken()}},filters:{momentDateTime:function(t){return helper.formatDateTime(t)}},watch:{filter:{handler:function(t){this.getBackups()},deep:!0}}},i=a("KHd+"),n=Object(i.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"page-titles"},[a("div",{staticClass:"row"},[a("div",{staticClass:"col-12 col-sm-6"},[a("h3",{staticClass:"text-themecolor"},[t._v(t._s(t.trans("utility.backup"))+"\n "),t.backups.total?a("span",{staticClass:"card-subtitle d-none d-sm-inline"},[t._v(t._s(t.trans("general.total_result_found",{count:t.backups.total,from:t.backups.from,to:t.backups.to})))]):a("span",{staticClass:"card-subtitle d-none d-sm-inline"},[t._v(t._s(t.trans("general.no_result_found")))])])]),t._v(" "),a("div",{staticClass:"col-12 col-sm-6"},[a("div",{staticClass:"action-buttons pull-right"},[a("sort-by",{attrs:{"order-by-options":t.orderByOptions,"sort-by":t.filter.sort_by,order:t.filter.order},on:{updateSortBy:function(e){t.filter.sort_by=e},updateOrder:function(e){t.filter.order=e}}})],1)])])]),t._v(" "),a("div",{staticClass:"container-fluid"},[a("div",{staticClass:"card border-bottom"},[a("div",{staticClass:"card-body p-4"},[a("h4",{staticClass:"card-title"},[t._v(t._s(t.trans("utility.generate_backup")))]),t._v(" "),a("show-tip",{attrs:{module:"utility",tip:"tip_backup"}}),t._v(" "),a("div",{staticClass:"form-group"},[a("switches",{staticClass:"m-l-20",attrs:{theme:"bootstrap",color:"success"},model:{value:t.backupForm.delete_previous,callback:function(e){t.$set(t.backupForm,"delete_previous",e)},expression:"backupForm.delete_previous"}}),t._v(" "+t._s(t.trans("utility.delete_previous_backup?"))+"\n ")],1),t._v(" "),a("div",{staticClass:"form-group"},[a("button",{staticClass:"btn btn-info btn-sm",on:{click:function(e){return e.preventDefault(),t.createBackup(e)}}},[t._v(t._s(t.trans("utility.generate_backup")))])])],1)]),t._v(" "),a("div",{staticClass:"card"},[a("div",{staticClass:"card-body"},[t.backups.total?a("div",{staticClass:"table-responsive"},[a("table",{staticClass:"table table-sm"},[a("thead",[a("tr",[a("th",[t._v(t._s(t.trans("utility.backup_name")))]),t._v(" "),a("th",[t._v(t._s(t.trans("utility.backup_generated_at")))]),t._v(" "),a("th",{staticClass:"table-option"},[t._v(t._s(t.trans("general.action")))])])]),t._v(" "),a("tbody",t._l(t.backups.data,(function(e){return a("tr",[a("td",{domProps:{textContent:t._s(e.file)}}),t._v(" "),a("td",[t._v(t._s(t._f("momentDateTime")(e.created_at)))]),t._v(" "),a("td",{staticClass:"table-option"},[a("div",{staticClass:"btn-group"},[a("a",{directives:[{name:"tooltip",rawName:"v-tooltip",value:t.trans("utility.download_backup"),expression:"trans('utility.download_backup')"}],staticClass:"btn btn-success btn-sm",attrs:{href:t.getDownloadLink(e)}},[a("i",{staticClass:"fas fa-download"})]),t._v(" "),a("button",{directives:[{name:"confirm",rawName:"v-confirm",value:{ok:t.confirmDelete(e)},expression:"{ok: confirmDelete(backup)}"},{name:"tooltip",rawName:"v-tooltip",value:t.trans("utility.delete_backup"),expression:"trans('utility.delete_backup')"}],key:e.id,staticClass:"btn btn-danger btn-sm"},[a("i",{staticClass:"fas fa-trash"})])])])])})),0)])]):t._e(),t._v(" "),t.backups.total?t._e():a("module-info",{attrs:{module:"utility",title:"backup_module_title",description:"backup_module_description",icon:"list"}}),t._v(" "),a("pagination-record",{attrs:{"page-length":t.filter.page_length,records:t.backups},on:{"update:pageLength":function(e){return t.$set(t.filter,"page_length",e)},"update:page-length":function(e){return t.$set(t.filter,"page_length",e)},updateRecords:t.getBackups},nativeOn:{change:function(e){return t.getBackups(e)}}})],1)])])])}),[],!1,null,null,null);e.default=n.exports}}]);
//# sourceMappingURL=index.js.map?id=ff335310d80dc238af3e