(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/database/settings"],{1240:(e,n,a)=>{"use strict";a.r(n);var t=a(88),i=a(208),s=a(361),o=a(748),r=a(837),l=a(489),d=a(209),c=a(210),u=a.n(c),f=a(1241),b=a.n(f);const m=t.Locale.getTranslate("admin.components.forms.database-settings"),v=({values:e})=>{const{data:{os:{isWindows:n}={},databaseServers:a}={}}=(0,s.useQuery)(b()),t=(0,i.useMemo)((()=>{const e=a?.find((({isUsedForPsaDb:e})=>e));return e?atob(e.id).split(":")[1]:null}),[a]),[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((a=>(0,d.setIn)(a,e,n)))},submitButton:{id:"btn-send"},applyButton:{id:"btn-apply"},cancelButton:{id:"btn-cancel",onClick:()=>{window.location="/plesk/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:t&&(0,i.jsx)(m,{content:"aclDescription",params:{serverLink:(0,i.jsx)(l.default,{to:`/server/db_server_edit.php?db_server_id=${t}`,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},n.default=(0,o.withPageLayout)(v)},1239:(e,n,a)=>{"use strict";a.r(n),a.d(n,{default:()=>t.default});var t=a(1240)},1241: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 a(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);else if("VariableDefinition"===e.kind){var t=e.type;"NamedType"===t.kind&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach((function(e){a(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){a(e,n)})),e.definitions&&e.definitions.forEach((function(e){a(e,n)}))}var t={};function i(e,n){for(var a=0;a<e.definitions.length;a++){var t=e.definitions[a];if(t.name&&t.name.value==n)return t}}n.definitions.forEach((function(e){if(e.name){var n=new Set;a(e,n),t[e.name.value]=n}})),e.exports=n,e.exports.DatabaseSettingsPage=function(e,n){var a={kind:e.kind,definitions:[i(e,n)]};e.hasOwnProperty("loc")&&(a.loc=e.loc);var s=t[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),(t[e]||new Set).forEach((function(e){r.add(e)})))}))}return o.forEach((function(n){var t=i(e,n);t&&a.definitions.push(t)})),a}(n,"DatabaseSettingsPage")}}]);
//# sourceMappingURL=settings.js.map?edad59f864148f4d9a48