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=120091273 (#2936)
  feat: 键值型(KV)新增“文件批量导入”功能--story=115743850 (#2926)
  feat:helmctl 添加上传 chart 的命令 (#2906)
  fix:workload 创建和启动时间时区问题修复 (#2928)
  chore: 前端构建优化 (#2932)
  • Loading branch information
wenxinlee2015 committed Jan 31, 2024
2 parents f6f0d7f + d197f92 commit 5006e27
Show file tree
Hide file tree
Showing 228 changed files with 22,307 additions and 21,537 deletions.
8 changes: 4 additions & 4 deletions bcs-services/bcs-bscp/ui/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
root = true

[*.{js,jsx,ts,tsx,vue}]
intent_style = space
indent = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true # 不保留行末的空格
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true # 不保留行末的空格
54 changes: 40 additions & 14 deletions bcs-services/bcs-bscp/ui/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,11 @@
/**
* 要求箭头函数体使用大括号
*/
"arrow-body-style": ["warn", "as-needed"],
"arrow-body-style": ["off", "as-needed"],
/**
* 要求箭头函数的参数使用圆括号
*/
"arrow-parens": [
"warn",
"as-needed",
{
"requireForBlockBody": true
}
],
"arrow-parens": ["warn", "always"],
/**
* 强制箭头函数的箭头前后使用一致的空格
*/
Expand Down Expand Up @@ -103,7 +97,7 @@
/**
* 强制在函数括号内使用一致的换行
*/
"function-paren-newline": ["warn", "multiline"],
"function-paren-newline": "off",
/**
* 强制 generator 函数中 * 号周围使用一致的空格
*/
Expand All @@ -121,7 +115,7 @@
/**
* 强制隐式返回的箭头函数体的位置
*/
"implicit-arrow-linebreak": ["warn", "beside"],
"implicit-arrow-linebreak": "off",
/**
* 使用 2 个空格缩进
*/
Expand Down Expand Up @@ -208,7 +202,8 @@
"ignoreStrings": true,
"ignoreUrls": true,
"ignoreRegExpLiterals": true,
"ignoreTemplateLiterals": true
"ignoreTemplateLiterals": true,
"ignoreComments": true
}
],
/**
Expand All @@ -221,7 +216,7 @@
* 在编写多个方法链式调用(超过两个方法链式调用)时。 使用前导点,强调这行是一个方法调用,而不是一个语句。
*/
"newline-per-chained-call": [
"warn",
"off",
{
"ignoreChainWithDepth": 2
}
Expand Down Expand Up @@ -391,7 +386,6 @@
* 禁止变量申明时用逗号一次申明多个
*/
"one-var": ["warn", "never"],

/**
* 要求或禁止块内填充
*/
Expand Down Expand Up @@ -700,8 +694,40 @@
"vue/no-multiple-template-root": "off",
"vue/no-v-for-template-key": "off",
"vue/no-useless-template-attributes": "off",
"vue/no-deprecated-slot-attribute": "off"
"vue/no-deprecated-slot-attribute": "off",
"vue/attribute-hyphenation": ["error", "always"],
"vue/html-closing-bracket-newline": [
"error",
{
"singleline": "never",
"multiline": "never"
}
],
"vue/first-attribute-linebreak": [
"error",
{
"singleline": "ignore",
"multiline": "below"
}
],
"vue/script-indent": [
"error",
2,
{
"baseIndent": 1,
"switchCase": 1,
"ignores": []
}
]
},
"overrides": [
{
"files": ["*.vue"],
"rules": {
"indent": "off"
}
}
],
"settings": {
"import/resolver": {
"node": {
Expand Down
4 changes: 4 additions & 0 deletions bcs-services/bcs-bscp/ui/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 忽略国际化文件

src/i18n/en-us.ts
src/i18n/zh-cn.ts
17 changes: 13 additions & 4 deletions bcs-services/bcs-bscp/ui/.prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
{
"singleQuote": true,
"useTabs": false,
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"trailingComma": "es5"
}
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"arrowParens": "always",
"bracketSpacing": true,
"bracketSameLine": true,
"vueIndentScriptAndStyle": true,
"endOfLine": "lf",
"singleAttributePerLine": false,
"htmlWhitespaceSensitivity": "css"
}
10 changes: 7 additions & 3 deletions bcs-services/bcs-bscp/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"scripts": {
"dev": "vite --force",
"build": "vue-tsc --noEmit && vite build",
"preview": "vite preview"
"preview": "vite preview",
"format": "npx prettier ./ --write",
"lint": "npx eslint \"./src/**/*.{js,vue,ts}\""
},
"dependencies": {
"@blueking/notice-component": "^2.0.1",
Expand All @@ -19,6 +21,7 @@
"highlight.js": "~11.5.0",
"js-cookie": "^3.0.1",
"js-yaml": "^4.1.0",
"jszip": "^3.10.1",
"markdown-it": "^13.0.1",
"monaco-editor": "^0.34.1",
"pinia": "^2.0.33",
Expand All @@ -32,8 +35,8 @@
"@babel/eslint-parser": "^7.22.15",
"@blueking/eslint-config": "^1.0.6",
"@types/axios": "^0.14.0",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitejs/plugin-basic-ssl": "^1.0.1",
"@vitejs/plugin-vue": "^3.0.3",
"eslint": "^8.23.0",
Expand All @@ -42,6 +45,7 @@
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-vue": "^9.4.0",
"prettier": "^3.0.3",
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "^4.6.4",
"vite": "^3.0.7",
"vite-plugin-compression": "^0.5.1",
Expand Down
68 changes: 34 additions & 34 deletions bcs-services/bcs-bscp/ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,45 @@
</template>

<script setup lang="ts">
import { watch } from 'vue';
import { storeToRefs } from 'pinia';
import useGlobalStore from './store/global';
import useUserStore from './store/user';
import isCrossOriginIFrame from './utils/is-cross-origin-iframe';
import NoticeComponent from '@blueking/notice-component'
import '@blueking/notice-component/dist/style.css'
import Header from './components/head.vue';
import PermissionDialog from './components/permission/apply-dialog.vue';
import { watch } from 'vue';
import { storeToRefs } from 'pinia';
import useGlobalStore from './store/global';
import useUserStore from './store/user';
import isCrossOriginIFrame from './utils/is-cross-origin-iframe';
import NoticeComponent from '@blueking/notice-component';
import '@blueking/notice-component/dist/style.css';
import Header from './components/head.vue';
import PermissionDialog from './components/permission/apply-dialog.vue';
const userStore = useUserStore();
const globalStore = useGlobalStore();
const { showLoginModal } = storeToRefs(userStore);
const { showApplyPermDialog, showNotice } = storeToRefs(globalStore);
const userStore = useUserStore();
const globalStore = useGlobalStore();
const { showLoginModal } = storeToRefs(userStore);
const { showApplyPermDialog, showNotice } = storeToRefs(globalStore);
// @ts-ignore
const noticeApiURL = `${window.BK_BCS_BSCP_API}/api/v1/announcements`
// @ts-ignore
const noticeApiURL = `${window.BK_BCS_BSCP_API}/api/v1/announcements`;
watch(
() => showLoginModal.value,
(val) => {
if (val) {
const topWindow = isCrossOriginIFrame() ? window : window.top;
// @ts-ignore
topWindow.BLUEKING.corefunc.open_login_dialog(userStore.loginUrl);
}
},
);
watch(
() => showLoginModal.value,
(val) => {
if (val) {
const topWindow = isCrossOriginIFrame() ? window : window.top;
// @ts-ignore
topWindow.BLUEKING.corefunc.open_login_dialog(userStore.loginUrl);
}
},
);
</script>

<style scoped lang="scss">
.page-content-container {
min-width: 1366px;
overflow: auto;
}
.content {
height: calc(100vh - 52px);
&.show-notice {
height: calc(100vh - 92px);
.page-content-container {
min-width: 1366px;
overflow: auto;
}
.content {
height: calc(100vh - 52px);
&.show-notice {
height: calc(100vh - 92px);
}
}
}
</style>

0 comments on commit 5006e27

Please sign in to comment.