Skip to content

Commit

Permalink
fix: powershell 环境变量格式问题修复--bug=130444637 (#3504)
Browse files Browse the repository at this point in the history
* fix: powershell 环境变量格式问题修复

* fix: 退出登录国际化大写
  • Loading branch information
Yuikill committed Sep 10, 2024
1 parent 79bc542 commit d10f4a8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
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 @@ -90,7 +90,7 @@ export default {
版本日志: 'Release Notes',
功能特性: 'Features',
问题反馈: 'Feedback',
退出登录: 'Sign out',
退出登录: 'Sign Out',
新建业务: 'New Business Creation',
模板与变量: 'Templates and Variables',
模板管理: 'Template Management',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,36 @@
{
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' }),
batTips: t('客户端配置的配置存放临时目录,默认值为 {n}', { n: ' C:\\data\\bscp' })
batTips: t('客户端配置的配置存放临时目录,默认值为 {n}', { n: ' C:\\data\\bscp' }),
},
{
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'),
batTips: t('蓝鲸配置平台上的业务ID,例如:2'),
},
{
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'),
batTips: t('服务配置中心上的服务名称,例如:demo_service'),
},
{
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(
'单个客户端可使用多个服务的配置,为保证路径唯一,服务配置需存放于:配置根目录/业务ID/服务名称,服务配置存放目录 = 配置存放根目录/业务ID/服务名称',
),
Expand All @@ -67,8 +71,9 @@
{
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(
'当前客户端最近一次成功拉取的服务配置版本名称,如 V1,通常会在后置脚本中为服务配置版本添加标识,以表示配置文件已经完成拉取',
),
Expand All @@ -94,12 +99,15 @@
};
const getVar = (item: any) => {
if (props.language === 'shell' || props.language === 'powershell') {
if (props.language === 'shell') {
return item.shellVar;
}
if (props.language === 'python') {
return item.pythonVar;
}
if (props.language === 'powershell') {
return item.PSVar;
}
return item.batVar;
};
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@
size = new Blob([stringContent]).size;
await updateConfigContent(props.bkBizId, props.appId, stringContent, sign, () => {});
}
if (configForm.value.path?.endsWith('/') && configForm.value.path !== '/') {
configForm.value.path = configForm.value.path.slice(0, -1);
}
const params = { ...configForm.value, ...{ sign, byte_size: size } };
const res = await createServiceConfigItem(props.appId, props.bkBizId, params);
serviceStore.$patch((state) => {
Expand Down

0 comments on commit d10f4a8

Please sign in to comment.