Skip to content

Commit

Permalink
feat: webfe support normal app autoscaling (#468)
Browse files Browse the repository at this point in the history
Co-authored-by: jiayuan929 <[email protected]>
Co-authored-by: schnee <[email protected]>
  • Loading branch information
3 people authored May 26, 2023
1 parent 7bd3ed8 commit feba1e5
Show file tree
Hide file tree
Showing 14 changed files with 504 additions and 210 deletions.
3 changes: 3 additions & 0 deletions webfe/package_vue/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ module.exports = {
$: true,
BACKEND_URL: true,
},
rule: {
// 'linebreak-style': ['error', 'windows'], // 回车符使用windows风格(CRLF),默认是LF:使用mac风格
},
};
10 changes: 10 additions & 0 deletions webfe/package_vue/src/assets/iconfont/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ <h2 class="page-title">
<span class="icon paasng-icon paasng-edit-2"></span>
<p class="icon-text">edit-2</p>
</li>
<li class="icon-item" title="process-file">
<span class="icon paasng-icon paasng-process-file"></span>
<p class="icon-text">process-file</p>
</li>
<li class="icon-item" title="bukeyulan">
<span class="icon paasng-icon paasng-bukeyulan"></span>
<p class="icon-text">bukeyulan</p>
Expand Down Expand Up @@ -1400,6 +1404,12 @@ <h3 class="describe-title">如何使用</h3>
</svg>
<p class="icon-text">edit-2</p>
</li>
<li class="colorful-icon">
<svg class="icon svg-icon">
<use xlink:href="#paasng-process-file"></use>
</svg>
<p class="icon-text">process-file</p>
</li>
<li class="colorful-icon">
<svg class="icon svg-icon">
<use xlink:href="#paasng-bukeyulan"></use>
Expand Down
Binary file modified webfe/package_vue/src/assets/iconfont/fonts/iconcool.eot
Binary file not shown.
3 changes: 3 additions & 0 deletions webfe/package_vue/src/assets/iconfont/fonts/iconcool.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified webfe/package_vue/src/assets/iconfont/fonts/iconcool.ttf
Binary file not shown.
Binary file modified webfe/package_vue/src/assets/iconfont/fonts/iconcool.woff
Binary file not shown.
2 changes: 1 addition & 1 deletion webfe/package_vue/src/assets/iconfont/iconcool.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion webfe/package_vue/src/assets/iconfont/iconcool.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions webfe/package_vue/src/assets/iconfont/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype");
.paasng-edit-2:before {
content: "\e23f";
}
.paasng-process-file:before {
content: "\e24e";
}
.paasng-bukeyulan:before {
content: "\e21c";
}
Expand Down
34 changes: 8 additions & 26 deletions webfe/package_vue/src/components/paas-cloud-app-nav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ export default {
'appCloudAPI',
// 镜像凭证
'imageCredential',
// 数据统计
'appAnalysis',
// 应用推广
'appMarketing',
// 基本设置
Expand Down Expand Up @@ -136,6 +138,8 @@ export default {
'appCloudAPI',
// 镜像凭证
'imageCredential',
// 数据统计
'appAnalysis',
// 应用推广
'appMarketing',
// 基本设置
Expand All @@ -144,32 +148,10 @@ export default {
'docuManagement',
],
operator: [
// 概览
'appSummary',
// 应用编排
'cloudAppDeploy',
// 应用编排 - 进程配置
'cloudAppDeployForProcess',
// 应用编排 - 钩子命令
'cloudAppDeployForHook',
// 应用编排 - 环境变量
'cloudAppDeployForEnv',
// 应用编排 - 依赖资源
'cloudAppDeployForResource',
// 应用编排 - YAML
'cloudAppDeployForYaml',
// 部署状态
'appStatus',
// 日志查询
'appLog',
// 访问入口
'appAccessPortal',
// 增强服务
'appServices',
// 云 API 管理
'appCloudAPI',
// 镜像凭证
'imageCredential',
// 权限管理
'appPermissions',
// 数据统计
'appAnalysis',
// 应用推广
'appMarketing',
// 基本设置
Expand Down
11 changes: 10 additions & 1 deletion webfe/package_vue/src/language/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -2149,5 +2149,14 @@ export default {
最近半年: 'Last 6 months',
'质量评价依照腾讯开源治理指标体系 (其中文档质量暂按100分计算), 评分仅供参考。': 'The quality evaluation is based on Tencent open source governance index system (the document quality is temporarily calculated as 100 points), and the scoring is for reference only.',
'确认下架插件【{id}】?': 'Confirm the removal of the plug-in [{id}]?',
请输入用户: 'Please enter user',
自动扩缩容: 'Automatic scaling',
web进程扩缩容: 'Web process expansion and contraction',
扩缩容: 'expansion and contraction',
手动调节: 'manual adjustment',
自动调节: 'automatic adjustment',
'CPU 使用率': 'CPU usage',
: 'when',
扩容上限: 'Expansion limit',
缩容下限: 'Shrink limit',
请输入用户: 'Please enter user'
};
11 changes: 10 additions & 1 deletion webfe/package_vue/src/language/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -2149,5 +2149,14 @@ export default {
'确认删除应用【{name}】?': '确认删除应用【{name}】?',
最近半年: '最近半年',
'确认下架插件【{id}】?': '确认下架插件【{id}】?',
请输入用户: '请输入用户',
自动扩缩容: '自动扩缩容',
web进程扩缩容: 'web进程扩缩容',
扩缩容: '扩缩容',
手动调节: '手动调节',
自动调节: '自动调节',
'CPU 使用率': 'CPU 使用率',
: '当',
扩容上限: '扩容上限',
缩容下限: '缩容下限',
请输入用户: '请输入用户'
};
11 changes: 10 additions & 1 deletion webfe/package_vue/src/store/modules/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,16 @@ const actions = {
console.log('BACKEND_URL', moduleId, env);
const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/modules/${moduleId}/envs/${env}/manifest_ext/`;
return http.get(url, config);
}
},

/**
* 获取进程是否开启自动扩缩容
* @param {Object} params 请求参数:appCode, moduleId, env
*/
getAutoScalFlagWithEnv ({ commit, state }, { appCode, moduleId, env }, config = {}) {
const url = `${BACKEND_URL}/api/bkapps/applications/feature_flags/${appCode}/modules/${moduleId}/env/${env}/`;
return http.get(url, config);
}
};

export default {
Expand Down
Loading

0 comments on commit feba1e5

Please sign in to comment.