Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: schedule前端页面支持shell,k8s shell任务 #213 #214

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
import request from '@/utils/request'

function encodeBase64(data) {
data.source = btoa(data.source)
return data
}

function decodeBase64(res) {
for (const item of res.data.records) {
item.source = atob(item.source)
}
return res
}

export const list = (data) => request({
url: '/job/list',
method: 'get',
params: data
})
}).then(res => decodeBase64(res))

export const create = (data) => request({
url: '/job/create',
method: 'post',
data: data
data: encodeBase64(data)
})

export const update = (id, data) => request({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ export default (safe) => {
},
{
label: '调度类型',
prop: 'scheduleType',
prop: 'scheduleType1', // 这里字段名不能跟下面的scheduleType重复,不然下面框的控制会失效
dicUrl: '/dict/ScheduleType',
props: {
value: 'scheduleType'
},
display: false
},
{
Expand Down Expand Up @@ -146,6 +149,7 @@ export default (safe) => {
label: 'Cron表达式',
display: true,
type: 'input',
placeholder: '请输入Cron表达式',
value: '',
rules: [{
required: true,
Expand All @@ -164,7 +168,8 @@ export default (safe) => {
},
{
label: '调度配置',
prop: 'scheduleConf'
prop: 'scheduleConf',
display: false
}
]
},
Expand All @@ -178,6 +183,45 @@ export default (safe) => {
type: 'select',
value: 1,
dicUrl: '/dict/JobMode',
control: (val, form) => {
if (val === 1) {
return {
image: {
display: false
},
jobHandler: {
display: true
},
source: {
display: false
},
}
} else if (val === 2) {
return {
image: {
display: false
},
jobHandler: {
display: false
},
source: {
display: true
},
}
} else if (val === 3) {
return {
image: {
display: true
},
jobHandler: {
display: false
},
source: {
display: true
},
}
}
},
rules: [{
required: true,
message: '请选择运行模式',
Expand All @@ -188,12 +232,32 @@ export default (safe) => {
label: 'jobHandler',
prop: 'jobHandler',
type: 'input',
display: false,
rules: [{
required: true,
message: '请输入job handler',
trigger: 'blur'
}]
},
{
label: '镜像',
prop: 'image',
type: 'input',
display: false,
rules: [{
message: '请输入镜像',
trigger: 'blur'
}]
},
{
label: '资源',
prop: 'source',
type: 'textarea',
display: false,
placeholder: '请输入资源',
maxlength: 10240,
showWordLimit: true,
span: 24
},
{
label: '任务参数',
prop: 'jobParam',
Expand Down
Loading