File tree 2 files changed +27
-1
lines changed
backend/src/service/job_manager
2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ async function listJobs(uid) {
14
14
const jobs = await getUserJobs ( uid ) ;
15
15
for ( const jobId in jobs ) {
16
16
const job = await getJob ( uid , jobId ) ;
17
+ if ( ! job ) {
18
+ continue ;
19
+ }
17
20
job . id = jobId ;
18
21
list . push ( job ) ;
19
22
}
@@ -25,7 +28,11 @@ async function getJob(uid, jobId) {
25
28
if ( ! await asyncFs . asyncFileExisted ( jobFile ) ) {
26
29
return null ;
27
30
}
28
- return JSON . parse ( await asyncFs . asyncReadFile ( jobFile ) ) ;
31
+ const fileText = await asyncFs . asyncReadFile ( jobFile ) ;
32
+ if ( fileText == "" ) {
33
+ return null ;
34
+ }
35
+ return JSON . parse ( fileText ) ;
29
36
}
30
37
31
38
async function updateJob ( uid , jobId , info ) {
Original file line number Diff line number Diff line change 102
102
</el-button >
103
103
</el-tooltip >
104
104
105
+ <el-tooltip
106
+ :content ="
107
+ globalConfig.downloadPathExisted
108
+ ? '下载到服务器'
109
+ : '下载到服务器(请先配置下载路径)'
110
+ "
111
+ placement =" top"
112
+ >
113
+ <el-button
114
+ type =" primary"
115
+ circle
116
+ @click =" downloadToLocalService(scope.row.url)"
117
+ :disabled =" !globalConfig.downloadPathExisted"
118
+ class =" operation-btn"
119
+ >
120
+ <i class =" bi bi-download" ></i >
121
+ </el-button >
122
+ </el-tooltip >
123
+
105
124
<el-tooltip content =" 在源站查看" placement =" top" >
106
125
<el-button
107
126
type =" warning"
You can’t perform that action at this time.
0 commit comments