Skip to content

Commit

Permalink
Feature flag 控制 (#1833)
Browse files Browse the repository at this point in the history
  • Loading branch information
leafage-collb authored Dec 24, 2024
1 parent 6bb7a37 commit 3d9517d
Show file tree
Hide file tree
Showing 8 changed files with 1,249 additions and 1,076 deletions.
19 changes: 19 additions & 0 deletions webfe/package_vue/src/language/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -2918,4 +2918,23 @@ export default {
'如果您的应用描述文件版本为 spec_version: 2,并且应用是云原生应用,请直接将描述文件转换为 specVersion: 3 后进行重新部署。': 'If your APP descriptor file version is spec_version: 2 and the application is cloud-native, please directly convert the descriptor file to specVersion: 3 and redeploy it.',
'普通应用请勿使用本工具。请先将应用迁移到云原生应用,再更新描述文件版本。': 'Do not use this tool for traditional applications. Please first migrate the application to a cloud-native application and then update the descriptor file version.',
'specVersion: 3 是针对云原生应用设计的最新规范,可以定义进程服务、可观测性等所有云原生应用的功能。本工具可以帮助您将旧版描述文件转换为新版。': 'specVersion: 3 is the latest specification designed for cloud-native applications, capable of defining all cloud-native application features such as process services and observability. This tool can help you convert older descriptor files to the new version.',
'由应用描述文件 app_desc.yaml 定义': 'Defined by the application description file app_desc.yaml',
'当前值由应用描述文件定义,如果继续编辑,建议先删除应用描述文件的相关配置,否则重新部署时会覆盖填写的值。': 'The current value is defined by the application description file. If you continue to edit, please delete the relevant configurations in the file first, or your changes may be overwritten during redeployment.',
来自应用描述文件: 'From the APP description file',
'应用描述文件中定义的环境变量无法在页面上修改,但可以在页面上添加同名变量以覆盖其值': 'The environment variables defined in the APP description file cannot be modified on the page, but you can add variables with the same name on the page to override their values.',
'环境变量已失效,因为页面上新增了同名的环境变量': 'The environment variable has become invalid because a variable with the same name was added on the page.',
提交代码: 'Submit code',
变更文件: 'Changed files',
代码提交成功: 'Code submitted successfully',
点击跳转到仓库查看: 'Click to view the repository',
没有变更的文件: 'No changed files',
文件名不符合规范: 'Filename does not conform to specifications',
'文件 {x} 名称不符合规范': 'The filename {x} does not conform to specifications',
'文件 {x} 等 {n} 个文件名称不符合规范': 'The filename {x} and {n} other files do not conform to specifications',
'修改的文件路径中不能包含中文,空格,以及除连接符(-),下划线(一),句号(.)外的特殊字符': 'The modified file path cannot contain Chinese characters, spaces, or special characters other than hyphens (-), underscores (_), and periods (.).',
暂无访问控制台功能: 'Web console is currently not available',
'访问控制台可以让您进入应用进程的容器,查看线上运行的代码、进行在线调试以及执行一次性命令等操作。': 'The web console allows you to enter the container of the application process, view the code running online, perform online debugging, and execute one-time commands.',
'如需使用该功能,需要:': 'To use this feature, you need to:',
'1. 安装 BCS 套餐': '1. Install the BCS package.',
'2. 将应用集群来源修改为: BCS 集群': '2. Change the application cluster source to: BCS cluster.',
};
17 changes: 17 additions & 0 deletions webfe/package_vue/src/language/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -3055,4 +3055,21 @@ export default {
'如果您的应用描述文件版本为 spec_version: 2,并且应用是云原生应用,请直接将描述文件转换为 specVersion: 3 后进行重新部署。': '如果您的应用描述文件版本为 spec_version: 2,并且应用是云原生应用,请直接将描述文件转换为 specVersion: 3 后进行重新部署。',
'普通应用请勿使用本工具。请先将应用迁移到云原生应用,再更新描述文件版本。': '普通应用请勿使用本工具。请先将应用迁移到云原生应用,再更新描述文件版本。',
'specVersion: 3 是针对云原生应用设计的最新规范,可以定义进程服务、可观测性等所有云原生应用的功能。本工具可以帮助您将旧版描述文件转换为新版。': 'specVersion: 3 是针对云原生应用设计的最新规范,可以定义进程服务、可观测性等所有云原生应用的功能。本工具可以帮助您将旧版描述文件转换为新版。',
来自应用描述文件: '来自应用描述文件',
'应用描述文件中定义的环境变量无法在页面上修改,但可以在页面上添加同名变量以覆盖其值': '应用描述文件中定义的环境变量无法在页面上修改,但可以在页面上添加同名变量以覆盖其值',
'环境变量已失效,因为页面上新增了同名的环境变量': '环境变量已失效,因为页面上新增了同名的环境变量',
提交代码: '提交代码',
变更文件: '变更文件',
代码提交成功: '代码提交成功',
点击跳转到仓库查看: '点击跳转到仓库查看',
没有变更的文件: '没有变更的文件',
文件名不符合规范: '文件名不符合规范',
'文件 {x} 名称不符合规范': '文件 {x} 名称不符合规范',
'文件 {x} 等 {n} 个文件名称不符合规范': '文件 {x} 等 {n} 个文件名称不符合规范',
'修改的文件路径中不能包含中文,空格,以及除连接符(-),下划线(一),句号(.)外的特殊字符': '修改的文件路径中不能包含中文,空格,以及除连接符(-),下划线(一),句号(.)外的特殊字符',
暂无访问控制台功能: '暂无访问控制台功能',
'访问控制台可以让您进入应用进程的容器,查看线上运行的代码、进行在线调试以及执行一次性命令等操作。': '访问控制台可以让您进入应用进程的容器,查看线上运行的代码、进行在线调试以及执行一次性命令等操作。',
'如需使用该功能,需要:': '如需使用该功能,需要:',
'1. 安装 BCS 套餐': '1. 安装 BCS 套餐',
'2. 将应用集群来源修改为: BCS 集群': '2. 将应用集群来源修改为: BCS 集群',
};
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@
>
{{ $t('蓝鲸开发框架') }}
</li>
<li
v-if="curUserFeature.BK_LESSCODE_APP"
:class="['tab-item template', { 'active': localSourceOrigin === 2 }]"
@click="handleCodeTypeChange(2)"
>
{{ $t('蓝鲸运维开发平台') }}
</li>
</div>
</section>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,19 @@
:params="logConfig.params"
@refresh="refreshLogs"
></process-log>

<!-- 功能依赖项展示 -->
<FunctionalDependency
:show-dialog.sync="showFunctionalDependencyDialog"
mode="dialog"
:title="$t('暂无访问控制台功能')"
:functional-desc="
$t('访问控制台可以让您进入应用进程的容器,查看线上运行的代码、进行在线调试以及执行一次性命令等操作。')
"
:guide-title="$t('如需使用该功能,需要:')"
:guide-desc-list="[$t('1. 安装 BCS 套餐'), $t('2. 将应用集群来源修改为: BCS 集群')]"
@gotoMore="gotoMore"
/>
</div>
</template>

Expand All @@ -512,6 +525,7 @@ import { bus } from '@/common/bus';
import eventDetail from './event-detail.vue';
import dayjs from 'dayjs';
import processLog from '@/components/process-log-dialog/log.vue';
import FunctionalDependency from '@blueking/functional-dependency/vue2/index.umd.min.js';
moment.locale('zh-cn');
// let maxReplicasNum = 0;
Expand All @@ -526,6 +540,7 @@ export default {
scaleDialog,
eventDetail,
processLog,
FunctionalDependency,
},
mixins: [appBaseMixin, sidebarDiffMixin],
props: {
Expand Down Expand Up @@ -700,6 +715,7 @@ export default {
logs: [],
parmas: {},
},
showFunctionalDependencyDialog: false,
};
},
computed: {
Expand All @@ -725,6 +741,9 @@ export default {
const maxWidth = window.innerWidth * 0.8;
return Math.min(defaultWidth, maxWidth);
},
platformFeature() {
return this.$store.state.platformFeature;
},
},
watch: {
Expand Down Expand Up @@ -1471,6 +1490,11 @@ export default {
* @param {Object} instance, processes
*/
async showInstanceConsole(instance, processes) {
// 暂无访问控制台功能
if (!this.platformFeature.WEB_CONSOLE) {
this.showFunctionalDependencyDialog = true;
return;
}
this.processRefuseDialog.isLoading = true;
try {
const params = {
Expand Down Expand Up @@ -1643,6 +1667,11 @@ export default {
});
}
},
// 查看更多-访问控制台
gotoMore() {
window.open(this.GLOBAL.DOC.WEB_CONSOLE, '_blank');
},
},
};
</script>
Expand Down
Loading

0 comments on commit 3d9517d

Please sign in to comment.