@devtable/settings-form 2.1.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{settings-form/src/api-caller → api-caller}/datasource.d.ts +2 -2
- package/dist/{settings-form/src/api-caller → api-caller}/datasource.typed.d.ts +0 -0
- package/dist/api-caller/index.d.ts +7 -0
- package/dist/api-caller/request.d.ts +5 -0
- package/dist/api-caller/types.d.ts +5 -0
- package/dist/datasource/add-data-source.d.ts +8 -0
- package/dist/datasource/data-source-list.d.ts +9 -0
- package/dist/datasource/delete-data-source.d.ts +10 -0
- package/dist/{settings-form/src/datasource → datasource}/index.d.ts +0 -0
- package/dist/datasource/styles.d.ts +6 -0
- package/dist/datasource/types.d.ts +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/settings-form.es.js +71 -47
- package/dist/settings-form.umd.js +2 -2
- package/dist/{settings-form/src/vite-env.d.ts → vite-env.d.ts} +0 -0
- package/package.json +2 -2
- package/dist/settings-form/src/api-caller/index.d.ts +0 -7
- package/dist/settings-form/src/datasource/add-data-source.d.ts +0 -6
- package/dist/settings-form/src/datasource/data-source-list.d.ts +0 -2
- package/dist/settings-form/src/datasource/delete-data-source.d.ts +0 -6
- package/dist/settings-form/src/index.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DataSourceType, IDataSource, IDataSourceConfig } from
|
|
2
|
-
import { PaginationResponse } from
|
|
1
|
+
import { DataSourceType, IDataSource, IDataSourceConfig } from './datasource.typed';
|
|
2
|
+
import { PaginationResponse } from './types';
|
|
3
3
|
export declare const datasource: {
|
|
4
4
|
list: () => Promise<PaginationResponse<IDataSource>>;
|
|
5
5
|
create: (type: DataSourceType, key: string, config: IDataSourceConfig) => Promise<PaginationResponse<IDataSource> | false>;
|
|
File without changes
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const APICaller: {
|
|
2
|
+
datasource: {
|
|
3
|
+
list: () => Promise<import("./types").PaginationResponse<import("./datasource.typed").IDataSource>>;
|
|
4
|
+
create: (type: import("./datasource.typed").DataSourceType, key: string, config: import("./datasource.typed").IDataSourceConfig) => Promise<false | import("./types").PaginationResponse<import("./datasource.typed").IDataSource>>;
|
|
5
|
+
delete: (id: string) => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IStyles } from './styles';
|
|
3
|
+
import { ISettingsFormConfig } from './types';
|
|
4
|
+
interface IDataSourceList {
|
|
5
|
+
styles?: IStyles;
|
|
6
|
+
config: ISettingsFormConfig;
|
|
7
|
+
}
|
|
8
|
+
export declare function DataSourceList({ styles, config }: IDataSourceList): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IStyles } from './styles';
|
|
3
|
+
interface IDeleteDataSource {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
onSuccess: () => void;
|
|
7
|
+
styles?: IStyles;
|
|
8
|
+
}
|
|
9
|
+
export declare function DeleteDataSource({ id, name, onSuccess, styles }: IDeleteDataSource): JSX.Element;
|
|
10
|
+
export {};
|
|
File without changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './datasource';
|
package/dist/settings-form.es.js
CHANGED
|
@@ -6,34 +6,36 @@ import { PlaylistAdd, Trash } from "tabler-icons-react";
|
|
|
6
6
|
import axios from "axios";
|
|
7
7
|
import { useRequest } from "ahooks";
|
|
8
8
|
import { useModals } from "@mantine/modals";
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
const APIClient = {
|
|
10
|
+
baseURL: "http://localhost:31200",
|
|
11
|
+
getRequest(method) {
|
|
12
|
+
return (url, data, options = {}) => {
|
|
13
|
+
const headers = {
|
|
14
|
+
"X-Requested-With": "XMLHttpRequest",
|
|
15
|
+
"Content-Type": options.string ? "application/x-www-form-urlencoded" : "application/json",
|
|
16
|
+
...options.headers
|
|
17
|
+
};
|
|
18
|
+
const conf = {
|
|
19
|
+
baseURL: this.baseURL,
|
|
20
|
+
method,
|
|
21
|
+
url,
|
|
22
|
+
params: method === "GET" ? data : options.params,
|
|
23
|
+
headers
|
|
24
|
+
};
|
|
25
|
+
if (method === "POST") {
|
|
26
|
+
conf.data = options.string ? JSON.stringify(data) : data;
|
|
27
|
+
}
|
|
28
|
+
return axios(conf).then((res) => {
|
|
29
|
+
return res.data;
|
|
30
|
+
}).catch((err) => {
|
|
31
|
+
return Promise.reject(err);
|
|
32
|
+
});
|
|
22
33
|
};
|
|
23
|
-
|
|
24
|
-
conf.data = options.string ? JSON.stringify(data) : data;
|
|
25
|
-
}
|
|
26
|
-
return axios(conf).then((res) => {
|
|
27
|
-
return res.data;
|
|
28
|
-
}).catch((err) => {
|
|
29
|
-
return Promise.reject(err);
|
|
30
|
-
});
|
|
31
|
-
};
|
|
34
|
+
}
|
|
32
35
|
};
|
|
33
|
-
const post = getRequest("POST");
|
|
34
36
|
const datasource = {
|
|
35
37
|
list: async () => {
|
|
36
|
-
const res = await
|
|
38
|
+
const res = await APIClient.getRequest("POST")("/datasource/list", {
|
|
37
39
|
filter: {},
|
|
38
40
|
sort: {
|
|
39
41
|
field: "create_time",
|
|
@@ -48,7 +50,7 @@ const datasource = {
|
|
|
48
50
|
},
|
|
49
51
|
create: async (type, key, config) => {
|
|
50
52
|
try {
|
|
51
|
-
const res = await
|
|
53
|
+
const res = await APIClient.getRequest("POST")("/datasource/create", { type, key, config });
|
|
52
54
|
return res;
|
|
53
55
|
} catch (error) {
|
|
54
56
|
console.error(error);
|
|
@@ -56,12 +58,16 @@ const datasource = {
|
|
|
56
58
|
}
|
|
57
59
|
},
|
|
58
60
|
delete: async (id) => {
|
|
59
|
-
await
|
|
61
|
+
await APIClient.getRequest("POST")("/datasource/delete", { id });
|
|
60
62
|
}
|
|
61
63
|
};
|
|
62
64
|
const APICaller = {
|
|
63
65
|
datasource
|
|
64
66
|
};
|
|
67
|
+
const defaultStyles = {
|
|
68
|
+
size: "sm",
|
|
69
|
+
spacing: "md"
|
|
70
|
+
};
|
|
65
71
|
var jsxRuntime = { exports: {} };
|
|
66
72
|
var reactJsxRuntime_production_min = {};
|
|
67
73
|
/**
|
|
@@ -96,7 +102,8 @@ const jsx = jsxRuntime.exports.jsx;
|
|
|
96
102
|
const jsxs = jsxRuntime.exports.jsxs;
|
|
97
103
|
const Fragment = jsxRuntime.exports.Fragment;
|
|
98
104
|
function AddDataSourceForm({
|
|
99
|
-
postSubmit
|
|
105
|
+
postSubmit,
|
|
106
|
+
styles = defaultStyles
|
|
100
107
|
}) {
|
|
101
108
|
const {
|
|
102
109
|
control,
|
|
@@ -159,7 +166,8 @@ function AddDataSourceForm({
|
|
|
159
166
|
field
|
|
160
167
|
}) => /* @__PURE__ */ jsx(SegmentedControl, {
|
|
161
168
|
fullWidth: true,
|
|
162
|
-
mb:
|
|
169
|
+
mb: styles.spacing,
|
|
170
|
+
size: styles.size,
|
|
163
171
|
data: [{
|
|
164
172
|
label: "PostgreSQL",
|
|
165
173
|
value: "postgresql"
|
|
@@ -179,7 +187,8 @@ function AddDataSourceForm({
|
|
|
179
187
|
render: ({
|
|
180
188
|
field
|
|
181
189
|
}) => /* @__PURE__ */ jsx(TextInput, {
|
|
182
|
-
mb:
|
|
190
|
+
mb: styles.spacing,
|
|
191
|
+
size: styles.size,
|
|
183
192
|
required: true,
|
|
184
193
|
label: "Name",
|
|
185
194
|
placeholder: "A unique name",
|
|
@@ -196,7 +205,8 @@ function AddDataSourceForm({
|
|
|
196
205
|
render: ({
|
|
197
206
|
field
|
|
198
207
|
}) => /* @__PURE__ */ jsx(TextInput, {
|
|
199
|
-
mb:
|
|
208
|
+
mb: styles.spacing,
|
|
209
|
+
size: styles.size,
|
|
200
210
|
required: true,
|
|
201
211
|
label: "Host",
|
|
202
212
|
sx: {
|
|
@@ -210,7 +220,8 @@ function AddDataSourceForm({
|
|
|
210
220
|
render: ({
|
|
211
221
|
field
|
|
212
222
|
}) => /* @__PURE__ */ jsx(NumberInput, {
|
|
213
|
-
mb:
|
|
223
|
+
mb: styles.spacing,
|
|
224
|
+
size: styles.size,
|
|
214
225
|
required: true,
|
|
215
226
|
label: "Port",
|
|
216
227
|
hideControls: true,
|
|
@@ -226,7 +237,8 @@ function AddDataSourceForm({
|
|
|
226
237
|
render: ({
|
|
227
238
|
field
|
|
228
239
|
}) => /* @__PURE__ */ jsx(TextInput, {
|
|
229
|
-
mb:
|
|
240
|
+
mb: styles.spacing,
|
|
241
|
+
size: styles.size,
|
|
230
242
|
required: true,
|
|
231
243
|
label: "Username",
|
|
232
244
|
...field
|
|
@@ -237,7 +249,8 @@ function AddDataSourceForm({
|
|
|
237
249
|
render: ({
|
|
238
250
|
field
|
|
239
251
|
}) => /* @__PURE__ */ jsx(PasswordInput, {
|
|
240
|
-
mb:
|
|
252
|
+
mb: styles.spacing,
|
|
253
|
+
size: styles.size,
|
|
241
254
|
required: true,
|
|
242
255
|
label: "Password",
|
|
243
256
|
...field
|
|
@@ -248,16 +261,18 @@ function AddDataSourceForm({
|
|
|
248
261
|
render: ({
|
|
249
262
|
field
|
|
250
263
|
}) => /* @__PURE__ */ jsx(TextInput, {
|
|
251
|
-
mb:
|
|
264
|
+
mb: styles.spacing,
|
|
265
|
+
size: styles.size,
|
|
252
266
|
required: true,
|
|
253
267
|
label: "Database",
|
|
254
268
|
...field
|
|
255
269
|
})
|
|
256
270
|
}), /* @__PURE__ */ jsx(Group, {
|
|
257
271
|
position: "right",
|
|
258
|
-
mt:
|
|
272
|
+
mt: styles.spacing,
|
|
259
273
|
children: /* @__PURE__ */ jsx(Button, {
|
|
260
274
|
type: "submit",
|
|
275
|
+
size: styles.size,
|
|
261
276
|
children: "Save"
|
|
262
277
|
})
|
|
263
278
|
})]
|
|
@@ -265,7 +280,8 @@ function AddDataSourceForm({
|
|
|
265
280
|
});
|
|
266
281
|
}
|
|
267
282
|
function AddDataSource({
|
|
268
|
-
onSuccess
|
|
283
|
+
onSuccess,
|
|
284
|
+
styles = defaultStyles
|
|
269
285
|
}) {
|
|
270
286
|
const [opened, setOpened] = require$$0.useState(false);
|
|
271
287
|
const open = () => setOpened(true);
|
|
@@ -285,10 +301,11 @@ function AddDataSource({
|
|
|
285
301
|
e.stopPropagation();
|
|
286
302
|
},
|
|
287
303
|
children: /* @__PURE__ */ jsx(AddDataSourceForm, {
|
|
288
|
-
postSubmit
|
|
304
|
+
postSubmit,
|
|
305
|
+
styles
|
|
289
306
|
})
|
|
290
307
|
}), /* @__PURE__ */ jsx(Button, {
|
|
291
|
-
size:
|
|
308
|
+
size: styles.size,
|
|
292
309
|
onClick: open,
|
|
293
310
|
leftIcon: /* @__PURE__ */ jsx(PlaylistAdd, {
|
|
294
311
|
size: 20
|
|
@@ -300,7 +317,8 @@ function AddDataSource({
|
|
|
300
317
|
function DeleteDataSource({
|
|
301
318
|
id,
|
|
302
319
|
name,
|
|
303
|
-
onSuccess
|
|
320
|
+
onSuccess,
|
|
321
|
+
styles = defaultStyles
|
|
304
322
|
}) {
|
|
305
323
|
const modals = useModals();
|
|
306
324
|
const doDelete = async () => {
|
|
@@ -325,7 +343,7 @@ function DeleteDataSource({
|
|
|
325
343
|
const confirmAndDelete = () => modals.openConfirmModal({
|
|
326
344
|
title: "Delete this data source?",
|
|
327
345
|
children: /* @__PURE__ */ jsx(Text, {
|
|
328
|
-
size:
|
|
346
|
+
size: styles.size,
|
|
329
347
|
children: "This action won't affect your database."
|
|
330
348
|
}),
|
|
331
349
|
labels: {
|
|
@@ -336,7 +354,7 @@ function DeleteDataSource({
|
|
|
336
354
|
onConfirm: doDelete
|
|
337
355
|
});
|
|
338
356
|
return /* @__PURE__ */ jsx(Button, {
|
|
339
|
-
size:
|
|
357
|
+
size: styles.size,
|
|
340
358
|
color: "red",
|
|
341
359
|
onClick: confirmAndDelete,
|
|
342
360
|
leftIcon: /* @__PURE__ */ jsx(Trash, {
|
|
@@ -345,7 +363,10 @@ function DeleteDataSource({
|
|
|
345
363
|
children: "Delete"
|
|
346
364
|
});
|
|
347
365
|
}
|
|
348
|
-
function DataSourceList(
|
|
366
|
+
function DataSourceList({
|
|
367
|
+
styles = defaultStyles,
|
|
368
|
+
config
|
|
369
|
+
}) {
|
|
349
370
|
const {
|
|
350
371
|
data = [],
|
|
351
372
|
loading,
|
|
@@ -358,24 +379,27 @@ function DataSourceList() {
|
|
|
358
379
|
}, {
|
|
359
380
|
refreshDeps: []
|
|
360
381
|
});
|
|
382
|
+
if (APIClient.baseURL !== config.apiBaseURL) {
|
|
383
|
+
APIClient.baseURL = config.apiBaseURL;
|
|
384
|
+
}
|
|
361
385
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
362
386
|
children: [/* @__PURE__ */ jsx(Group, {
|
|
363
|
-
pt:
|
|
387
|
+
pt: styles.spacing,
|
|
364
388
|
position: "right",
|
|
365
389
|
children: /* @__PURE__ */ jsx(AddDataSource, {
|
|
366
390
|
onSuccess: refresh
|
|
367
391
|
})
|
|
368
392
|
}), /* @__PURE__ */ jsxs(Box, {
|
|
369
|
-
mt:
|
|
393
|
+
mt: styles.spacing,
|
|
370
394
|
sx: {
|
|
371
395
|
position: "relative"
|
|
372
396
|
},
|
|
373
397
|
children: [/* @__PURE__ */ jsx(LoadingOverlay, {
|
|
374
398
|
visible: loading
|
|
375
399
|
}), /* @__PURE__ */ jsxs(Table, {
|
|
376
|
-
horizontalSpacing:
|
|
377
|
-
verticalSpacing:
|
|
378
|
-
fontSize:
|
|
400
|
+
horizontalSpacing: styles.spacing,
|
|
401
|
+
verticalSpacing: styles.spacing,
|
|
402
|
+
fontSize: styles.size,
|
|
379
403
|
highlightOnHover: true,
|
|
380
404
|
children: [/* @__PURE__ */ jsx("thead", {
|
|
381
405
|
children: /* @__PURE__ */ jsxs("tr", {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(o,
|
|
1
|
+
(function(o,i){typeof exports=="object"&&typeof module!="undefined"?i(exports,require("@mantine/core"),require("react-hook-form"),require("@mantine/notifications"),require("react"),require("tabler-icons-react"),require("axios"),require("ahooks"),require("@mantine/modals")):typeof define=="function"&&define.amd?define(["exports","@mantine/core","react-hook-form","@mantine/notifications","react","tabler-icons-react","axios","ahooks","@mantine/modals"],i):(o=typeof globalThis!="undefined"?globalThis:o||self,i(o["settings-form"]={},o["@mantine/core"],o["react-hook-form"],o["@mantine/notifications"],o.React,o["tabler-icons-react"],o.axios,o.ahooks,o["@mantine/modals"]))})(this,function(o,i,u,p,T,z,P,R,L){"use strict";function q(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var w=q(T),O=q(P);const m={baseURL:"http://localhost:31200",getRequest(r){return(e,a,n={})=>{const l={"X-Requested-With":"XMLHttpRequest","Content-Type":n.string?"application/x-www-form-urlencoded":"application/json",...n.headers},s={baseURL:this.baseURL,method:r,url:e,params:r==="GET"?a:n.params,headers:l};return r==="POST"&&(s.data=n.string?JSON.stringify(a):a),O.default(s).then(d=>d.data).catch(d=>Promise.reject(d))}}},x={datasource:{list:async()=>await m.getRequest("POST")("/datasource/list",{filter:{},sort:{field:"create_time",order:"ASC"},pagination:{page:1,pagesize:100}}),create:async(r,e,a)=>{try{return await m.getRequest("POST")("/datasource/create",{type:r,key:e,config:a})}catch(n){return console.error(n),!1}},delete:async r=>{await m.getRequest("POST")("/datasource/delete",{id:r})}}},g={size:"sm",spacing:"md"};var S={exports:{}},b={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var y=w.default,A=Symbol.for("react.element"),j=Symbol.for("react.fragment"),I=Object.prototype.hasOwnProperty,N=y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,U={key:!0,ref:!0,__self:!0,__source:!0};function _(r,e,a){var n,l={},s=null,d=null;a!==void 0&&(s=""+a),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(d=e.ref);for(n in e)I.call(e,n)&&!U.hasOwnProperty(n)&&(l[n]=e[n]);if(r&&r.defaultProps)for(n in e=r.defaultProps,e)l[n]===void 0&&(l[n]=e[n]);return{$$typeof:A,type:r,key:s,ref:d,props:l,_owner:N.current}}b.Fragment=j,b.jsx=_,b.jsxs=_,S.exports=b;const t=S.exports.jsx,f=S.exports.jsxs,C=S.exports.Fragment;function B({postSubmit:r,styles:e=g}){const{control:a,handleSubmit:n,formState:{errors:l,isValidating:s,isValid:d}}=u.useForm({defaultValues:{type:"postgresql",key:"",config:{host:"",port:5432,username:"",password:"",database:""}}}),h=async({type:c,key:M,config:k})=>{if(p.showNotification({id:"for-creating",title:"Pending",message:"Adding data source...",loading:!0}),!await x.datasource.create(c,M,k)){p.updateNotification({id:"for-creating",title:"Failed",message:"Test connection failed with given info",color:"red"});return}p.updateNotification({id:"for-creating",title:"Successful",message:"Data source is added",color:"green"}),r()};return t(i.Box,{mx:"auto",children:f("form",{onSubmit:n(h),children:[t(u.Controller,{name:"type",control:a,render:({field:c})=>t(i.SegmentedControl,{fullWidth:!0,mb:e.spacing,size:e.size,data:[{label:"PostgreSQL",value:"postgresql"},{label:"MySQL",value:"mysql"},{label:"HTTP",value:"http",disabled:!0}],...c})}),t(u.Controller,{name:"key",control:a,render:({field:c})=>t(i.TextInput,{mb:e.spacing,size:e.size,required:!0,label:"Name",placeholder:"A unique name",...c})}),t(i.Divider,{label:"Connection Info",labelPosition:"center"}),f(i.Group,{grow:!0,children:[t(u.Controller,{name:"config.host",control:a,render:({field:c})=>t(i.TextInput,{mb:e.spacing,size:e.size,required:!0,label:"Host",sx:{flexGrow:1},...c})}),t(u.Controller,{name:"config.port",control:a,render:({field:c})=>t(i.NumberInput,{mb:e.spacing,size:e.size,required:!0,label:"Port",hideControls:!0,sx:{width:"8em"},...c})})]}),t(u.Controller,{name:"config.username",control:a,render:({field:c})=>t(i.TextInput,{mb:e.spacing,size:e.size,required:!0,label:"Username",...c})}),t(u.Controller,{name:"config.password",control:a,render:({field:c})=>t(i.PasswordInput,{mb:e.spacing,size:e.size,required:!0,label:"Password",...c})}),t(u.Controller,{name:"config.database",control:a,render:({field:c})=>t(i.TextInput,{mb:e.spacing,size:e.size,required:!0,label:"Database",...c})}),t(i.Group,{position:"right",mt:e.spacing,children:t(i.Button,{type:"submit",size:e.size,children:"Save"})})]})})}function D({onSuccess:r,styles:e=g}){const[a,n]=w.default.useState(!1),l=()=>n(!0),s=()=>n(!1),d=()=>{r(),s()};return f(C,{children:[t(i.Modal,{overflow:"inside",opened:a,onClose:()=>n(!1),title:"Add a data source",trapFocus:!0,onDragStart:h=>{h.stopPropagation()},children:t(B,{postSubmit:d,styles:e})}),t(i.Button,{size:e.size,onClick:l,leftIcon:t(z.PlaylistAdd,{size:20}),children:"Add a Data Source"})]})}function v({id:r,name:e,onSuccess:a,styles:n=g}){const l=L.useModals(),s=async()=>{!r||(p.showNotification({id:"for-deleting",title:"Pending",message:"Deleting data source...",loading:!0}),await x.datasource.delete(r),p.updateNotification({id:"for-deleting",title:"Successful",message:`Data source [${e}] is deleted`,color:"green"}),a())},d=()=>l.openConfirmModal({title:"Delete this data source?",children:t(i.Text,{size:n.size,children:"This action won't affect your database."}),labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:s});return t(i.Button,{size:n.size,color:"red",onClick:d,leftIcon:t(z.Trash,{size:20}),children:"Delete"})}function E({styles:r=g,config:e}){const{data:a=[],loading:n,refresh:l}=R.useRequest(async()=>{const{data:s}=await x.datasource.list();return s},{refreshDeps:[]});return m.baseURL!==e.apiBaseURL&&(m.baseURL=e.apiBaseURL),f(C,{children:[t(i.Group,{pt:r.spacing,position:"right",children:t(D,{onSuccess:l})}),f(i.Box,{mt:r.spacing,sx:{position:"relative"},children:[t(i.LoadingOverlay,{visible:n}),f(i.Table,{horizontalSpacing:r.spacing,verticalSpacing:r.spacing,fontSize:r.size,highlightOnHover:!0,children:[t("thead",{children:f("tr",{children:[t("th",{children:"Type"}),t("th",{children:"Name"}),t("th",{children:"Action"})]})}),t("tbody",{children:a.map(({id:s,key:d,type:h})=>f("tr",{children:[t("td",{width:200,children:h}),t("td",{children:d}),t("td",{width:200,children:t(i.Group,{position:"left",children:t(v,{id:s,name:d,onSuccess:l})})})]},d))})]})]})]})}o.AddDataSource=D,o.DataSourceList=E,o.DeleteDataSource=v,Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devtable/settings-form",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -52,4 +52,4 @@
|
|
|
52
52
|
"react-hook-form": "^7.31.2",
|
|
53
53
|
"tabler-icons-react": "^1.48.0"
|
|
54
54
|
}
|
|
55
|
-
}
|
|
55
|
+
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const APICaller: {
|
|
2
|
-
datasource: {
|
|
3
|
-
list: () => Promise<import("../../../website/src/api-caller/types").PaginationResponse<import("./datasource.typed").IDataSource>>;
|
|
4
|
-
create: (type: import("./datasource.typed").DataSourceType, key: string, config: import("./datasource.typed").IDataSourceConfig) => Promise<false | import("../../../website/src/api-caller/types").PaginationResponse<import("./datasource.typed").IDataSource>>;
|
|
5
|
-
delete: (id: string) => Promise<void>;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './datasource';
|