(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/database/settings"],{1667:(e,n,t)=>{"use strict";t.r(n),t.d(n,{getId:()=>a});const a=e=>e?Number(atob(e).split(":")[1]):null},1710:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>p});var a=t(231),i=t(233),s=t.n(i),o=t(389),r=t(232),l=t(85),d=t(790),c=t(880),u=t(518),f=t(1667),m=t(1711),b=t.n(m);const v=l.Locale.getTranslate("admin.components.forms.database-settings"),x=({values:e})=>{const{data:{os:{isWindows:n}={},databaseServers:t}={}}=(0,o.useQuery)(b()),i=(0,a.useMemo)((()=>{const e=t?.find((({isUsedForPsaDb:e})=>e));return e?(0,f.getId)(e.id):null}),[t]),[s,l]=(0,a.useState)((()=>{const n=e;return n.dbUserPrefix=!0===n.dbUserPrefix?"1":"0",n.grantAlterDatabase=!0===n.grantAlterDatabase?"1":"0",n}));return(0,a.jsxs)(c.default,{id:"adminpanel-form-final-databasesettings",values:s,onFieldChange:(e,n)=>{l((t=>(0,r.setIn)(t,e,n)))},submitButton:{id:"btn-send"},applyButton:{id:"btn-apply"},cancelButton:{id:"btn-cancel",component:u.default,to:"/cp/server/db/"},children:[(0,a.jsx)(r.FormFieldRadioButtons,{label:(0,a.jsx)(v,{content:"dbPrefixRadio"}),name:"dbPrefix",options:[{value:"false",label:(0,a.jsx)(v,{content:"dbPrefixNone"})},{value:"true",label:(0,a.jsx)(v,{content:"dbPrefixUsername"})},{value:"external_id",label:(0,a.jsx)(v,{content:"dbPrefixExternalId"})}]}),(0,a.jsx)(r.FormFieldCheckbox,{name:"dbUserPrefix",label:(0,a.jsx)(v,{content:"dbUserPrefix"}),description:(0,a.jsx)(v,{content:"dbUserPrefixHint"}),checkedValue:"1",uncheckedValue:"0"}),n&&(0,a.jsx)(r.FormFieldCheckbox,{name:"grantAlterDatabase",label:(0,a.jsx)(v,{content:"grantAlterDatabase"}),description:(0,a.jsx)(v,{content:"grantAlterDatabaseHint"}),checkedValue:"1",uncheckedValue:"0"}),(0,a.jsx)(r.FormFieldRadioButtons,{name:"aclRadio",label:(0,a.jsx)(v,{content:"aclRadio"}),description:i?(0,a.jsx)(v,{content:"aclDescription",params:{serverLink:(0,a.jsx)(u.default,{to:`/cp/server/db/${encodeURIComponent(i)}/properties`,children:(0,a.jsx)(v,{content:"aclDescriptionLink"})})}}):void 0,options:[{value:"localhost",label:(0,a.jsx)(v,{content:"aclLocalhost"})},{value:"any",label:(0,a.jsx)(v,{content:"aclAny"})},{value:"custom",label:(0,a.jsx)(v,{content:"aclCustom"}),indentFields:"custom"===s.aclRadio?[(0,a.jsx)(r.FormFieldText,{multiline:!0,id:"aclHosts",name:"aclHosts",size:"lg",label:null,description:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v,{content:"example"}),(0,a.jsx)("br",{}),["thomas.loc.gov","%.loc.gov","x.y.%","144.155.166.177","144.155.166.%","144.155.166.0/255.255.255.0"].map((e=>(0,a.jsxs)(a.Fragment,{children:[e,(0,a.jsx)("br",{})]}))),(0,a.jsx)("br",{}),(0,a.jsx)(v,{content:"aclExampleDescription"})]})},"aclHosts-")]:[]}]})]})};x.propTypes={values:s().object.isRequired};const p=(0,d.withPageLayout)(x)},1709:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>a.default});var a=t(1710)},1711:e=>{var n={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"DatabaseSettingsPage"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"os"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"isWindows"},arguments:[],directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"databaseServers"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"isUsedForPsaDb"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:133}};n.loc.source={body:"query DatabaseSettingsPage {\r\n    os {\r\n        isWindows\r\n    }\r\n    databaseServers {\r\n        id\r\n        isUsedForPsaDb\r\n    }\r\n}",name:"GraphQL request",locationOffset:{line:1,column:1}};function t(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var a=e.type;"NamedType"===a.kind&&n.add(a.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){t(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){t(e,n)})),e.definitions&&e.definitions.forEach((function(e){t(e,n)}))}var a={};function i(e,n){for(var t=0;t<e.definitions.length;t++){var a=e.definitions[t];if(a.name&&a.name.value==n)return a}}n.definitions.forEach((function(e){if(e.name){var n=new Set;t(e,n),a[e.name.value]=n}})),e.exports=n,e.exports.DatabaseSettingsPage=function(e,n){var t={kind:e.kind,definitions:[i(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var s=a[n]||new Set,o=new Set,r=new Set;for(s.forEach((function(e){r.add(e)}));r.size>0;){var l=r;r=new Set,l.forEach((function(e){o.has(e)||(o.add(e),(a[e]||new Set).forEach((function(e){r.add(e)})))}))}return o.forEach((function(n){var a=i(e,n);a&&t.definitions.push(a)})),t}(n,"DatabaseSettingsPage")}}]);
//# sourceMappingURL=settings.js.map?6d6124bddd24456b5c6c