Browse Source

[Feature][UI Next][V1.0.0-Alpha] Added results page without workflow nodes. (#9189)

3.0.0/version-upgrade
songjianet 3 years ago committed by GitHub
parent
commit
294f94e860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      dolphinscheduler-ui-next/src/components/result/index.tsx
  2. 6
      dolphinscheduler-ui-next/src/layouts/content/index.tsx
  3. 5
      dolphinscheduler-ui-next/src/locales/modules/en_US.ts
  4. 5
      dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts
  5. 10
      dolphinscheduler-ui-next/src/views/monitor/servers/worker/index.tsx
  6. 6
      dolphinscheduler-ui-next/src/views/projects/task/definition/use-table.ts
  7. 28
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/index.tsx
  8. 23
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/use-table.ts
  9. 137
      dolphinscheduler-ui-next/src/views/projects/workflow/relation/index.tsx

6
dolphinscheduler-ui-next/src/components/result/index.tsx

@ -33,11 +33,13 @@ const props = {
type: String as PropType<string> type: String as PropType<string>
}, },
size: { size: {
type: String as PropType<"small" | "medium" | "large" | "huge">, type: String as PropType<'small' | 'medium' | 'large' | 'huge'>,
default: 'medium' default: 'medium'
}, },
status: { status: {
type: String as PropType<"500" | "error" | "info" | "success" | "warning" | "404" | "403" | "418"> type: String as PropType<
'500' | 'error' | 'info' | 'success' | 'warning' | '404' | '403' | '418'
>
}, },
contentStyle: { contentStyle: {
type: String as PropType<string | CSSProperties>, type: String as PropType<string | CSSProperties>,

6
dolphinscheduler-ui-next/src/layouts/content/index.tsx

@ -119,7 +119,11 @@ const Content = defineComponent({
sideKey={this.sideKeyRef} sideKey={this.sideKeyRef}
/> />
)} )}
<NLayoutContent native-scrollbar={false} style='padding: 16px 22px' contentStyle={'height: 100%'}> <NLayoutContent
native-scrollbar={false}
style='padding: 16px 22px'
contentStyle={'height: 100%'}
>
<router-view key={this.$route.fullPath} /> <router-view key={this.$route.fullPath} />
</NLayoutContent> </NLayoutContent>
</NLayout> </NLayout>

5
dolphinscheduler-ui-next/src/locales/modules/en_US.ts

@ -162,7 +162,10 @@ const monitor = {
last_heartbeat_time: 'Last Heartbeat Time', last_heartbeat_time: 'Last Heartbeat Time',
directory_detail: 'Directory Detail', directory_detail: 'Directory Detail',
host: 'Host', host: 'Host',
directory: 'Directory' directory: 'Directory',
worker_no_data_result_title: 'No Worker Nodes Exist',
worker_no_data_result_desc:
'Currently, there are no worker nodes exist, please create a worker node and refresh this page'
}, },
db: { db: {
health_state: 'Health State', health_state: 'Health State',

5
dolphinscheduler-ui-next/src/locales/modules/zh_CN.ts

@ -161,7 +161,10 @@ const monitor = {
last_heartbeat_time: '最后心跳时间', last_heartbeat_time: '最后心跳时间',
directory_detail: '目录详情', directory_detail: '目录详情',
host: '主机', host: '主机',
directory: '注册目录' directory: '注册目录',
worker_no_data_result_title: 'Worker节点不存在',
worker_no_data_result_desc:
'目前没有任何Worker节点,请先创建Worker节点,再访问该页面'
}, },
db: { db: {
health_state: '健康状态', health_state: '健康状态',

10
dolphinscheduler-ui-next/src/views/monitor/servers/worker/index.tsx

@ -21,6 +21,7 @@ import { useI18n } from 'vue-i18n'
import { useWorker } from './use-worker' import { useWorker } from './use-worker'
import styles from './index.module.scss' import styles from './index.module.scss'
import Card from '@/components/card' import Card from '@/components/card'
import Result from '@/components/result'
import Gauge from '@/components/chart/modules/Gauge' import Gauge from '@/components/chart/modules/Gauge'
import WorkerModal from './worker-modal' import WorkerModal from './worker-modal'
import type { Ref } from 'vue' import type { Ref } from 'vue'
@ -65,7 +66,14 @@ const worker = defineComponent({
const { t, clickDetails, onConfirmModal, showModalRef, zkDirectoryRef } = const { t, clickDetails, onConfirmModal, showModalRef, zkDirectoryRef } =
this this
return ( return this.data.length < 1 ? (
<Result
title={t('monitor.worker.worker_no_data_result_title')}
description={t('monitor.worker.worker_no_data_result_desc')}
status={'info'}
size={'medium'}
/>
) : (
<> <>
<NSpace vertical size={25}> <NSpace vertical size={25}>
{this.data.map((item: WorkerNode) => { {this.data.map((item: WorkerNode) => {

6
dolphinscheduler-ui-next/src/views/projects/task/definition/use-table.ts

@ -106,11 +106,7 @@ export function useTable(onEdit: Function) {
key: 'upstreamTaskMap', key: 'upstreamTaskMap',
render: (row: TaskDefinitionItem) => render: (row: TaskDefinitionItem) =>
row.upstreamTaskMap.map((item: string, index: number) => { row.upstreamTaskMap.map((item: string, index: number) => {
return h( return h('p', null, { default: () => `[${index + 1}] ${item}` })
'p',
null,
{ default: () => `[${index + 1}] ${item}` }
)
}), }),
...COLUMN_WIDTH_CONFIG['name'] ...COLUMN_WIDTH_CONFIG['name']
}, },

28
dolphinscheduler-ui-next/src/views/projects/workflow/definition/index.tsx

@ -176,19 +176,21 @@ export default defineComponent({
{{ {{
default: () => t('project.workflow.delete'), default: () => t('project.workflow.delete'),
trigger: () => ( trigger: () => (
<NPopconfirm onPositiveClick={this.batchDeleteWorkflow}> <NPopconfirm onPositiveClick={this.batchDeleteWorkflow}>
{{ {{
default: () => t('project.workflow.delete_confirm'), default: () => t('project.workflow.delete_confirm'),
trigger: () => ( trigger: () => (
<NButton <NButton
tag='div' tag='div'
type='primary' type='primary'
disabled={this.checkedRowKeys.length <= 0} disabled={this.checkedRowKeys.length <= 0}
class='btn-delete-all' class='btn-delete-all'
>{t('project.workflow.delete')}</NButton> >
) {t('project.workflow.delete')}
}} </NButton>
</NPopconfirm> )
}}
</NPopconfirm>
) )
}} }}
</NTooltip> </NTooltip>

23
dolphinscheduler-ui-next/src/views/projects/workflow/definition/use-table.ts

@ -82,17 +82,18 @@ export function useTable() {
key: 'name', key: 'name',
className: 'workflow-name', className: 'workflow-name',
...COLUMN_WIDTH_CONFIG['name'], ...COLUMN_WIDTH_CONFIG['name'],
render: (row) => h( render: (row) =>
ButtonLink, h(
{ ButtonLink,
onClick: () => {
void router.push({ onClick: () =>
name: 'workflow-definition-detail', void router.push({
params: { code: row.code } name: 'workflow-definition-detail',
}) params: { code: row.code }
}, })
{ default: () => row.name } },
) { default: () => row.name }
)
}, },
{ {
title: t('project.workflow.status'), title: t('project.workflow.status'),

137
dolphinscheduler-ui-next/src/views/projects/workflow/relation/index.tsx

@ -23,7 +23,7 @@ import { ReloadOutlined, EyeOutlined } from '@vicons/antd'
import { useRelation } from './use-relation' import { useRelation } from './use-relation'
import Card from '@/components/card' import Card from '@/components/card'
import Graph from './components/Graph' import Graph from './components/Graph'
import Result from "@/components/result"; import Result from '@/components/result'
const workflowRelation = defineComponent({ const workflowRelation = defineComponent({
name: 'workflow-relation', name: 'workflow-relation',
@ -61,71 +61,76 @@ const workflowRelation = defineComponent({
const { t, handleResetDate } = this const { t, handleResetDate } = this
return ( return (
this.seriesData.length === 0 && ( (this.seriesData.length === 0 && (
<Result <Result
title={t('project.workflow.workflow_relation_no_data_result_title')} title={t('project.workflow.workflow_relation_no_data_result_title')}
description={t('project.workflow.workflow_relation_no_data_result_desc')} description={t(
status={"info"} 'project.workflow.workflow_relation_no_data_result_desc'
size={"medium"}/> )}
) status={'info'}
) || ( size={'medium'}
this.seriesData.length > 0 && ( />
<Card title={t('project.workflow.workflow_relation')}> )) ||
{{ (this.seriesData.length > 0 && (
default: () => <Card title={t('project.workflow.workflow_relation')}>
Object.keys(this.seriesData).length > 0 && ( {{
<Graph seriesData={this.seriesData} labelShow={this.labelShow} /> default: () =>
), Object.keys(this.seriesData).length > 0 && (
'header-extra': () => ( <Graph
<NSpace> seriesData={this.seriesData}
<NSelect labelShow={this.labelShow}
clearable />
style={{ width: '300px' }} ),
placeholder={t('project.workflow.workflow_name')} 'header-extra': () => (
options={this.workflowOptions} <NSpace>
v-model={[this.workflow, 'value']} <NSelect
/> clearable
<NTooltip trigger={'hover'}> style={{ width: '300px' }}
{{ placeholder={t('project.workflow.workflow_name')}
default: () => t('project.workflow.refresh'), options={this.workflowOptions}
trigger: () => ( v-model={[this.workflow, 'value']}
<NButton />
strong <NTooltip trigger={'hover'}>
secondary {{
circle default: () => t('project.workflow.refresh'),
type='info' trigger: () => (
onClick={handleResetDate} <NButton
> strong
<NIcon> secondary
<ReloadOutlined /> circle
</NIcon> type='info'
</NButton> onClick={handleResetDate}
) >
}} <NIcon>
</NTooltip> <ReloadOutlined />
<NTooltip trigger={'hover'}> </NIcon>
{{ </NButton>
default: () => t('project.workflow.show_hide_label'), )
trigger: () => ( }}
<NButton </NTooltip>
strong <NTooltip trigger={'hover'}>
secondary {{
circle default: () => t('project.workflow.show_hide_label'),
type='info' trigger: () => (
onClick={() => (this.labelShow = !this.labelShow)} <NButton
> strong
<NIcon> secondary
<EyeOutlined /> circle
</NIcon> type='info'
</NButton> onClick={() => (this.labelShow = !this.labelShow)}
) >
}} <NIcon>
</NTooltip> <EyeOutlined />
</NSpace> </NIcon>
) </NButton>
}} )
</Card> }}
) </NTooltip>
</NSpace>
)
}}
</Card>
))
) )
} }
}) })

Loading…
Cancel
Save