Skip to content

Commit

Permalink
feat:构建日志归档阈值支持按项目配置 TencentBlueKing#11437
Browse files Browse the repository at this point in the history
# Reviewed, transaction id: 30104
  • Loading branch information
vhwweng committed Feb 11, 2025
1 parent 48c6f49 commit 3ded596
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/frontend/devops-manage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "",
"scripts": {
"dev": "nx exec -- bk-cli-service-webpack dev",
"dev": "bk-cli-service-webpack dev",
"build": "bk-cli-service-webpack build",
"server": "node ./paas-server/index.js",
"lint:style": "stylelint **/*.{html,vue,css,sass,scss,less} --fix",
Expand Down
20 changes: 20 additions & 0 deletions src/frontend/devops-manage/src/components/project-form.vue
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,23 @@ onBeforeUnmount(() => {
>
</bk-input>
</bk-form-item>
<bk-form-item
:label="t('构建日志归档阈值')"
property="loggingLineLimit"
:description="t('单个步骤(Step)日志达到阈值时,将压缩并归档到日志仓库。可下周日志文件到本地查看')"
>
<bk-input
v-model="projectData.properties.loggingLineLimit"
class="log-line-limit-input"
type="number"
:showControl="false"
:min="1"
:max="100"
:suffix="t('万行')"
:placeholder="t('缺省时默认为10')"
>
</bk-input>
</bk-form-item>
</div>
</div>
</bk-form>
Expand Down Expand Up @@ -578,6 +595,9 @@ onBeforeUnmount(() => {
font-size: 12px;
color: #3c96ff;
}
.log-line-limit-input {
width: 150px;
}
</style>

<style lang="postcss">
Expand Down
1 change: 1 addition & 0 deletions src/frontend/devops-manage/src/views/apply-project.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const projectData = ref({
authSecrecy: 0,
properties: {
pipelineDialect: 'CLASSIC',
loggingLineLimit: null
}
});
const projectForm = ref(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const fetchProjectData = async () => {
...res,
properties: {
pipelineDialect: 'CLASSIC',
loggingLineLimit: null,
...res.properties,
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ const fieldMap = [
current: 'centerName',
after: 'afterCenterName',
},
{
current: 'loggingLineLimit',
after: 'afterLoggingLineLimit'
}
];
const propertiesFieldMap = [
{
Expand Down Expand Up @@ -464,6 +468,24 @@ onMounted(async () => {
<span>{{ projectData.afterPipelineNameFormat }}</span>
</div>
</bk-form-item>
<bk-form-item
:label="t('构建日志归档阈值')"
property="loggingLineLimit"
:description="t('单个步骤(Step)日志达到阈值时,将压缩并归档到日志仓库。可下周日志文件到本地查看')"
>
<span class="item-value">
{{ projectData.properties.loggingLineLimit || '--' }}
<span v-if="projectData.properties.loggingLineLimit">
{{ t('万行') }}
</span>
</span>
<div class="diff-content" v-if="projectData.afterLoggingLineLimit">
<p class="update-title">
{{ t('本次更新:') }}
</p>
<span>{{ projectData.afterLoggingLineLimit }}{{ t('万行') }}</span>
</div>
</bk-form-item>
</bk-form>
</div>
<div>
Expand Down
6 changes: 5 additions & 1 deletion src/frontend/locale/manage/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,5 +319,9 @@
"资源授权": "Resource authorization",
"查看详情": "View details",
"需先完成交接。": "Handover must be completed first.",
"返回": "Return"
"返回": "Return",
"单个步骤(Step)日志达到阈值时,将压缩并归档到日志仓库。可下周日志文件到本地查看": "When an individual step's log reaches the threshold, it will be compressed and archived to the log repository. The log file can be downloaded for local viewing.",
"万行": "10k lines",
"缺省时默认为10": "Defaults to 10",
"构建日志归档阈值": "Build log archival threshold"
}
6 changes: 5 additions & 1 deletion src/frontend/locale/manage/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -320,5 +320,9 @@
"资源授权": "资源授权",
"查看详情": "查看详情",
"需先完成交接。": "需先完成交接。",
"返回": "返回"
"返回": "返回",
"单个步骤(Step)日志达到阈值时,将压缩并归档到日志仓库。可下周日志文件到本地查看": "单个步骤(Step)日志达到阈值时,将压缩并归档到日志仓库。可下周日志文件到本地查看",
"万行": "万行",
"缺省时默认为10": "缺省时默认为10",
"构建日志归档阈值": "构建日志归档阈值"
}

0 comments on commit 3ded596

Please sign in to comment.