refactor(devops): 重构流水线相关代码

- 重命名 DevopsPipelineController 为 DevopsPipelineInstanceController
- 新增 DevopsPipelineTemplateController
- 修改流水线实例和模板相关的数据结构
- 优化流水线启动和重启逻辑
- 调整前端 API 路径
This commit is contained in:
2025-07-23 20:56:15 +08:00
parent 0965ef74b9
commit 091c056cd0
27 changed files with 316 additions and 311 deletions
@@ -2,11 +2,11 @@
<div class="sidebar-logo-container" :class="{'collapse':collapse}">
<transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo">
<img v-if="logo" :src="logo" class="sidebar-logo" alt="">
<h1 v-else class="sidebar-title">{{ title }} </h1>
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo">
<img v-if="logo" :src="logo" class="sidebar-logo" alt="">
<h1 class="sidebar-title">{{ title }} </h1>
</router-link>
</transition>
@@ -25,7 +25,7 @@ export default {
},
data() {
return {
title: 'CuteJava后台管理',
title: 'CuteJava',
logo: Logo
}
}
@@ -76,7 +76,7 @@ export default {
&.collapse {
.sidebar-logo {
margin-right: 0px;
margin-right: 0;
border-radius: 50%;
}
}
+1 -1
View File
@@ -9,7 +9,7 @@ const api = {
// Sql 监控
druidSqlApi: baseUrl + '/druid/index.html',
// websocket
websocketApi: baseUrl + '/webSocket/{sid}',
websocketApi: baseUrl + '/websocket/{sid}',
// swagger
swaggerApi: baseUrl + '/doc.html',
// 文件上传
@@ -0,0 +1,82 @@
import Vue from 'vue'
/**
* 消息提示
*/
export default {
/**
* 确认消息对话框<br/>
* 提示用户确认其已经触发的动作, 并询问是否进行此操作时会用到此对话框
* @param questionText 提示语
* @param msgType 消息类型(w、i、e、s)
* @param confirmCallBack 确认回调
* @param cancelCallBack 取消回调
*/
FullConfirm(questionText, msgType, confirmCallBack, cancelCallBack) {
let currentType = 'info'
if (msgType === 's') {
currentType = 'success'
} else if (msgType === 'e') {
currentType = 'error'
} else if (msgType === 'i') {
currentType = 'info'
} else if (msgType === 'w') {
currentType = 'warning'
}
Vue.prototype.$confirm(questionText, '提示', {
confirmButtonText: '确定', cancelButtonText: '取消', type: currentType
}).then(() => {
if (confirmCallBack != null) {
confirmCallBack()
}
}).catch(() => {
if (cancelCallBack != null) {
cancelCallBack()
}
})
}, /**
* 数据删除确认对话框
* @param confirmCallBack 确认回调
* @param cancelCallBack 取消回调
*/
DeleteConfirm(confirmCallBack, cancelCallBack) {
this.FullConfirm('确定删除本条数据吗?', 'w', confirmCallBack, cancelCallBack)
}, /**
* 数据删除确认对话框(自定义提示内容)
* @param message 提示内容
* @param confirmCallBack 确认回调
* @param cancelCallBack 取消回调
*/
DeleteMessageConfirm(message, confirmCallBack, cancelCallBack) {
this.FullConfirm(message, 'w', confirmCallBack, cancelCallBack)
}, /**
* 数据输入对话框
* @param title 标题提示
* @param patternText 正则表达式
* @param errorMsg 校验失败消息内容
* @param confirmCallBack 校验通过回调
* @param cancelCallBack 取消回调
*/
TextInputConfirm(title, patternText, errorMsg, confirmCallBack, cancelCallBack) {
Vue.prototype.$prompt('', title, {
confirmButtonText: '确定', cancelButtonText: '取消', inputPattern: patternText, inputErrorMessage: errorMsg
}).then(({ value }) => {
if (confirmCallBack != null) {
confirmCallBack(value)
}
}).catch(() => {
if (cancelCallBack != null) {
cancelCallBack()
}
})
}, /**
* 确认内容消息框
* @param title 标题
* @param content 内容
*/
ShowConfirm(title, content) {
Vue.prototype.$alert(content, title, {
confirmButtonText: '关闭'
})
}
}
@@ -0,0 +1,26 @@
import Vue from 'vue'
/**
* 消息提示
*/
export default {
Info(content) {
Vue.prototype.$message({
message: content, type: 'info'
})
},
Success(content) {
Vue.prototype.$message({
message: content, type: 'success'
})
},
Warning(content) {
Vue.prototype.$message({
message: content, type: 'warning'
})
},
Error(content) {
Vue.prototype.$message({
message: content, type: 'error'
})
}
}
@@ -0,0 +1,20 @@
import Vue from 'vue'
/**
* 通知
*/
export default {
Info(content) {
Vue.prototype.$notify({ message: content, type: 'info' })
}, Success(content) {
Vue.prototype.$notify({ message: content, type: 'success' })
}, SuccessDuration(content, durationTime) {
Vue.prototype.$notify({ message: content, type: 'success', duration: durationTime })
}, Warning(content) {
Vue.prototype.$notify({ message: content, type: 'warning' })
}, Error(content) {
Vue.prototype.$notify({ message: content, type: 'error' })
}, ErrorDuration(content, durationTime) {
Vue.prototype.$notify({ message: content, type: 'error', duration: durationTime })
}
}
-183
View File
@@ -1,183 +0,0 @@
/**
* 消息提示工具
* @type {{success: MessageUtil.success, warning: MessageUtil.warning, error: MessageUtil.error, info: MessageUtil.info}}
*/
const MessageUtil = {
info: function(context, content) {
context.$message(content)
},
success: function(context, content) {
context.$message({
message: content,
type: 'success'
})
},
warning: function(context, content) {
context.$message({
message: content,
type: 'warning'
})
},
error: function(context, content) {
context.$message.error(content)
}
}
/**
* 通知工具类
* @type {{success: NotificationUtil.success, warning: NotificationUtil.warning, error: NotificationUtil.error, info: NotificationUtil.info}}
*/
const NotificationUtil = {
info: function(context, content) {
context.$notify({
message: content
})
},
success: function(context, content) {
context.$notify({
message: content,
type: 'success'
})
},
successDuration: function(context, content, durationTime) {
context.$notify({
message: content,
type: 'success',
duration: durationTime
})
},
warning: function(context, content) {
context.$notify({
message: content,
type: 'warning'
})
},
error: function(context, content) {
context.$notify({
message: content,
type: 'error'
})
},
errorDuration: function(context, content, durationTime) {
context.$notify({
message: content,
type: 'error',
duration: durationTime
})
}
}
const MessageBoxUtil = {
/**
* 确认消息对话框<br/>
* 提示用户确认其已经触发的动作, 并询问是否进行此操作时会用到此对话框
* @param context 上下文
* @param questionText 提示语
* @param msgType 消息类型(w、i、e、s)
* @param confirmCallBack 确认回调
* @param cancelCallBack 取消回调
*/
fullConfirm: function(context, questionText, msgType, confirmCallBack, cancelCallBack) {
let currentType = 'info'
if (msgType === 's') {
currentType = 'success'
} else if (msgType === 'e') {
currentType = 'error'
} else if (msgType === 'i') {
currentType = 'info'
} else if (msgType === 'w') {
currentType = 'warning'
}
context.$confirm(questionText, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: currentType
}).then(() => {
if (confirmCallBack != null) {
confirmCallBack()
}
}).catch(() => {
if (cancelCallBack != null) {
cancelCallBack()
}
})
},
/**
* 数据删除确认对话框
* @param context 上下文
* @param confirmCallBack 确认回调
* @param cancelCallBack 取消回调
*/
deleteConfirm: function(context, confirmCallBack, cancelCallBack) {
this.fullConfirm(context, '确定删除本条数据吗?', 'w', confirmCallBack, cancelCallBack)
},
/**
* 数据删除确认对话框(自定义提示内容)
* @param context 上下文
* @param message 提示内容
* @param confirmCallBack 确认回调
* @param cancelCallBack 取消回调
*/
deleteMessageConfirm: function(context, message, confirmCallBack, cancelCallBack) {
this.fullConfirm(context, message, 'w', confirmCallBack, cancelCallBack)
},
/**
* 数据输入对话框
* @param context 上下文
* @param title 标题提示
* @param patternText 正则表达式
* @param errorMsg 校验失败消息内容
* @param confirmCallBack 校验通过回调
* @param cancelCallBack 取消回调
*/
textInputConfirm: function(context, title, patternText, errorMsg, confirmCallBack, cancelCallBack) {
context.$prompt('', title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: patternText,
inputErrorMessage: errorMsg
}).then(({ value }) => {
if (confirmCallBack != null) {
confirmCallBack(value)
}
}).catch(() => {
if (cancelCallBack != null) {
cancelCallBack()
}
})
},
/**
* 确认内容消息框
* @param context 上下文
* @param title 标题
* @param content 内容
*/
showConfirm: function(context, title, content) {
context.$alert(content, title, {
confirmButtonText: '关闭'
})
}
}
/**
* 全屏加载动画<br/>
* const loading = LoadingUtil.product()
* loading.close()
* @type {{product: (function(*): *)}}
*/
const LoadingUtil = {
product: function(context) {
return context.$loading({
lock: true,
text: '数据加载中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
}
}
export {
MessageUtil,
MessageBoxUtil,
NotificationUtil,
LoadingUtil
}
-43
View File
@@ -1,43 +0,0 @@
/**
* 构造方法式
* @param context
* @param wsUri
* @constructor
*/
function MyWebSocket(context, wsUri) {
this.context = context
this.wsUri = wsUri
this.webSocket = null
/**
* 初始化WebSocket连接
* @param handleError -> function (e) { e是异常本身 }
* @param handleMessage -> function (e) { e.data是message }
*/
this.connect = function(handleError, handleMessage) {
this.webSocket = new WebSocket(this.wsUri)
// 连接发生错误
this.webSocket.onerror = handleError
// 收到消息
this.webSocket.onmessage = handleMessage
return this
}
/**
* 发送客户端数据
* @param data 客户端数据
*/
this.sendData = function(data) {
this.webSocket.send(JSON.stringify(data))
}
/**
* 用于关闭ws连接
*/
this.close = function() {
console.info('关闭连接')
if (this.webSocket.readyState === 1) {
this.sendData([{}])
this.webSocket.close()
}
}
}
export default MyWebSocket