Skip to content

Commit

Permalink
feature: 流水线日志支持AI修复 TencentBlueKing#10913
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanxu33 committed Sep 20, 2024
1 parent 42d9df8 commit 30ca7e8
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/frontend/devops-pipeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"public:external": "cross-env NODE_ENV=external npm run public --"
},
"dependencies": {
"@blueking/log": "2.2.0-beta.15",
"@blueking/log": "2.2.0-beta.17",
"@blueking/search-select": "0.0.1-beta.2",
"@icon-cool/bk-icon-devops": "^0.2.1",
"axios": "^0.28.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
class="log-tools"
>
<template v-slot:tool>
<li class="more-button" @click="toggleShowDebugLog">
<li
class="more-button"
@click="toggleShowDebugLog"
>
{{ showDebug ? $t("hideDebugLog") : $t("showDebugLog") }}
</li>
<li class="more-button" @click="downloadLog">{{ $t("downloadLog") }}</li>
<li
class="more-button"
@click="downloadLog"
>
{{ $t("downloadLog") }}
</li>
</template>
</bk-log-search>
<bk-log
Expand Down Expand Up @@ -154,30 +162,44 @@
'getLogStatus',
'getDownloadLogFromArtifactory',
'praiseAi',
'getPraiseAiInfo',
'getLogAIMessage'
]),
handlePraiseAi () {
handlePraiseAi (item) {
this.praiseAi({
...this.postData,
score: true
}).then(() => {
this.$bkMessage({ theme: 'error', message: this.$t('successPraise') })
this.handleGetPraiseAiInfo(item)
this.$bkMessage({ theme: 'success', message: this.$t('successPraise') })
})
},
handleDownPraiseAi () {
handleDownPraiseAi (item) {
this.praiseAi({
...this.postData,
score: false
}).then(() => {
this.$bkMessage({ theme: 'error', message: this.$t('successDownPraise') })
this.handleGetPraiseAiInfo(item)
this.$bkMessage({ theme: 'success', message: this.$t('successDownPraise') })
})
},
handleGetPraiseAiInfo (item) {
const scrollRef = this.$refs.scroll
this.getPraiseAiInfo()
.then((res) => {
item.goodUsers = res.goodUsers
item.badUsers = res.badUsers
scrollRef.setSingleLogData(item)
})
},
handleLoadAiMessage (item) {
item.aiMessage = ''
const scrollRef = this.$refs.scroll
this.handleGetPraiseAiInfo(item)
this.getLogAIMessage({
...this.postData,
refresh: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,14 @@ export default {
return request.post(url)
},

getPraiseAiInfo ({ commit }, { projectId, pipelineId, buildId, tag, executeCount }) {
let url = `/misc/api/user/gpt/script_error_analysis_score/${projectId}/${pipelineId}/${buildId}?taskId=${tag}&score=true`
if (executeCount) {
url += `&executeCount=${executeCount}`
}
return request.get(url)
},

getLogAIMessage ({ commit }, { projectId, pipelineId, buildId, tag, executeCount, refresh, callBack }) {
let url = `/misc/api/user/gpt/script_error_analysis/${projectId}/${pipelineId}/${buildId}?taskId=${tag}&refresh=${refresh}`
if (executeCount) {
Expand Down
4 changes: 2 additions & 2 deletions src/frontend/locale/pipeline/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
"downloadLog": "下载日志",
"hideDebugLog": "隐藏调试日志",
"showDebugLog": "展示调试日志",
"successPraise": "点赞成功",
"successDownPraise": "点踩成功",
"successPraise": "已赞",
"successDownPraise": "已踩",
"stageReview": {
"stageInConditions": "准入规则",
"approvalFlow": "审核流",
Expand Down

0 comments on commit 30ca7e8

Please sign in to comment.