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(desktop): add connection select when left list hide #1828

Merged
merged 1 commit into from
Dec 11, 2024
Merged
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
13 changes: 12 additions & 1 deletion src/views/connections/ConnectionsDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
</a>
</el-tooltip>
<el-tooltip
v-if="showConnectionList"
:disabled="!showTitleTooltip"
:effect="theme !== 'light' ? 'light' : 'dark'"
:content="titleName"
Expand All @@ -41,6 +42,7 @@
{{ titleName }}
</h2>
</el-tooltip>
<ConnectionSelect v-else size="mini" width="180px" @change="handleConnectionSelect" />
<a
href="javascript:;"
:class="['collapse-btn', showClientInfo ? 'top' : 'bottom']"
Expand Down Expand Up @@ -366,6 +368,7 @@ import { isLargeData } from '@/utils/data'
import { serializeAvroToBuffer, deserializeBufferToAvro } from '@/utils/avro'
import { globalEventBus } from '@/utils/globalEventBus'
import SyncTopicTreeDialog from '@/widgets/SyncTopicTreeDialog.vue'
import ConnectionSelect from '@/components/ConnectionSelect.vue'

type CommandType =
| 'searchContent'
Expand Down Expand Up @@ -401,6 +404,7 @@ interface TopModel {
MsgTip,
Copilot,
SyncTopicTreeDialog,
ConnectionSelect,
},
})
export default class ConnectionsDetail extends Vue {
Expand Down Expand Up @@ -2094,6 +2098,10 @@ export default class ConnectionsDetail extends Vue {
this.toggleShowCopilot(false)
}

private handleConnectionSelect(connectionId: string) {
this.$router.push({ path: `/recent_connections/${connectionId}` })
}

private created() {
this.getConnectionValue(this.curConnectionId)
ipcRenderer.on('searchContent', () => {
Expand Down Expand Up @@ -2146,13 +2154,16 @@ export default class ConnectionsDetail extends Vue {
color: var(--color-text-light);
}
}
.connection-select {
margin-right: 12px;
}
.icon-show-connections,
.icon-collapse {
font-size: 20px;
}
a.show-connections-button {
color: var(--color-text-title);
margin-right: 16px;
margin-right: 12px;
}
.icon-collapse {
font-weight: bold;
Expand Down