PageSourceSearch

https://dreampoolfoundation.org/cp/javascript/components/pages/OdbcAddPage.js?58ebdeb9777c6039bc4c

js dreampoolfoundation.org collected 2026-10-08 19:30:41 UTC 5,988 bytes, 2 lines download raw bytes

1(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["components/pages/OdbcAddPage"],{1015:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>r});var t=i(270),o=i(581),a=i(272),d=i.n(a),s=i(271);const c=({onClose:e,isOpen:n=!0,closeOnFormSuccess:i=!0,closeUrl:a="..",form:d,...c})=>{const r=(0,o.useNavigate)(),[l,u]=(0,t.useState)(n),m=(0,t.useRef)(null),f=(0,t.useCallback)(((...n)=>{const i=e??(()=>r(a,{preventScrollReset:!0}));u(!1),m.current=setTimeout((()=>{i(...n),m.current=null}),300)}),[a,r,e]);(0,t.useEffect)((()=>()=>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:()=>{d.props.onSuccess?.(),f()}});if("object"==typeof d)return{...d,onSuccess:()=>{d.onSuccess?.(),f()}}}return d}),[i,f,d]);return(0,t.jsx)(s.Drawer,{...c,form:p,onClose:f,isOpen:l})};c.propTypes={onClose:d().func,isOpen:d().bool,form:d().oneOfType([d().object,d().node]),closeOnFormSuccess:d().bool,closeUrl:d().string};const r=c},2111:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>h});var t=i(270),o=i(272),a=i.n(o),d=i(581),s=i(588),c=i(620),r=i(89),l=i(271),u=i(1015),m=i(828),f=i(715),p=i(2106),v=i(708),b=i.n(v),k=i(2112),S=i.n(k);const O=r.Locale.getTranslate("components.pages.OdbcAdd"),g=({domainId:e,drivers:n})=>{const i=(0,s.useApolloClient)(),o=(0,d.useNavigate)(),[a,r]=(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}}),o(`../${(0,f.getId)(e.id)}/edit`)}});return(0,t.jsx)(u.default,{isOpen:!0,"data-type":"add-odbc",title:(0,t.jsx)(O,{content:"title"}),size:"xs",closeOnFormSuccess:!1,form:(0,t.jsxs)(m.default,{values:a,onFieldChange:(e,n)=>{r((i=>(0,l.setIn)(i,e,n)))},onSubmit:n=>({domainId:e??null,...n}),mutation:v,applyButton:!1,submitButton:{children:(0,t.jsx)(O,{content:"submit"})},vertical:!0,children:[(0,t.jsx)(l.FormFieldText,{name:"name",label:(0,t.jsx)(O,{content:"nameLabel"}),required:!0,autoFocus:!0,inputProps:{maxLength:"32"}}),(0,t.jsx)(l.FormFieldText,{name:"description",label:(0,t.jsx)(O,{content:"descriptionLabel"}),inputProps:{maxLength:"32"}}),(0,t.jsx)(l.FormFieldSelect,{label:(0,t.jsx)(O,{content:"driver"}),name:"driver",children:n.map((e=>(0,t.jsx)("option",{value:e,children:e},e)))})]})})};g.propTypes={domainId:a().string,drivers:a().arrayOf(a().string).isRequired};const h=g},2110:(e,n,i)=>{"use strict";i.r(n),i.d(n,{default:()=>t.default});var t=i(2111)},2106:(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"})))}},2112:(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:380}};t.loc.source={body:'#import "queries/OdbcEditFragment.graphql"\n#import "queries/DomainSubscriptionOdbcLimitFragment.graphql"\n\nmutation AddOdbcDsnConnection($input: AddOdbcDsnConnectionInput!) {\n    addOdbcDsnConnection(input: $input) {\n        domain {\n            id\n            ...DomainSubscriptionOdbcLimitFragment\n        }\n        connection {\n            ...OdbcEditFragment\n        }\n    }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var o={};function a(e){return e.filter((function(e){if("FragmentDefinition"!==e.kind)return!0;var n=e.name.value;return!o[n]&&(o[n]=!0,!0)}))}function d(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){d(e,n)})),e.variableDefinitions&&e.variableDefinitions.forEach((function(e){d(e,n)})),e.definitions&&e.definitions.forEach((function(e){d(e,n)}))}t.definitions=t.definitions.concat(a(i(709).definitions)),t.definitions=t.definitions.concat(a(i(737).definitions));var s={};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;d(e,n),s[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=s[n]||new Set,o=new Set,a=new Set;for(t.forEach((function(e){a.add(e)}));a.size>0;){var d=a;a=new Set,d.forEach((function(e){o.has(e)||(o.add(e),(s[e]||new Set).forEach((function(e){a.add(e)})))}))}return o.forEach((function(n){var t=c(e,n);t&&i.definitions.push(t)})),i}(t,"AddOdbcDsnConnection")}}]);
2//# sourceMappingURL=OdbcAddPage.js.map?58ebdeb9777c6039bc4c

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.