/home/ivoiecob/email.hirewise-va.com/adminpanel/js/6836.79c61044.js
"use strict";(globalThis["webpackChunkadmin_panel_vue_webclient"]=globalThis["webpackChunkadmin_panel_vue_webclient"]||[]).push([[6836],{58985:(t,e,s)=>{s.d(e,{A:()=>g});var n=s(43436),i=s.n(n),o=s(35118);class a{constructor(t){const e=o.A.pObject(t.S3Filestorage);i().isEmpty(e)||(this.accessKey=o.A.pString(e.AccessKey),this.secretKey=o.A.pString(e.SecretKey),this.region=o.A.pString(e.Region),this.host=o.A.pString(e.Host),this.bucketPrefix=o.A.pString(e.BucketPrefix))}saveS3FilestorageSettings({accessKey:t,secretKey:e,region:s,host:n,bucketPrefix:i}){this.accessKey=t,this.secretKey=e,this.region=s,this.host=n,this.bucketPrefix=i}}let r=null;const g={init(t){r=new a(t)},saveS3FilestorageSettings(t){r.saveS3FilestorageSettings(t)},getS3FilestorageSettings(){return{accessKey:r.accessKey,secretKey:r.secretKey,region:r.region,host:r.host,bucketPrefix:r.bucketPrefix}}}},96836:(t,e,s)=>{s.r(e),s.d(e,{default:()=>u});var n=s(58985);s(55246),s(61758),s(29104),s(58790);var i=s(36720),o=s(38176),a=s(35118),r=s(79134);const g={name:"S3FilestorageAdminSettingsPerTenant",data(){return{saving:!1,loading:!1,tenant:null,region:"",host:"",testingConnection:!1}},computed:{tenantId(){return this.$store.getters["tenants/getCurrentTenantId"]}},watch:{"$store.state.tenants.tenants":{handler:function(){this.populate()},deep:!0}},beforeRouteLeave(t,e,s){this.$root.doBeforeRouteLeave(t,e,s)},mounted(){this.loading=!1,this.saving=!1,this.populate()},methods:{hasChanges(){if(this.loading)return!1;const t=a.A.pObject(this.tenant?.completeData);return this.region!==t["S3Filestorage::Region"]||this.host!==t["S3Filestorage::Host"]},revertChanges(){const t=a.A.pObject(this.tenant?.completeData);this.region=t["S3Filestorage::Region"],this.host=t["S3Filestorage::Host"]},populate(){const t=this.$store.getters["tenants/getTenant"](this.tenantId);t&&(void 0!==t.completeData["S3Filestorage::Region"]?(this.tenant=t,this.region=t.completeData["S3Filestorage::Region"],this.host=t.completeData["S3Filestorage::Host"]):this.getSettings())},save(){if(!this.saving){this.saving=!0;const t={TenantId:this.tenantId,Region:this.region,Host:this.host};r.A.sendRequest({moduleName:"S3Filestorage",methodName:"UpdateS3Settings",parameters:t}).then((e=>{if(this.saving=!1,e){const e={"S3Filestorage::Region":t.Region,"S3Filestorage::Host":t.Host};this.$store.commit("tenants/setTenantCompleteData",{id:this.tenantId,data:e}),o.A.showReport(this.$t("COREWEBCLIENT.REPORT_SETTINGS_UPDATE_SUCCESS"))}else o.A.showError(this.$t("COREWEBCLIENT.ERROR_SAVING_SETTINGS_FAILED"))}),(t=>{this.saving=!1,o.A.showError(i.A.getTextFromResponse(t,this.$t("COREWEBCLIENT.ERROR_SAVING_SETTINGS_FAILED")))}))}},getSettings(){this.loading=!0;const t={TenantId:this.tenantId};r.A.sendRequest({moduleName:"S3Filestorage",methodName:"GetSettings",parameters:t}).then((t=>{if(this.loading=!1,t){const e={"S3Filestorage::Region":a.A.pString(t.Region),"S3Filestorage::Host":a.A.pString(t.Host)};this.$store.commit("tenants/setTenantCompleteData",{id:this.tenantId,data:e})}}),(t=>{o.A.showError(i.A.getTextFromResponse(t))}))},testConnection(){if(!this.testingConnection){this.testingConnection=!0;const t={Region:this.region,Host:this.host,TenantId:this.tenantId};r.A.sendRequest({moduleName:"S3Filestorage",methodName:"TestConnection",parameters:t}).then((t=>{this.testingConnection=!1,!0===t?o.A.showReport(this.$t("S3FILESTORAGE.REPORT_CONNECT_SUCCESSFUL")):o.A.showError(this.$t("S3FILESTORAGE.ERROR_CONNECT_FAILED"))}),(t=>{this.testingConnection=!1,o.A.showError(i.A.getTextFromResponse(t,this.$t("S3FILESTORAGE.ERROR_CONNECT_FAILED")))}))}}}};s(12807);var h=s(48958),c=s(23316),S=s(44189),l=s(39270),d=s(13796),A=s(56384),m=s(39035),R=s(35859),p=s(98582),E=s.n(p);E()(g,"components",{QScrollArea:h.A,QCard:c.A,QCardSection:S.A,QInput:l.A,QItemLabel:d.A,QBtn:A.A,QInnerLoading:m.A,QLinearProgress:R.A});const u={moduleName:"S3Filestorage",requiredModules:[],init(t){n.A.init(t)},getAdminSystemTabs(){return[{tabName:"s3-filestorage",tabTitle:"S3FILESTORAGE.LABEL_SETTINGS_TAB",tabRouteChildren:[{path:"s3-filestorage",component:()=>s.e(7735).then(s.bind(s,87735))}]}]}}}}]);