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

perf: 移除右侧栏的按钮,通过 luna 控制 #1281

Merged
merged 2 commits into from
Jan 19, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ui/src/components/RightPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
>
<div class="background" />
<div class="right-panel">
<div ref="dragDiv" class="handle-button">
<i :class="show ? 'el-icon-close':'el-icon-setting'" />
</div>
<div class="right-panel-items">
<slot />
</div>
Expand Down Expand Up @@ -45,7 +42,7 @@ export default {
}
},
mounted() {
this.init()
// this.init()
this.insertToBody()
},
beforeDestroy() {
Expand Down Expand Up @@ -107,6 +104,9 @@ export default {
const element = this.$refs.container
const body = document.querySelector('body')
body.insertBefore(element, body.firstChild)
},
toggle() {
this.show = !this.show
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions ui/src/components/Terminal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@ export default {
this.term.focus()
}
break
case 'OPEN':
this.$emit("event", "open", this.terminalId)
break
}
console.log('KoKo got post message: ', msg)
},
Expand Down
6 changes: 5 additions & 1 deletion ui/src/views/Connection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
v-on:event="onEvent"
v-on:ws-data="onWsData"></Terminal>
</el-main>
<RightPanel>
<RightPanel ref="panel">
<Settings :settings="settings" :title="$t('Terminal.Settings')"/>
</RightPanel>

Expand Down Expand Up @@ -386,6 +386,10 @@ export default {
})
this.$log.debug("reconnect: ", data);
break
case 'open':
this.$log.debug("open: ", data);
this.$refs.panel.toggle()
break
}
},
getMinuteLabel(item) {
Expand Down
11 changes: 10 additions & 1 deletion ui/src/views/ShareTerminal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
<el-main>
<Terminal v-if="!codeDialog" ref='term' v-bind:connectURL="wsURL" v-bind:shareCode="shareCode"
v-on:background-color="onThemeBackground"
v-on:event="onEvent"
v-on:ws-data="onWsData"></Terminal>
</el-main>

<RightPanel>
<RightPanel ref="panel">
<Settings :settings="settings" :title="$t('Terminal.Settings')" />
</RightPanel>

Expand Down Expand Up @@ -197,6 +198,14 @@ export default {
this.themeBackground = themeColors.background;
}
this.$log.debug(val);
},
onEvent(event, data) {
switch (event) {
case 'open':
this.$log.debug("open: ", data);
this.$refs.panel.toggle()
break
}
}
},

Expand Down