1(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["components/pages/OdbcAddPage"],{1472(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>r});var t=i(396),a=i(717),o=i(397);const r=({onClose:e,isOpen:n=!0,closeOnFormSuccess:i=!0,closeUrl:r="..",form:d,...c})=>{const s=(0,a.useNavigate)(),[l,u]=(0,t.useState)(n),m=(0,t.useRef)(null),f=(0,t.useCallback)((...n)=>{const i=e??(()=>s(r,{preventScrollReset:!0}));u(!1),m.current=setTimeout(()=>{i(...n),m.current=null},300)},[r,s,e]);(0,t.useEffect)(()=>()=>{m.current&&clearTimeout(m.current)},[]),(0,t.useEffect)(()=>{n?m.current&&clearTimeout(m.current):u(n)},[n]);const p=(0,t.useMemo)(()=>{if(d&&i){if((0,t.isValidElement)(d))return(0,t.cloneElement)(d,{onSuccess:(...e)=>{d.props.onSuccess?.(...e),f()}});if("object"==typeof d)return{...d,onSuccess:(...e)=>{d.onSuccess?.(...e),f()}}}return d},[i,f,d]);return(0,t.jsx)(o.Drawer,{...c,form:p,onClose:f,isOpen:l})}},2762(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>O});var t=i(396),a=i(786),o=i.n(a),r=i(717),d=i(740),c=i(809),s=i(95),l=i(397),u=i(1472),m=i(1318),f=i(784),p=i(2758),v=i(1206),b=i.n(v),k=i(2763),S=i.n(k);const g=s.Locale.getTranslate("components.pages.OdbcAdd"),h=({domainId:e,drivers:n})=>{const i=(0,d.useApolloClient)(),a=(0,r.useNavigate)(),[o,s]=(0,t.useState)({name:"",description:"",driver:n[0]}),[v]=(0,c.useMutation)(S(),{update(e){(0,p.evictOdbcDsnConnectionsCache)(e)},onCompleted({addOdbcDsnConnection:{connection:e}}){i.writeQuery({query:b(),data:{connection:e},variables:{id:e.id}}),a(`../${(0,f.getId)(e.id)}/edit`)}});return(0,t.jsx)(u.default,{isOpen:!0,"data-type":"add-odbc",title:(0,t.jsx)(g,{content:"title"}),size:"xs",closeOnFormSuccess:!1,form:(0,t.jsxs)(m.default,{values:o,onFieldChange:(e,n)=>{s(i=>(0,l.setIn)(i,e,n))},onSubmit:n=>({domainId:e??null,...n}),mutation:v,applyButton:!1,submitButton:{children:(0,t.jsx)(g,{content:"submit"})},vertical:!0,children:[(0,t.jsx)(l.FormFieldText,{name:"name",label:(0,t.jsx)(g,{content:"nameLabel"}),required:!0,autoFocus:!0,inputProps:{maxLength:"32"}}),(0,t.jsx)(l.FormFieldText,{name:"description",label:(0,t.jsx)(g,{content:"descriptionLabel"}),inputProps:{maxLength:"32"}}),(0,t.jsx)(l.FormFieldSelect,{label:(0,t.jsx)(g,{content:"driver"}),name:"driver",children:n.map(e=>(0,t.jsx)("option",{value:e,children:e},e))})]})})};h.propTypes={domainId:o().string,drivers:o().arrayOf(o().string).isRequired};const O=h},2761(e,n,i){"use strict";i.r(n),i.d(n,{default:()=>t.default});var t=i(2762)},2758(e,n,i){"use strict";i.r(n),i.d(n,{evictOdbcDsnConnectionsCache:()=>t});const t=e=>{e.evict({id:e.identify({__typename:"Server"}),fieldName:"odbcDsnConnections"}),Object.values(e.extract()).filter(({__typename:e})=>"Domain"===e).map(n=>e.evict({id:e.identify(n),fieldName:"odbcDsnConnections"}))}},2763(e,n,i){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"AddOdbcDsnConnection"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"AddOdbcDsnConnectionInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"addOdbcDsnConnection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"domain"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"FragmentSpread",name:{kind:"Name",value:"DomainSubscriptionOdbcLimitFragment"},directives:[]}]}},{kind:"Field",name:{kind:"Name",value:"connection"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"OdbcEditFragment"},directives:[]}]}}]}}]}}],loc:{start:0,end:394}};t.loc.source={body:'#import "queries/OdbcEditFragment.graphql"\r\n#import "queries/DomainSubscriptionOdbcLimitFragment.graphql"\r\n\r\nmutation AddOdbcDsnConnection($input: AddOdbcDsnConnectionInput!) {\r\n addOdbcDsnConnection(input: $input) {\r\n domain {\r\n id\r\n ...DomainSubscriptionOdbcLimitFragment\r\n }\r\n connection {\r\n ...OdbcEditFragment\r\n }\r\n }\r\n}\r\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var a={};function o(e){return e.filter(function(e){if("FragmentDefinition"!==e.kind)return!0;var n=e.name.value;return!a[n]&&(a[n]=!0,!0)})}function r(e,n){if("FragmentSpread"===e.kind)n.add(e.name.value);
1else if("VariableDefinition"===e.kind){var i=e.type;"NamedType"===i.kind&&n.add(i.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(e){r(e,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(e){r(e,n)}),e.definitions&&e.definitions.forEach(function(e){r(e,n)})}t.definitions=t.definitions.concat(o(i(1207).definitions)),t.definitions=t.definitions.concat(o(i(1237).definitions));var d={};function c(e,n){for(var i=0;i<e.definitions.length;i++){var t=e.definitions[i];if(t.name&&t.name.value==n)return t}}t.definitions.forEach(function(e){if(e.name){var n=new Set;r(e,n),d[e.name.value]=n}}),e.exports=t,e.exports.AddOdbcDsnConnection=function(e,n){var i={kind:e.kind,definitions:[c(e,n)]};e.hasOwnProperty("loc")&&(i.loc=e.loc);var t=d[n]||new Set,a=new Set,o=new Set;for(t.forEach(function(e){o.add(e)});o.size>0;){var r=o;o=new Set,r.forEach(function(e){a.has(e)||(a.add(e),(d[e]||new Set).forEach(function(e){o.add(e)}))})}return a.forEach(function(n){var t=c(e,n);t&&i.definitions.push(t)}),i}(t,"AddOdbcDsnConnection")}}]); 2//# sourceMappingURL=OdbcAddPage.js.map?bf08e2f476e59ef87e72
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.