Skip to content

Commit

Permalink
Merge remote-tracking branch 'github-bk-bcs/master'
Browse files Browse the repository at this point in the history
* github-bk-bcs/master:
  fix: 文件恢复后更新生成版本按钮状态--bug=131345207  (#3538)
  refactor: 升级axios版本 (#3532)
  feat: 客户端查询列表展示“最后一次拉取配置耗时”字段 (#3528)
  • Loading branch information
wenxinlee2015 committed Sep 25, 2024
2 parents ab1dfb9 + 2ad19f7 commit 783fecd
Show file tree
Hide file tree
Showing 29 changed files with 1,146 additions and 1,131 deletions.
6 changes: 3 additions & 3 deletions bcs-services/bcs-bscp/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@blueking/platform-config": "^1.0.3",
"@types/js-cookie": "^3.0.2",
"@types/lodash.clonedeep": "^4.5.7",
"axios": "^1.6.0",
"axios": "^1.7.7",
"bkui-vue": "1.0.3-beta.32",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.9",
Expand Down Expand Up @@ -59,6 +59,6 @@
"vite-plugin-compression": "^0.5.1",
"vite-plugin-eslint": "^1.8.1",
"vue-eslint-parser": "^9.3.1",
"vue-tsc": "^2.0.7"
"vue-tsc": "2.0.7"
}
}
}
2 changes: 1 addition & 1 deletion bcs-services/bcs-bscp/ui/src/i18n/en-us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,6 @@ export default {
'当前已有「未上线」版本': 'There is currently a "not online" version',
前往编辑: 'Go to edit',
创建版本: 'Create version',
选择载入脚本: 'Select load script',
'无效名称,只允许包含中文、英文、数字、下划线()、连字符(-)、空格,且必须以中文、英文、数字开头和结尾': 'Invalid name, only allowed to contain Chinese, English, numbers, underscores (), hyphens (-), spaces, and must start and end with Chinese, English, numbers',
编辑版本: 'Edited version',
脚本内容不能为空: 'Script content cannot be empty',
Expand Down Expand Up @@ -1064,6 +1063,7 @@ export default {
'组件类型 / 版本分布': 'Component type / Version distribution',
下钻: 'Drill down',
总和: 'Total',
最后一次拉取配置耗时: 'Last pull time-consuming',

// 跨页全选
跨页全选: 'AcrossChecked',
Expand Down
2 changes: 1 addition & 1 deletion bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,6 @@ export default {
'当前已有「未上线」版本': '当前已有「未上线」版本',
前往编辑: '前往编辑',
创建版本: '创建版本',
选择载入脚本: '选择载入脚本',
'无效名称,只允许包含中文、英文、数字、下划线()、连字符(-)、空格,且必须以中文、英文、数字开头和结尾': '无效名称,只允许包含中文、英文、数字、下划线()、连字符(-)、空格,且必须以中文、英文、数字开头和结尾',
编辑版本: '编辑版本',
脚本内容不能为空: '脚本内容不能为空',
Expand Down Expand Up @@ -1068,6 +1067,7 @@ export default {
'组件类型 / 版本分布': '组件类型 / 版本分布',
下钻: '下钻',
总和: '总和',
最后一次拉取配置耗时: '最后一次拉取配置耗时',

// 跨页全选
跨页全选: '跨页全选',
Expand Down
44 changes: 42 additions & 2 deletions bcs-services/bcs-bscp/ui/src/views/space/client/search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@
@page-limit-change="handlePageLimitChange"
@page-value-change="loadList(true)"
@column-filter="handleFilter"
@column-sort="handleSort"
@setting-change="handleSettingsChange">
<template #prepend>
<render-table-tip />
</template>
<bk-table-column :min-width="80" :width="80" :label="renderSelection" :show-overflow-tooltip="false">
<bk-table-column
:min-width="80"
fixed="left"
:width="80"
:label="renderSelection"
:show-overflow-tooltip="false">
<template #default="{ row }">
<across-check-box
:checked="isChecked(row)"
Expand Down Expand Up @@ -106,6 +112,21 @@
</div>
</template>
</bk-table-column>
<bk-table-column
v-if="selectedShowColumn.includes('pull-time')"
:label="t('最后一次拉取配置耗时')"
:width="200"
:sort="true">
<template #default="{ row }">
<span v-if="row.client">
{{
row.client.spec.total_seconds > 1
? `${Math.round(row.client.spec.total_seconds)}s`
: `${Math.round(row.client.spec.total_seconds * 1000)}ms`
}}
</span>
</template>
</bk-table-column>
<!-- <bk-table-column label="附加信息" :width="244"></bk-table-column> -->
<bk-table-column
v-if="selectedShowColumn.includes('online-status')"
Expand Down Expand Up @@ -321,6 +342,7 @@
];
const onlineStatusFilterChecked = ref<string[]>([]);
const pollTimer = ref(0);
const updateSortType = ref('null');
// 当前页数据,不含禁用
const selecTableData = computed(() => {
Expand Down Expand Up @@ -411,7 +433,8 @@
settings.value.size = 'medium';
if (tableSet) {
const { checked, size } = JSON.parse(tableSet);
selectedShowColumn.value = checked;
const requiredChecked = settings.value.fields.filter((item) => item.disabled).map((item) => item.id);
selectedShowColumn.value = [...requiredChecked, ...checked];
settings.value.checked = checked;
settings.value.size = size;
}
Expand Down Expand Up @@ -462,6 +485,11 @@
id: 'pull-status',
disabled: true,
},
{
name: t('最后一次拉取配置耗时'),
id: 'pull-time',
disabled: true,
},
{
name: t('在线状态'),
id: 'online-status',
Expand Down Expand Up @@ -498,6 +526,7 @@
'label',
'current-version',
'pull-status',
'pull-time',
'online-status',
'first-connect-time',
'last-heartbeat-time',
Expand All @@ -515,6 +544,7 @@
'label',
'current-version',
'pull-status',
'pull-time',
'online-status',
'first-connect-time',
'last-heartbeat-time',
Expand Down Expand Up @@ -545,6 +575,11 @@
desc: 'online_status',
},
};
if (updateSortType.value === 'desc') {
params.order!.desc = 'online_status,total_seconds';
} else if (updateSortType.value === 'asc') {
params.order!.asc = 'total_seconds';
}
try {
listLoading.value = true;
const res = await getClientQueryList(bkBizId.value, appId.value, params);
Expand Down Expand Up @@ -608,6 +643,11 @@
}
};
const handleSort = ({ type }: any) => {
updateSortType.value = type;
loadList();
};
const handleSettingsChange = ({ checked, size }: any) => {
selectedShowColumn.value = [...checked];
localStorage.setItem('client-show-column', JSON.stringify({ checked, size }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class="action-icon bk-bscp-icon icon-download"
v-bk-tooltips="{ content: $t('可下钻图表') }" />
</div>
<TriggerBtn v-model:currentType="currentType" />
<TriggerBtn v-model:current-type="currentType" />
</div>
</template>
<bk-loading class="loading-wrap" :loading="loading">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
content: `${$t('支持点击数据下钻')}\n${$t('下钻维度')}\: ${selectedDownDimension}`,
}" />
</div>
<TriggerBtn v-model:currentType="currentType" />
<TriggerBtn v-model:current-type="currentType" />
</div>
</template>
<bk-loading class="loading-wrap" :loading="loading">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@toggle-full-screen="isOpenFullScreen = !isOpenFullScreen" />
</template>
<template #head-suffix>
<TriggerBtn v-model:currentType="currentType" style="margin-left: 16px" />
<TriggerBtn v-model:current-type="currentType" style="margin-left: 16px" />
</template>
<bk-loading class="loading-wrap" :loading="loading">
<component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{ t('批量删除') }}
</bk-button>
<DeleteConfirmDialog
v-model:isShow="isBatchDeleteDialogShow"
v-model:is-show="isBatchDeleteDialogShow"
:title="t('确认删除所选的 {n} 项分组?', { n: props.selectedIds.length })"
:pending="batchDeletePending"
@confirm="handleBatchDeleteConfirm">
Expand Down
2 changes: 1 addition & 1 deletion bcs-services/bcs-bscp/ui/src/views/space/groups/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
:name="editingGroup.name"></services-to-published>
</section>
<DeleteConfirmDialog
v-model:isShow="isDeleteGroupDialogShow"
v-model:is-show="isDeleteGroupDialogShow"
:title="t('确认删除该分组?')"
@confirm="handleDeleteGroupConfirm">
<div style="margin-bottom: 8px">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{
cnName: t('配置根目录'),
shellVar: '${bk_bscp_temp_dir}',
pythonVar: "os.environ.get( 'bk_bscp_temp_dir' )",
pythonVar: 'os.environ.get( \'bk_bscp_temp_dir\' )',
batVar: '%bk_bscp_temp_dir%',
PSVar: '$env:bk_bscp_temp_dir',
tips: t('客户端配置的配置存放临时目录,默认值为 {n}', { n: ' /data/bscp' }),
Expand All @@ -40,7 +40,7 @@
{
cnName: t('业务ID'),
shellVar: '${bk_bscp_biz}',
pythonVar: "os.environ.get( 'bk_bscp_biz' )",
pythonVar: 'os.environ.get( \'bk_bscp_biz\' )',
batVar: '%bk_bscp_biz%',
PSVar: '$env:bk_bscp_biz',
tips: t('蓝鲸配置平台上的业务ID,例如:2'),
Expand All @@ -49,7 +49,7 @@
{
cnName: t('服务名称'),
shellVar: '${bk_bscp_app}',
pythonVar: "os.environ.get( 'bk_bscp_app' )",
pythonVar: 'os.environ.get( \'bk_bscp_app\' )',
batVar: '%bk_bscp_app%',
PSVar: '$env:bk_bscp_app',
tips: t('服务配置中心上的服务名称,例如:demo_service'),
Expand All @@ -58,7 +58,7 @@
{
cnName: t('服务配置目录'),
shellVar: '${bk_bscp_app_temp_dir}',
pythonVar: "os.environ.get( 'bk_bscp_app_temp_dir' )",
pythonVar: 'os.environ.get( \'bk_bscp_app_temp_dir\' )',
batVar: '%bk_bscp_app_temp_dir%',
PSVar: '$env:bk_bscp_app_temp_dir',
tips: t(
Expand All @@ -71,7 +71,7 @@
{
cnName: t('当前配置版本名称'),
shellVar: '${bk_bscp_current_version_name}',
pythonVar: "os.environ.get( 'bk_bscp_current_version_name' )",
pythonVar: 'os.environ.get( \'bk_bscp_current_version_name\' )',
batVar: '%bk_bscp_current_version_name%',
PSVar: '$env:bk_bscp_current_version_name',
tips: t(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{ t('批量删除') }}
</bk-button>
<DeleteConfirmDialog
v-model:isShow="isBatchDeleteDialogShow"
v-model:is-show="isBatchDeleteDialogShow"
:title="
t('确认删除所选的 {n} 项脚本?', {
n: isAcrossChecked ? dataCount - props.selectedIds.length : props.selectedIds.length,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
<ScriptCited v-model:show="showCiteSlider" :id="currentId" />
</section>
<DeleteConfirmDialog
v-model:isShow="isDeleteScriptDialogShow"
v-model:is-show="isDeleteScriptDialogShow"
:title="t('确认删除该脚本?')"
@confirm="handleDeleteScriptConfirm">
<div style="margin-bottom: 8px">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@confirm="handleLoadScript"
@closed="dialogShow = false">
<bk-form ref="formRef" form-type="vertical" :model="{ selectedScript }">
<bk-form-item :label="t('选择载入脚本')" required property="selectedScript">
<bk-form-item :label="t('选择载入版本')" required property="selectedScript">
<bk-select
v-model="selectedScript"
:loading="listLoading"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
:space-id="spaceId"
:script-id="scriptId" />
<DeleteConfirmDialog
v-model:isShow="isDeleteScriptVersionDialogShow"
v-model:is-show="isDeleteScriptVersionDialogShow"
:title="t('确认删除该脚本版本?')"
@confirm="handleDeleteScriptVersionConfirm">
<div style="margin-bottom: 8px">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{{ t('批量删除') }}
</bk-button>
<DeleteConfirmDialog
v-model:isShow="isBatchDeleteDialogShow"
v-model:is-show="isBatchDeleteDialogShow"
:title="
t('确认删除所选的 {n} 项配置项?', {
n: isAcrossChecked ? dataCount - props.selectedIds.length : props.selectedIds.length,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ConfigForm
ref="formRef"
class="config-form-wrapper"
v-model:fileUploading="fileUploading"
v-model:file-uploading="fileUploading"
:config="configForm"
:content="content"
:is-edit="false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
v-if="!configDetailLoading"
ref="formRef"
class="config-form-wrapper"
v-model:fileUploading="fileUploading"
v-model:file-uploading="fileUploading"
:config="configForm"
:content="content"
:is-edit="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
@open-edit="handleSwitchToEdit" />
<VersionDiff v-model:show="isDiffPanelShow" :current-version="versionData" :selected-kv-config-id="diffConfig" />
<DeleteConfirmDialog
v-model:isShow="isDeleteConfigDialogShow"
v-model:is-show="isDeleteConfigDialogShow"
:title="t('确认删除该配置项?')"
@confirm="handleDeleteConfigConfirm">
<div style="margin-bottom: 8px">
Expand All @@ -160,7 +160,7 @@
<div>{{ deleteConfigTips }}</div>
</DeleteConfirmDialog>
<DeleteConfirmDialog
v-model:isShow="isRecoverConfigDialogShow"
v-model:is-show="isRecoverConfigDialogShow"
:title="t('确认恢复该配置项?')"
:confirm-text="t('恢复')"
@confirm="handleRecoverConfigConfirm">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
:app-id="props.appId"
@updated="getAllConfigList" />
<DeleteConfirmDialog
v-model:isShow="isDeleteConfigDialogShow"
v-model:is-show="isDeleteConfigDialogShow"
:title="t('确认删除该配置文件?')"
@confirm="handleDeleteConfigConfirm">
<div style="margin-bottom: 8px">
Expand All @@ -270,7 +270,7 @@
<div>{{ deleteConfigTips }}</div>
</DeleteConfirmDialog>
<DeleteConfirmDialog
v-model:isShow="isDeletePkgDialogShow"
v-model:is-show="isDeletePkgDialogShow"
:title="t('确认移除该配置模板套餐?')"
:confirm-text="t('移除')"
:pending="removePkgLoading"
Expand All @@ -281,7 +281,7 @@
<div>{{ t('移除后本服务配置将不再引用该配置模板套餐,以后需要时可以重新从配置模板导入') }}</div>
</DeleteConfirmDialog>
<DeleteConfirmDialog
v-model:isShow="isRecoverConfigDialogShow"
v-model:is-show="isRecoverConfigDialogShow"
:title="t('确认恢复该配置文件?')"
:confirm-text="t('恢复')"
@confirm="handleRecoverConfigConfirm">
Expand Down Expand Up @@ -937,6 +937,14 @@
if (oldConfigIndex.value !== -1) {
tableGroupsData.value.find((group) => group.id === 0)!.configs.splice(oldConfigIndex.value, 1);
}
// 更新配置项数量
const existConfigCount = configList.value.filter((item) => item.file_state !== 'DELETE').length;
configStore.$patch((state) => {
state.conflictFileCount = conflictCount.value;
state.allConfigCount = configsCount.value + templatesCount.value;
state.allExistConfigCount = existConfigCount + templatesCount.value;
});
};
// 批量操作配置项后刷新配置项列表
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="slider-content-container">
<ConfigForm
ref="formRef"
v-model:fileUploading="fileUploading"
v-model:file-uploading="fileUploading"
:config="configForm"
:content="content"
:editable="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@
<RecycleScroller class="table-body" :items="data" :item-size="44" key-field="fileAP" v-slot="{ item, index }">
<div class="table-row">
<div class="not-editable td-cell name">
{{ item.fileAP }}
<span class="text-ov">
{{ item.fileAP }}
</span>
</div>
<div class="not-editable td-cell type">
{{ item.file_type === 'text' ? t('文本') : t('二进制') }}
Expand Down
Loading

0 comments on commit 783fecd

Please sign in to comment.