芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/cloud.pulsehost.co.uk/adminpanel/js/9441.ac5b8303.js
"use strict";(globalThis["webpackChunkadmin_panel_vue_webclient"]=globalThis["webpackChunkadmin_panel_vue_webclient"]||[]).push([[9441],{9441:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Q});var n=s(4350),i=s(8936),o=s(9835),a=s(1957),l=s(6970);const r={class:"q-pa-lg"},c={class:"row q-mb-md"},d={class:"col text-h5"},h={class:"row q-mb-md"},g={class:"col-2 q-my-sm"},m={class:"col-5"},u={class:"row q-mb-md"},S=(0,o._)("div",{class:"col-2 q-my-sm"},null,-1),p={class:"col-8"},E={class:"row q-mb-md"},T={class:"col-2 q-my-sm"},_={class:"col-5"},R={class:"row q-mb-md"},I=(0,o._)("div",{class:"col-2 q-my-sm"},null,-1),v={class:"col-8"},C={class:"row q-mb-xl"},F=(0,o._)("div",{class:"col-2 q-my-sm"},null,-1),b={class:"col-5"},N={class:"q-pt-md text-right"};function O(e,t,s,n,i,O){const w=(0,o.up)("q-input"),A=(0,o.up)("q-item-label"),Z=(0,o.up)("q-btn"),L=(0,o.up)("q-card-section"),f=(0,o.up)("q-card"),y=(0,o.up)("q-linear-progress"),q=(0,o.up)("q-inner-loading"),G=(0,o.up)("q-scroll-area"),k=(0,o.Q2)("t");return(0,o.wg)(),(0,o.j4)(G,{class:"full-height full-width"},{default:(0,o.w5)((()=>[(0,o._)("div",r,[(0,o._)("div",c,[(0,o.wy)((0,o._)("div",d,null,512),[[k,"S3FILESTORAGE.HEADING_SETTINGS_TAB"]])]),(0,o.Wm)(f,{flat:"",bordered:"",class:"card-edit-settings"},{default:(0,o.w5)((()=>[(0,o.Wm)(L,null,{default:(0,o.w5)((()=>[(0,o._)("div",h,[(0,o.wy)((0,o._)("div",g,null,512),[[k,"S3FILESTORAGE.LABEL_REGION"]]),(0,o._)("div",m,[(0,o.Wm)(w,{outlined:"",dense:"","bg-color":"white",modelValue:i.region,"onUpdate:modelValue":t[0]||(t[0]=e=>i.region=e),onKeyup:(0,a.D2)(O.save,["enter"])},null,8,["modelValue","onKeyup"])])]),(0,o._)("div",u,[S,(0,o._)("div",p,[(0,o.Wm)(A,{caption:""},{default:(0,o.w5)((()=>[(0,o.Uk)((0,l.zw)(e.$t("S3FILESTORAGE.INFO_REGION")),1)])),_:1})])]),(0,o._)("div",E,[(0,o.wy)((0,o._)("div",T,null,512),[[k,"S3FILESTORAGE.LABEL_HOST"]]),(0,o._)("div",_,[(0,o.Wm)(w,{outlined:"",dense:"","bg-color":"white",modelValue:i.host,"onUpdate:modelValue":t[1]||(t[1]=e=>i.host=e),onKeyup:(0,a.D2)(O.save,["enter"])},null,8,["modelValue","onKeyup"])])]),(0,o._)("div",R,[I,(0,o._)("div",v,[(0,o.Wm)(A,{caption:""},{default:(0,o.w5)((()=>[(0,o.Uk)((0,l.zw)(e.$t("S3FILESTORAGE.INFO_HOST")),1)])),_:1})])]),(0,o._)("div",C,[F,(0,o._)("div",b,[(0,o.Wm)(Z,{unelevated:"","no-caps":"",dense:"",class:"q-px-sm",ripple:!1,color:"primary",label:e.$t("S3FILESTORAGE.BUTTON_TEST_CONNECTION"),onClick:O.testConnection},null,8,["label","onClick"])])])])),_:1})])),_:1}),(0,o._)("div",N,[(0,o.Wm)(Z,{unelevated:"","no-caps":"",dense:"",class:"q-px-sm",ripple:!1,color:"primary",onClick:O.save,label:e.$t("COREWEBCLIENT.ACTION_SAVE")},null,8,["onClick","label"])])]),(0,o.Wm)(q,{style:{"justify-content":"flex-start"},showing:i.loading||i.saving},{default:(0,o.w5)((()=>[(0,o.Wm)(y,{query:""})])),_:1},8,["showing"])])),_:1})}var w=s(9336),A=s(1427),Z=s(4089),L=s(2456);const f={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(e,t,s){this.$root.doBeforeRouteLeave(e,t,s)},mounted(){this.loading=!1,this.saving=!1,this.populate()},methods:{hasChanges(){if(this.loading)return!1;const e=Z.Z.pObject(this.tenant?.completeData);return this.region!==e["S3Filestorage::Region"]||this.host!==e["S3Filestorage::Host"]},revertChanges(){const e=Z.Z.pObject(this.tenant?.completeData);this.region=e["S3Filestorage::Region"],this.host=e["S3Filestorage::Host"]},populate(){const e=this.$store.getters["tenants/getTenant"](this.tenantId);e&&(void 0!==e.completeData["S3Filestorage::Region"]?(this.tenant=e,this.region=e.completeData["S3Filestorage::Region"],this.host=e.completeData["S3Filestorage::Host"]):this.getSettings())},save(){if(!this.saving){this.saving=!0;const e={TenantId:this.tenantId,Region:this.region,Host:this.host};L.Z.sendRequest({moduleName:"S3Filestorage",methodName:"UpdateS3Settings",parameters:e}).then((t=>{if(this.saving=!1,t){const t={"S3Filestorage::Region":e.Region,"S3Filestorage::Host":e.Host};this.$store.commit("tenants/setTenantCompleteData",{id:this.tenantId,data:t}),A.Z.showReport(this.$t("COREWEBCLIENT.REPORT_SETTINGS_UPDATE_SUCCESS"))}else A.Z.showError(this.$t("COREWEBCLIENT.ERROR_SAVING_SETTINGS_FAILED"))}),(e=>{this.saving=!1,A.Z.showError(w.Z.getTextFromResponse(e,this.$t("COREWEBCLIENT.ERROR_SAVING_SETTINGS_FAILED")))}))}},getSettings(){this.loading=!0;const e={TenantId:this.tenantId};L.Z.sendRequest({moduleName:"S3Filestorage",methodName:"GetSettings",parameters:e}).then((e=>{if(this.loading=!1,e){const t={"S3Filestorage::Region":Z.Z.pString(e.Region),"S3Filestorage::Host":Z.Z.pString(e.Host)};this.$store.commit("tenants/setTenantCompleteData",{id:this.tenantId,data:t})}}),(e=>{A.Z.showError(w.Z.getTextFromResponse(e))}))},testConnection(){if(!this.testingConnection){this.testingConnection=!0;const e={Region:this.region,Host:this.host,TenantId:this.tenantId};L.Z.sendRequest({moduleName:"S3Filestorage",methodName:"TestConnection",parameters:e}).then((e=>{this.testingConnection=!1,!0===e?A.Z.showReport(this.$t("S3FILESTORAGE.REPORT_CONNECT_SUCCESSFUL")):A.Z.showError(this.$t("S3FILESTORAGE.ERROR_CONNECT_FAILED"))}),(e=>{this.testingConnection=!1,A.Z.showError(w.Z.getTextFromResponse(e,this.$t("S3FILESTORAGE.ERROR_CONNECT_FAILED")))}))}}}};var y=s(1639),q=s(6663),G=s(4458),k=s(3190),K=s(6611),$=s(3115),x=s(8879),B=s(854),D=s(8289),W=s(9984),H=s.n(W);const P=(0,y.Z)(f,[["render",O]]),U=P;H()(f,"components",{QScrollArea:q.Z,QCard:G.Z,QCardSection:k.Z,QInput:K.Z,QItemLabel:$.Z,QBtn:x.Z,QInnerLoading:B.Z,QLinearProgress:D.Z});const Q={moduleName:"S3Filestorage",requiredModules:[],init(e){n.Z.init(e)},getAdminSystemTabs(){return[{tabName:"s3-filestorage",tabTitle:"S3FILESTORAGE.LABEL_SETTINGS_TAB",tabRouteChildren:[{path:"s3-filestorage",component:()=>s.e(2119).then(s.bind(s,2119))}]}]},getAdminTenantTabs(){const e=i["default"].getters["user/isUserSuperAdmin"];return e?[{tabName:"s3-filestorage",tabTitle:"S3FILESTORAGE.LABEL_SETTINGS_TAB",tabRouteChildren:[{path:"id/:id/chat",component:U},{path:"search/:search/id/:id/chat",component:U},{path:"page/:page/id/:id/chat",component:U},{path:"search/:search/page/:page/id/:id/chat",component:U}]}]:[]}}},4350:(e,t,s)=>{s.d(t,{Z:()=>r});var n=s(4409),i=s.n(n),o=s(4089);class a{constructor(e){const t=o.Z.pObject(e.S3Filestorage);i().isEmpty(t)||(this.accessKey=o.Z.pString(t.AccessKey),this.secretKey=o.Z.pString(t.SecretKey),this.region=o.Z.pString(t.Region),this.host=o.Z.pString(t.Host),this.bucketPrefix=o.Z.pString(t.BucketPrefix))}saveS3FilestorageSettings({accessKey:e,secretKey:t,region:s,host:n,bucketPrefix:i}){this.accessKey=e,this.secretKey=t,this.region=s,this.host=n,this.bucketPrefix=i}}let l=null;const r={init(e){l=new a(e)},saveS3FilestorageSettings(e){l.saveS3FilestorageSettings(e)},getS3FilestorageSettings(){return{accessKey:l.accessKey,secretKey:l.secretKey,region:l.region,host:l.host,bucketPrefix:l.bucketPrefix}}}}}]);