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. 4
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/index.tsx
  8. 3
      dolphinscheduler-ui-next/src/views/projects/workflow/definition/use-table.ts
  9. 25
      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']
}, },

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

@ -185,7 +185,9 @@ export default defineComponent({
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>

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

@ -82,7 +82,8 @@ 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) =>
h(
ButtonLink, ButtonLink,
{ {
onClick: () => onClick: () =>

25
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,20 +61,25 @@ 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 && ( />
)) ||
(this.seriesData.length > 0 && (
<Card title={t('project.workflow.workflow_relation')}> <Card title={t('project.workflow.workflow_relation')}>
{{ {{
default: () => default: () =>
Object.keys(this.seriesData).length > 0 && ( Object.keys(this.seriesData).length > 0 && (
<Graph seriesData={this.seriesData} labelShow={this.labelShow} /> <Graph
seriesData={this.seriesData}
labelShow={this.labelShow}
/>
), ),
'header-extra': () => ( 'header-extra': () => (
<NSpace> <NSpace>
@ -125,7 +130,7 @@ const workflowRelation = defineComponent({
) )
}} }}
</Card> </Card>
) ))
) )
} }
}) })

Loading…
Cancel
Save