Skip to content

Commit 51bb42c

Browse files
feat: Add download task button to view current ongoing download tasks (#7995)
1 parent f18a37a commit 51bb42c

File tree

13 files changed

+125
-38
lines changed

13 files changed

+125
-38
lines changed

agent/app/api/v2/file.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ var wsUpgrade = websocket.Upgrader{
748748
},
749749
}
750750

751-
func (b *BaseApi) Ws(c *gin.Context) {
751+
func (b *BaseApi) WgetProcess(c *gin.Context) {
752752
ws, err := wsUpgrade.Upgrade(c.Writer, c.Request, nil)
753753
if err != nil {
754754
return
@@ -758,7 +758,7 @@ func (b *BaseApi) Ws(c *gin.Context) {
758758
go wsClient.Write()
759759
}
760760

761-
func (b *BaseApi) Keys(c *gin.Context) {
761+
func (b *BaseApi) ProcessKeys(c *gin.Context) {
762762
res := &response.FileProcessKeys{}
763763
keys := global.CACHE.PrefixScanKey("file-wget-")
764764
res.Keys = keys

agent/router/ro_file.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ func (f *FileRouter) InitRouter(Router *gin.RouterGroup) {
3333
fileRouter.GET("/download", baseApi.Download)
3434
fileRouter.POST("/chunkdownload", baseApi.DownloadChunkFiles)
3535
fileRouter.POST("/size", baseApi.Size)
36-
fileRouter.GET("/ws", baseApi.Ws)
37-
fileRouter.GET("/keys", baseApi.Keys)
36+
fileRouter.GET("/wget/process", baseApi.WgetProcess)
37+
fileRouter.GET("/wget/process/keys", baseApi.ProcessKeys)
3838
fileRouter.POST("/read", baseApi.ReadFileByLine)
3939
fileRouter.POST("/batch/role", baseApi.BatchChangeModeAndOwner)
4040

frontend/src/api/modules/files.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ export const computeDirSize = (params: File.DirSizeReq) => {
8585
return http.post<File.DirSizeRes>('files/size', params, TimeoutEnum.T_5M);
8686
};
8787

88-
export const fileKeys = () => {
89-
return http.get<File.FileKeys>('files/keys');
88+
export const fileWgetKeys = () => {
89+
return http.get<File.FileKeys>('files//wget/process/keys');
9090
};
9191

9292
export const getRecycleList = (params: ReqPage) => {

frontend/src/lang/modules/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,7 @@ const message = {
13921392
minimap: 'Code Mini Map',
13931393
fileCanNotRead: 'File can not read',
13941394
panelInstallDir: '1Panel installation directory cannot be deleted',
1395+
wgetTask: 'Download Task',
13951396
},
13961397
ssh: {
13971398
autoStart: 'Auto Start',

frontend/src/lang/modules/ja.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,7 @@ const message = {
13341334
minimap: 'コードミニマップ',
13351335
fileCanNotRead: 'ファイルは読み取れません',
13361336
panelInstallDir: `1Panelインストールディレクトリは削除できません`,
1337+
wgetTask: 'ダウンロードタスク',
13371338
},
13381339
ssh: {
13391340
setting: '設定',

frontend/src/lang/modules/ko.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,7 @@ const message = {
13201320
minimap: '코드 미니맵',
13211321
fileCanNotRead: '파일을 읽을 수 없습니다.',
13221322
panelInstallDir: `1Panel 설치 디렉터리는 삭제할 수 없습니다.`,
1323+
wgetTask: '다운로드 작업',
13231324
},
13241325
ssh: {
13251326
setting: '설정',

frontend/src/lang/modules/ms.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,6 +1377,7 @@ const message = {
13771377
minimap: 'Peta mini kod',
13781378
fileCanNotRead: 'Fail tidak dapat dibaca',
13791379
panelInstallDir: 'Direktori pemasangan 1Panel tidak boleh dipadamkan',
1380+
wgetTask: 'Tugas Muat Turun',
13801381
},
13811382
ssh: {
13821383
setting: 'tetapan',

frontend/src/lang/modules/pt-br.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,7 @@ const message = {
13621362
minimap: 'Mini mapa de código',
13631363
fileCanNotRead: 'O arquivo não pode ser lido',
13641364
panelInstallDir: 'O diretório de instalação do 1Panel não pode ser excluído',
1365+
wgetTask: 'Tarefa de Download',
13651366
},
13661367
ssh: {
13671368
setting: 'configuração',

frontend/src/lang/modules/ru.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,6 +1366,7 @@ const message = {
13661366
minimap: 'Мини-карта кода',
13671367
fileCanNotRead: 'Файл не может быть прочитан',
13681368
panelInstallDir: 'Директорию установки 1Panel нельзя удалить',
1369+
wgetTask: 'Задача загрузки',
13691370
},
13701371
ssh: {
13711372
setting: 'настройка',

frontend/src/lang/modules/tw.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,6 +1344,7 @@ const message = {
13441344
minimap: '縮略圖',
13451345
fileCanNotRead: '此文件不支持預覽',
13461346
panelInstallDir: '1Panel 安裝目錄不能删除',
1347+
wgetTask: '下載任務',
13471348
},
13481349
ssh: {
13491350
autoStart: '開機自啟',

0 commit comments

Comments
 (0)