fix: 解决进程搜索为空一直转圈的问题 (#1526)

This commit is contained in:
zhengkunwang223 2023-07-04 11:38:10 +08:00 committed by GitHub
parent e507611cad
commit 24e6fe89c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 9 deletions

View File

@ -532,7 +532,7 @@ func (b *BaseApi) DownloadChunkFiles(c *gin.Context) {
}
defer file.Close()
file.Seek(startPos, 0)
_, _ = file.Seek(startPos, 0)
reader := io.LimitReader(file, endPos-startPos+1)
_, err = io.CopyBuffer(c.Writer, reader, buffer)
if err != nil {

View File

@ -55,13 +55,7 @@
</el-row>
</template>
<template #main>
<ComplexTable
:data="data"
@sort-change="changeSort"
@filter-change="changeFilter"
ref="tableRef"
v-loading="data.length === 0"
>
<ComplexTable :data="data" @sort-change="changeSort" @filter-change="changeFilter" ref="tableRef">
<el-table-column :label="'PID'" fix prop="PID" max-width="60px" sortable></el-table-column>
<el-table-column
:label="$t('commons.table.name')"
@ -225,6 +219,7 @@ const onMessage = (message: any) => {
oldData.value = result;
data.value = filterByStatus();
sortTable();
loading.value = false;
};
const filterByStatus = () => {
@ -258,6 +253,8 @@ const initProcess = () => {
processSocket.onmessage = onMessage;
processSocket.onerror = onerror;
processSocket.onclose = onClose;
loading.value = true;
search();
sendMsg();
};

View File

@ -25,7 +25,6 @@
</template>
<template #main>
<ComplexTable :data="data" ref="tableRef" v-loading="loading">
<el-table-column :label="$t('commons.table.user')" fix prop="PID"></el-table-column>
<el-table-column :label="$t('commons.table.user')" fix prop="username"></el-table-column>
<el-table-column :label="'PTS'" fix prop="terminal"></el-table-column>
<el-table-column :label="$t('ssh.loginIP')" fix prop="host"></el-table-column>