Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 添加文件上传大小环境变量 #1366

Merged
merged 1 commit into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion webfe/package_vue/.bk.production.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ BK_ANALYSIS_JS = '\$BK_ANALYSIS_JS'

BK_PAAS_VERSION = '\$BK_PAAS_VERSION'

BK_PAAS_BUILD_VERSION = '\$BKPAAS_BUILD_VERSION'
BK_PAAS_BUILD_VERSION = '\$BKPAAS_BUILD_VERSION'

BK_MAX_PACKAGE_SIZE = '\$BK_MAX_PACKAGE_SIZE'
1 change: 1 addition & 0 deletions webfe/package_vue/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
USERS_URL: `<%= process.env.BK_COMPONENT_API_URL %>/api/c/compapi/v2/usermanage/fs_list_users/` || '',
}
var BKPAAS_BUILD_VERSION = decodeURIComponent('<%= process.env.BK_PAAS_BUILD_VERSION %>' || '')
var BK_MAX_PACKAGE_SIZE = '<%= process.env.BK_MAX_PACKAGE_SIZE %>' || ''

// 控制台输出版本信息
if (BKPAAS_BUILD_VERSION !== '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
:key="renderUploaderIndex"
:validate-name="fileReg"
:action="uploadUrl"
:max-size="maxPackageSize"
:with-credentials="true"
:name="'package'"
:accept-tips="$t('仅支持蓝鲸 S-mart 包,可以从“蓝鲸 S-mart”获取,上传成功后即可进行应用部署 仅支持 .tar 或 .tar.gz 格式的文件')"
Expand Down Expand Up @@ -302,6 +303,9 @@ export default {
isSmartApp() {
return this.curAppInfo.application?.is_smart_app;
},
maxPackageSize() {
return window.BK_MAX_PACKAGE_SIZE || 500;
},
},
watch: {
'$route'() {
Expand Down
4 changes: 4 additions & 0 deletions webfe/package_vue/src/views/dev-center/create-app/smart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
:validate-name="/^[a-zA-Z0-9-_. ]+$/"
:with-credentials="true"
:name="'package'"
:max-size="maxPackageSize"
:accept-tips="$t('仅支持蓝鲸 S-mart 包,可以从“蓝鲸 S-mart”获取,上传成功后即可进行应用部署 仅支持 .tar 或 .tar.gz 格式的文件')"
:headers="uploadHeader"
:on-upload-success="handleSuccess"
Expand Down Expand Up @@ -207,6 +208,9 @@ export default {
uploadUrl() {
return `${BACKEND_URL}/api/bkapps/s-mart/`;
},
maxPackageSize() {
return window.BK_MAX_PACKAGE_SIZE || 500;
},
},
methods: {
handleSuccess(res) {
Expand Down
1 change: 1 addition & 0 deletions webfe/package_vue/static/runtime/runtime.ce.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var BK_LESSCODE_URL = process.env.BK_LESSCODE_URL || '' // 用于拼接 lesscode
var BK_COMPONENT_API_URL = process.env.BK_COMPONENT_API_URL || '' // 蓝鲸组件API地址,目前值跟 v2 开发者中心一致,内部版本不用填
var BK_ANALYSIS_JS = process.env.BK_ANALYSIS_JS || '' //上报js 内部版需要 外部版不需要
var BK_PAAS_VERSION = process.env.BK_PAAS_VERSION || ''
var BK_MAX_PACKAGE_SIZE = process.env.BK_MAX_PACKAGE_SIZE || ''

var BACKEND_URL = `${SITE_URL}/backend` // 后端接口前缀
var DOCS_URL_PREFIX = `${BK_DOCS_URL_PREFIX}/markdown/PaaS/DevelopTools/BaseGuide`
Expand Down
1 change: 1 addition & 0 deletions webfe/package_vue/static/runtime/runtime.ee.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var BK_LESSCODE_URL = process.env.BK_LESSCODE_URL || '' // 用于拼接 lesscode
var BK_COMPONENT_API_URL = process.env.BK_COMPONENT_API_URL || '' // 蓝鲸组件API地址,目前值跟 v2 开发者中心一致,内部版本不用填
var BK_ANALYSIS_JS = process.env.BK_ANALYSIS_JS || '' //上报js 内部版需要 外部版不需要
var BK_PAAS_VERSION = process.env.BK_PAAS_VERSION || ''
var BK_MAX_PACKAGE_SIZE = process.env.BK_MAX_PACKAGE_SIZE || ''

var BACKEND_URL = `${SITE_URL}/backend` // 后端接口前缀
var DOCS_URL_PREFIX = `${BK_DOCS_URL_PREFIX}/markdown/PaaS/DevelopTools/BaseGuide`
Expand Down