(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/database/settings"],{1281:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>x});var a=t(96),i=t(216),s=t(373),o=t(765),r=t(855),l=t(502),d=t(217),c=t(218),u=t.n(c),f=t(1282),b=t.n(f);const m=a.Locale.getTranslate("admin.components.forms.database-settings"),v=({values:e})=>{const{data:{os:{isWindows:n}={},databaseServers:t}={}}=(0,s.useQuery)(b()),a=(0,i.useMemo)((()=>{const e=t?.find((({isUsedForPsaDb:e})=>e));return e?atob(e.id).split(":")[1]:null}),[t]),[o,c]=(0,i.useState)((()=>{const n=e;return n.dbUserPrefix=!0===n.dbUserPrefix?"1":"0",n.grantAlterDatabase=!0===n.grantAlterDatabase?"1":"0",n}));return(0,i.jsxs)(r.default,{id:"adminpanel-form-final-databasesettings",values:o,onFieldChange:(e,n)=>{c((t=>(0,d.setIn)(t,e,n)))},submitButton:{id:"btn-send"},applyButton:{id:"btn-apply"},cancelButton:{id:"btn-cancel",component:l.default,to:"/cp/server/db/"},children:[(0,i.jsx)(d.FormFieldRadioButtons,{label:(0,i.jsx)(m,{content:"dbPrefixRadio"}),name:"dbPrefix",options:[{value:"false",label:(0,i.jsx)(m,{content:"dbPrefixNone"})},{value:"true",label:(0,i.jsx)(m,{content:"dbPrefixUsername"})},{value:"external_id",label:(0,i.jsx)(m,{content:"dbPrefixExternalId"})}]}),(0,i.jsx)(d.FormFieldCheckbox,{name:"dbUserPrefix",label:(0,i.jsx)(m,{content:"dbUserPrefix"}),description:(0,i.jsx)(m,{content:"dbUserPrefixHint"}),checkedValue:"1",uncheckedValue:"0"}),n&&(0,i.jsx)(d.FormFieldCheckbox,{name:"grantAlterDatabase",label:(0,i.jsx)(m,{content:"grantAlterDatabase"}),description:(0,i.jsx)(m,{content:"grantAlterDatabaseHint"}),checkedValue:"1",uncheckedValue:"0"}),(0,i.jsx)(d.FormFieldRadioButtons,{name:"aclRadio",label:(0,i.jsx)(m,{content:"aclRadio"}),description:a&&(0,i.jsx)(m,{content:"aclDescription",params:{serverLink:(0,i.jsx)(l.default,{to:`/server/db_server_edit.php?db_server_id=${a}`,children:(0,i.jsx)(m,{content:"aclDescriptionLink"})})}}),options:[{value:"localhost",label:(0,i.jsx)(m,{content:"aclLocalhost"})},{value:"any",label:(0,i.jsx)(m,{content:"aclAny"})},{value:"custom",label:(0,i.jsx)(m,{content:"aclCustom"}),indentFields:"custom"===o.aclRadio?[(0,i.jsx)(d.FormFieldText,{multiline:!0,id:"aclHosts",name:"aclHosts",size:"lg",label:null,description:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(m,{content:"example"}),(0,i.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,i.jsxs)(i.Fragment,{children:[e,(0,i.jsx)("br",{})]}))),(0,i.jsx)("br",{}),(0,i.jsx)(m,{content:"aclExampleDescription"})]})},"aclHosts-")]:[]}]})]})};v.propTypes={values:u().object.isRequired};const x=(0,o.withPageLayout)(v)},1280:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>a.default});var a=t(1281)},1282: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?45ac947a7e1dd5728f47