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(frontend): sqlserver 工具箱 #3485 #6766

Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion dbm-ui/frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ module.exports = {
],
'vue/prefer-separate-static-class': 'error',
'vue/prefer-true-attribute-shorthand': 'error',
'vue/script-indent': ['error', 2, { baseIndent: 1 }],
'vue/script-indent': ['off', 2, { baseIndent: 1 }],
'vue/component-name-in-template-casing': [
'error',
'PascalCase',
Expand Down
1 change: 1 addition & 0 deletions dbm-ui/frontend/.prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"plugins": [
"prettier-plugin-curly"
],
"$schema": "https://json.schemastore.org/prettierrc",
"semi": true,
"quoteProps": "as-needed",
"jsxSingleQuote": true,
Expand Down
59 changes: 59 additions & 0 deletions dbm-ui/frontend/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"eslint.validate": ["javascript", "javascriptreact", "html", "vue"],
"eslint.alwaysShowStatus": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"editor.formatOnSave": true,
"editor.tabSize": 2,
"css.validate": false,
"stylelint.enable": true,
"scss.validate": false,
"stylelint.validate": ["css", "scss", "vue"],
"preCI.localCodeCheck.filter.whitePath": "",
"preCI.localCodeCheck.filter.skipPath": "",
"preCI.localCodeCheck.checkerSet.JS": ["standard_js"],
"peacock.remoteColor": "#45e35f",
"bk-code-ai.enable": false,
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#71ea85",
"activityBar.background": "#71ea85",
"activityBar.foreground": "#15202b",
"activityBar.inactiveForeground": "#15202b99",
"activityBarBadge.background": "#8874ea",
"activityBarBadge.foreground": "#15202b",
"commandCenter.border": "#15202b99",
"sash.hoverBorder": "#71ea85",
"statusBar.background": "#45e35f",
"statusBar.foreground": "#15202b",
"statusBarItem.hoverBackground": "#20d53e",
"statusBarItem.remoteBackground": "#45e35f",
"statusBarItem.remoteForeground": "#15202b",
"titleBar.activeBackground": "#45e35f",
"titleBar.activeForeground": "#15202b",
"titleBar.inactiveBackground": "#45e35f99",
"titleBar.inactiveForeground": "#15202b99"
}
}
1 change: 1 addition & 0 deletions dbm-ui/frontend/env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ declare module '@blueking/notice-component';
declare module '@blueking/login-modal' {
export function showLoginModal(params: { loginUrl: string }): void;
}
declare module '@blueking/sub-saas';

declare module '@blueking/sub-saas' {
export function connectToMain(router: Router): any;
Expand Down
440 changes: 220 additions & 220 deletions dbm-ui/frontend/lib/bk-icon/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.
89 changes: 45 additions & 44 deletions dbm-ui/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,82 +17,83 @@
},
"dependencies": {
"@blueking/app-select": "0.0.1-beta.12",
"@blueking/bk-weweb": "0.0.24",
"@blueking/bkflow.js": "^0.1.11",
"@blueking/date-picker": "^1.0.1",
"@blueking/bk-weweb": "0.0.26",
"@blueking/bkflow.js": "0.1.11",
"@blueking/date-picker": "1.0.1",
"@blueking/ip-selector": "0.3.0-beta.23",
"@blueking/login-modal": "^1.0.3",
"@blueking/login-modal": "1.0.3",
"@blueking/notice-component": "2.0.5",
"@blueking/sub-saas": "^0.0.0-beta.6",
"@blueking/sub-saas": "0.0.0-beta.6",
"@icon-cool/bk-icon-bk-biz-components": "0.0.4",
"@vueuse/core": "10.11.0",
"axios": "1.7.2",
"bkui-vue": "2.0.1-beta.44",
"@vueuse/core": "11.0.1",
"axios": "1.7.4",
"bkui-vue": "2.0.1-beta.63",
"date-fns": "3.6.0",
"dayjs": "1.11.11",
"dayjs": "1.11.12",
"html-to-image": "1.11.11",
"js-cookie": "3.0.5",
"jsencrypt": "3.3.2",
"lodash": "4.17.21",
"mitt": "3.0.1",
"monaco-editor": "^0.49.0",
"pinia": "2.1.7",
"qs": "^6.12.1",
"monaco-editor": "0.50.0",
"pinia": "2.2.2",
"qs": "6.13.0",
"screenfull": "6.0.2",
"tiny-pinyin": "1.3.2",
"tippy.js": "6.3.7",
"unplugin-auto-import": "^0.17.6",
"url-join": "5.0.0",
"vite-plugin-monaco-editor": "1.1.0",
"vite-plugin-static-copy": "^1.0.5",
"vue": "^3.4.29",
"vue": "3.4.27",
"vue-content-loader": "2.0.1",
"vue-i18n": "^9.13.1",
"vue-i18n": "9.14.0",
"vue-request": "2.0.4",
"vue-router": "^4.3.3",
"vue-router": "4.3.2",
"vue-types": "5.1.2",
"vuedraggable": "4.1.0",
"xlsx": "0.18.5"
},
"devDependencies": {
"@commitlint/config-conventional": "^19.2.2",
"@commitlint/config-conventional": "19.2.2",
"@trivago/prettier-plugin-sort-imports": "4.3.0",
"@types/lodash": "^4.17.5",
"@types/node": "^20.14.4",
"@types/qs": "^6.9.15",
"@vitejs/plugin-basic-ssl": "^1.1.0",
"@vitejs/plugin-vue": "^5.0.5",
"@vitejs/plugin-vue-jsx": "^4.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"@tsconfig/node20": "20.1.4",
"@types/lodash": "4.17.7",
"@types/node": "22.4.1",
"@types/qs": "6.9.15",
"@vitejs/plugin-basic-ssl": "1.1.0",
"@vitejs/plugin-vue": "5.1.2",
"@vitejs/plugin-vue-jsx": "4.0.1",
"@vue/eslint-config-typescript": "13.0.0",
"@vue/tsconfig": "0.5.1",
"commitlint": "^19.3.0",
"commitlint": "19.4.0",
"cross-env": "7.0.3",
"eslint": "8.56.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-config-tencent": "1.0.4",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-simple-import-sort": "12.0.0",
"eslint-plugin-vue": "9.18.1",
"eslint-plugin-simple-import-sort": "12.1.1",
"eslint-plugin-vue": "9.25.0",
"less": "4.2.0",
"lint-staged": "^15.2.7",
"npm-run-all2": "^6.2.0",
"postcss-html": "^1.7.0",
"lint-staged": "15.2.9",
"npm-run-all2": "6.2.2",
"postcss-html": "1.7.0",
"postcss-less": "6.0.0",
"prettier": "^3.3.2",
"prettier-plugin-curly": "^0.2.1",
"simple-git-hooks": "^2.11.1",
"stylelint": "^16.6.1",
"stylelint-config-standard": "36.0.0",
"prettier": "3.3.3",
"prettier-plugin-curly": "0.2.2",
"simple-git-hooks": "2.11.1",
"stylelint": "16.8.2",
"stylelint-config-standard": "36.0.1",
"stylelint-less": "3.0.1",
"stylelint-order": "6.0.4",
"typescript": "^5.4.5",
"unplugin-vue-components": "^0.27.0",
"vite": "^5.3.1",
"typescript": "5.5.4",
"unplugin-auto-import": "0.18.2",
"unplugin-vue-components": "0.27.4",
"vite": "5.2.11",
"vite-plugin-babel": "1.2.0",
"vite-plugin-html-env": "1.2.8",
"vite-plugin-imp": "2.4.0",
"vite-plugin-monaco-editor": "1.1.0",
"vite-plugin-static-copy": "1.0.4",
"vite-plugin-style-import": "2.0.0",
"vue-component-type-helpers": "^2.0.21",
"vue-tsc": "^2.0.21"
"vue-component-type-helpers": "2.0.29",
"vue-tsc": "2.0.29"
},
"simple-git-hooks": {
"pre-commit": "cd dbm-ui/frontend && npx lint-staged",
Expand Down
14 changes: 14 additions & 0 deletions dbm-ui/frontend/src/common/const/ticketTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,21 @@ export enum TicketTypes {
SQLSERVER_EXCEL_AUTHORIZE_RULES = 'SQLSERVER_EXCEL_AUTHORIZE_RULES', // sqlserver 导入授权
SQLSERVER_RESET = 'SQLSERVER_RESET', // sqlserver 集群重置
SQLSERVER_BACKUP_DBS = 'SQLSERVER_BACKUP_DBS', // sqlserver 数据库备份
SQLSERVER_DBRENAME = 'SQLSERVER_DBRENAME', // sqlserver 数据库重命名
SQLSERVER_DATA_MIGRATE = 'SQLSERVER_DATA_MIGRATE', // sqlserver 数据迁移
SQLSERVER_CLEAR_DBS = 'SQLSERVER_CLEAR_DBS', // sqlserver 清档
SQLSERVER_MASTER_FAIL_OVER = 'SQLSERVER_MASTER_FAIL_OVER', // sqlserver 主故障切换
SQLSERVER_MASTER_SLAVE_SWITCH = 'SQLSERVER_MASTER_SLAVE_SWITCH', // sqlserver 主从切换
SQLSERVER_ROLLBACK = 'SQLSERVER_ROLLBACK', // sqlserver 定点回档
SQLSERVER_ADD_SLAVE = 'SQLSERVER_ADD_SLAVE', // sqlserver 增加从库'
SQLSERVER_RESTORE_SLAVE = 'SQLSERVER_RESTORE_SLAVE', // sqlserver 重建从库_新机重建
SQLSERVER_RESTORE_LOCAL_SLAVE = 'SQLSERVER_RESTORE_LOCAL_SLAVE', // sqlserver 重建从库_原地重建
SQLSERVER_IMPORT_SQLFILE = 'SQLSERVER_IMPORT_SQLFILE', // sqlserver SQL变更执行'
SQLSERVER_FULL_MIGRATE = 'SQLSERVER_FULL_MIGRATE', // sqlserver 全量迁移
SQLSERVER_INCR_MIGRATE = 'SQLSERVER_INCR_MIGRATE', // sqlserver 增量迁移
SQLSERVER_BUILD_DB_SYNC = 'SQLSERVER_BUILD_DB_SYNC', // DB建立同步
}

export enum TicketTypes {
ES_APPLY = 'ES_APPLY',
ES_DISABLE = 'ES_DISABLE',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
@change="handleSearchChange" />
<BkCheckbox
v-model="isOnlyShowSelected"
@change="handleChangeOnlyShowSelected"
>{{ t('仅显示已选择') }}</BkCheckbox
>
@change="handleChangeOnlyShowSelected">
{{ t('仅显示已选择') }}
</BkCheckbox>
</div>
<BkButton
text
Expand Down Expand Up @@ -316,8 +316,8 @@
height: 730px;

.top-operate {
width: 100%;
display: flex;
width: 100%;
font-size: 12px;

.search-main {
Expand Down
65 changes: 35 additions & 30 deletions dbm-ui/frontend/src/components/apply-items/AffinityItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,43 +46,48 @@
const { AFFINITY: affinityList } = useSystemEnviron().urls;

const localValue = ref('');
const regionList = ref<{
label: string;
value: string;
}[]>([]);
const regionList = ref<
{
label: string;
value: string;
}[]
>([]);

watch(modelValue, (value) => {
localValue.value = value;
});

watch(() => [affinityList, props.cityCode], () => {
if (props.cityCode !== 'default') {
if (affinityList && affinityList.length > 0) {
regionList.value = affinityList;
if (modelValue.value) {
const index = affinityList.findIndex(affinityItem => affinityItem.value === modelValue.value);
modelValue.value = index > -1 ? modelValue.value : affinityList[0].value;
} else {
modelValue.value = affinityList[0].value;
watch(
() => [affinityList, props.cityCode],
() => {
if (props.cityCode !== 'default') {
if (affinityList && affinityList.length > 0) {
regionList.value = affinityList;
if (modelValue.value) {
const index = affinityList.findIndex((affinityItem) => affinityItem.value === modelValue.value);
modelValue.value = index > -1 ? modelValue.value : affinityList[0].value;
} else {
modelValue.value = affinityList[0].value;
}
}
} else {
regionList.value = [
{
label: t('无容灾要求'),
value: 'NONE',
},
{
label: t('跨机架部署'),
value: 'CROSS_RACK',
},
];
modelValue.value = 'NONE';
}
} else {
regionList.value = [
{
label: t('无容灾要求'),
value: 'NONE',
},
{
label: t('跨机架部署'),
value: 'CROSS_RACK',
}
];
modelValue.value = 'NONE';
}

}, {
immediate: true,
});
},
{
immediate: true,
},
);

const handleRadioChange = (value: string) => {
modelValue.value = value;
Expand Down
Loading
Loading