Skip to content

Commit

Permalink
🐛 修复通知测试按钮&自动重连机制
Browse files Browse the repository at this point in the history
  • Loading branch information
chaos-zhu committed Dec 24, 2024
1 parent 5f0e6e9 commit 5ff7051
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
13 changes: 1 addition & 12 deletions web/src/views/setting/components/notify-config.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,30 +93,19 @@
</template>
<el-form-item label="" class="form_item">
<el-button
v-if="noticeConfig.type !== 'tg'"
type="primary"
:loading="loading"
@click="handleSave"
>
测试并保存
</el-button>
<PlusSupportTip>
<el-button
type="primary"
:disabled="!isPlusActive"
:loading="loading"
@click="handleSave"
>
测试并保存
</el-button>
</PlusSupportTip>
</el-form-item>
</el-form>
</template>

<script setup>
import { ref, reactive, onMounted, getCurrentInstance, computed } from 'vue'
import PlusSupportTip from '@/components/common/PlusSupportTip.vue'
// import PlusSupportTip from '@/components/common/PlusSupportTip.vue'
const { proxy: { $api, $notification, $store } } = getCurrentInstance()
Expand Down
6 changes: 2 additions & 4 deletions web/src/views/terminal/components/terminal-tab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ const connectIO = () => {
curStatus.value = CONNECT_FAIL
term.value.write('\r\n\x1b[91mError: 连接失败,请检查EasyNode服务端是否正常, 回车重新发起连接\x1b[0m \r\n')
$notification({
title: '连接失败',
title: '服务端连接失败',
message: '请检查EasyNode服务端是否正常',
type: 'error'
})
Expand All @@ -222,7 +222,6 @@ const reconnectTerminal = (isCommonTips = false, tips) => {
socket.value.removeAllListeners()
socket.value.close()
socket.value = null
curStatus.value = CONNECT_FAIL
socketConnected.value = false
if (isCommonTips) {
if (isPlusActive.value && autoReconnect.value) {
Expand Down Expand Up @@ -354,12 +353,11 @@ function extractLastCdPath(text) {
const onData = () => {
term.value.onData((key) => {
if (!socket.value || !socketConnected.value) return
if ('\r' === key && curStatus.value === CONNECT_FAIL) {
reconnectTerminal(false, '重新连接中...')
return
}
if (!socket.value || !socketConnected.value) return
if (isLongPressCtrl.value || isLongPressAlt.value) {
const keyCode = key.toUpperCase().charCodeAt(0)
Expand Down

0 comments on commit 5ff7051

Please sign in to comment.