Skip to content

Commit

Permalink
Merge pull request #1 from apache/add_canvas_job_define
Browse files Browse the repository at this point in the history
Add canvas job define
  • Loading branch information
zhangchengming601 authored Jul 13, 2023
2 parents b46aeee + 3bfcdad commit d17ecc6
Show file tree
Hide file tree
Showing 178 changed files with 1,582 additions and 18,656 deletions.
4 changes: 2 additions & 2 deletions seatunnel-ui/src/common/column-width-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const COLUMN_WIDTH_CONFIG = {
}
},
link_name: {
width: 400
width: 240
},
state: {
width: 120
Expand Down Expand Up @@ -63,7 +63,7 @@ export const COLUMN_WIDTH_CONFIG = {
},
operation: (number: number): CommonColumnInfo => ({
fixed: 'right',
width: Math.max(30 * number + 12 * (number - 1) + 24, 100)
width: Math.max(28 * number + 12 * (number - 1) + 24, 100)
}),
processDefinitionName: {
width: 120,
Expand Down
2 changes: 1 addition & 1 deletion seatunnel-ui/src/components/button-link/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.button-link {
.button-link {
cursor: pointer;
color: var(--n-color-target);
line-height: normal;
Expand Down
1 change: 0 additions & 1 deletion seatunnel-ui/src/components/checkbox-tree/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ const CheckboxTree = defineComponent({
>
{t('resource.auth.public_resource')}
<NSwitch
disabled={!userStore.isAdmin}
v-model={[globalResource.value, 'value']}
/>
</NSpace>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,12 @@ export function getCheckboxList(
}
return checkboxList
}


export function setColumns(key: string, value: any) {
localStorage.setItem(`col_${key}`, JSON.stringify(value))
}

export function getColumns(key: string): Array<any> {
return JSON.parse(localStorage.getItem(`col_${key}`) as string) as Array<any>
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
}

.column-style{
width: 70px;
min-width: 70px;
}

.btnlist-style {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import {
filterColumns,
getColumnsBytable,
getCheckboxList
} from '../utils/dealColumns'
import { getColumns, setColumns } from '../utils/storeColums'
} from './dealColumns'
import { getColumns, setColumns } from './dealColumns'
import './index.scss'
import { useI18n } from 'vue-i18n'

Expand Down
1 change: 0 additions & 1 deletion seatunnel-ui/src/components/log-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ export default defineComponent({
onConfirm={this.confirmModal}
style={{ width: '60%' }}
confirmText={t('modal.close')}
headerLinks={this.headerLinks}
>
<NLog
rows={30}
Expand Down
2 changes: 1 addition & 1 deletion seatunnel-ui/src/hooks/use-source-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/
import { onMounted, reactive } from 'vue'
import { getDatasourceType } from '@/service/modules/data-source'
import { getDatasourceType } from '@/service/data-source'
import { useI18n } from 'vue-i18n'
import type { SelectOption } from 'naive-ui'

Expand Down
118 changes: 43 additions & 75 deletions seatunnel-ui/src/hooks/use-table-operation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { h, withDirectives, VNode } from 'vue'
import { h, VNode } from 'vue'
import {
NSpace,
NTooltip,
Expand All @@ -26,11 +26,8 @@ import {
NSwitch
} from 'naive-ui'
import { DeleteOutlined } from '@vicons/antd'
import { permission } from '@/directives/permission'
// import { usePermissionLength } from './use-permission-length'
import { COLUMN_WIDTH_CONFIG } from '@/common/column-width-config'
// import { IPermissionModule } from '@/store/user'
// import { accessTypeKey } from '@/service/resources/types'


export const useTableOperation = (
params: {
Expand All @@ -50,7 +47,6 @@ export const useTableOperation = (
positiveText?: string
popTips?: string
text: string | ((rowData: any) => string)
permission?: string
icon?: VNode | ((rowData: any) => VNode)
auth?: any
// accessType?: accessTypeKey
Expand All @@ -62,30 +58,12 @@ export const useTableOperation = (
onPositiveClick?: (rowData: any, index: number) => void
onClick?: (rowData: any) => void
onUpdateValue?: (value: any, rowData: any) => void
customFunc?: (rowData: any) => VNode
customFunc?: (rowData: any) => VNode,
show?: any
}[]
},
// module?: IPermissionModule
) => {
const buttonPermissions = [] as string[]
params.buttons.forEach((button) => {
button.permission && buttonPermissions.push(button.permission)
})
let permissionLength
if (params.noPermission) {
permissionLength = params.buttons.length
} else {
// permissionLength = usePermissionLength(
// buttonPermissions,
// module || 'common'
// )
}

const wrapDirective = (vNode: VNode, permissionKey?: string) => {
return permissionKey
? withDirectives(vNode, [[permission, permissionKey]])
: vNode
}
const getButtonVnodes = (rowData: any, index: number) => {
// const showPopover = ref(false)
return params.buttons
Expand Down Expand Up @@ -124,21 +102,18 @@ export const useTableOperation = (
},
{
trigger: () =>
wrapDirective(
h(
NButton,
{
...commonProps,
type: 'error'
},
{
default: () =>
h(NIcon, null, {
default: () => button.icon || h(DeleteOutlined)
})
}
),
params.noPermission ? '' : button.permission
h(
NButton,
{
...commonProps,
type: 'error'
},
{
default: () =>
h(NIcon, null, {
default: () => button.icon || h(DeleteOutlined)
})
}
),
default: () => button.popTips
}
Expand All @@ -156,52 +131,48 @@ export const useTableOperation = (
if (button.isSwitch) {
return h(NTooltip, null, {
trigger: () =>
wrapDirective(
h(NSwitch, {
value: rowData.status,
checkedValue: button.checkedValue,
uncheckedValue: button.uncheckedValue,
onUpdateValue: (value) =>
button.onUpdateValue
? void button.onUpdateValue(value, rowData)
: () => {}
}),
params.noPermission ? '' : button.permission
),
h(NSwitch, {
value: rowData.status,
checkedValue: button.checkedValue,
uncheckedValue: button.uncheckedValue,
onUpdateValue: (value) =>
button.onUpdateValue
? void button.onUpdateValue(value, rowData)
: () => {}
}),
default: () => buttonText
})
}
if (button.isCustom && button.customFunc) {
const { customFunc } = button
return wrapDirective(customFunc(rowData), button.permission)
return customFunc(rowData)
}
return h(NTooltip, null, {

// show btn
const show = typeof button.show === 'function' ? button.show.call(this, rowData) : button.show === undefined ? true : !!button.show
return show ? h(NTooltip, null, {
trigger: () =>
wrapDirective(
h(
NButton,
{
...commonProps,
type: 'info',
onClick: () =>
button.onClick ? void button.onClick(rowData) : () => {}
},
{
default: () => h(NIcon, null, { default: () => buttonIcon })
}
),
params.noPermission ? '' : button.permission
),
h(
NButton,
{
...commonProps,
type: 'info',
onClick: () =>
button.onClick ? void button.onClick(rowData) : () => {}
},
{
default: () => h(NIcon, null, { default: () => buttonIcon })
}
),
default: () => buttonText
})
}) : h('')
})
}

return {
title: params.title,
key: params.key,
...COLUMN_WIDTH_CONFIG['operation'](params.itemNum as any),
// ...COLUMN_WIDTH_CONFIG['operation'](params.itemNum || permissionLength),
render: (rowData: any, index: number) => {
const buttonVnodes = getButtonVnodes(rowData, index)
const result =
Expand All @@ -213,7 +184,4 @@ export const useTableOperation = (
: result
}
}
// : {
// width: 0
// }
}
4 changes: 0 additions & 4 deletions seatunnel-ui/src/layouts/dashboard/header/menu/use-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ export function useMenu() {
const { t } = useI18n()

const menuOptions = [
{
label: () => h(NEllipsis, null, { default: () => t('menu.data_pipes') }),
key: 'data-pipes'
},
{
label: () => h(NEllipsis, null, { default: () => t('menu.tasks') }),
key: 'tasks'
Expand Down
24 changes: 2 additions & 22 deletions seatunnel-ui/src/layouts/dashboard/sidebar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,12 @@
import { defineComponent, ref, PropType, onMounted, watch, h } from 'vue'
import { NLayoutSider, NMenu, NIcon, NDropdown, NEllipsis } from 'naive-ui'
import { useThemeStore } from '@/store/theme'
// import { DashOutlined } from '@vicons/antd'
// import { useMenuClick } from './use-menuClick'
import styles from './index.module.scss'
import { PartitionOutlined, ProjectOutlined, RightOutlined } from '@vicons/antd'
import { useRoute, useRouter, RouterLink } from 'vue-router'
import { MenuOption } from 'naive-ui'
import { useI18n } from 'vue-i18n'

const toOverview = [
'workflow-definition-detail',
'workflow-instance-detail',
'workflow-instance-gantt',
'synchronization-definition-dag'
]
const Sidebar = defineComponent({
name: 'Sidebar',
props: {
Expand All @@ -47,16 +39,7 @@ const Sidebar = defineComponent({
setup() {
const router = useRouter()
const collapsedRef = ref(false)
const defaultExpandedKeys = [
'workflow',
'task',
'udf-manage',
'service-manage',
'statistical-manage',
'task-group-manage',
'file-manage',
'baseline'
]
const defaultExpandedKeys = ['']
const route = useRoute()
const { t } = useI18n()
// Determine if it is a project overview
Expand Down Expand Up @@ -96,10 +79,7 @@ const Sidebar = defineComponent({
}
])

onMounted(() => {
console.log(route, 'route')
})

onMounted(() => {})

return {
collapsedRef,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
* limitations under the License.
*/

.pagination {
margin-top: 20px;
display: flex;
justify-content: center;
export default {
success_tips: 'Success',
hour: 'h',
min: 'm',
second: 's',
}
4 changes: 4 additions & 0 deletions seatunnel-ui/src/locales/en_US/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ import virtual_tables from '@/locales/en_US/virtual-tables'
import theme from '@/locales/en_US/theme'
import project from '@/locales/en_US/project'
import hook from '@/locales/en_US/hook'
import common from '@/locales/en_US/common'
import security from '@/locales/en_US/security'

export default {
security,
common,
login,
menu,
modal,
Expand Down
1 change: 1 addition & 0 deletions seatunnel-ui/src/locales/en_US/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ export default {
virtual_tables: 'Virtual Tables',
sync_task_definition: 'Syncing Task Definition',
sync_task_instance: 'Syncing Task Instance',
synchronization_instance: 'Syncing Task Instance',
}
6 changes: 5 additions & 1 deletion seatunnel-ui/src/locales/en_US/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,11 @@ export default {
engine: 'Engine',
write: 'Write',
read: 'Read',
line: 'lines'
line: 'lines',
confirm: 'Confirm',
cancel: 'Cancel',
delete: 'Delete',
delete_confirm: 'Delete?',
},
menu: {
fav: 'Favorites',
Expand Down
Loading

0 comments on commit d17ecc6

Please sign in to comment.