Skip to content

Commit

Permalink
--story=121558541 模板文件夹删除提示文案 (merge request !2203)
Browse files Browse the repository at this point in the history
Squash merge branch 'feat/template-file-tips' into 'master'
--story=121558541 模板文件夹删除提示文案
# Reviewed, transaction id: 29461

 



TAPD: --story=121558541
  • Loading branch information
v_yfqnyang authored and hitozhang committed Jan 16, 2025
1 parent 0edc608 commit 64f4eaa
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 12 deletions.
2 changes: 2 additions & 0 deletions bcs-ui/frontend/src/i18n/en-US.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3873,6 +3873,8 @@ templateFile:
helmdesc: >-
The current file has been upgraded to a Helm template. After saving,
switching back to a non-Helm template will no longer be supported.
spaceSubTitle: The template folder and its template files will be removed
noChanges: No changes
tag:
draft: draft
baseOn: base on
Expand Down
2 changes: 2 additions & 0 deletions bcs-ui/frontend/src/i18n/zh-CN.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3093,6 +3093,8 @@ templateFile:
uploadTips: '支持.tgz, .tar.gz类型压缩包,文件小于{0}M'
createSpace: 新建文件夹
helmdesc: 当前文件已升级为 Helm 模板,保存后将不再支持切换回非 Helm 模板。
spaceSubTitle: 模板文件夹及其中的模板文件将被删除
noChanges: 未变更
tag:
draft: 草稿
baseOn: 基于
Expand Down
14 changes: 12 additions & 2 deletions bcs-ui/frontend/src/views/cluster-manage/cluster/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@
:loading="logLoading"
:height="'calc(100vh - 92px)'"
:rolling-loading="false"
:show-step-retry-fn="item => item?.step?.allowRetry"
:show-step-skip-fn="item => item?.step?.allowSkip"
:show-step-retry-fn="handleStepRetry"
:show-step-skip-fn="handleStepSkip"
@refresh="handleShowLog(logSideDialogConf.row)"
@auto-refresh="handleAutoRefresh"
@download="getDownloadTaskRecords"
Expand Down Expand Up @@ -565,6 +565,14 @@ export default defineComponent({
},
});
};
// 重试按钮显示逻辑
function handleStepRetry(item) {
return item?.step?.status === 'FAILED' && item?.step?.allowRetry;
}
// 跳过按钮显示逻辑
function handleStepSkip(item) {
return item?.step?.status === 'FAILED' && item?.step?.allowSkip;
}
// 集群节点数
const clusterNodesMap = ref<Record<string, number>>({});
Expand Down Expand Up @@ -715,6 +723,8 @@ export default defineComponent({
logSideDialogConf,
handleAutoRefresh,
getDownloadTaskRecords,
handleStepRetry,
handleStepSkip,
};
},
});
Expand Down
16 changes: 14 additions & 2 deletions bcs-ui/frontend/src/views/cluster-manage/node-list/node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,8 @@
:loading="logSideDialogConf.loading"
:height="'calc(100vh - 92px)'"
:rolling-loading="false"
:show-step-retry-fn="item => item?.step?.allowRetry"
:show-step-skip-fn="item => item?.step?.allowSkip"
:show-step-retry-fn="handleStepRetry"
:show-step-skip-fn="handleStepSkip"
@refresh="handleShowLog(logSideDialogConf.row)"
@auto-refresh="handleAutoRefresh"
@download="getDownloadTaskRecords"
Expand Down Expand Up @@ -1740,6 +1740,16 @@ export default defineComponent({
},
});
};
// 重试按钮显示逻辑
function handleStepRetry(item) {
return item?.step?.status === 'FAILED' && item?.step?.allowRetry;
}
// 跳过按钮显示逻辑
function handleStepSkip(item) {
return item?.step?.status === 'FAILED' && item?.step?.allowSkip;
}


// 批量允许调度
const showBatchMenu = ref(false);
const handleBatchEnableNodes = () => {
Expand Down Expand Up @@ -2157,6 +2167,8 @@ export default defineComponent({
handleAutoRefresh,
getDownloadTaskRecords,
handleSkip,
handleStepRetry,
handleStepSkip,
};
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,20 @@
:original-version="versionDetail.version"
:is-draft="fileMetadata?.isDraft" />
<div class="bcs-border-top flex items-center h-[48px] px-[24px] bg-[#FAFBFD]">
<bcs-button
theme="primary"
class="min-w-[88px]"
:disabled="versionDetail.content === originalContent && !fileMetadata?.isDraft && !upgrade"
@click="showVersionDialog = true">
{{ $t('generic.button.confirmSave') }}
</bcs-button>
<div
class="mr-[8px]"
v-bk-tooltips="{
content: $t('templateFile.tips.noChanges'),
disabled: !disabledSave
}">
<bcs-button
theme="primary"
class="min-w-[88px]"
:disabled="disabledSave"
@click="showVersionDialog = true">
{{ $t('generic.button.confirmSave') }}
</bcs-button>
</div>
<bcs-button @click="showDiffSlider = false">{{ $t('generic.button.cancel') }}</bcs-button>
</div>
</template>
Expand All @@ -129,7 +136,7 @@
</BcsContent>
</template>
<script setup lang="ts">
import { onBeforeMount, ref } from 'vue';
import { computed, onBeforeMount, ref } from 'vue';
import DiffYaml from './diff-yaml.vue';
import FileMetadataDialog from './file-metadata.vue';
Expand Down Expand Up @@ -294,6 +301,9 @@ async function handleShowDiffSlider() {
}
// 是否升级为Helm 模板
const disabledSave = computed(() => versionDetail.value.content === originalContent.value
&& !fileMetadata.value?.isDraft
&& !upgrade.value);
const isHelm = ref(false);
const upgrade = ref(false);
function getUpgradeStatus(data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ async function deleteSpace(space: ITemplateSpaceData) {
type: 'warning',
clsName: 'custom-info-confirm',
title: $i18n.t('generic.title.confirmDelete1', { name: space.name }),
subTitle: $i18n.t('templateFile.tips.spaceSubTitle'),
defaultInfo: true,
okText: $i18n.t('generic.button.delete'),
confirmFn: async () => {
Expand Down

0 comments on commit 64f4eaa

Please sign in to comment.