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(copilot): add preset prompt actions #1513

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fix(copilot): fix the z-index issue
  • Loading branch information
ysfscream committed Dec 7, 2023
commit 6b9a4daf09a5594c3e5771095f357a6e472f6ea2
5 changes: 3 additions & 2 deletions src/components/Copilot.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<template>
<div class="right-panel">
<a @click="toggleWindow" href="javascript:;"><i class="el-icon-chat-line-square"></i></a>
<transition name="pop">
<el-card v-show="showCopilot" class="copilot" shadow="never">
<div slot="header" class="clearfix">
Expand Down Expand Up @@ -461,7 +460,9 @@ body.night {
.el-button--text {
padding: 0;
i {
font-size: 16px !important;
font-size: 16px;
color: var(--color-text-title);
font-weight: 400;
}
}
}
Expand Down
1 change: 0 additions & 1 deletion src/components/MsgPublish.vue
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,6 @@ export default class MsgPublish extends Vue {
position: absolute;
transform: translate(0, -100%);
width: 100%;
z-index: 11;
.el-card.meta-card {
padding: 10px;
padding-bottom: 0px;
Expand Down
2 changes: 1 addition & 1 deletion src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default class Home extends Vue {
position: fixed;
left: 341px;
right: 0;
z-index: 3;
z-index: 2;
background: var(--color-bg-normal);
}
.rightbar {
Expand Down
14 changes: 11 additions & 3 deletions src/views/connections/ConnectionsDetail.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div class="connections-detail">
<copilot ref="copilot" :record="record" mode="connections" />
<div ref="connectionTopbar" class="connections-topbar right-topbar">
<div class="connections-info">
<div class="topbar">
Expand Down Expand Up @@ -86,7 +87,9 @@
<i class="iconfont icon-a-stopscrip"></i>
</a>
</el-tooltip>
<copilot ref="copilot" style="margin-right: 12px" :record="record" mode="connections" />
<a href="javascript:;" @click="showCopilotPanel" style="margin-right: 12px"
><i class="el-icon-chat-line-square"></i
></a>
<template v-if="!isNewWindow">
<el-tooltip
placement="bottom"
Expand Down Expand Up @@ -1806,9 +1809,14 @@ export default class ConnectionsDetail extends Vue {
* @param askMsg The question to ask Copilot.
*/
private askCopilot(askMsg: string) {
const copilotRef = this.showCopilotPanel()
copilotRef.sendMessage(askMsg)
}

private showCopilotPanel() {
const copilotRef: Copilot = this.$refs.copilot as Copilot
copilotRef.showCopilot = true
copilotRef.sendMessage(askMsg)
return copilotRef
}

private created() {
Expand Down Expand Up @@ -2000,7 +2008,7 @@ export default class ConnectionsDetail extends Vue {
bottom: 0;
left: 0;
right: 0;
z-index: 2;
z-index: 3;
}
}
}
Expand Down