"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[9117],{7075:(t,e,n)=>{n.r(e),n.d(e,{default:()=>o});var a=n(5947),s=n.n(a);const i={metaInfo:{title:"Backup"},data:function(){return{backups:[],isLoading:!0,totalRows:""}},computed:{columns:function(){return[{label:this.$t("date"),field:"date",tdClass:"text-left",thClass:"text-left"},{label:this.$t("Filesize"),field:"size",tdClass:"text-left",thClass:"text-left"},{label:this.$t("Action"),field:"actions",html:!0,tdClass:"text-right",thClass:"text-right",sortable:!1}]}},methods:{GenerateBackup:function(){s().start(),s().set(.1),axios.get("generate_new_backup").then((function(t){Fire.$emit("Generate_Backup"),setTimeout((function(){return s().done()}),500)})).catch((function(t){setTimeout((function(){return s().done()}),500)}))},Get_Backups:function(){var t=this;s().start(),s().set(.1),axios.get("get_backup").then((function(e){t.backups=e.data.backups,t.totalRows=e.data.totalRows,s().done(),t.isLoading=!1})).catch((function(e){s().done(),setTimeout((function(){t.isLoading=!1}),500)}))},DeleteBackup:function(t){var e=this;this.$swal({title:this.$t("Delete_Title"),text:this.$t("Delete_Text"),type:"warning",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",cancelButtonText:this.$t("Delete_cancelButtonText"),confirmButtonText:this.$t("Delete_confirmButtonText")}).then((function(n){n.value&&axios.delete("delete_backup/"+t).then((function(){e.$swal(e.$t("Delete_Deleted"),e.$t("Deleted_in_successfully"),"success"),Fire.$emit("Delete_Backup")})).catch((function(){e.$swal(e.$t("Delete_Failed"),e.$t("Delete_Therewassomethingwronge"),"warning")}))}))}},created:function(){var t=this;this.Get_Backups(),Fire.$on("Generate_Backup",(function(){setTimeout((function(){t.Get_Backups()}),500)})),Fire.$on("Delete_Backup",(function(){setTimeout((function(){t.Get_Backups(),s().done()}),500)}))}};const o=(0,n(14486).A)(i,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"main-content"},[e("breadcumb",{attrs:{page:t.$t("BackupDatabase"),folder:t.$t("Settings")}}),t._v(" "),t.isLoading?e("div",{staticClass:"loading_page spinner spinner-primary mr-3"}):t._e(),t._v(" "),t.isLoading?t._e():e("b-card",{staticClass:"wrapper"},[e("span",{staticClass:"alert alert-danger"},[t._v(t._s(t.$t("You_will_find_your_backup_on"))+" "),e("strong",[t._v("/storage/app/public/backup")]),t._v(" "+t._s(t.$t("and_save_it_to_your_pc")))]),t._v(" "),e("vue-good-table",{attrs:{mode:"remote",columns:t.columns,totalRows:t.totalRows,rows:t.backups,styleClass:"table-hover tableOne vgt-table"},scopedSlots:t._u([{key:"table-row",fn:function(n){return["actions"==n.column.field?e("span",[e("a",{directives:[{name:"b-tooltip",rawName:"v-b-tooltip.hover",modifiers:{hover:!0}}],attrs:{title:"Delete"},on:{click:function(e){return t.DeleteBackup(n.row.date)}}},[e("i",{staticClass:"i-Close-Window text-25 text-danger"})])]):t._e()]}}],null,!1,2132012496)},[e("div",{staticClass:"mt-2 mb-3",attrs:{slot:"table-actions"},slot:"table-actions"},[e("b-button",{staticClass:"btn-rounded",attrs:{size:"sm",variant:"btn btn-primary btn-icon m-1"},on:{click:function(e){return t.GenerateBackup()}}},[e("i",{staticClass:"i-Add"}),t._v("\n          "+t._s(t.$t("GenerateBackup"))+"\n        ")])],1)])],1)],1)}),[],!1,null,null,null).exports}}]);