-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): 工具箱支持资源池协议变更_mysql添加proxy #8076
- Loading branch information
1 parent
8f44114
commit 5d65b67
Showing
36 changed files
with
6,503 additions
and
5,510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 111 additions & 0 deletions
111
dbm-ui/frontend/src/components/editable-table/edit/Operate.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
<!-- | ||
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. | ||
* | ||
* Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License athttps://opensource.org/licenses/MIT | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for | ||
* the specific language governing permissions and limitations under the License. | ||
--> | ||
|
||
<template> | ||
<div class="action-box"> | ||
<div | ||
v-if="showAdd" | ||
class="action-btn" | ||
@click="handleAppend"> | ||
<DbIcon type="plus-fill" /> | ||
</div> | ||
<div | ||
v-if="showRemove" | ||
class="action-btn" | ||
:class="{ | ||
disabled: removeable, | ||
}" | ||
@click="handleRemove"> | ||
<DbIcon type="minus-fill" /> | ||
</div> | ||
<div | ||
v-if="showClone" | ||
v-bk-tooltips="t('克隆')" | ||
class="action-btn" | ||
@click="handleClone"> | ||
<DbIcon type="copy-2" /> | ||
</div> | ||
</div> | ||
</template> | ||
<script setup lang="ts"> | ||
import { useI18n } from 'vue-i18n'; | ||
|
||
interface Props { | ||
showAdd?: boolean; | ||
showRemove?: boolean; | ||
removeable?: boolean; | ||
showClone?: boolean; | ||
} | ||
|
||
interface Emits { | ||
(e: 'add'): void; | ||
(e: 'remove'): void; | ||
(e: 'clone'): void; | ||
} | ||
|
||
const props = withDefaults(defineProps<Props>(), { | ||
showAdd: true, | ||
showRemove: true, | ||
removeable: true, | ||
showClone: false, | ||
}); | ||
|
||
const emits = defineEmits<Emits>(); | ||
|
||
const { t } = useI18n(); | ||
|
||
const handleAppend = () => { | ||
emits('add'); | ||
}; | ||
|
||
const handleRemove = () => { | ||
if (props.removeable) { | ||
return; | ||
} | ||
emits('remove'); | ||
}; | ||
|
||
const handleClone = () => { | ||
emits('clone'); | ||
}; | ||
</script> | ||
<style lang="less" scoped> | ||
.action-box { | ||
display: flex; | ||
height: 42px; | ||
padding: 0 16px; | ||
align-items: center; | ||
background-color: #fff; | ||
|
||
.action-btn { | ||
display: flex; | ||
font-size: 14px; | ||
color: #c4c6cc; | ||
cursor: pointer; | ||
transition: all 0.15s; | ||
|
||
&:hover { | ||
color: #979ba5; | ||
} | ||
|
||
&.disabled { | ||
color: #dcdee5; | ||
cursor: not-allowed; | ||
} | ||
|
||
& ~ .action-btn { | ||
margin-left: 12px; | ||
} | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { createTicket } from '@services/source/ticket'; | ||
|
||
import type { TicketTypes } from '@common/const'; | ||
|
||
export function useCreateTicket<T>(ticketType: TicketTypes) { | ||
const loading = ref(false); | ||
const router = useRouter(); | ||
|
||
const run = async (details: T, remark = '') => { | ||
loading.value = true; | ||
const { id } = await createTicket<T>({ | ||
ticket_type: ticketType, | ||
bk_biz_id: window.PROJECT_CONFIG.BIZ_ID, | ||
details, | ||
remark, | ||
ignore_duplication: true, | ||
}); | ||
loading.value = false; | ||
router.push({ | ||
name: ticketType, | ||
params: { | ||
page: 'success', | ||
}, | ||
query: { | ||
ticketId: id, | ||
}, | ||
}); | ||
}; | ||
|
||
return { | ||
run, | ||
loading, | ||
}; | ||
} |
Oops, something went wrong.