Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dinky
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangpeng
dinky
Commits
71f5d017
Unverified
Commit
71f5d017
authored
Dec 06, 2023
by
Zzm0809
Committed by
GitHub
Dec 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bug] fix datasource detail bug (#2613)
* fixbug-datasource-detail * Spotless Apply --------- Co-authored-by:
Zzm0809
<
Zzm0809@users.noreply.github.com
>
parent
6a438e58
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
23 deletions
+20
-23
index.tsx
dinky-web/src/pages/Other/Login/index.tsx
+1
-2
index.tsx
...egCenter/DataSource/components/DataSourceDetail/index.tsx
+7
-8
index.tsx
.../RegCenter/DataSource/components/DataSourceList/index.tsx
+10
-11
index.tsx
...RegCenter/DataSource/components/DataSourceModal/index.tsx
+1
-1
function.tsx
dinky-web/src/utils/function.tsx
+1
-1
No files found.
dinky-web/src/pages/Other/Login/index.tsx
View file @
71f5d017
...
...
@@ -25,7 +25,7 @@ import { chooseTenantSubmit, login, queryDataByParams } from '@/services/Busines
import
{
API
}
from
'@/services/data'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
UserBaseInfo
}
from
'@/types/AuthCenter/data'
;
import
{
setLocalThemeToStorage
,
setTenantStorageAndCookie
}
from
'@/utils/function'
;
import
{
setLocalThemeToStorage
,
setTenantStorageAndCookie
}
from
'@/utils/function'
;
import
{
useLocalStorage
}
from
'@/utils/hook/useLocalStorage'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
ErrorMessage
,
SuccessMessageAsync
}
from
'@/utils/messages'
;
...
...
@@ -84,7 +84,6 @@ const Login: React.FC = () => {
const
handleChooseTenant
=
async
(
chooseTenantResult
:
API
.
Result
)
=>
{
if
(
chooseTenantResult
.
code
===
0
)
{
await
SuccessMessageAsync
(
l
(
'login.chooseTenantSuccess'
,
''
,
{
msg
:
chooseTenantResult
.
msg
,
...
...
dinky-web/src/pages/RegCenter/DataSource/components/DataSourceDetail/index.tsx
View file @
71f5d017
...
...
@@ -27,16 +27,17 @@ import { RESPONSE_CODE } from '@/services/constants';
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
DataSources
}
from
'@/types/RegCenter/data'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
connect
}
from
'@@/exports'
;
import
{
BackwardOutlined
,
ReloadOutlined
}
from
'@ant-design/icons'
;
import
{
Key
,
ProCard
}
from
'@ant-design/pro-components'
;
import
{
useNavigate
}
from
'@umijs/max'
;
import
{
connect
,
history
}
from
'@umijs/max'
;
import
{
Button
,
Space
}
from
'antd'
;
import
{
useCallback
,
useEffect
,
useState
}
from
'react'
;
const
DataSourceDetail
=
(
props
:
any
)
=>
{
const
navigate
=
useNavigate
();
interface
DataSourceDetailProps
{
dataSource
:
DataSources
.
DataSource
;
backClick
:
()
=>
void
;
}
const
DataSourceDetail
=
(
props
:
DataSourceDetailProps
&
connect
)
=>
{
const
{
dataSource
,
backClick
,
...
...
@@ -56,9 +57,7 @@ const DataSourceDetail = (props: any) => {
const
handleBackClick
=
()
=>
{
// go back
navigate
(
'/registration/database'
,
{
state
:
{
from
:
`/registration/database/detail/
${
dataSource
.
id
}
`
}
});
history
.
push
(
`/registration/datasource`
);
// back click callback
backClick
();
};
...
...
dinky-web/src/pages/RegCenter/DataSource/components/DataSourceList/index.tsx
View file @
71f5d017
...
...
@@ -39,7 +39,6 @@ import { API_CONSTANTS } from '@/services/endpoints';
import
{
DataSources
}
from
'@/types/RegCenter/data.d'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
WarningMessage
}
from
'@/utils/messages'
;
import
{
useNavigate
}
from
'@@/exports'
;
import
{
CheckCircleOutlined
,
CopyTwoTone
,
...
...
@@ -47,6 +46,7 @@ import {
HeartTwoTone
}
from
'@ant-design/icons'
;
import
{
ActionType
,
ProList
}
from
'@ant-design/pro-components'
;
import
{
history
}
from
'@umijs/max'
;
import
{
Button
,
Descriptions
,
Input
,
Modal
,
Space
,
Tag
,
Tooltip
}
from
'antd'
;
import
DescriptionsItem
from
'antd/es/descriptions/Item'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
...
...
@@ -54,8 +54,7 @@ import { connect } from 'umi';
import
DataSourceModal
from
'../DataSourceModal'
;
const
DataSourceTable
:
React
.
FC
<
connect
&
StateType
>
=
(
props
)
=>
{
const
{
dispatch
}
=
props
;
const
navigate
=
useNavigate
();
const
{
dispatch
,
database
}
=
props
;
/**
* state
...
...
@@ -63,14 +62,16 @@ const DataSourceTable: React.FC<connect & StateType> = (props) => {
const
[
loading
,
setLoading
]
=
React
.
useState
<
boolean
>
(
false
);
const
[
modalVisible
,
setModalVisible
]
=
useState
<
boolean
>
(
false
);
const
[
detailPage
,
setDetailPage
]
=
useState
<
boolean
>
(
false
);
const
[
dataSource
,
setDataSource
]
=
useState
<
DataSources
.
DataSource
[]
>
([]);
const
[
formValues
,
setFormValues
]
=
useState
<
Partial
<
DataSources
.
DataSource
>>
({});
const
actionRef
=
React
.
useRef
<
ActionType
>
();
const
queryDataSourceList
=
async
(
keyword
=
''
)
=>
{
queryDataByParams
(
API_CONSTANTS
.
DATASOURCE
,
{
keyword
}).
then
((
res
)
=>
setDataSource
(
res
as
DataSources
.
DataSource
[])
);
queryDataByParams
(
API_CONSTANTS
.
DATASOURCE
,
{
keyword
}).
then
((
res
)
=>
{
dispatch
({
type
:
STUDIO_MODEL
.
saveDataBase
,
payload
:
res
});
});
};
/**
...
...
@@ -176,9 +177,7 @@ const DataSourceTable: React.FC<connect & StateType> = (props) => {
payload
:
item
.
id
});
setFormValues
(
item
);
navigate
(
`/registration/datasource/detail/
${
item
.
id
}
`
,
{
state
:
{
from
:
'/registration/datasource'
}
});
history
.
push
(
`/registration/datasource/detail/
${
item
.
id
}
`
);
setDetailPage
(
!
detailPage
);
}
else
{
await
WarningMessage
(
l
(
'rc.ds.enter.error'
));
...
...
@@ -243,7 +242,7 @@ const DataSourceTable: React.FC<connect & StateType> = (props) => {
/**
* render data source
*/
const
renderDataSource
=
data
Source
.
map
((
item
)
=>
({
const
renderDataSource
=
data
base
.
dbData
.
map
((
item
:
DataSources
.
DataSource
)
=>
({
subTitle
:
renderDataSourceSubTitle
(
item
),
actions
:
<
DataAction
>
{
renderDataSourceActionButton
(
item
)
}
</
DataAction
>,
avatar
:
(
...
...
dinky-web/src/pages/RegCenter/DataSource/components/DataSourceModal/index.tsx
View file @
71f5d017
...
...
@@ -107,7 +107,7 @@ const DataSourceModal: React.FC<DataSourceModalProps> = (props) => {
const
submitForm
=
async
()
=>
{
const
fieldsValue
=
await
form
.
validateFields
();
setSubmitting
(
true
);
await
onSubmit
({
...
values
,
...
fieldsValue
});
onSubmit
({
...
values
,
...
fieldsValue
});
handleCancel
();
};
...
...
dinky-web/src/utils/function.tsx
View file @
71f5d017
...
...
@@ -126,7 +126,7 @@ export function getLocalTheme(): string {
}
export
function
setLocalThemeToStorage
(
defaultTheme
?:
string
)
{
localStorage
.
setItem
(
THEME
.
NAV_THEME
,
defaultTheme
??
getLocalTheme
())
;
localStorage
.
setItem
(
THEME
.
NAV_THEME
,
defaultTheme
??
getLocalTheme
())
;
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment