You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/05/18 07:46:17 UTC
[GitHub] [dolphinscheduler] qianli2022 opened a new pull request, #10096: [Feature][Improvement] Support multi cluster environments - k8s type
qianli2022 opened a new pull request, #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096
<!--Thanks very much for contributing to Apache DolphinScheduler. Please review https://dolphinscheduler.apache.org/en-us/community/development/pull-request.html before opening a pull request.-->
## Purpose of the pull request
Adding a cluster configuration, a cluster configuration with k8s etc. Currently only k8s multi-clusters are supported.
## Brief change log
- *Add ClusterServiceImpl.java*
- *Add ClusterController.java*
- *Add ClusterMapper.java*
- *Add cluster-modal.tsx*
## Verify this pull request
This change added tests and can be verified as follows:
- *Added ClusterControllerTest.*
- *Added ClusterServiceTest.*
- *Added ClusterMapperTest*
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897495362
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
Hi @Amy0104, yes, you are right, for this part, I have changed the code with NSpace(without css), it's better use NSpace.
And about the next comments, lines near 155, as the parent div also has margin-top, not only keep NPagination center, so I kept the same code(\<div class={styles.pagination}\>) with other pages, because they have implemented the unified css margin-top in css file
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1139238844
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10096)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [27 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list) [88.8% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list) [6.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897495362
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
Hi @Amy0104, yes, you are right, for this part, I have changed the code with NSpace(without css), it's better use NSpace.
And about the next comments, lines near 155, as the parent div also has margin-top, not only keep NPagination center, so I kept the same code(<div class={styles.pagination}>) with other pages, because they have implemented the unified css margin-top in css file
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] qianli2022 commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
qianli2022 commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1153479291
> Hello, after the cluster should belong to the scope of data permissions, we will refactor function permissions and resource permissions in the next version, the purpose is to facilitate the expansion and customization of functional permissions and data permissions. You can Under the dev' branch, you can see the method of unified management of permissions in ResourcePermissionCheckService. I hope you can optimize the permission management of the cluster in the future, thank you.
OK,next pr will be namespace using multiple clusters, which will include permissions, and I will fellow your latest permissions design.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] kezhenxu94 commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1136649982
Hi @qianli2022 , thank you, do you have an issue to link to the feature discussion?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] Amy0104 commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
Amy0104 commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897487559
##########
dolphinscheduler-ui/src/views/security/cluster-manage/components/use-modal.ts:
##########
@@ -0,0 +1,119 @@
+/*
+ * 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 { reactive, ref, SetupContext } from 'vue'
+import { useI18n } from 'vue-i18n'
+import {
+ verifyCluster,
+ createCluster,
+ updateCluster
+} from '@/service/modules/cluster'
+
+export function useModal(
+ props: any,
+ ctx: SetupContext<('cancelModal' | 'confirmModal')[]>
+) {
+ const { t } = useI18n()
+
+ const variables = reactive({
+ clusterFormRef: ref(),
+ model: {
+ code: ref<number>(-1),
+ name: ref(''),
+ k8s_config: ref(''),
+ yarn_config: ref(''),
+ description: ref('')
+ },
+ saving: false,
+ rules: {
+ name: {
+ required: true,
+ trigger: ['input', 'blur'],
+ validator() {
+ if (variables.model.name === '') {
+ return new Error(t('security.cluster.cluster_name_tips'))
+ }
+ }
+ },
+ description: {
+ required: true,
+ trigger: ['input', 'blur'],
+ validator() {
+ if (variables.model.description === '') {
+ return new Error(t('security.cluster.cluster_description_tips'))
+ }
+ }
+ }
+ }
+ })
+
+ const handleValidate = async (statusRef: number) => {
+ await variables.clusterFormRef.validate()
+
+ if (variables.saving) return
+ variables.saving = true
+
+ try {
+ statusRef === 0 ? await submitClusterModal() : await updateClusterModal()
+ variables.saving = false
+ } catch (err) {
+ variables.saving = false
+ }
Review Comment:
Yes, other modules also be optimized.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897481904
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
Code changed, thank you.
##########
dolphinscheduler-ui/src/views/security/cluster-manage/components/cluster-modal.tsx:
##########
@@ -0,0 +1,191 @@
+/*
+ * 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 { defineComponent, PropType, toRefs, watch } from 'vue'
+import Modal from '@/components/modal'
+import { NForm, NFormItem, NInput } from 'naive-ui'
+import { useModal } from './use-modal'
+import { useI18n } from 'vue-i18n'
+
+const envK8sConfigPlaceholder = `apiVersion: v1
+clusters:
+- cluster:
+ certificate-authority-data: LS0tLS1CZJQ0FURS0tLS0tCg==
+ server: https://127.0.0.1:6443
+ name: kubernetes
+contexts:
+- context:
+ cluster: kubernetes
+ user: kubernetes-admin
+ name: kubernetes-admin@kubernetes
+current-context: kubernetes-admin@kubernetes
+kind: Config
+preferences: {}
+users:
+- name: kubernetes-admin
+ user:
+ client-certificate-data: LS0tLS1CZJQ0FURS0tLS0tCg=
+`
+
+const envYarnConfigPlaceholder = 'In development...'
+
+const ClusterModal = defineComponent({
+ name: 'ClusterModal',
+ props: {
+ showModalRef: {
+ type: Boolean as PropType<boolean>,
+ default: false
+ },
+ statusRef: {
+ type: Number as PropType<number>,
+ default: 0
+ },
+ row: {
+ type: Object as PropType<any>,
+ default: {}
+ }
+ },
+ emits: ['cancelModal', 'confirmModal'],
+ setup(props, ctx) {
+ const { variables, handleValidate } = useModal(props, ctx)
+ const { t } = useI18n()
+
+ const cancelModal = () => {
+ if (props.statusRef === 0) {
+ variables.model.name = ''
+ variables.model.k8s_config = ''
+ variables.model.yarn_config = ''
+ variables.model.description = ''
+ }
+ ctx.emit('cancelModal', props.showModalRef)
+ }
+
+ const confirmModal = () => {
+ handleValidate(props.statusRef)
+ }
+
+ const setModal = (row: any) => {
+ variables.model.code = row.code
+ variables.model.name = row.name
+ if (row.config) {
+ const config = JSON.parse(row.config)
+ variables.model.k8s_config = config.k8s || ''
+ variables.model.yarn_config = config.yarn || ''
+ } else {
+ variables.model.k8s_config = ''
+ variables.model.yarn_config = ''
+ }
+ variables.model.description = row.description
+ }
+
+ watch(
+ () => props.statusRef,
+ () => {
+ if (props.statusRef === 0) {
+ variables.model.name = ''
+ variables.model.k8s_config = ''
+ variables.model.yarn_config = ''
+ variables.model.description = ''
+ } else {
+ setModal(props.row)
+ }
+ }
+ )
+
+ watch(
+ () => props.row,
+ () => {
+ setModal(props.row)
+ }
+ )
+
+ return { t, ...toRefs(variables), cancelModal, confirmModal }
+ },
+ render() {
+ const { t } = this
+ return (
+ <div>
+ <Modal
+ title={
+ this.statusRef === 0
+ ? t('security.cluster.create_cluster')
+ : t('security.cluster.edit_cluster')
Review Comment:
Thank you for your commits, code changed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897504064
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
Sure, thank you for your update. BTW, the style between pages is best to be uniform, I found that there is a small place that is not the same as other pages.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1151968353
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10096)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [27 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list) [88.8% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list) [6.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897495521
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
<img width="1101" alt="image" src="https://user-images.githubusercontent.com/13530192/173729266-f3235138-c58a-43d2-9c54-afeea1d680d1.png">
<img width="580" alt="image" src="https://user-images.githubusercontent.com/13530192/173729291-6a97a9ad-f4c6-498c-90e4-f0e3f79334ac.png">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] Amy0104 commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
Amy0104 commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1155971947
>
Thanks for your suggestion. We will try to make the pages to a small template later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897460515
##########
dolphinscheduler-ui/src/views/security/cluster-manage/components/use-modal.ts:
##########
@@ -0,0 +1,119 @@
+/*
+ * 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 { reactive, ref, SetupContext } from 'vue'
+import { useI18n } from 'vue-i18n'
+import {
+ verifyCluster,
+ createCluster,
+ updateCluster
+} from '@/service/modules/cluster'
+
+export function useModal(
+ props: any,
+ ctx: SetupContext<('cancelModal' | 'confirmModal')[]>
+) {
+ const { t } = useI18n()
+
+ const variables = reactive({
+ clusterFormRef: ref(),
+ model: {
+ code: ref<number>(-1),
+ name: ref(''),
+ k8s_config: ref(''),
+ yarn_config: ref(''),
+ description: ref('')
+ },
+ saving: false,
+ rules: {
+ name: {
+ required: true,
+ trigger: ['input', 'blur'],
+ validator() {
+ if (variables.model.name === '') {
+ return new Error(t('security.cluster.cluster_name_tips'))
+ }
+ }
+ },
+ description: {
+ required: true,
+ trigger: ['input', 'blur'],
+ validator() {
+ if (variables.model.description === '') {
+ return new Error(t('security.cluster.cluster_description_tips'))
+ }
+ }
+ }
+ }
+ })
+
+ const handleValidate = async (statusRef: number) => {
+ await variables.clusterFormRef.validate()
+
+ if (variables.saving) return
+ variables.saving = true
+
+ try {
+ statusRef === 0 ? await submitClusterModal() : await updateClusterModal()
+ variables.saving = false
+ } catch (err) {
+ variables.saving = false
+ }
Review Comment:
Yes, you are right, code changed, I found other modules also has this issue, other modules can also be optimized:)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] caishunfeng commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
caishunfeng commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1149395553
PTAL @lenboo @zhongjiajie @songjianet
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897495626
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
@Amy0104
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] Amy0104 commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
Amy0104 commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897498904
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
I have changed it. Pls, check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897504609
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
<img width="1755" alt="image" src="https://user-images.githubusercontent.com/13530192/173732007-b98e3edf-ca77-4c8a-93ca-320e8276b617.png">
<img width="1751" alt="image" src="https://user-images.githubusercontent.com/13530192/173732091-7e2694f5-e207-43cb-a9d4-886b65988f23.png">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] Amy0104 merged pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
Amy0104 merged PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897481958
##########
dolphinscheduler-ui/src/views/security/cluster-manage/components/cluster-modal.tsx:
##########
@@ -0,0 +1,191 @@
+/*
+ * 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 { defineComponent, PropType, toRefs, watch } from 'vue'
+import Modal from '@/components/modal'
+import { NForm, NFormItem, NInput } from 'naive-ui'
+import { useModal } from './use-modal'
+import { useI18n } from 'vue-i18n'
+
+const envK8sConfigPlaceholder = `apiVersion: v1
+clusters:
+- cluster:
+ certificate-authority-data: LS0tLS1CZJQ0FURS0tLS0tCg==
+ server: https://127.0.0.1:6443
+ name: kubernetes
+contexts:
+- context:
+ cluster: kubernetes
+ user: kubernetes-admin
+ name: kubernetes-admin@kubernetes
+current-context: kubernetes-admin@kubernetes
+kind: Config
+preferences: {}
+users:
+- name: kubernetes-admin
+ user:
+ client-certificate-data: LS0tLS1CZJQ0FURS0tLS0tCg=
+`
+
+const envYarnConfigPlaceholder = 'In development...'
+
+const ClusterModal = defineComponent({
+ name: 'ClusterModal',
+ props: {
+ showModalRef: {
+ type: Boolean as PropType<boolean>,
+ default: false
+ },
+ statusRef: {
+ type: Number as PropType<number>,
+ default: 0
+ },
+ row: {
+ type: Object as PropType<any>,
+ default: {}
+ }
+ },
+ emits: ['cancelModal', 'confirmModal'],
+ setup(props, ctx) {
+ const { variables, handleValidate } = useModal(props, ctx)
+ const { t } = useI18n()
+
+ const cancelModal = () => {
+ if (props.statusRef === 0) {
+ variables.model.name = ''
+ variables.model.k8s_config = ''
+ variables.model.yarn_config = ''
+ variables.model.description = ''
+ }
+ ctx.emit('cancelModal', props.showModalRef)
+ }
+
+ const confirmModal = () => {
+ handleValidate(props.statusRef)
+ }
+
+ const setModal = (row: any) => {
+ variables.model.code = row.code
+ variables.model.name = row.name
+ if (row.config) {
+ const config = JSON.parse(row.config)
+ variables.model.k8s_config = config.k8s || ''
+ variables.model.yarn_config = config.yarn || ''
+ } else {
+ variables.model.k8s_config = ''
+ variables.model.yarn_config = ''
+ }
+ variables.model.description = row.description
+ }
+
+ watch(
+ () => props.statusRef,
+ () => {
+ if (props.statusRef === 0) {
+ variables.model.name = ''
+ variables.model.k8s_config = ''
+ variables.model.yarn_config = ''
+ variables.model.description = ''
+ } else {
+ setModal(props.row)
+ }
+ }
+ )
+
+ watch(
+ () => props.row,
+ () => {
+ setModal(props.row)
+ }
+ )
+
+ return { t, ...toRefs(variables), cancelModal, confirmModal }
+ },
+ render() {
+ const { t } = this
+ return (
+ <div>
+ <Modal
+ title={
+ this.statusRef === 0
+ ? t('security.cluster.create_cluster')
+ : t('security.cluster.edit_cluster')
Review Comment:
Thank you for your comments, code changed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] Amy0104 commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
Amy0104 commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897487388
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
Sorry, maybe I didn't express clearly. I mean that using NSpace instead of the div with 'search-card' class. And then you don't need write css.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] Amy0104 commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
Amy0104 commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897518630
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
That's true. So it's better to use Nspace when we need a space in a page.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1155955734
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10096)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [27 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list) [88.8% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list) [6.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897481688
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
+ </NCard>
+ <Card class={styles['table-card']}>
+ <NDataTable
+ loading={loadingRef}
+ row-class-name='items'
+ columns={this.columns}
+ data={this.tableData}
+ scrollX={this.tableWidth}
+ />
+ <div class={styles.pagination}>
+ <NPagination
+ v-model:page={this.page}
+ v-model:page-size={this.pageSize}
+ page-count={this.totalPage}
+ show-size-picker
+ page-sizes={[10, 30, 50]}
+ show-quick-jumper
+ onUpdatePage={requestData}
+ onUpdatePageSize={onUpdatePageSize}
+ />
+ </div>
Review Comment:
Hi @Amy0104, this NPagination parent div here has other styles. In order to keep the page style and code style consistent with other modules, I have not modified this code, please help check again, thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1149371781
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10096)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [27 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list) [25.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list) [6.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] Amy0104 commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
Amy0104 commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r895631369
##########
dolphinscheduler-ui/src/views/security/cluster-manage/components/use-modal.ts:
##########
@@ -0,0 +1,119 @@
+/*
+ * 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 { reactive, ref, SetupContext } from 'vue'
+import { useI18n } from 'vue-i18n'
+import {
+ verifyCluster,
+ createCluster,
+ updateCluster
+} from '@/service/modules/cluster'
+
+export function useModal(
+ props: any,
+ ctx: SetupContext<('cancelModal' | 'confirmModal')[]>
+) {
+ const { t } = useI18n()
+
+ const variables = reactive({
+ clusterFormRef: ref(),
+ model: {
+ code: ref<number>(-1),
+ name: ref(''),
+ k8s_config: ref(''),
+ yarn_config: ref(''),
+ description: ref('')
+ },
+ saving: false,
+ rules: {
+ name: {
+ required: true,
+ trigger: ['input', 'blur'],
+ validator() {
+ if (variables.model.name === '') {
+ return new Error(t('security.cluster.cluster_name_tips'))
+ }
+ }
+ },
+ description: {
+ required: true,
+ trigger: ['input', 'blur'],
+ validator() {
+ if (variables.model.description === '') {
+ return new Error(t('security.cluster.cluster_description_tips'))
+ }
+ }
+ }
+ }
+ })
+
+ const handleValidate = async (statusRef: number) => {
+ await variables.clusterFormRef.validate()
+
+ if (variables.saving) return
+ variables.saving = true
+
+ try {
+ statusRef === 0 ? await submitClusterModal() : await updateClusterModal()
+ variables.saving = false
+ } catch (err) {
+ variables.saving = false
+ }
Review Comment:
It is better to use finally here than setting saving to false twice.
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
Review Comment:
It is unnecessary to wrap a div for the NButton.
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
It is better to use 'NSpace' component here.
##########
dolphinscheduler-ui/src/views/security/cluster-manage/components/cluster-modal.tsx:
##########
@@ -0,0 +1,191 @@
+/*
+ * 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 { defineComponent, PropType, toRefs, watch } from 'vue'
+import Modal from '@/components/modal'
+import { NForm, NFormItem, NInput } from 'naive-ui'
+import { useModal } from './use-modal'
+import { useI18n } from 'vue-i18n'
+
+const envK8sConfigPlaceholder = `apiVersion: v1
+clusters:
+- cluster:
+ certificate-authority-data: LS0tLS1CZJQ0FURS0tLS0tCg==
+ server: https://127.0.0.1:6443
+ name: kubernetes
+contexts:
+- context:
+ cluster: kubernetes
+ user: kubernetes-admin
+ name: kubernetes-admin@kubernetes
+current-context: kubernetes-admin@kubernetes
+kind: Config
+preferences: {}
+users:
+- name: kubernetes-admin
+ user:
+ client-certificate-data: LS0tLS1CZJQ0FURS0tLS0tCg=
+`
+
+const envYarnConfigPlaceholder = 'In development...'
+
+const ClusterModal = defineComponent({
+ name: 'ClusterModal',
+ props: {
+ showModalRef: {
+ type: Boolean as PropType<boolean>,
+ default: false
+ },
+ statusRef: {
+ type: Number as PropType<number>,
+ default: 0
+ },
+ row: {
+ type: Object as PropType<any>,
+ default: {}
+ }
+ },
+ emits: ['cancelModal', 'confirmModal'],
+ setup(props, ctx) {
+ const { variables, handleValidate } = useModal(props, ctx)
+ const { t } = useI18n()
+
+ const cancelModal = () => {
+ if (props.statusRef === 0) {
+ variables.model.name = ''
+ variables.model.k8s_config = ''
+ variables.model.yarn_config = ''
+ variables.model.description = ''
+ }
+ ctx.emit('cancelModal', props.showModalRef)
+ }
+
+ const confirmModal = () => {
+ handleValidate(props.statusRef)
+ }
+
+ const setModal = (row: any) => {
+ variables.model.code = row.code
+ variables.model.name = row.name
+ if (row.config) {
+ const config = JSON.parse(row.config)
+ variables.model.k8s_config = config.k8s || ''
+ variables.model.yarn_config = config.yarn || ''
+ } else {
+ variables.model.k8s_config = ''
+ variables.model.yarn_config = ''
+ }
+ variables.model.description = row.description
+ }
+
+ watch(
+ () => props.statusRef,
+ () => {
+ if (props.statusRef === 0) {
+ variables.model.name = ''
+ variables.model.k8s_config = ''
+ variables.model.yarn_config = ''
+ variables.model.description = ''
+ } else {
+ setModal(props.row)
+ }
+ }
+ )
+
+ watch(
+ () => props.row,
+ () => {
+ setModal(props.row)
+ }
+ )
+
+ return { t, ...toRefs(variables), cancelModal, confirmModal }
+ },
+ render() {
+ const { t } = this
+ return (
+ <div>
+ <Modal
+ title={
+ this.statusRef === 0
+ ? t('security.cluster.create_cluster')
+ : t('security.cluster.edit_cluster')
Review Comment:
Have you committed the language packs codes?
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
+ </NCard>
+ <Card class={styles['table-card']}>
+ <NDataTable
+ loading={loadingRef}
+ row-class-name='items'
+ columns={this.columns}
+ data={this.tableData}
+ scrollX={this.tableWidth}
+ />
+ <div class={styles.pagination}>
+ <NPagination
+ v-model:page={this.page}
+ v-model:page-size={this.pageSize}
+ page-count={this.totalPage}
+ show-size-picker
+ page-sizes={[10, 30, 50]}
+ show-quick-jumper
+ onUpdatePage={requestData}
+ onUpdatePageSize={onUpdatePageSize}
+ />
+ </div>
Review Comment:
Same as above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1155955820
@Amy0104, thank you for your review, very nice catching :)
I also have some suggestions, as we are only contributors, not owners, so our new code style is best to refer to the existing code, this will make the project code management clearer. So it would be even better if all the similar pages using the similar template, this pr front-end code is copied from the cluster page. Obviously, the cluster code can't be recognized by project owners, it does have some small areas that can be optimized. For our contributors, we'd better not be unconventional, but keep the same way of code writing style.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1129707180
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10096)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [28 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list) [88.8% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list) [6.3% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1136649180
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10096)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [28 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list) [88.8% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list) [6.3% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897506818
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
There are a few small differences between pages, probably written by different developers.
<img width="1757" alt="image" src="https://user-images.githubusercontent.com/13530192/173732529-fa261600-37d2-4259-9bc4-eeca120414de.png">
<img width="1756" alt="image" src="https://user-images.githubusercontent.com/13530192/173732566-8c862585-f4e1-47c0-af0d-56aee234a58f.png">
<img width="1778" alt="image" src="https://user-images.githubusercontent.com/13530192/173732703-96c0f0cc-4ade-477e-bf4b-7ca08c4462de.png">
<img width="1734" alt="image" src="https://user-images.githubusercontent.com/13530192/173732750-dfd955a6-4dd9-4790-898c-0635161e9103.png">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1151954812
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10096)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [27 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list) [88.8% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list) [6.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1129734310
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10096)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [28 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list) [88.8% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list) [6.3% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1149632199
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10096)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [27 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list) [25.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list) [6.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1151009895
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10096)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [85 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list) [10.6% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list) [3.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1136736695
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10096)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [27 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list) [88.8% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list) [6.3% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897481688
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
+ </NCard>
+ <Card class={styles['table-card']}>
+ <NDataTable
+ loading={loadingRef}
+ row-class-name='items'
+ columns={this.columns}
+ data={this.tableData}
+ scrollX={this.tableWidth}
+ />
+ <div class={styles.pagination}>
+ <NPagination
+ v-model:page={this.page}
+ v-model:page-size={this.pageSize}
+ page-count={this.totalPage}
+ show-size-picker
+ page-sizes={[10, 30, 50]}
+ show-quick-jumper
+ onUpdatePage={requestData}
+ onUpdatePageSize={onUpdatePageSize}
+ />
+ </div>
Review Comment:
Hi @Amy0104, this NPagination parent div here has other styles. In order to keep the style and code style consistent with other modules, I have not modified this code, please help check again, thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897495362
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
+ </div>
+ <div class={styles.box}>
+ <NInput
+ size='small'
+ clearable
+ v-model={[this.searchVal, 'value']}
+ placeholder={t('security.cluster.search_tips')}
+ />
+ <NButton size='small' type='primary' onClick={onSearch}>
+ {{
+ icon: () => (
+ <NIcon>
+ <SearchOutlined />
+ </NIcon>
+ )
+ }}
+ </NButton>
+ </div>
+ </div>
Review Comment:
Hi @Amy0104, yes, you are right, for this part, I have changed the code with NSpace(without css), it's better use NSpace.
And about the next comments, lines near 155, as the parent div also has margin-top, not only keep NPagination center, so I kept the same code(\<div class={styles.pagination}\>) with other pages, because they have implemented the css margin-top in css file, so I copied and used the same way to keep them similar.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1129700564
# [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/10096?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#10096](https://codecov.io/gh/apache/dolphinscheduler/pull/10096?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (f5695a1) into [dev](https://codecov.io/gh/apache/dolphinscheduler/commit/cd70ad584aae91958a187800a7083868e778d49b?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (cd70ad5) will **increase** coverage by `0.26%`.
> The diff coverage is `85.40%`.
> :exclamation: Current head f5695a1 differs from pull request most recent head 4eeaee9. Consider uploading reports for the commit 4eeaee9 to get more accurate results
```diff
@@ Coverage Diff @@
## dev #10096 +/- ##
============================================
+ Coverage 40.89% 41.16% +0.26%
- Complexity 4637 4706 +69
============================================
Files 839 844 +5
Lines 34015 34244 +229
Branches 3772 3794 +22
============================================
+ Hits 13910 14095 +185
- Misses 18773 18812 +39
- Partials 1332 1337 +5
```
| [Impacted Files](https://codecov.io/gh/apache/dolphinscheduler/pull/10096?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...olphinscheduler/common/utils/ClusterConfUtils.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10096/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvY29tbW9uL3V0aWxzL0NsdXN0ZXJDb25mVXRpbHMuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...g/apache/dolphinscheduler/dao/entity/Resource.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10096/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1kYW8vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvZGFvL2VudGl0eS9SZXNvdXJjZS5qYXZh) | `45.88% <0.00%> (-1.68%)` | :arrow_down: |
| [...er/server/master/runner/WorkflowExecuteThread.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10096/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1tYXN0ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9ydW5uZXIvV29ya2Zsb3dFeGVjdXRlVGhyZWFkLmphdmE=) | `8.01% <0.00%> (-0.02%)` | :arrow_down: |
| [...ver/master/runner/task/ConditionTaskProcessor.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10096/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1tYXN0ZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvc2VydmVyL21hc3Rlci9ydW5uZXIvdGFzay9Db25kaXRpb25UYXNrUHJvY2Vzc29yLmphdmE=) | `5.33% <0.00%> (+0.07%)` | :arrow_up: |
| [...scheduler/api/service/impl/ClusterServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10096/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9DbHVzdGVyU2VydmljZUltcGwuamF2YQ==) | `88.18% <88.18%> (ø)` | |
| [...hinscheduler/api/controller/ClusterController.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10096/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2NvbnRyb2xsZXIvQ2x1c3RlckNvbnRyb2xsZXIuamF2YQ==) | `89.47% <89.47%> (ø)` | |
| [...rg/apache/dolphinscheduler/api/dto/ClusterDto.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10096/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2R0by9DbHVzdGVyRHRvLmphdmE=) | `92.85% <92.85%> (ø)` | |
| [.../org/apache/dolphinscheduler/api/enums/Status.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10096/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2VudW1zL1N0YXR1cy5qYXZh) | `100.00% <100.00%> (ø)` | |
| [...rg/apache/dolphinscheduler/dao/entity/Cluster.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10096/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1kYW8vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvZGFvL2VudGl0eS9DbHVzdGVyLmphdmE=) | `100.00% <100.00%> (ø)` | |
| [...rg/apache/dolphinscheduler/dao/entity/UdfFunc.java](https://codecov.io/gh/apache/dolphinscheduler/pull/10096/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1kYW8vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvZGFvL2VudGl0eS9VZGZGdW5jLmphdmE=) | `81.66% <100.00%> (+0.96%)` | :arrow_up: |
| ... and [5 more](https://codecov.io/gh/apache/dolphinscheduler/pull/10096/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/10096?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/10096?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [cd70ad5...4eeaee9](https://codecov.io/gh/apache/dolphinscheduler/pull/10096?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] caishunfeng commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
caishunfeng commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1150990341
> I find some test classes are not counted in the unit coverage, so git show the insufficient coverage error
I had rerun the UT to check the test converage.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] caishunfeng commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
caishunfeng commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r891867249
##########
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClusterE2ETest.java:
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.
+ */
+
+package org.apache.dolphinscheduler.e2e.cases;
+
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.awaitility.Awaitility.await;
+
+import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
+import org.apache.dolphinscheduler.e2e.pages.LoginPage;
+import org.apache.dolphinscheduler.e2e.pages.security.ClusterPage;
+import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
+
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.remote.RemoteWebDriver;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+class ClusterE2ETest {
Review Comment:
You should add this e2e case into `.github/workflows/e2e.yml`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] kezhenxu94 commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r881158971
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java:
##########
@@ -0,0 +1,237 @@
+/*
+ * 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.
+ */
+
+package org.apache.dolphinscheduler.api.controller;
+
+import static org.apache.dolphinscheduler.api.enums.Status.CREATE_CLUSTER_ERROR;
+import static org.apache.dolphinscheduler.api.enums.Status.DELETE_CLUSTER_ERROR;
+import static org.apache.dolphinscheduler.api.enums.Status.QUERY_CLUSTER_BY_CODE_ERROR;
+import static org.apache.dolphinscheduler.api.enums.Status.QUERY_CLUSTER_ERROR;
+import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_CLUSTER_ERROR;
+import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_CLUSTER_ERROR;
+
+import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation;
+import org.apache.dolphinscheduler.api.exceptions.ApiException;
+import org.apache.dolphinscheduler.api.service.ClusterService;
+import org.apache.dolphinscheduler.api.utils.Result;
+import org.apache.dolphinscheduler.common.Constants;
+import org.apache.dolphinscheduler.common.utils.ParameterUtils;
+import org.apache.dolphinscheduler.dao.entity.User;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestController;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import springfox.documentation.annotations.ApiIgnore;
+
+/**
+ * cluster controller
+ * todo 这是新增的 集群环境
+ */
Review Comment:
Remove this kind of comments, they are meaningless
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] qianli2022 commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
qianli2022 commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r881171100
##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/controller/ClusterController.java:
##########
@@ -0,0 +1,237 @@
+/*
+ * 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.
+ */
+
+package org.apache.dolphinscheduler.api.controller;
+
+import static org.apache.dolphinscheduler.api.enums.Status.CREATE_CLUSTER_ERROR;
+import static org.apache.dolphinscheduler.api.enums.Status.DELETE_CLUSTER_ERROR;
+import static org.apache.dolphinscheduler.api.enums.Status.QUERY_CLUSTER_BY_CODE_ERROR;
+import static org.apache.dolphinscheduler.api.enums.Status.QUERY_CLUSTER_ERROR;
+import static org.apache.dolphinscheduler.api.enums.Status.UPDATE_CLUSTER_ERROR;
+import static org.apache.dolphinscheduler.api.enums.Status.VERIFY_CLUSTER_ERROR;
+
+import org.apache.dolphinscheduler.api.aspect.AccessLogAnnotation;
+import org.apache.dolphinscheduler.api.exceptions.ApiException;
+import org.apache.dolphinscheduler.api.service.ClusterService;
+import org.apache.dolphinscheduler.api.utils.Result;
+import org.apache.dolphinscheduler.common.Constants;
+import org.apache.dolphinscheduler.common.utils.ParameterUtils;
+import org.apache.dolphinscheduler.dao.entity.User;
+
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestController;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import springfox.documentation.annotations.ApiIgnore;
+
+/**
+ * cluster controller
+ * todo 这是新增的 集群环境
+ */
Review Comment:
Just remove the chinese comments , or all of them? I find that all other classes are commented with xx controller?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] qianli2022 commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
qianli2022 commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1136669757
> Hi @qianli2022 , thank you, do you have an issue to link to the feature discussion?
Yes, [Feature][Improvement] Support multi cluster environments](https://github.com/apache/dolphinscheduler/issues/9462)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1148425269
SonarCloud Quality Gate failed. [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=10096)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL) [27 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=10096&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list) [25.0% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list) [6.4% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=10096&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] qianli2022 commented on pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
qianli2022 commented on PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#issuecomment-1149485024
I find some test classes are not counted in the unit coverage, so git show the insufficient coverage error
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] qianli2022 commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
qianli2022 commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r892997279
##########
dolphinscheduler-e2e/dolphinscheduler-e2e-case/src/test/java/org/apache/dolphinscheduler/e2e/cases/ClusterE2ETest.java:
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to 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. Apache Software Foundation (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.
+ */
+
+package org.apache.dolphinscheduler.e2e.cases;
+
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.awaitility.Awaitility.await;
+
+import org.apache.dolphinscheduler.e2e.core.DolphinScheduler;
+import org.apache.dolphinscheduler.e2e.pages.LoginPage;
+import org.apache.dolphinscheduler.e2e.pages.security.ClusterPage;
+import org.apache.dolphinscheduler.e2e.pages.security.SecurityPage;
+
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.remote.RemoteWebDriver;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+class ClusterE2ETest {
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897481958
##########
dolphinscheduler-ui/src/views/security/cluster-manage/components/cluster-modal.tsx:
##########
@@ -0,0 +1,191 @@
+/*
+ * 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 { defineComponent, PropType, toRefs, watch } from 'vue'
+import Modal from '@/components/modal'
+import { NForm, NFormItem, NInput } from 'naive-ui'
+import { useModal } from './use-modal'
+import { useI18n } from 'vue-i18n'
+
+const envK8sConfigPlaceholder = `apiVersion: v1
+clusters:
+- cluster:
+ certificate-authority-data: LS0tLS1CZJQ0FURS0tLS0tCg==
+ server: https://127.0.0.1:6443
+ name: kubernetes
+contexts:
+- context:
+ cluster: kubernetes
+ user: kubernetes-admin
+ name: kubernetes-admin@kubernetes
+current-context: kubernetes-admin@kubernetes
+kind: Config
+preferences: {}
+users:
+- name: kubernetes-admin
+ user:
+ client-certificate-data: LS0tLS1CZJQ0FURS0tLS0tCg=
+`
+
+const envYarnConfigPlaceholder = 'In development...'
+
+const ClusterModal = defineComponent({
+ name: 'ClusterModal',
+ props: {
+ showModalRef: {
+ type: Boolean as PropType<boolean>,
+ default: false
+ },
+ statusRef: {
+ type: Number as PropType<number>,
+ default: 0
+ },
+ row: {
+ type: Object as PropType<any>,
+ default: {}
+ }
+ },
+ emits: ['cancelModal', 'confirmModal'],
+ setup(props, ctx) {
+ const { variables, handleValidate } = useModal(props, ctx)
+ const { t } = useI18n()
+
+ const cancelModal = () => {
+ if (props.statusRef === 0) {
+ variables.model.name = ''
+ variables.model.k8s_config = ''
+ variables.model.yarn_config = ''
+ variables.model.description = ''
+ }
+ ctx.emit('cancelModal', props.showModalRef)
+ }
+
+ const confirmModal = () => {
+ handleValidate(props.statusRef)
+ }
+
+ const setModal = (row: any) => {
+ variables.model.code = row.code
+ variables.model.name = row.name
+ if (row.config) {
+ const config = JSON.parse(row.config)
+ variables.model.k8s_config = config.k8s || ''
+ variables.model.yarn_config = config.yarn || ''
+ } else {
+ variables.model.k8s_config = ''
+ variables.model.yarn_config = ''
+ }
+ variables.model.description = row.description
+ }
+
+ watch(
+ () => props.statusRef,
+ () => {
+ if (props.statusRef === 0) {
+ variables.model.name = ''
+ variables.model.k8s_config = ''
+ variables.model.yarn_config = ''
+ variables.model.description = ''
+ } else {
+ setModal(props.row)
+ }
+ }
+ )
+
+ watch(
+ () => props.row,
+ () => {
+ setModal(props.row)
+ }
+ )
+
+ return { t, ...toRefs(variables), cancelModal, confirmModal }
+ },
+ render() {
+ const { t } = this
+ return (
+ <div>
+ <Modal
+ title={
+ this.statusRef === 0
+ ? t('security.cluster.create_cluster')
+ : t('security.cluster.edit_cluster')
Review Comment:
Thank you for your comments, code changed. @Amy0104
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] tongwl commented on a diff in pull request #10096: [Feature][Improvement] Support multi cluster environments - k8s type
Posted by GitBox <gi...@apache.org>.
tongwl commented on code in PR #10096:
URL: https://github.com/apache/dolphinscheduler/pull/10096#discussion_r897463978
##########
dolphinscheduler-ui/src/views/security/cluster-manage/index.tsx:
##########
@@ -0,0 +1,170 @@
+/*
+ * 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 { defineComponent, onMounted, toRefs, watch } from 'vue'
+import {
+ NButton,
+ NCard,
+ NDataTable,
+ NIcon,
+ NInput,
+ NPagination
+} from 'naive-ui'
+import { SearchOutlined } from '@vicons/antd'
+import { useI18n } from 'vue-i18n'
+import { useTable } from './use-table'
+import Card from '@/components/card'
+import ClusterModal from './components/cluster-modal'
+import styles from './index.module.scss'
+
+const clusterManage = defineComponent({
+ name: 'cluster-manage',
+ setup() {
+ const { t } = useI18n()
+ const { variables, getTableData, createColumns } = useTable()
+
+ const requestData = () => {
+ getTableData({
+ pageSize: variables.pageSize,
+ pageNo: variables.page,
+ searchVal: variables.searchVal
+ })
+ }
+
+ const onUpdatePageSize = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const onSearch = () => {
+ variables.page = 1
+ requestData()
+ }
+
+ const handleModalChange = () => {
+ variables.showModalRef = true
+ variables.statusRef = 0
+ }
+
+ const onCancelModal = () => {
+ variables.showModalRef = false
+ }
+
+ const onConfirmModal = () => {
+ variables.showModalRef = false
+ requestData()
+ }
+
+ onMounted(() => {
+ createColumns(variables)
+ requestData()
+ })
+
+ watch(useI18n().locale, () => {
+ createColumns(variables)
+ })
+
+ return {
+ t,
+ ...toRefs(variables),
+ requestData,
+ onCancelModal,
+ onConfirmModal,
+ onUpdatePageSize,
+ handleModalChange,
+ onSearch
+ }
+ },
+ render() {
+ const {
+ t,
+ requestData,
+ onUpdatePageSize,
+ onCancelModal,
+ onConfirmModal,
+ handleModalChange,
+ onSearch,
+ loadingRef
+ } = this
+
+ return (
+ <div>
+ <NCard>
+ <div class={styles['search-card']}>
+ <div>
+ <NButton
+ size='small'
+ type='primary'
+ onClick={handleModalChange}
+ class='btn-create-cluster'
+ >
+ {t('security.cluster.create_cluster')}
+ </NButton>
Review Comment:
Yes, you are right, code changed, I found other modules also has this issue, other modules can also be optimized:)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org