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
255aca5a
Unverified
Commit
255aca5a
authored
Feb 29, 2024
by
Zzm0809
Committed by
GitHub
Feb 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix] Fix k8s application type can not render (#3202)
Co-authored-by:
Zzm0809
<
Zzm0809@users.noreply.github.com
>
parent
9f000eda
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
76 additions
and
154 deletions
+76
-154
EditJobInstanceForm.tsx
.../JobDetail/JobOperator/components/EditJobInstanceForm.tsx
+2
-3
index.tsx
...ster/Configuration/components/ConfigurationList/index.tsx
+2
-2
index.tsx
...ConfigurationModal/ConfigurationForm/BaseConfig/index.tsx
+6
-2
index.tsx
...s/ConfigurationModal/ConfigurationForm/FlinkK8s/index.tsx
+1
-1
contants.tsx
...s/RegCenter/Cluster/Configuration/components/contants.tsx
+0
-69
index.tsx
...Center/Cluster/Instance/components/InstanceList/index.tsx
+2
-2
index.tsx
.../Instance/components/InstanceModal/InstanceForm/index.tsx
+6
-3
contants.tsx
.../pages/RegCenter/Cluster/Instance/components/contants.tsx
+0
-71
constants.ts
dinky-web/src/pages/RegCenter/Cluster/constants.ts
+57
-1
No files found.
dinky-web/src/pages/DevOps/JobDetail/JobOperator/components/EditJobInstanceForm.tsx
View file @
255aca5a
...
@@ -17,8 +17,7 @@
...
@@ -17,8 +17,7 @@
*
*
*/
*/
import
{
ClusterType
}
from
'@/pages/RegCenter/Cluster/constants'
;
import
{
CLUSTER_INSTANCE_TYPE
}
from
'@/pages/RegCenter/Cluster/constants'
;
import
{
CLUSTER_INSTANCE_TYPE
}
from
'@/pages/RegCenter/Cluster/Instance/components/contants'
;
import
{
validatorJMHAAdderess
}
from
'@/pages/RegCenter/Cluster/Instance/components/function'
;
import
{
validatorJMHAAdderess
}
from
'@/pages/RegCenter/Cluster/Instance/components/function'
;
import
{
handleAddOrUpdate
}
from
'@/services/BusinessCrud'
;
import
{
handleAddOrUpdate
}
from
'@/services/BusinessCrud'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
import
{
API_CONSTANTS
}
from
'@/services/endpoints'
;
...
@@ -85,7 +84,7 @@ const EditJobInstanceForm = (props: {
...
@@ -85,7 +84,7 @@ const EditJobInstanceForm = (props: {
name=
'type'
name=
'type'
label=
{
l
(
'rc.ci.type'
)
}
label=
{
l
(
'rc.ci.type'
)
}
disabled
disabled
options=
{
CLUSTER_INSTANCE_TYPE
(
[
ClusterType
.
YARN_APPLICATION
]
)
}
options=
{
CLUSTER_INSTANCE_TYPE
()
}
rules=
{
[{
required
:
true
,
message
:
l
(
'rc.ci.typePlaceholder'
)
}]
}
rules=
{
[{
required
:
true
,
message
:
l
(
'rc.ci.typePlaceholder'
)
}]
}
placeholder=
{
l
(
'rc.ci.typePlaceholder'
)
}
placeholder=
{
l
(
'rc.ci.typePlaceholder'
)
}
/>
/>
...
...
dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationList/index.tsx
View file @
255aca5a
...
@@ -27,7 +27,7 @@ import { DataAction } from '@/components/StyledComponents';
...
@@ -27,7 +27,7 @@ import { DataAction } from '@/components/StyledComponents';
import
{
Authorized
,
HasAuthority
}
from
'@/hooks/useAccess'
;
import
{
Authorized
,
HasAuthority
}
from
'@/hooks/useAccess'
;
import
{
imgStyle
}
from
'@/pages/Home/constants'
;
import
{
imgStyle
}
from
'@/pages/Home/constants'
;
import
ConfigurationModal
from
'@/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal'
;
import
ConfigurationModal
from
'@/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal'
;
import
{
CLUSTER_
CONFIG_TYPE
}
from
'@/pages/RegCenter/Cluster/Configuration/components/con
tants'
;
import
{
CLUSTER_
TYPE_OPTIONS
}
from
'@/pages/RegCenter/Cluster/cons
tants'
;
import
{
import
{
handleAddOrUpdate
,
handleAddOrUpdate
,
handleOption
,
handleOption
,
...
@@ -237,7 +237,7 @@ export default () => {
...
@@ -237,7 +237,7 @@ export default () => {
disabled=
{
!
HasAuthority
(
PermissionConstants
.
REGISTRATION_CLUSTER_CONFIG_EDIT
)
}
disabled=
{
!
HasAuthority
(
PermissionConstants
.
REGISTRATION_CLUSTER_CONFIG_EDIT
)
}
/>
/>
<
Tag
color=
'cyan'
>
<
Tag
color=
'cyan'
>
{
CLUSTER_
CONFIG_TYPE
.
find
((
record
)
=>
item
.
type
===
record
.
value
)?.
label
}
{
CLUSTER_
TYPE_OPTIONS
.
find
((
record
)
=>
item
.
type
===
record
.
value
)?.
label
}
</
Tag
>
</
Tag
>
<
Tag
<
Tag
icon=
{
item
.
isAvailable
?
<
CheckCircleOutlined
/>
:
<
ExclamationCircleOutlined
/>
}
icon=
{
item
.
isAvailable
?
<
CheckCircleOutlined
/>
:
<
ExclamationCircleOutlined
/>
}
...
...
dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal/ConfigurationForm/BaseConfig/index.tsx
View file @
255aca5a
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
*
*
*/
*/
import
{
C
LUSTER_CONFIG_TYPE
}
from
'@/pages/RegCenter/Cluster/Configuration/components/con
tants'
;
import
{
C
lusterType
,
CLUSTER_CONFIG_TYPE
}
from
'@/pages/RegCenter/Cluster/cons
tants'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
import
{
ProFormDigit
,
ProFormDigit
,
...
@@ -38,7 +38,11 @@ const BaseConfig: React.FC = () => {
...
@@ -38,7 +38,11 @@ const BaseConfig: React.FC = () => {
name=
'type'
name=
'type'
label=
{
l
(
'rc.cc.type'
)
}
label=
{
l
(
'rc.cc.type'
)
}
width=
'md'
width=
'md'
options=
{
CLUSTER_CONFIG_TYPE
}
options=
{
CLUSTER_CONFIG_TYPE
([
ClusterType
.
KUBERNETES_OPERATOR
,
ClusterType
.
KUBERNETES_APPLICATION
,
ClusterType
.
YARN
])
}
rules=
{
[{
required
:
true
,
message
:
l
(
'rc.cc.typePlaceholder'
)
}]
}
rules=
{
[{
required
:
true
,
message
:
l
(
'rc.cc.typePlaceholder'
)
}]
}
placeholder=
{
l
(
'rc.cc.typePlaceholder'
)
}
placeholder=
{
l
(
'rc.cc.typePlaceholder'
)
}
/>
/>
...
...
dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal/ConfigurationForm/FlinkK8s/index.tsx
View file @
255aca5a
...
@@ -158,7 +158,7 @@ const FlinkK8s = (props: { type: string; value: any; form: FormInstance<Values>
...
@@ -158,7 +158,7 @@ const FlinkK8s = (props: { type: string; value: any; form: FormInstance<Values>
<
Row
gutter=
{
[
16
,
16
]
}
>
<
Row
gutter=
{
[
16
,
16
]
}
>
<
Col
span=
{
10
}
>
<
Col
span=
{
10
}
>
<
ProFormGroup
>
<
ProFormGroup
>
{
type
&&
type
===
ClusterType
.
KUBERNETES_
NATIVE
&&
(
{
type
&&
type
===
ClusterType
.
KUBERNETES_
APPLICATION
&&
(
<
ProFormSelect
<
ProFormSelect
name=
{
[
name=
{
[
'config'
,
'config'
,
...
...
dinky-web/src/pages/RegCenter/Cluster/Configuration/components/contants.tsx
View file @
255aca5a
...
@@ -18,30 +18,7 @@
...
@@ -18,30 +18,7 @@
*/
*/
import
{
FormConfig
}
from
'@/pages/RegCenter/Cluster/Configuration/components/data'
;
import
{
FormConfig
}
from
'@/pages/RegCenter/Cluster/Configuration/components/data'
;
import
{
ClusterType
}
from
'@/pages/RegCenter/Cluster/constants'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
DefaultOptionType
}
from
'rc-select/es/Select'
;
/**
* Cluster config type
*/
export
const
CLUSTER_CONFIG_TYPE
:
DefaultOptionType
[]
=
[
{
value
:
ClusterType
.
YARN
,
label
:
'Flink On Yarn'
,
key
:
ClusterType
.
YARN
},
{
value
:
ClusterType
.
KUBERNETES_NATIVE
,
label
:
'Kubernetes Native'
,
key
:
ClusterType
.
KUBERNETES_NATIVE
},
{
value
:
ClusterType
.
KUBERNETES_OPERATOR
,
label
:
'Kubernetes Operator'
,
key
:
ClusterType
.
KUBERNETES_OPERATOR
}
];
export
const
FLINK_CONFIG_LIST
:
FormConfig
[]
=
[
export
const
FLINK_CONFIG_LIST
:
FormConfig
[]
=
[
{
{
...
@@ -82,52 +59,6 @@ export const FLINK_CONFIG_LIST: FormConfig[] = [
...
@@ -82,52 +59,6 @@ export const FLINK_CONFIG_LIST: FormConfig[] = [
}
}
];
];
export
const
DOCKER_CONFIG_LIST
:
FormConfig
[]
=
[
{
name
:
'dinky.remote.addr'
,
label
:
l
(
'rc.cc.docker.dinky.addr'
),
placeholder
:
l
(
'rc.cc.docker.dinky.addrHelp'
),
tooltip
:
l
(
'rc.cc.docker.dinky.addrHelp'
),
defaultValue
:
'127.0.0.1:8888'
},
{
name
:
'docker.instance'
,
label
:
l
(
'rc.cc.docker.instance'
),
placeholder
:
l
(
'rc.cc.docker.instanceHelp'
),
tooltip
:
l
(
'rc.cc.docker.instanceHelp'
)
},
{
name
:
'docker.registry.url'
,
label
:
l
(
'rc.cc.docker.url'
),
placeholder
:
l
(
'rc.cc.docker.urlHelp'
),
tooltip
:
l
(
'rc.cc.docker.urlHelp'
)
},
{
name
:
'docker.registry.username'
,
label
:
l
(
'rc.cc.docker.username'
),
placeholder
:
l
(
'rc.cc.docker.usernameHelp'
),
tooltip
:
l
(
'rc.cc.docker.usernameHelp'
)
},
{
name
:
'docker.registry.password'
,
label
:
l
(
'rc.cc.docker.password'
),
placeholder
:
l
(
'rc.cc.docker.passwordHelp'
),
tooltip
:
l
(
'rc.cc.docker.passwordHelp'
)
},
{
name
:
'docker.image.tag'
,
label
:
l
(
'rc.cc.docker.tag'
),
placeholder
:
l
(
'rc.cc.docker.tagHelp'
),
tooltip
:
l
(
'rc.cc.docker.tagHelp'
)
},
{
name
:
'docker.image.dockerfile'
,
label
:
l
(
'rc.cc.docker.file'
),
placeholder
:
l
(
'rc.cc.docker.fileHelp'
),
tooltip
:
l
(
'rc.cc.docker.fileHelp'
)
}
];
export
const
KUBERNETES_CONFIG_LIST
:
FormConfig
[]
=
[
export
const
KUBERNETES_CONFIG_LIST
:
FormConfig
[]
=
[
{
{
name
:
'kubernetes.namespace'
,
name
:
'kubernetes.namespace'
,
...
...
dinky-web/src/pages/RegCenter/Cluster/Instance/components/InstanceList/index.tsx
View file @
255aca5a
...
@@ -23,7 +23,7 @@ import { EnableSwitchBtn } from '@/components/CallBackButton/EnableSwitchBtn';
...
@@ -23,7 +23,7 @@ import { EnableSwitchBtn } from '@/components/CallBackButton/EnableSwitchBtn';
import
{
PopconfirmDeleteBtn
}
from
'@/components/CallBackButton/PopconfirmDeleteBtn'
;
import
{
PopconfirmDeleteBtn
}
from
'@/components/CallBackButton/PopconfirmDeleteBtn'
;
import
{
Authorized
,
HasAuthority
}
from
'@/hooks/useAccess'
;
import
{
Authorized
,
HasAuthority
}
from
'@/hooks/useAccess'
;
import
useHookRequest
from
'@/hooks/useHookRequest'
;
import
useHookRequest
from
'@/hooks/useHookRequest'
;
import
{
CLUSTER_
INSTANCE_TYPE
}
from
'@/pages/RegCenter/Cluster/Instance/components/con
tants'
;
import
{
CLUSTER_
TYPE_OPTIONS
}
from
'@/pages/RegCenter/Cluster/cons
tants'
;
import
{
renderWebUiRedirect
}
from
'@/pages/RegCenter/Cluster/Instance/components/function'
;
import
{
renderWebUiRedirect
}
from
'@/pages/RegCenter/Cluster/Instance/components/function'
;
import
InstanceModal
from
'@/pages/RegCenter/Cluster/Instance/components/InstanceModal'
;
import
InstanceModal
from
'@/pages/RegCenter/Cluster/Instance/components/InstanceModal'
;
import
{
getData
}
from
'@/services/api'
;
import
{
getData
}
from
'@/services/api'
;
...
@@ -237,7 +237,7 @@ export default () => {
...
@@ -237,7 +237,7 @@ export default () => {
disabled=
{
!
HasAuthority
(
PermissionConstants
.
REGISTRATION_CLUSTER_INSTANCE_EDIT
)
}
disabled=
{
!
HasAuthority
(
PermissionConstants
.
REGISTRATION_CLUSTER_INSTANCE_EDIT
)
}
/>
/>
<
Tag
color=
'cyan'
>
<
Tag
color=
'cyan'
>
{
CLUSTER_
INSTANCE_TYPE
()
.
find
((
record
)
=>
item
.
type
===
record
.
value
)?.
label
}
{
CLUSTER_
TYPE_OPTIONS
.
find
((
record
)
=>
item
.
type
===
record
.
value
)?.
label
}
</
Tag
>
</
Tag
>
<
Tag
<
Tag
icon=
{
item
.
status
===
1
?
<
CheckCircleOutlined
/>
:
<
ExclamationCircleOutlined
/>
}
icon=
{
item
.
status
===
1
?
<
CheckCircleOutlined
/>
:
<
ExclamationCircleOutlined
/>
}
...
...
dinky-web/src/pages/RegCenter/Cluster/Instance/components/InstanceModal/InstanceForm/index.tsx
View file @
255aca5a
...
@@ -17,8 +17,7 @@
...
@@ -17,8 +17,7 @@
*
*
*/
*/
import
{
ClusterType
}
from
'@/pages/RegCenter/Cluster/constants'
;
import
{
ClusterType
,
CLUSTER_INSTANCE_TYPE
}
from
'@/pages/RegCenter/Cluster/constants'
;
import
{
CLUSTER_INSTANCE_TYPE
}
from
'@/pages/RegCenter/Cluster/Instance/components/contants'
;
import
{
validatorJMHAAdderess
}
from
'@/pages/RegCenter/Cluster/Instance/components/function'
;
import
{
validatorJMHAAdderess
}
from
'@/pages/RegCenter/Cluster/Instance/components/function'
;
import
{
Cluster
}
from
'@/types/RegCenter/data.d'
;
import
{
Cluster
}
from
'@/types/RegCenter/data.d'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
l
}
from
'@/utils/intl'
;
...
@@ -65,7 +64,11 @@ const InstanceForm: React.FC<InstanceFormProps> = (props) => {
...
@@ -65,7 +64,11 @@ const InstanceForm: React.FC<InstanceFormProps> = (props) => {
label=
{
l
(
'rc.ci.type'
)
}
label=
{
l
(
'rc.ci.type'
)
}
width=
'sm'
width=
'sm'
disabled=
{
values
&&
values
.
autoRegisters
}
disabled=
{
values
&&
values
.
autoRegisters
}
options=
{
CLUSTER_INSTANCE_TYPE
([
ClusterType
.
YARN_APPLICATION
])
}
options=
{
CLUSTER_INSTANCE_TYPE
([
ClusterType
.
YARN_APPLICATION
,
ClusterType
.
KUBERNETES_OPERATOR
,
ClusterType
.
KUBERNETES_APPLICATION
])
}
rules=
{
[{
required
:
true
,
message
:
l
(
'rc.ci.typePlaceholder'
)
}]
}
rules=
{
[{
required
:
true
,
message
:
l
(
'rc.ci.typePlaceholder'
)
}]
}
placeholder=
{
l
(
'rc.ci.typePlaceholder'
)
}
placeholder=
{
l
(
'rc.ci.typePlaceholder'
)
}
/>
/>
...
...
dinky-web/src/pages/RegCenter/Cluster/Instance/components/contants.tsx
deleted
100644 → 0
View file @
9f000eda
/*
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import
{
ClusterType
}
from
'@/pages/RegCenter/Cluster/constants'
;
import
{
l
}
from
'@/utils/intl'
;
import
{
Tag
}
from
'antd'
;
import
{
DefaultOptionType
}
from
'rc-select/es/Select'
;
/**
* Cluster instance type
*/
export
const
CLUSTER_INSTANCE_TYPE
=
(
hiddenOptions
:
string
[]
=
[]):
DefaultOptionType
[]
=>
{
const
returnResult
:
DefaultOptionType
[]
=
[
{
value
:
ClusterType
.
STANDALONE
,
label
:
'Standalone'
,
key
:
ClusterType
.
STANDALONE
},
{
value
:
ClusterType
.
YARN_SESSION
,
label
:
'Yarn Session'
,
key
:
ClusterType
.
YARN_SESSION
},
{
value
:
ClusterType
.
KUBERNETES_SESSION
,
label
:
'Kubernetes Session'
,
key
:
ClusterType
.
KUBERNETES_SESSION
},
{
value
:
ClusterType
.
YARN_APPLICATION
,
label
:
'Yarn Application'
,
key
:
ClusterType
.
YARN_APPLICATION
},
{
value
:
ClusterType
.
LOCAL
,
label
:
'Local'
,
key
:
ClusterType
.
LOCAL
}
];
return
returnResult
.
filter
((
item
)
=>
!
hiddenOptions
.
includes
(
item
.
value
as
string
));
};
/**
* Cluster instance status enum
*/
export
const
CLUSTER_INSTANCE_STATUS_ENUM
=
{
1
:
{
text
:
<
Tag
color=
{
'success'
}
>
{
l
(
'global.table.status.normal'
)
}
</
Tag
>,
status
:
'Success'
},
0
:
{
text
:
<
Tag
color=
{
'error'
}
>
{
l
(
'global.table.status.abnormal'
)
}
</
Tag
>,
status
:
'Error'
}
};
dinky-web/src/pages/RegCenter/Cluster/constants.ts
View file @
255aca5a
...
@@ -17,13 +17,69 @@
...
@@ -17,13 +17,69 @@
*
*
*/
*/
import
{
DefaultOptionType
}
from
'rc-select/es/Select'
;
export
enum
ClusterType
{
export
enum
ClusterType
{
STANDALONE
=
'standalone'
,
STANDALONE
=
'standalone'
,
YARN
=
'yarn-application'
,
YARN
=
'yarn-application'
,
YARN_SESSION
=
'yarn-session'
,
YARN_SESSION
=
'yarn-session'
,
KUBERNETES_SESSION
=
'kubernetes-session'
,
KUBERNETES_SESSION
=
'kubernetes-session'
,
KUBERNETES_
NATIVE
=
'kubernetes-application'
,
KUBERNETES_
APPLICATION
=
'kubernetes-application'
,
KUBERNETES_OPERATOR
=
'kubernetes-application-operator'
,
KUBERNETES_OPERATOR
=
'kubernetes-application-operator'
,
YARN_APPLICATION
=
'yarn-application'
,
YARN_APPLICATION
=
'yarn-application'
,
LOCAL
=
'local'
LOCAL
=
'local'
}
}
export
const
CLUSTER_TYPE_OPTIONS
:
DefaultOptionType
[]
=
[
{
value
:
ClusterType
.
STANDALONE
,
label
:
'Standalone'
,
key
:
ClusterType
.
STANDALONE
},
{
value
:
ClusterType
.
YARN_SESSION
,
label
:
'Yarn Session'
,
key
:
ClusterType
.
YARN_SESSION
},
{
value
:
ClusterType
.
KUBERNETES_SESSION
,
label
:
'Kubernetes Session'
,
key
:
ClusterType
.
KUBERNETES_SESSION
},
{
value
:
ClusterType
.
KUBERNETES_APPLICATION
,
label
:
'Kubernetes Application'
,
key
:
ClusterType
.
KUBERNETES_APPLICATION
},
{
value
:
ClusterType
.
KUBERNETES_OPERATOR
,
label
:
'Kubernetes Operator'
,
key
:
ClusterType
.
KUBERNETES_OPERATOR
},
{
value
:
ClusterType
.
YARN_APPLICATION
,
label
:
'Yarn Application'
,
key
:
ClusterType
.
YARN_APPLICATION
},
{
value
:
ClusterType
.
LOCAL
,
label
:
'Local'
,
key
:
ClusterType
.
LOCAL
}
];
/**
* Cluster instance type
*/
export
const
CLUSTER_INSTANCE_TYPE
=
(
hiddenOptions
:
string
[]
=
[]):
DefaultOptionType
[]
=>
{
return
CLUSTER_TYPE_OPTIONS
.
filter
((
item
)
=>
!
hiddenOptions
.
includes
(
item
.
value
as
string
));
};
/**
* Cluster config type
* @param renderOptions
* @constructor
*/
export
const
CLUSTER_CONFIG_TYPE
=
(
renderOptions
:
string
[]
=
[]):
DefaultOptionType
[]
=>
{
return
CLUSTER_TYPE_OPTIONS
.
filter
((
item
)
=>
renderOptions
.
includes
(
item
.
value
as
string
));
};
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