!245 i18n: pages/file-manager

Merge pull request !245 from a20070322/task/i18n
This commit is contained in:
蒋小小 2024-05-06 08:41:09 +00:00 committed by Gitee
commit fa29b6534b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
25 changed files with 1110 additions and 287 deletions

View File

@ -13,12 +13,14 @@ import build from './pages/build'
import certificate from './pages/certificate'
import dispatch from './pages/dispatch'
import docker from './pages/docker'
import fileManager from './pages/file-manager'
export default {
pages: {
404: page404,
build,
certificate,
dispatch,
docker
docker,
fileManager
}
}

View File

@ -0,0 +1,7 @@
import list from './list'
import releaseFile from './releaseFile'
export default {
list,
releaseFile
}

View File

@ -0,0 +1,167 @@
export default {
c: {
aliasCode: 'Alias Code',
uploadFile: 'Upload File',
fileName: 'File Name:',
unknown: 'Unknown',
global: 'Global',
selectFile: 'Select File',
retentionDays: 'Retention Days',
fileSaveDays: 'File Save Days, Default 3650 Days',
fileShare: 'File Share',
currentWorkspace: 'Current Workspace',
fileType:
'Used to distinguish whether files are of the same type, and can be downloaded and managed for the same type',
enterAliasCode: 'Please Enter Alias Code',
randomGenerate: 'Randomly Generate',
fileDescription: 'File Description',
enterFileDescription: 'Please Enter File Description',
downloadAddress: 'Download Address',
copyByClick: 'Click to Copy',
immediateDownload: 'Immediate Download',
cancel: 'Cancel',
systemPrompt: 'System Prompt',
confirm: 'Confirm',
pleaseSelectFile: 'Please Select a File to Use',
aliasCode_1: 'Alias Code',
uploadFile_1: 'Upload File',
fileName_1: 'File Name:',
unknown_1: 'Unknown',
global_1: 'Global',
selectFile_1: 'Select File',
retentionDays_1: 'Retention Days',
fileSaveDays_1: 'File Save Days, Default 3650 Days',
fileShare_1: 'File Share',
currentWorkspace_1: 'Current Workspace',
fileType_1:
'Used to distinguish whether files are of the same type, and can be downloaded and managed for the same type',
enterAliasCode_1: 'Please Enter Alias Code',
randomGenerate_1: 'Random Generate',
fileDescription_1: 'File Description',
enterFileDescription_1: 'Please Enter File Description',
downloadAddress_1: 'Download Address',
copyByClick_1: 'Click to Copy',
immediateDownload_1: 'Immediate Download',
cancel_1: 'Cancel',
systemPrompt_1: 'System Prompt',
confirm_1: 'Confirm',
pleaseSelectFile_1: 'Please Select a File to Use'
},
p: {
fileName: 'File Name',
suffix: 'Suffix, Precise Search',
fileId: 'File ID, Precise Search',
quickBackToFirstPage: 'Hold Ctrl or Alt/Option and click the button to quickly return to the first page',
search: 'Search',
remoteDownload: 'Remote Download',
batchDelete: 'Batch Delete',
fileInfo: 'File Info',
fileDescription: 'File Description:',
downloadStatus: 'Download Status:',
statusDescription: 'Status Description:',
exist: 'Exist',
lost: 'Lost',
workspace: 'Workspace',
download: 'Download',
release: 'Release',
delete: 'Delete',
usageTime: 'Usage Time',
modifyFile: 'Modify File',
remoteDownloadFile: 'Remote Download File',
remoteDownloadUrl: 'Remote Download URL',
remoteDownloadAddress: 'Remote Download Address',
resumableDownload: 'Resumable/Chunked Download',
resetDownloadToken:
'Reset Download Token Information. After resetting, the previous download token will be invalid',
reset: 'Reset',
resumableSingleFileDownload: 'Resumable/Chunked Single File Download',
resumableAliasDownload: 'Resumable/Chunked Alias Download',
warmPrompt: 'Warm Prompt',
customSortField: 'Supports custom sorting fields: sort',
sortDesc: 'Description is sorted in ascending order based on creation time',
supportedFields: 'Supported fields can be viewed through the interface response',
commonFields: 'Common fields include: createTimeMillis, modifyTimeMillis',
releaseFile: 'Release File',
confirm: 'Confirm',
fileMD5: 'File MD5',
name: 'Name',
size: 'Size',
contentSuffix: 'Suffix',
shared: 'Shared',
source: 'Source',
expireDays: 'Expire Days',
fileStatus: 'File Status',
creator: 'Creator',
modifier: 'Modifier',
creationTime: 'Creation Time',
modificationTime: 'Modification Time',
operation: 'Operation',
pleaseEnterFileName: 'Please Enter File Name',
pleaseEnterRemoteAddress: 'Please Enter Remote Address',
pleaseSelectFile: 'Please Select a File',
fileAlreadyExists: 'The current file already exists',
isShared: 'Is Shared:',
yes: 'Yes',
no: 'No',
reallyDeleteCurrentFile: 'Are you sure you want to delete the current file?',
noDataSelected: 'No data selected',
reallyDeleteTheseFiles: 'Are you sure you want to delete these files?',
fileName_1: 'File Name',
suffix_1: 'Suffix, Precise Search',
fileId_1: 'File ID, Precise Search',
quickBackToFirstPage_1: 'Hold Ctrl or Alt/Option Key to Quickly Return to the First Page',
search_1: 'Search',
remoteDownload_1: 'Remote Download',
batchDelete_1: 'Batch Delete',
fileInfo_1: 'File Info',
fileDescription_1: 'File Description:',
downloadStatus_1: 'Download Status:',
statusDescription_1: 'Status Description:',
exist_1: 'Exist',
lost_1: 'Lost',
workspace_1: 'Workspace',
download_1: 'Download',
release_1: 'Release',
delete_1: 'Delete',
usageTime_1: 'Usage Time',
modifyFile_1: 'Modify File',
remoteDownloadFile_1: 'Remote Download File',
remoteDownloadUrl_1: 'Remote Download URL',
remoteDownloadAddress_1: 'Remote Download Address',
resumableDownload_1: 'Resumable/Chunked Download',
resetDownloadToken_1: 'Reset Download Token Information, Previous Download Tokens Will Be Invalidated',
reset_1: 'Reset',
resumableSingleFileDownload_1: 'Resumable/Chunked Single File Download',
resumableAliasDownload_1: 'Resumable/Chunked Alias Download',
warmPrompt_1: 'Warm Prompt',
customSortField_1: 'Supports Custom Sorting Fields: sort',
sortDesc_1: 'The First One Is Sorted Ascending Based on Creation Time',
supportedFields_1: 'Supported Fields Can Be Viewed Through the Returned Interface',
commonFields_1: 'Common Fields Include: createTimeMillis, modifyTimeMillis',
releaseFile_1: 'Release File',
confirm_1: 'Confirm',
fileMD5_6: 'File MD5',
name_1: 'Name',
size_1: 'Size',
contentSuffix_1: 'Suffix',
shared_1: 'Shared',
source_1: 'Source',
expireDays_1: 'Expiration Days',
fileStatus_1: 'File Status',
creator_1: 'Creator',
modifier_1: 'Modifier',
creationTime_1: 'Creation Time',
modificationTime_1: 'Modification Time',
operation_1: 'Operation',
pleaseEnterFileName_1: 'Please Enter File Name',
pleaseEnterRemoteAddress_1: 'Please Enter Remote Address',
pleaseSelectFile_1: 'Please Select a File',
fileAlreadyExists_1: 'The Current File Already Exists',
isShared_1: 'Is Shared:',
yes_1: 'Yes',
no_1: 'No',
reallyDeleteCurrentFile_1: 'Are You Sure You Want to Delete the Current File?',
noDataSelected_1: 'No Data Selected',
reallyDeleteTheseFiles_1: 'Are You Sure You Want to Delete These Files?'
}
}

View File

@ -0,0 +1,39 @@
export default {
c: {
content: 'Before uploading'
},
p: {
taskName: 'Task name',
taskNamePlaceholder: 'Please enter the task name',
publishMode: 'Publishing method',
node: 'Node',
fileNameAfterPublish:
'The filename after publishing is: FileID.Suffix, not the real name of the file (can be modified freely using the post-upload script)',
ssh: 'Publishing SSH',
sshPlaceholder: 'Please select SSH',
publishNode: 'Publishing node',
nodePlaceholder: 'Please select a node',
publishDir: 'Publishing directory',
authDirConfig:
'Authorization directory configuration is required (authorization is required for normal use of publishing). The authorization directory is mainly used to determine which directories can be published to',
authDir: 'Configuration directory',
firstLevelDir: 'Please select the first-level directory for publishing',
secondLevelDir: 'Please enter the second-level directory for publishing',
executeScript: 'Execution script',
scriptVariable: 'Supports variable references: ${TASK_ID}, ${FILE_ID}, ${FILE_NAME}, ${FILE_EXT_NAME}',
workspaceEnvVariable:
'You can reference workspace environment variables. Variable placeholder: ${xxxx}, where xxxx is the variable name',
renameFile:
'It is recommended to rename the file in the post-upload script. The default for SSH upload is: ${FILE_ID}.${FILE_EXT_NAME}',
preUploadScript: 'Script to be executed before file upload (non-blocking command)',
postUploadScript: 'Script to be executed after successful file upload (non-blocking command)',
execute: 'Execute',
afterUpload: 'After uploading',
afterUploadExecute: 'Execute after uploading',
authDirSetting: 'Configure the authorization directory',
taskNameInput: 'Please enter the file task name',
publishModeSelect: 'Please select the publishing method',
publishDirSelect: 'Please select the first-level directory for publishing and enter the second-level directory',
sshSelect: 'Please select the publishing SSH'
}
}

View File

@ -0,0 +1,9 @@
import fileStorage from './fileStorage'
import releaseTask from './release-task'
import staticFileStorage from './staticFileStorage'
export default {
fileStorage,
releaseTask,
staticFileStorage
}

View File

@ -0,0 +1,17 @@
export default {
c: {
taskName: 'Please enter the task name'
},
p: {
taskName: 'Task name',
publishMethod: 'Publishing method',
node: 'Node',
publishDir: 'Publishing directory',
status: 'Status',
unknown: 'Unknown',
executionLog: 'Execution log',
executionScript: 'Execution script',
beforeUpload: 'Before upload',
afterUpload: 'After upload'
}
}

View File

@ -0,0 +1,7 @@
import details from './details'
import list from './list'
export default {
details,
list
}

View File

@ -0,0 +1,114 @@
export default {
c: {
taskName: 'Task Name',
status: 'Status',
unknown: 'Unknown',
cancel: 'Cancel',
publishDir: 'Publish Directory',
fileId: 'File ID',
systemPrompt: 'System Prompt',
confirm: 'Confirm',
fileNotExist: 'File does not exist',
taskName_1: 'Task Name',
status_1: 'Status',
unknown_1: 'Unknown',
cancel_1: 'Cancel',
publishDir_1: 'Publish Directory',
fileId_1: 'File ID',
systemPrompt_1: 'System Prompt',
confirm_1: 'Confirm',
fileNotExist_1: 'File does not exist'
},
p: {
publishType: 'Publish Type',
fastReturnFirstPage: 'Press Ctrl or Alt/Option and click the button to quickly return to the first page',
search: 'Search',
staticFile: 'Static File',
fileCenter: 'File Center',
view: 'View',
rebuild: 'Rebuild',
delete: 'Delete',
taskDetail: 'Task Detail',
publishFile: 'Publish File',
pleaseInputTaskName: 'Please enter the task name',
publishWay: 'Publish Method',
node: 'Node',
publishSsh: 'Publish SSH',
pleaseSelectSsh: 'Please select SSH',
publishNode: 'Publish Node',
pleaseSelectNode: 'Please select a node',
pleaseInputPublishDir: 'Please enter the publish directory',
fileIdInput: 'File ID',
pleaseInputPublishFileId: 'Please enter the file ID to publish',
executeScript: 'Execute Script',
beforeUpload: 'Before Upload',
beforeUploadScript: 'Script to be executed before file upload (non-blocking command)',
afterUpload: 'After Upload',
afterUploadScript: 'Script to be executed after successful file upload (non-blocking command)',
viewFile: 'View File',
fileName: 'File Name',
fileSize: 'File Size',
expireTime: 'Expiration Time',
fileShare: 'File Share',
global: 'Global',
workspace: 'Workspace',
fileDescription: 'File Description',
taskName: 'Task Name',
distributeType: 'Distribute Type',
fileSource: 'File Source',
statusDescription: 'Status Description',
executor: 'Executor',
taskTime: 'Task Time',
taskUpdateTime: 'Task Update Time',
operation: 'Operation',
pleaseInputFileTaskName: 'Please enter the file task name',
pleaseSelectPublishSsh: 'Please select the publish SSH',
reallyDeleteRecord: 'Are you sure you want to delete this execution record?',
reallyCancelTask: 'Are you sure you want to cancel the current publish task?',
publishType_1: 'Publish Type',
fastReturnFirstPage_1: 'Click the button with Ctrl or Alt/Option key held down to quickly return to the first page',
search_1: 'Search',
staticFile_1: 'Static File',
fileCenter_1: 'File Center',
view_1: 'View',
rebuild_1: 'Rebuild',
delete_1: 'Delete',
taskDetail_1: 'Task Detail',
publishFile_1: 'Publish File',
pleaseInputTaskName_1: 'Please enter the task name',
publishWay_1: 'Publish Method',
node_1: 'Node',
publishSsh_1: 'Publish SSH',
pleaseSelectSsh_1: 'Please select SSH',
publishNode_1: 'Publish Node',
pleaseSelectNode_1: 'Please select node',
pleaseInputPublishDir_1: 'Please enter the publish directory',
fileIdInput_1: 'File ID',
pleaseInputPublishFileId_1: 'Please enter the file ID for publishing',
executeScript_1: 'Execute Script',
beforeUpload_1: 'Before Upload',
beforeUploadScript_1: 'Script to be executed before file upload (non-blocking command)',
afterUpload_1: 'After Upload',
afterUploadScript_1: 'Script to be executed after successful file upload (non-blocking command)',
viewFile_1: 'View File',
fileName_1: 'File Name',
fileSize_1: 'File Size',
expireTime_1: 'Expiration Time',
fileShare_1: 'File Share',
global_1: 'Global',
workspace_1: 'Workspace',
fileDescription_1: 'File Description',
taskName_1: 'Task Name',
distributeType_1: 'Distribution Type',
fileSource_1: 'File Source',
statusDescription_1: 'Status Description',
executor_1: 'Executor',
taskTime_1: 'Task Time',
taskUpdateTime_1: 'Task Update Time',
operation_1: 'Operation',
pleaseInputFileTaskName_1: 'Please enter the file task name',
pleaseSelectPublishSsh_1: 'Please select the publish SSH',
reallyDeleteRecord_1: 'Are you sure you want to delete this execution record?',
reallyCancelTask_1: 'Are you sure you want to cancel the current publish task?'
}
}

View File

@ -0,0 +1,5 @@
import list from './list'
export default {
list
}

View File

@ -0,0 +1,126 @@
export default {
c: {
content1: 'Unknown',
fileName: 'File Name',
downloadAddress: 'Download Address',
copyTip: 'Click to Copy',
downloadNow: 'Download Now',
systemPrompt: 'System Prompt',
confirm: 'Confirm',
cancel: 'Cancel',
pleaseSelectFile: 'Please Select a File to Use'
},
p: {
fileName: 'File Name',
suffixSearch: 'Suffix, Precise Search',
fileIdSearch: 'File ID, Precise Search',
quickBackToFirstPage: 'Hold Ctrl or Alt/Option and click the button to quickly return to the first page',
search: 'Search',
scan: 'Scan',
batchDelete: 'Batch Delete',
configDirectory: 'Configure Directory',
fileInfo: 'File Info',
fileId: 'File ID:',
fileNameLabel: 'File Name:',
fileDescriptionLabel: 'File Description:',
exist: 'Exists',
missing: 'Missing',
file: 'File',
folder: 'Folder',
download: 'Download',
publish: 'Publish',
deleteFile: 'Delete File',
modifyFile: 'Modify File',
fileDescription: 'File Description',
pleaseEnterFileDescription: 'Please Enter File Description',
chunkedDownload: 'Chunked/Segmented Download',
resetDownloadToken: 'Reset Download Token Information, which will invalidate previous download tokens',
reset: 'Reset',
chunkedSingleFileDownload: 'Chunked/Segmented Single File Download',
chunkedAliasDownload: 'Chunked/Segmented Alias Download',
warmPrompt: 'Warm Prompt',
customSortField: 'Supports custom sorting fields: sort',
descSortAscFirst: 'Description sorted by creation time in ascending order first',
supportedFields: 'Supported fields can be viewed through the interface return',
commonFields: 'Common fields include: createTimeMillis, modifyTimeMillis',
publishFile: 'Publish File',
configAuthDirectory: 'Configure Authorization Directory',
name: 'Name',
desc: 'Description',
path: 'Path',
size: 'Size',
suffix: 'Suffix',
type: 'Type',
fileStatus: 'File Status',
fileModifyTime: 'File Modification Time',
operation: 'Operation',
pleaseEnterFileName: 'Please Enter File Name',
pleaseEnterRemoteAddress: 'Please Enter Remote Address',
confirmDeleteFile: 'Are you sure you want to delete the current file?',
noDataSelected: 'No data selected',
confirmDeleteFiles: 'Are you sure you want to delete these files?'
},
enUS: {
c: {
content1: 'Unknown',
fileName: 'File Name',
downloadAddress: 'Download Address',
copyTip: 'Click to Copy',
downloadNow: 'Download Now',
systemPrompt: 'System Prompt',
confirm: 'Confirm',
cancel: 'Cancel',
pleaseSelectFile: 'Please Select a File to Use'
},
p: {
fileName: 'File Name',
suffixSearch: 'Suffix, Precise Search',
fileIdSearch: 'File ID, Precise Search',
quickBackToFirstPage: 'Hold Ctrl or Alt/Option and click the button to quickly return to the first page',
search: 'Search',
scan: 'Scan',
batchDelete: 'Batch Delete',
configDirectory: 'Configure Directory',
fileInfo: 'File Info',
fileId: 'File ID:',
fileNameLabel: 'File Name:',
fileDescriptionLabel: 'File Description:',
exist: 'Exists',
missing: 'Missing',
file: 'File',
folder: 'Folder',
download: 'Download',
publish: 'Publish',
deleteFile: 'Delete File',
modifyFile: 'Modify File',
fileDescription: 'File Description',
pleaseEnterFileDescription: 'Please Enter File Description',
chunkedDownload: 'Chunked/Split Download',
resetDownloadToken: 'Reset Download Token Information. Previous Download Tokens Will Be Invalidated After Reset',
reset: 'Reset',
chunkedSingleFileDownload: 'Chunked/Split Single File Download',
chunkedAliasDownload: 'Chunked/Split Alias Download',
warmPrompt: 'Warm Prompt',
customSortField: 'Supports Custom Sorting Field: sort',
descSortAscFirst: 'Description Sorted Ascending by Creation Time First',
supportedFields: 'Supported Fields Can Be Viewed Through the API Response',
commonFields: 'Common Fields Include: createTimeMillis, modifyTimeMillis',
publishFile: 'Publish File',
configAuthDirectory: 'Configure Authorization Directory',
name: 'Name',
desc: 'Description',
path: 'Path',
size: 'Size',
suffix: 'Suffix',
type: 'Type',
fileStatus: 'File Status',
fileModifyTime: 'File Modification Time',
operation: 'Operation',
pleaseEnterFileName: 'Please Enter File Name',
pleaseEnterRemoteAddress: 'Please Enter Remote Address',
confirmDeleteFile: 'Are You Sure You Want to Delete This File?',
noDataSelected: 'No Data Selected',
confirmDeleteFiles: 'Are You Sure You Want to Delete These Files?'
}
}
}

View File

@ -13,12 +13,14 @@ import build from './pages/build'
import certificate from './pages/certificate'
import dispatch from './pages/dispatch'
import docker from './pages/docker'
import fileManager from './pages/file-manager'
export default {
pages: {
404: page404,
build,
certificate,
dispatch,
docker
docker,
fileManager
}
}

View File

@ -0,0 +1,7 @@
import list from './list'
import releaseFile from './releaseFile'
export default {
list,
releaseFile
}

View File

@ -0,0 +1,85 @@
export default {
c: {
aliasCode: '别名码',
uploadFile: '上传文件',
fileName: '文件名:',
unknown: '未知',
global: '全局',
selectFile: '选择文件',
retentionDays: '保留天数',
fileSaveDays: '文件保存天数,默认 3650 天',
fileShare: '文件共享',
currentWorkspace: '当前工作空间',
fileType: '用于区别文件是否为同一类型,可以针对同类型进行下载管理',
enterAliasCode: '请输入别名码',
randomGenerate: '随机生成',
fileDescription: '文件描述',
enterFileDescription: '请输入文件描述',
downloadAddress: '下载地址',
copyByClick: '点击可以复制',
immediateDownload: '立即下载',
cancel: '取消',
systemPrompt: '系统提示',
confirm: '确认',
pleaseSelectFile: '请选择要使用的文件'
},
p: {
fileName: '文件名称',
suffix: '后缀,精准搜索',
fileId: '文件id,精准搜索',
quickBackToFirstPage: '按住 Ctr 或者 Alt/Option 键点击按钮快速回到第一页',
search: '搜索',
remoteDownload: '远程下载',
batchDelete: '批量删除',
fileInfo: '文件信息',
fileDescription: '文件描述:',
downloadStatus: '下载状态:',
statusDescription: '状态描述:',
exist: '存在',
lost: '丢失',
workspace: '工作空间',
download: '下载',
release: '发布',
delete: '删除',
usageTime: '用时',
modifyFile: '修改文件',
remoteDownloadFile: '远程下载文件',
remoteDownloadUrl: '远程下载URL',
remoteDownloadAddress: '远程下载地址',
resumableDownload: '断点/分片下载',
resetDownloadToken: '重置下载 token 信息,重置后之前的下载 token 将失效',
reset: '重置',
resumableSingleFileDownload: '断点/分片单文件下载',
resumableAliasDownload: '断点/分片别名下载',
warmPrompt: '温馨提示',
customSortField: '支持自定义排序字段sort',
sortDesc: '描述根据创建时间升序第一个',
supportedFields: '支持的字段可以通过接口返回的查看',
commonFields: '通用的字段有createTimeMillis、modifyTimeMillis',
releaseFile: '发布文件',
confirm: '确定',
fileMD5: '文件MD5',
name: '名称',
size: '大小',
contentSuffix: '后缀',
shared: '共享',
source: '来源',
expireDays: '过期天数',
fileStatus: '文件状态',
creator: '创建人',
modifier: '修改人',
creationTime: '创建时间',
modificationTime: '修改时间',
operation: '操作',
pleaseEnterFileName: '请输入文件名称',
pleaseEnterRemoteAddress: '请输入远程地址',
pleaseSelectFile: '请选择文件',
fileAlreadyExists: '当前文件已经存在啦',
isShared: '是否共享:',
yes: '是',
no: '否',
reallyDeleteCurrentFile: '真的要删除当前文件么?',
noDataSelected: '没有选择任何数据',
reallyDeleteTheseFiles: '真的要删除这些文件么?'
}
}

View File

@ -0,0 +1,35 @@
export default {
c: {
content: '上传前'
},
p: {
taskName: '任务名',
taskNamePlaceholder: '请输入任务名',
publishMode: '发布方式',
node: '节点',
fileNameAfterPublish: '发布后的文件名是文件ID.后缀,并非文件真实名称 (可以使用上传后脚本随意修改)',
ssh: '发布的SSH',
sshPlaceholder: '请选择SSH',
publishNode: '发布的节点',
nodePlaceholder: '请选择节点',
publishDir: '发布目录',
authDirConfig: '需要配置授权目录(授权才能正常使用发布),授权目录主要是用于确定可以发布到哪些目录中',
authDir: '配置目录',
firstLevelDir: '请选择发布的一级目录',
secondLevelDir: '请填写发布的二级目录',
executeScript: '执行脚本',
scriptVariable: '支持变量引用:${TASK_ID}、${FILE_ID}、${FILE_NAME}、${FILE_EXT_NAME}',
workspaceEnvVariable: '可以引用工作空间的环境变量 变量占位符 ${xxxx} xxxx 为变量名称',
renameFile: '建议在上传后的脚本中对文件进行自定义更名SSH 上传默认为:${FILE_ID}.${FILE_EXT_NAME}',
preUploadScript: '文件上传前需要执行的脚本(非阻塞命令)',
postUploadScript: '文件上传成功后需要执行的脚本(非阻塞命令)',
execute: '执行',
afterUpload: '上传后',
afterUploadExecute: '上传后执行',
authDirSetting: '配置授权目录',
taskNameInput: '请输入文件任务名',
publishModeSelect: '请选择发布方式',
publishDirSelect: '请选择发布的一级目录和填写二级目录',
sshSelect: '请选择发布的SSH'
}
}

View File

@ -0,0 +1,9 @@
import fileStorage from './fileStorage'
import releaseTask from './release-task'
import staticFileStorage from './staticFileStorage'
export default {
fileStorage,
releaseTask,
staticFileStorage
}

View File

@ -0,0 +1,17 @@
export default {
c: {
taskName: '请输入任务名'
},
p: {
taskName: '任务名',
publishMethod: '发布方式',
node: '节点',
publishDir: '发布目录',
status: '状态',
unknown: '未知',
executionLog: '执行日志',
executionScript: '执行脚本',
beforeUpload: '上传前',
afterUpload: '上传后'
}
}

View File

@ -0,0 +1,7 @@
import details from './details'
import list from './list'
export default {
details,
list
}

View File

@ -0,0 +1,60 @@
export default {
c: {
taskName: '任务名',
status: '状态',
unknown: '未知',
cancel: '取消',
publishDir: '发布目录',
fileId: '文件ID',
systemPrompt: '系统提示',
confirm: '确认',
fileNotExist: '文件不存在啦'
},
p: {
publishType: '发布类型',
fastReturnFirstPage: '按住 Ctr 或者 Alt/Option 键点击按钮快速回到第一页',
search: '搜索',
staticFile: '静态文件',
fileCenter: '文件中心',
view: '查看',
rebuild: '重建',
delete: '删除',
taskDetail: '任务详情',
publishFile: '发布文件',
pleaseInputTaskName: '请输入任务名',
publishWay: '发布方式',
node: '节点',
publishSsh: '发布的SSH',
pleaseSelectSsh: '请选择SSH',
publishNode: '发布的节点',
pleaseSelectNode: '请选择节点',
pleaseInputPublishDir: '请输入发布目录',
fileIdInput: '文件id',
pleaseInputPublishFileId: '请输入发布的文件id',
executeScript: '执行脚本',
beforeUpload: '上传前',
beforeUploadScript: '文件上传前需要执行的脚本(非阻塞命令)',
afterUpload: '上传后',
afterUploadScript: '文件上传成功后需要执行的脚本(非阻塞命令)',
viewFile: '查看文件',
fileName: '文件名',
fileSize: '文件大小',
expireTime: '过期时间',
fileShare: '文件共享',
global: '全局',
workspace: '工作空间',
fileDescription: '文件描述',
taskName: '任务名称',
distributeType: '分发类型',
fileSource: '文件来源',
statusDescription: '状态描述',
executor: '执行人',
taskTime: '任务时间',
taskUpdateTime: '任务更新时间',
operation: '操作',
pleaseInputFileTaskName: '请输入文件任务名',
pleaseSelectPublishSsh: '请选择发布的SSH',
reallyDeleteRecord: '真的要删除该执行记录吗?',
reallyCancelTask: '真的取消当前发布任务吗?'
}
}

View File

@ -0,0 +1,5 @@
import list from './list'
export default {
list
}

View File

@ -0,0 +1,63 @@
export default {
c: {
content1: '未知',
fileName: '文件名',
downloadAddress: '下载地址',
copyTip: '点击可以复制',
downloadNow: '立即下载',
systemPrompt: '系统提示',
confirm: '确认',
cancel: '取消',
pleaseSelectFile: '请选择要使用的文件'
},
p: {
fileName: '文件名称',
suffixSearch: '后缀,精准搜索',
fileIdSearch: '文件id,精准搜索',
quickBackToFirstPage: '按住 Ctr 或者 Alt/Option 键点击按钮快速回到第一页',
search: '搜索',
scan: '扫描',
batchDelete: '批量删除',
configDirectory: '配置目录',
fileInfo: '文件信息',
fileId: '文件ID',
fileNameLabel: '文件名:',
fileDescriptionLabel: '文件描述:',
exist: '存在',
missing: '丢失',
file: '文件',
folder: '文件夹',
download: '下载',
publish: '发布',
deleteFile: '删除',
modifyFile: '修改文件',
fileDescription: '文件描述',
pleaseEnterFileDescription: '请输入文件描述',
chunkedDownload: '断点/分片下载',
resetDownloadToken: '重置下载 token 信息,重置后之前的下载 token 将失效',
reset: '重置',
chunkedSingleFileDownload: '断点/分片单文件下载',
chunkedAliasDownload: '断点/分片别名下载',
warmPrompt: '温馨提示',
customSortField: '支持自定义排序字段sort',
descSortAscFirst: '描述根据创建时间升序第一个',
supportedFields: '支持的字段可以通过接口返回的查看',
commonFields: '通用的字段有createTimeMillis、modifyTimeMillis',
publishFile: '发布文件',
configAuthDirectory: '配置授权目录',
name: '名称',
desc: '描述',
path: '路径',
size: '大小',
suffix: '后缀',
type: '类型',
fileStatus: '文件状态',
fileModifyTime: '文件修改时间',
operation: '操作',
pleaseEnterFileName: '请输入文件名称',
pleaseEnterRemoteAddress: '请输入远程地址',
confirmDeleteFile: '真的要删除当前文件么?',
noDataSelected: '没有选择任何数据',
confirmDeleteFiles: '真的要删除这些文件么?'
}
}

View File

@ -24,40 +24,40 @@
<a-space>
<a-input
v-model:value="listQuery['%name%']"
placeholder="文件名称"
:placeholder="$tl('p.fileName')"
class="search-input-item"
@press-enter="loadData"
/>
<a-input
v-model:value="listQuery['%aliasCode%']"
placeholder="别名码"
:placeholder="$tl('c.aliasCode')"
class="search-input-item"
@press-enter="loadData"
/>
<a-input
v-model:value="listQuery['extName']"
placeholder="后缀,精准搜索"
:placeholder="$tl('p.suffix')"
class="search-input-item"
@press-enter="loadData"
/>
<a-input
v-model:value="listQuery['id']"
placeholder="文件id,精准搜索"
:placeholder="$tl('p.fileId')"
class="search-input-item"
@press-enter="loadData"
/>
<a-tooltip title="按住 Ctr 或者 Alt/Option 键点击按钮快速回到第一页">
<a-button type="primary" :loading="loading" @click="loadData">搜索</a-button>
<a-tooltip :title="$tl('p.quickBackToFirstPage')">
<a-button type="primary" :loading="loading" @click="loadData">{{ $tl('p.search') }}</a-button>
</a-tooltip>
<a-button type="primary" @click="handleUpload">上传文件</a-button>
<a-button type="primary" @click="handleRemoteDownload">远程下载</a-button>
<a-button type="primary" @click="handleUpload">{{ $tl('c.uploadFile') }}</a-button>
<a-button type="primary" @click="handleRemoteDownload">{{ $tl('p.remoteDownload') }}</a-button>
<a-button
type="primary"
danger
:disabled="!tableSelections || tableSelections.length <= 0"
@click="handleBatchDelete"
>
批量删除
{{ $tl('p.batchDelete') }}
</a-button>
</a-space>
</template>
@ -74,12 +74,14 @@
</a-tooltip>
</template>
<template v-else-if="column.dataIndex === 'name'">
<a-popover title="文件信息">
<a-popover :title="$tl('p.fileInfo')">
<template #content>
<p>文件名{{ text }}</p>
<p>文件描述{{ record.description }}</p>
<p v-if="record.status !== undefined">下载状态{{ statusMap[record.status] || '未知' }}</p>
<p v-if="record.progressDesc">状态描述{{ record.progressDesc }}</p>
<p>{{ $tl('c.fileName') }}{{ text }}</p>
<p>{{ $tl('p.fileDescription') }}{{ record.description }}</p>
<p v-if="record.status !== undefined">
{{ $tl('p.downloadStatus') }}{{ statusMap[record.status] || $tl('c.unknown') }}
</p>
<p v-if="record.progressDesc">{{ $tl('p.statusDescription') }}{{ record.progressDesc }}</p>
</template>
<!-- {{ text }} -->
<a-button type="link" style="padding: 0" size="small" @click="handleEdit(record)">{{ text }}</a-button>
@ -92,29 +94,31 @@
</a-tooltip>
</template>
<template v-else-if="column.dataIndex === 'source'">
<a-tooltip placement="topLeft" :title="`${sourceMap[text] || '未知'}`">
<span>{{ sourceMap[text] || '未知' }}</span>
<a-tooltip placement="topLeft" :title="sourceMap[text] || $tl('c.unknown')">
<span>{{ sourceMap[text] || $tl('c.unknown') }}</span>
</a-tooltip>
</template>
<template v-else-if="column.dataIndex === 'exists'">
<a-tag v-if="text" color="green">存在</a-tag>
<a-tag v-else color="red">丢失</a-tag>
<a-tag v-if="text" color="green">{{ $tl('p.exist') }}</a-tag>
<a-tag v-else color="red">{{ $tl('p.lost') }}</a-tag>
</template>
<template v-else-if="column.dataIndex === 'workspaceId'">
<a-tag v-if="text === 'GLOBAL'">全局</a-tag>
<a-tag v-else>工作空间</a-tag>
<a-tag v-if="text === 'GLOBAL'">{{ $tl('c.global') }}</a-tag>
<a-tag v-else>{{ $tl('p.workspace') }}</a-tag>
</template>
<template v-else-if="column.dataIndex === 'operation'">
<a-space>
<!-- <a-button type="primary" size="small" @click="handleEdit(record)">编辑</a-button> -->
<a-button size="small" :disabled="!record.exists" type="primary" @click="handleDownloadUrl(record)"
>下载</a-button
>
<a-button size="small" :disabled="!record.exists" type="primary" @click="handleReleaseFile(record)"
>发布</a-button
>
<a-button type="primary" danger size="small" @click="handleDelete(record)">删除</a-button>
<a-button size="small" :disabled="!record.exists" type="primary" @click="handleDownloadUrl(record)">{{
$tl('p.download')
}}</a-button>
<a-button size="small" :disabled="!record.exists" type="primary" @click="handleReleaseFile(record)">{{
$tl('p.release')
}}</a-button>
<a-button type="primary" danger size="small" @click="handleDelete(record)">{{
$tl('p.delete')
}}</a-button>
</a-space>
</template>
</template>
@ -127,17 +131,19 @@
:closable="!uploading"
:footer="uploading ? null : undefined"
:keyboard="false"
:title="`上传文件`"
:title="`${$tl('c.uploadFile')}`"
:mask-closable="false"
@ok="handleUploadOk"
>
<a-form ref="form" :rules="rules" :model="temp" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
<a-form-item label="选择文件" name="file">
<a-form-item :label="$tl('c.selectFile')" name="file">
<a-progress v-if="percentage" :percent="percentage">
<template #format="percent">
{{ percent }}%
<template v-if="percentageInfo.total"> ({{ renderSize(percentageInfo.total) }}) </template>
<template v-if="percentageInfo.duration"> 用时:{{ formatDuration(percentageInfo.duration) }} </template>
<template v-if="percentageInfo.duration">
{{ $tl('p.usageTime') }}:{{ formatDuration(percentageInfo.duration) }}
</template>
</template>
</a-progress>
@ -159,28 +165,28 @@
"
>
<LoadingOutlined v-if="percentage" />
<a-button v-else type="primary"><UploadOutlined />选择文件</a-button>
<a-button v-else type="primary"><UploadOutlined />{{ $tl('c.selectFile') }}</a-button>
</a-upload>
</a-form-item>
<a-form-item label="保留天数" name="keepDay">
<a-form-item :label="$tl('c.retentionDays')" name="keepDay">
<a-input-number
v-model:value="temp.keepDay"
:min="1"
style="width: 100%"
placeholder="文件保存天数,默认 3650 天"
:placeholder="$tl('c.fileSaveDays')"
/>
</a-form-item>
<a-form-item label="文件共享" name="global">
<a-form-item :label="$tl('c.fileShare')" name="global">
<a-radio-group v-model:value="temp.global">
<a-radio :value="true"> 全局 </a-radio>
<a-radio :value="false"> 当前工作空间 </a-radio>
<a-radio :value="true"> {{ $tl('c.global') }} </a-radio>
<a-radio :value="false"> {{ $tl('c.currentWorkspace') }} </a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="别名码" name="aliasCode" help="用于区别文件是否为同一类型,可以针对同类型进行下载管理">
<a-form-item :label="$tl('c.aliasCode')" name="aliasCode" :help="$tl('c.fileType')">
<a-input-search
v-model:value="temp.aliasCode"
:max-length="50"
placeholder="请输入别名码"
:placeholder="$tl('c.enterAliasCode')"
@search="
() => {
temp = { ...temp, aliasCode: randomStr(6) }
@ -188,12 +194,12 @@
"
>
<template #enterButton>
<a-button type="primary"> 随机生成 </a-button>
<a-button type="primary"> {{ $tl('c.randomGenerate') }} </a-button>
</template>
</a-input-search>
</a-form-item>
<a-form-item label="文件描述" name="description">
<a-textarea v-model:value="temp.description" placeholder="请输入文件描述" />
<a-form-item :label="$tl('c.fileDescription')" name="description">
<a-textarea v-model:value="temp.description" :placeholder="$tl('c.enterFileDescription')" />
</a-form-item>
</a-form>
</a-modal>
@ -202,7 +208,7 @@
v-model:open="editVisible"
destroy-on-close
:confirm-loading="confirmLoading"
:title="`修改文件`"
:title="`${$tl('p.modifyFile')}`"
:mask-closable="false"
@ok="handleEditOk"
>
@ -210,25 +216,25 @@
<a-form-item label="文件名" name="name">
<a-input v-model:value="temp.name" placeholder="文件名" />
</a-form-item>
<a-form-item label="保留天数" name="keepDay">
<a-form-item :label="$tl('c.retentionDays')" name="keepDay">
<a-input-number
v-model:value="temp.keepDay"
:min="1"
style="width: 100%"
placeholder="文件保存天数,默认 3650 天"
:placeholder="$tl('c.fileSaveDays')"
/>
</a-form-item>
<a-form-item label="文件共享" name="global">
<a-form-item :label="$tl('c.fileShare')" name="global">
<a-radio-group v-model:value="temp.global">
<a-radio :value="true"> 全局 </a-radio>
<a-radio :value="false"> 当前工作空间 </a-radio>
<a-radio :value="true"> {{ $tl('c.global') }} </a-radio>
<a-radio :value="false"> {{ $tl('c.currentWorkspace') }} </a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="别名码" name="aliasCode" help="用于区别文件是否为同一类型,可以针对同类型进行下载管理">
<a-form-item :label="$tl('c.aliasCode')" name="aliasCode" :help="$tl('c.fileType')">
<a-input-search
v-model:value="temp.aliasCode"
:max-length="50"
placeholder="请输入别名码"
:placeholder="$tl('c.enterAliasCode')"
@search="
() => {
temp = { ...temp, aliasCode: randomStr(6) }
@ -236,12 +242,12 @@
"
>
<template #enterButton>
<a-button type="primary"> 随机生成 </a-button>
<a-button type="primary"> {{ $tl('c.randomGenerate') }} </a-button>
</template>
</a-input-search>
</a-form-item>
<a-form-item label="文件描述" name="description">
<a-textarea v-model:value="temp.description" placeholder="请输入文件描述" />
<a-form-item :label="$tl('c.fileDescription')" name="description">
<a-textarea v-model:value="temp.description" :placeholder="$tl('c.enterFileDescription')" />
</a-form-item>
</a-form>
</a-modal>
@ -249,34 +255,34 @@
<a-modal
v-model:open="uploadRemoteFileVisible"
destroy-on-close
title="远程下载文件"
:title="$tl('p.remoteDownloadFile')"
:mask-closable="false"
:confirm-loading="confirmLoading"
@ok="handleRemoteUpload"
>
<a-form ref="remoteForm" :model="temp" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" :rules="rules">
<a-form-item label="远程下载URL" name="url">
<a-input v-model:value="temp.url" placeholder="远程下载地址" />
<a-form-item :label="$tl('p.remoteDownloadUrl')" name="url">
<a-input v-model:value="temp.url" :placeholder="$tl('p.remoteDownloadAddress')" />
</a-form-item>
<a-form-item label="保留天数" name="keepDay">
<a-form-item :label="$tl('c.retentionDays')" name="keepDay">
<a-input-number
v-model:value="temp.keepDay"
:min="1"
style="width: 100%"
placeholder="文件保存天数,默认 3650 天"
:placeholder="$tl('c.fileSaveDays')"
/>
</a-form-item>
<a-form-item label="文件共享" name="global">
<a-form-item :label="$tl('c.fileShare')" name="global">
<a-radio-group v-model:value="temp.global">
<a-radio :value="true"> 全局 </a-radio>
<a-radio :value="false"> 当前工作空间 </a-radio>
<a-radio :value="true"> {{ $tl('c.global') }} </a-radio>
<a-radio :value="false"> {{ $tl('c.currentWorkspace') }} </a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="别名码" name="aliasCode" help="用于区别文件是否为同一类型,可以针对同类型进行下载管理">
<a-form-item :label="$tl('c.aliasCode')" name="aliasCode" :help="$tl('c.fileType')">
<a-input-search
v-model:value="temp.aliasCode"
:max-length="50"
placeholder="请输入别名码"
:placeholder="$tl('c.enterAliasCode')"
@search="
() => {
temp = { ...temp, aliasCode: randomStr(6) }
@ -284,12 +290,12 @@
"
>
<template #enterButton>
<a-button type="primary"> 随机生成 </a-button>
<a-button type="primary"> {{ $tl('c.randomGenerate') }} </a-button>
</template>
</a-input-search>
</a-form-item>
<a-form-item label="文件描述" name="description">
<a-textarea v-model:value="temp.description" placeholder="请输入文件描述" />
<a-form-item :label="$tl('c.fileDescription')" name="description">
<a-textarea v-model:value="temp.description" :placeholder="$tl('c.enterFileDescription')" />
</a-form-item>
</a-form>
</a-modal>
@ -297,7 +303,7 @@
<a-modal
v-model:open="triggerVisible"
destroy-on-close
title="断点/分片下载"
:title="$tl('p.resumableDownload')"
width="50%"
:footer="null"
:mask-closable="false"
@ -305,13 +311,13 @@
<a-form ref="editTriggerForm" :model="temp" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
<a-tabs default-active-key="1">
<template #rightExtra>
<a-tooltip title="重置下载 token 信息,重置后之前的下载 token 将失效">
<a-button type="primary" size="small" @click="resetTrigger">重置</a-button>
<a-tooltip :title="$tl('p.resetDownloadToken')">
<a-button type="primary" size="small" @click="resetTrigger">{{ $tl('p.reset') }}</a-button>
</a-tooltip>
</template>
<a-tab-pane key="1" tab="断点/分片单文件下载">
<a-tab-pane key="1" :tab="$tl('p.resumableSingleFileDownload')">
<a-space direction="vertical" style="width: 100%">
<a-alert type="info" :message="`下载地址(点击可以复制)`">
<a-alert type="info" :message="`${$tl('c.downloadAddress')}(${$tl('c.copyByClick')})`">
<template #description>
<a-typography-paragraph :copyable="{ tooltip: false, text: temp.triggerDownloadUrl }">
<a-tag>GET</a-tag>
@ -320,26 +326,26 @@
</template>
</a-alert>
<a :href="temp.triggerDownloadUrl" target="_blank">
<a-button size="small" type="primary"><DownloadOutlined />立即下载</a-button>
<a-button size="small" type="primary"><DownloadOutlined />{{ $tl('c.immediateDownload') }}</a-button>
</a>
</a-space>
</a-tab-pane>
<a-tab-pane v-if="temp.triggerAliasDownloadUrl" tab="断点/分片别名下载">
<a-tab-pane v-if="temp.triggerAliasDownloadUrl" :tab="$tl('p.resumableAliasDownload')">
<a-space direction="vertical" style="width: 100%">
<a-alert message="温馨提示" type="warning">
<a-alert :message="$tl('p.warmPrompt')" type="warning">
<template #description>
<ul>
<li>
支持自定义排序字段sort=createTimeMillis:desc
{{ $tl('p.customSortField') }}=createTimeMillis:desc
<p>描述根据创建时间升序第一个</p>
<p>{{ $tl('p.sortDesc') }}</p>
</li>
<li>支持的字段可以通过接口返回的查看</li>
<li>通用的字段有createTimeMillismodifyTimeMillis</li>
<li>{{ $tl('p.supportedFields') }}</li>
<li>{{ $tl('p.commonFields') }}</li>
</ul>
</template>
</a-alert>
<a-alert type="info" :message="`下载地址(点击可以复制)`">
<a-alert type="info" :message="`${$tl('c.downloadAddress')}(${$tl('c.copyByClick')})`">
<template #description>
<a-typography-paragraph :copyable="{ tooltip: false, text: temp.triggerAliasDownloadUrl }">
<a-tag>GET</a-tag>
@ -348,7 +354,7 @@
</template>
</a-alert>
<a :href="temp.triggerAliasDownloadUrl" target="_blank">
<a-button size="small" type="primary"><DownloadOutlined />立即下载</a-button>
<a-button size="small" type="primary"><DownloadOutlined />{{ $tl('c.immediateDownload') }}</a-button>
</a>
</a-space>
</a-tab-pane>
@ -360,7 +366,7 @@
v-model:open="releaseFileVisible"
destroy-on-close
:confirm-loading="confirmLoading"
title="发布文件"
:title="$tl('p.releaseFile')"
width="60%"
:mask-closable="false"
@ok="releaseFileOk()"
@ -391,9 +397,9 @@
}
"
>
取消
{{ $tl('c.cancel') }}
</a-button>
<a-button type="primary" @click="handerConfirm"> 确定 </a-button>
<a-button type="primary" @click="handerConfirm"> {{ $tl('p.confirm') }} </a-button>
</a-space>
</div>
</div>
@ -447,26 +453,26 @@ export default {
list: [],
columns: [
{
title: '文件MD5',
title: this.$tl('p.fileMD5'),
dataIndex: 'id',
ellipsis: true,
width: 100
},
{
title: '名称',
title: this.$tl('p.name'),
dataIndex: 'name',
ellipsis: true,
width: 150
},
{
title: '别名码',
title: this.$tl('c.aliasCode'),
dataIndex: 'aliasCode',
ellipsis: true,
width: 100,
tooltip: true
},
{
title: '大小',
title: this.$tl('p.size'),
dataIndex: 'size',
sorter: true,
ellipsis: true,
@ -474,28 +480,28 @@ export default {
width: '100px'
},
{
title: '后缀',
title: this.$tl('p.contentSuffix'),
dataIndex: 'extName',
ellipsis: true,
tooltip: true,
width: '80px'
},
{
title: '共享',
title: this.$tl('p.shared'),
dataIndex: 'workspaceId',
ellipsis: true,
width: '90px'
},
{
title: '来源',
title: this.$tl('p.source'),
dataIndex: 'source',
ellipsis: true,
width: '80px'
},
{
title: '过期天数',
title: this.$tl('p.expireDays'),
dataIndex: 'validUntil',
sorter: true,
customRender: ({ text }) => {
@ -507,42 +513,42 @@ export default {
width: '100px'
},
{
title: '文件状态',
title: this.$tl('p.fileStatus'),
dataIndex: 'exists',
ellipsis: true,
width: '80px'
},
{
title: '创建人',
title: this.$tl('p.creator'),
dataIndex: 'createUser',
ellipsis: true,
tooltip: true,
width: '120px'
},
{
title: '修改人',
title: this.$tl('p.modifier'),
dataIndex: 'modifyUser',
ellipsis: true,
tooltip: true,
width: '120px'
},
{
title: '创建时间',
title: this.$tl('p.creationTime'),
dataIndex: 'createTimeMillis',
sorter: true,
customRender: ({ text }) => parseTime(text),
width: '170px'
},
{
title: '修改时间',
title: this.$tl('p.modificationTime'),
dataIndex: 'modifyTimeMillis',
sorter: true,
customRender: ({ text }) => parseTime(text),
width: '170px'
},
{
title: '操作',
title: this.$tl('p.operation'),
dataIndex: 'operation',
align: 'center',
ellipsis: true,
@ -552,8 +558,8 @@ export default {
}
],
rules: {
name: [{ required: true, message: '请输入文件名称', trigger: 'blur' }],
url: [{ required: true, message: '请输入远程地址', trigger: 'blur' }]
name: [{ required: true, message: this.$tl('p.pleaseEnterFileName'), trigger: 'blur' }],
url: [{ required: true, message: this.$tl('p.pleaseEnterRemoteAddress'), trigger: 'blur' }]
},
temp: {},
@ -591,6 +597,9 @@ export default {
this.loadData()
},
methods: {
$tl(key, ...args) {
return this.$t(`pages.fileManager.fileStorage.list.${key}`, ...args)
},
randomStr,
CHANGE_PAGE,
renderSize,
@ -622,7 +631,7 @@ export default {
//
if (this.fileList.length === 0) {
$notification.success({
message: '请选择文件'
message: this.$tl('p.pleaseSelectFile')
})
return false
}
@ -650,7 +659,7 @@ export default {
if (res.data) {
//
$notification.warning({
message: `当前文件已经存在啦,文件名:${res.data.name} ,是否共享:${res.data.workspaceId === 'GLOBAL' ? '是' : '否'}`
message: `${this.$tl('p.fileAlreadyExists')},${this.$tl('c.fileName')}${res.data.name} ,${this.$tl('p.isShared')}${res.data.workspaceId === 'GLOBAL' ? this.$tl('p.yes') : this.$tl('p.no')}`
})
//
this.uploading = false
@ -754,11 +763,11 @@ export default {
//
handleDelete(record) {
$confirm({
title: '系统提示',
title: this.$tl('c.systemPrompt'),
zIndex: 1009,
content: '真的要删除当前文件么?' + record.name,
okText: '确认',
cancelText: '取消',
content: this.$tl('p.reallyDeleteCurrentFile') + record.name,
okText: this.$tl('c.confirm'),
cancelText: this.$tl('c.cancel'),
onOk: () => {
return delFile({
id: record.id
@ -777,16 +786,16 @@ export default {
handleBatchDelete() {
if (!this.tableSelections || this.tableSelections.length <= 0) {
$notification.error({
message: '没有选择任何数据'
message: this.$tl('p.noDataSelected')
})
return
}
$confirm({
title: '系统提示',
title: this.$tl('c.systemPrompt'),
zIndex: 1009,
content: '真的要删除这些文件么?',
okText: '确认',
cancelText: '取消',
content: this.$tl('p.reallyDeleteTheseFiles'),
okText: this.$tl('c.confirm'),
cancelText: this.$tl('c.cancel'),
onOk: () => {
return delFile({ ids: this.tableSelections.join(',') }).then((res) => {
if (res.code === 200) {
@ -900,7 +909,7 @@ export default {
handerConfirm() {
if (!this.tableSelections.length) {
$notification.warning({
message: '请选择要使用的文件'
message: this.$tl('c.pleaseSelectFile')
})
return
}
@ -909,7 +918,7 @@ export default {
})
if (!selectData.length) {
$notification.warning({
message: '请选择要使用的文件'
message: this.$tl('c.pleaseSelectFile')
})
return
}

View File

@ -7,23 +7,21 @@
:label-col="{ span: 4 }"
:wrapper-col="{ span: 20 }"
>
<a-form-item label="任务名" name="name">
<a-input v-model:value="temp.name" placeholder="请输入任务名" :max-length="50" />
<a-form-item :label="$tl('p.taskName')" name="name">
<a-input v-model:value="temp.name" :placeholder="$tl('p.taskNamePlaceholder')" :max-length="50" />
</a-form-item>
<a-form-item label="发布方式" name="taskType">
<a-form-item :label="$tl('p.publishMode')" name="taskType">
<a-radio-group v-model:value="temp.taskType" @change="taskTypeChange">
<a-radio :value="0"> SSH </a-radio>
<a-radio :value="1"> 节点 </a-radio>
<a-radio :value="1"> {{ $tl('p.node') }} </a-radio>
</a-radio-group>
<template #help>
<template v-if="temp.taskType === 0"
>发布后的文件名是文件ID.后缀并非文件真实名称 可以使用上传后脚本随意修改
</template>
<template v-if="temp.taskType === 0">{{ $tl('p.fileNameAfterPublish') }} </template>
</template>
</a-form-item>
<a-form-item v-if="temp.taskType === 0" name="taskDataIds" label="发布的SSH">
<a-form-item v-if="temp.taskType === 0" name="taskDataIds" :label="$tl('p.ssh')">
<a-row>
<a-col :span="22">
<a-select
@ -40,7 +38,7 @@
}
"
mode="multiple"
placeholder="请选择SSH"
:placeholder="$tl('p.sshPlaceholder')"
>
<a-select-option v-for="ssh in sshList" :key="ssh.id">
<a-tooltip :title="ssh.name"> {{ ssh.name }}</a-tooltip>
@ -52,7 +50,7 @@
</a-col>
</a-row>
</a-form-item>
<a-form-item v-else-if="temp.taskType === 1" name="taskDataIds" label="发布的节点">
<a-form-item v-else-if="temp.taskType === 1" name="taskDataIds" :label="$tl('p.publishNode')">
<a-row>
<a-col :span="22">
<a-select
@ -69,7 +67,7 @@
}
"
mode="multiple"
placeholder="请选择节点"
:placeholder="$tl('p.nodePlaceholder')"
>
<a-select-option v-for="ssh in nodeList" :key="ssh.id">
<a-tooltip :title="ssh.name"> {{ ssh.name }}</a-tooltip>
@ -82,9 +80,9 @@
</a-row>
</a-form-item>
<a-form-item name="releasePathParent" label="发布目录">
<a-form-item name="releasePathParent" :label="$tl('p.publishDir')">
<template #help>
<a-tooltip title="需要配置授权目录(授权才能正常使用发布),授权目录主要是用于确定可以发布到哪些目录中"
<a-tooltip :title="$tl('p.authDirConfig')"
><a-button
size="small"
type="link"
@ -94,7 +92,7 @@
}
"
>
<InfoCircleOutlined />配置目录
<InfoCircleOutlined />{{ $tl('p.authDir') }}
</a-button>
</a-tooltip>
</template>
@ -104,7 +102,7 @@
show-search
allow-clear
style="width: 30%"
placeholder="请选择发布的一级目录"
:placeholder="$tl('p.firstLevelDir')"
>
<a-select-option v-for="item in accessList" :key="item">
<a-tooltip :title="item">{{ item }}</a-tooltip>
@ -114,32 +112,36 @@
</template>
</a-select>
<a-form-item-rest>
<a-input v-model:value="temp.releasePathSecondary" style="width: 70%" placeholder="请填写发布的二级目录" />
<a-input
v-model:value="temp.releasePathSecondary"
style="width: 70%"
:placeholder="$tl('p.secondLevelDir')"
/>
</a-form-item-rest>
</a-input-group>
</a-form-item>
<a-form-item name="releaseBeforeCommand">
<template #label>
执行脚本
{{ $tl('p.executeScript') }}
<a-tooltip>
<template #title>
<ul>
<li>支持变量引用${TASK_ID}${FILE_ID}${FILE_NAME}${FILE_EXT_NAME}</li>
<li>可以引用工作空间的环境变量 变量占位符 ${xxxx} xxxx 为变量名称</li>
<li>建议在上传后的脚本中对文件进行自定义更名SSH 上传默认为${FILE_ID}.${FILE_EXT_NAME}</li>
<li>{{ $tl('p.scriptVariable') }}</li>
<li>{{ $tl('p.workspaceEnvVariable') }}</li>
<li>{{ $tl('p.renameFile') }}</li>
</ul>
</template>
<QuestionCircleOutlined />
</a-tooltip>
</template>
<template #help>
<div v-if="scriptTabKey === 'before'">文件上传前需要执行的脚本(非阻塞命令)</div>
<div v-else-if="scriptTabKey === 'after'">文件上传成功后需要执行的脚本(非阻塞命令)</div>
<div v-if="scriptTabKey === 'before'">{{ $tl('p.preUploadScript') }}</div>
<div v-else-if="scriptTabKey === 'after'">{{ $tl('p.postUploadScript') }}</div>
</template>
<a-form-item-rest>
<a-tabs v-model:activeKey="scriptTabKey" tab-position="right" type="card">
<a-tab-pane key="before" tab="上传前">
<a-tab-pane key="before" :tab="$tl('c.content')">
<code-editor
v-model:content="temp.beforeScript"
height="40vh"
@ -149,11 +151,14 @@
}"
>
<template #tool_before>
<a-tag><b>上传前</b>执行</a-tag>
<a-tag
><b>{{ $tl('c.content') }}</b
>{{ $tl('p.execute') }}</a-tag
>
</template>
</code-editor>
</a-tab-pane>
<a-tab-pane key="after" tab="上传后">
<a-tab-pane key="after" :tab="$tl('p.afterUpload')">
<code-editor
v-model:content="temp.afterScript"
height="40vh"
@ -162,7 +167,9 @@
mode: 'shell'
}"
>
<template #tool_before> <a-tag>上传后执行</a-tag></template>
<template #tool_before>
<a-tag>{{ $tl('p.afterUploadExecute') }}</a-tag></template
>
</code-editor>
</a-tab-pane>
</a-tabs>
@ -173,7 +180,7 @@
<a-modal
v-model:value="configDir"
destroy-on-close
:title="`配置授权目录`"
:title="`${$tl('p.authDirSetting')}`"
:footer="null"
:mask-closable="false"
@cancel="
@ -211,16 +218,16 @@ export default {
return {
temp: {},
releaseFileRules: {
name: [{ required: true, message: '请输入文件任务名', trigger: 'blur' }],
taskType: [{ required: true, message: '请选择发布方式', trigger: 'blur' }],
name: [{ required: true, message: this.$tl('p.taskNameInput'), trigger: 'blur' }],
taskType: [{ required: true, message: this.$tl('p.publishModeSelect'), trigger: 'blur' }],
releasePath: [
{
required: true,
message: '请选择发布的一级目录和填写二级目录',
message: this.$tl('p.publishDirSelect'),
trigger: 'blur'
}
],
taskDataIds: [{ required: true, message: '请选择发布的SSH', trigger: 'blur' }]
taskDataIds: [{ required: true, message: this.$tl('p.sshSelect'), trigger: 'blur' }]
},
sshList: [],
accessList: [],
@ -235,6 +242,9 @@ export default {
this.loadAccesList()
},
methods: {
$tl(key, ...args) {
return this.$t(`pages.fileManager.fileStorage.releaseFile.${key}`, ...args)
},
taskTypeChange() {
const value = this.temp.taskType
this.temp = { ...this.temp, taskDataIds: undefined }

View File

@ -1,25 +1,29 @@
<template>
<div>
<a-form :model="temp" :label-col="{ span: 2 }" :wrapper-col="{ span: 20 }">
<a-form-item label="任务名" name="name">
<a-input placeholder="请输入任务名" :disabled="true" :value="temp.taskData && temp.taskData.name" />
<a-form-item :label="$tl('p.taskName')" name="name">
<a-input :placeholder="$tl('c.taskName')" :disabled="true" :value="temp.taskData && temp.taskData.name" />
</a-form-item>
<a-form-item label="发布方式" name="taskType">
<a-form-item :label="$tl('p.publishMethod')" name="taskType">
<a-radio-group :value="temp.taskData && temp.taskData.taskType" :disabled="true">
<a-radio :value="0"> SSH </a-radio>
<a-radio :value="1"> 节点 </a-radio>
<a-radio :value="1"> {{ $tl('p.node') }} </a-radio>
</a-radio-group>
</a-form-item>
<a-form-item name="releasePath" label="发布目录">
<a-input placeholder="请输入任务名" :disabled="true" :value="temp.taskData && temp.taskData.releasePath" />
<a-form-item name="releasePath" :label="$tl('p.publishDir')">
<a-input
:placeholder="$tl('c.taskName')"
:disabled="true"
:value="temp.taskData && temp.taskData.releasePath"
/>
</a-form-item>
<a-form-item name="releasePath" label="状态" :help="temp.taskData && temp.taskData.statusMsg">
{{ statusMap[temp.taskData && temp.taskData.status] || '未知' }}
<a-form-item name="releasePath" :label="$tl('p.status')" :help="temp.taskData && temp.taskData.statusMsg">
{{ statusMap[temp.taskData && temp.taskData.status] || $tl('p.unknown') }}
</a-form-item>
<a-form-item label="执行日志">
<a-form-item :label="$tl('p.executionLog')">
<a-tabs :active-key="activeKey" @change="tabCallback">
<a-tab-pane v-for="item in temp.taskList" :key="item.id">
<template #tab>
@ -50,9 +54,9 @@
</a-tab-pane>
</a-tabs>
</a-form-item>
<a-form-item label="执行脚本" name="releaseBeforeCommand">
<a-form-item :label="$tl('p.executionScript')" name="releaseBeforeCommand">
<a-tabs tab-position="right">
<a-tab-pane key="before" tab="上传前">
<a-tab-pane key="before" :tab="$tl('p.beforeUpload')">
<code-editor
height="40vh"
:content="temp.taskData && temp.taskData.beforeScript"
@ -62,7 +66,7 @@
}"
></code-editor>
</a-tab-pane>
<a-tab-pane key="after" tab="上传后">
<a-tab-pane key="after" :tab="$tl('p.afterUpload')">
<code-editor
height="40vh"
:content="temp.taskData && temp.taskData.afterScript"
@ -119,6 +123,9 @@ export default {
this.loadData()
},
methods: {
$tl(key, ...args) {
return this.$t(`pages.fileManager.releaseTask.details.${key}`, ...args)
},
//
loadData() {
this.activeKey = this.temp.id || ''

View File

@ -21,7 +21,7 @@
<a-space wrap class="search-box">
<a-input
v-model:value="listQuery['%name%']"
placeholder="任务名"
:placeholder="$tl('c.taskName')"
class="search-input-item"
@press-enter="loadData"
/>
@ -39,7 +39,7 @@
}
"
allow-clear
placeholder="状态"
:placeholder="$tl('c.status')"
class="search-input-item"
>
<a-select-option v-for="(val, key) in statusMap" :key="key">{{ val }}</a-select-option>
@ -58,13 +58,13 @@
}
"
allow-clear
placeholder="发布类型"
:placeholder="$tl('p.publishType')"
class="search-input-item"
>
<a-select-option v-for="(val, key) in taskTypeMap" :key="key">{{ val }}</a-select-option>
</a-select>
<a-tooltip title="按住 Ctr 或者 Alt/Option 键点击按钮快速回到第一页">
<a-button type="primary" :loading="loading" @click="loadData">搜索</a-button>
<a-tooltip :title="$tl('p.fastReturnFirstPage')">
<a-button type="primary" :loading="loading" @click="loadData">{{ $tl('p.search') }}</a-button>
</a-tooltip>
</a-space>
</template>
@ -84,34 +84,34 @@
</template>
<template v-else-if="column.dataIndex === 'status'">
<a-tag v-if="text === 2" color="green">{{ statusMap[text] || '未知' }}</a-tag>
<a-tag v-else-if="text === 0 || text === 1" color="orange">{{ statusMap[text] || '未知' }}</a-tag>
<a-tag v-if="text === 2" color="green">{{ statusMap[text] || $tl('c.unknown') }}</a-tag>
<a-tag v-else-if="text === 0 || text === 1" color="orange">{{ statusMap[text] || $tl('c.unknown') }}</a-tag>
<a-tag v-else-if="text === 4" color="blue">
{{ statusMap[text] || '未知' }}
{{ statusMap[text] || $tl('c.unknown') }}
</a-tag>
<a-tag v-else-if="text === 3" color="red">{{ statusMap[text] || '未知' }}</a-tag>
<a-tag v-else>{{ statusMap[text] || '未知' }}</a-tag>
<a-tag v-else-if="text === 3" color="red">{{ statusMap[text] || $tl('c.unknown') }}</a-tag>
<a-tag v-else>{{ statusMap[text] || $tl('c.unknown') }}</a-tag>
</template>
<template v-else-if="column.dataIndex === 'taskType'">
<span>{{ taskTypeMap[text] || '未知' }}</span>
<span>{{ taskTypeMap[text] || $tl('c.unknown') }}</span>
</template>
<template v-else-if="column.dataIndex === 'fileType'">
<span v-if="text == 2">静态文件</span>
<span v-else>文件中心</span>
<span v-if="text == 2">{{ $tl('p.staticFile') }}</span>
<span v-else>{{ $tl('p.fileCenter') }}</span>
</template>
<template v-else-if="column.dataIndex === 'operation'">
<a-space>
<a-button type="primary" size="small" @click="handleView(record)">查看</a-button>
<a-button type="primary" size="small" @click="handleView(record)">{{ $tl('p.view') }}</a-button>
<a-button type="primary" size="small" @click="handleRetask(record)">重建</a-button>
<a-button type="primary" size="small" @click="handleRetask(record)">{{ $tl('p.rebuild') }}</a-button>
<a-button
type="primary"
danger
size="small"
:disabled="!(record.status === 0 || record.status === 1)"
@click="handleCancelTask(record)"
>取消</a-button
>{{ $tl('c.cancel') }}</a-button
>
<a-button
type="primary"
@ -119,7 +119,7 @@
size="small"
:disabled="record.status === 0 || record.status === 1"
@click="handleDelete(record)"
>删除</a-button
>{{ $tl('p.delete') }}</a-button
>
</a-space>
</template>
@ -127,7 +127,7 @@
</a-table>
<!-- 任务详情 -->
<a-drawer
title="任务详情"
:title="$tl('p.taskDetail')"
placement="right"
:width="'80vw'"
:open="detailsVisible"
@ -144,7 +144,7 @@
v-model:open="releaseFileVisible"
destroy-on-close
:confirm-loading="confirmLoading"
title="发布文件"
:title="$tl('p.publishFile')"
width="60%"
:mask-closable="false"
@ok="handleReCrateTask"
@ -156,18 +156,18 @@
:label-col="{ span: 4 }"
:wrapper-col="{ span: 20 }"
>
<a-form-item label="任务名" name="name">
<a-input v-model:value="temp.name" placeholder="请输入任务名" :max-length="50" />
<a-form-item :label="$tl('c.taskName')" name="name">
<a-input v-model:value="temp.name" :placeholder="$tl('p.pleaseInputTaskName')" :max-length="50" />
</a-form-item>
<a-form-item label="发布方式" name="taskType">
<a-form-item :label="$tl('p.publishWay')" name="taskType">
<a-radio-group v-model:value="temp.taskType" :disabled="true">
<a-radio :value="0"> SSH </a-radio>
<a-radio :value="1"> 节点 </a-radio>
<a-radio :value="1"> {{ $tl('p.node') }} </a-radio>
</a-radio-group>
</a-form-item>
<a-form-item v-if="temp.taskType === 0" name="taskDataIds" label="发布的SSH">
<a-form-item v-if="temp.taskType === 0" name="taskDataIds" :label="$tl('p.publishSsh')">
<a-row>
<a-col :span="22">
<a-select
@ -184,7 +184,7 @@
}
"
mode="multiple"
placeholder="请选择SSH"
:placeholder="$tl('p.pleaseSelectSsh')"
>
<a-select-option v-for="ssh in sshList" :key="ssh.id">
<a-tooltip :title="ssh.name"> {{ ssh.name }}</a-tooltip>
@ -196,7 +196,7 @@
</a-col>
</a-row>
</a-form-item>
<a-form-item v-else-if="temp.taskType === 1" name="taskDataIds" label="发布的节点">
<a-form-item v-else-if="temp.taskType === 1" name="taskDataIds" :label="$tl('p.publishNode')">
<a-row>
<a-col :span="22">
<a-select
@ -213,7 +213,7 @@
}
"
mode="multiple"
placeholder="请选择节点"
:placeholder="$tl('p.pleaseSelectNode')"
>
<a-select-option v-for="ssh in nodeList" :key="ssh.id">
<a-tooltip :title="ssh.name"> {{ ssh.name }}</a-tooltip>
@ -226,18 +226,18 @@
</a-row>
</a-form-item>
<a-form-item name="releasePathParent" label="发布目录">
<a-input v-model:value="temp.releasePath" placeholder="请输入发布目录" :disabled="true" />
<a-form-item name="releasePathParent" :label="$tl('c.publishDir')">
<a-input v-model:value="temp.releasePath" :placeholder="$tl('p.pleaseInputPublishDir')" :disabled="true" />
</a-form-item>
<a-form-item name="releasePathParent" label="文件id">
<a-input v-model:value="temp.fileId" placeholder="请输入发布的文件id" />
<a-form-item name="releasePathParent" :label="$tl('p.fileIdInput')">
<a-input v-model:value="temp.fileId" :placeholder="$tl('p.pleaseInputPublishFileId')" />
</a-form-item>
<a-form-item label="执行脚本" name="releaseBeforeCommand">
<a-form-item :label="$tl('p.executeScript')" name="releaseBeforeCommand">
<a-form-item-rest>
<a-tabs tab-position="right">
<a-tab-pane key="before" tab="上传前">
<a-tab-pane key="before" :tab="$tl('p.beforeUpload')">
<code-editor
v-model:content="temp.beforeScript"
height="40vh"
@ -246,9 +246,9 @@
}"
></code-editor>
<div style="margin-top: 10px">文件上传前需要执行的脚本(非阻塞命令)</div>
<div style="margin-top: 10px">{{ $tl('p.beforeUploadScript') }}</div>
</a-tab-pane>
<a-tab-pane key="after" tab="上传后">
<a-tab-pane key="after" :tab="$tl('p.afterUpload')">
<code-editor
v-model:content="temp.afterScript"
height="40vh"
@ -257,7 +257,7 @@
}"
></code-editor>
<div style="margin-top: 10px">文件上传成功后需要执行的脚本(非阻塞命令)</div>
<div style="margin-top: 10px">{{ $tl('p.afterUploadScript') }}</div>
</a-tab-pane>
</a-tabs>
</a-form-item-rest>
@ -265,24 +265,30 @@
</a-form>
</a-modal>
<!-- 查看文件 -->
<a-modal v-model:open="viewFileVisible" destroy-on-close :title="`查看文件`" :footer="null" :mask-closable="false">
<a-modal
v-model:open="viewFileVisible"
destroy-on-close
:title="`${$tl('p.viewFile')}`"
:footer="null"
:mask-closable="false"
>
<a-form :model="temp" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
<a-form-item label="文件名" name="name">
<a-form-item :label="$tl('p.fileName')" name="name">
{{ temp.name }}
</a-form-item>
<a-form-item label="文件ID" name="name">
<a-form-item :label="$tl('c.fileId')" name="name">
{{ temp.id }}
</a-form-item>
<a-form-item label="文件大小" name="size">
<a-form-item :label="$tl('p.fileSize')" name="size">
{{ renderSize(temp.size) }}
</a-form-item>
<a-form-item v-if="temp.validUntil" label="过期时间" name="validUntil">
<a-form-item v-if="temp.validUntil" :label="$tl('p.expireTime')" name="validUntil">
{{ parseTime(temp.validUntil) }}
</a-form-item>
<a-form-item v-if="temp.workspaceId" label="文件共享" name="global">
{{ temp.workspaceId === 'GLOBAL' ? '全局' : '工作空间' }}
<a-form-item v-if="temp.workspaceId" :label="$tl('p.fileShare')" name="global">
{{ temp.workspaceId === 'GLOBAL' ? $tl('p.global') : $tl('p.workspace') }}
</a-form-item>
<a-form-item label="文件描述" name="description">
<a-form-item :label="$tl('p.fileDescription')" name="description">
{{ temp.description }}
</a-form-item>
</a-form>
@ -324,59 +330,59 @@ export default {
confirmLoading: false,
columns: [
{
title: '任务名称',
title: this.$tl('p.taskName'),
dataIndex: 'name',
ellipsis: true,
width: 150,
tooltip: true
},
{
title: '分发类型',
title: this.$tl('p.distributeType'),
dataIndex: 'taskType',
width: '100px',
ellipsis: true
},
{
title: '文件来源',
title: this.$tl('p.fileSource'),
dataIndex: 'fileType',
width: '100px',
ellipsis: true
},
{
title: '状态',
title: this.$tl('c.status'),
dataIndex: 'status',
width: '100px',
ellipsis: true
},
{
title: '状态描述',
title: this.$tl('p.statusDescription'),
dataIndex: 'statusMsg',
ellipsis: true,
width: 200,
tooltip: true
},
{
title: '文件ID',
title: this.$tl('c.fileId'),
dataIndex: 'fileId',
ellipsis: true,
width: 150
},
{
title: '发布目录',
title: this.$tl('c.publishDir'),
dataIndex: 'releasePath',
width: '100px',
ellipsis: true,
tooltip: true
},
{
title: '执行人',
title: this.$tl('p.executor'),
dataIndex: 'modifyUser',
width: '120px',
ellipsis: true
},
{
title: '任务时间',
title: this.$tl('p.taskTime'),
dataIndex: 'createTimeMillis',
sorter: true,
ellipsis: true,
@ -384,7 +390,7 @@ export default {
width: '170px'
},
{
title: '任务更新时间',
title: this.$tl('p.taskUpdateTime'),
dataIndex: 'modifyTimeMillis',
sorter: true,
ellipsis: true,
@ -393,7 +399,7 @@ export default {
},
{
title: '操作',
title: this.$tl('p.operation'),
dataIndex: 'operation',
align: 'center',
@ -405,9 +411,9 @@ export default {
nodeList: [],
releaseFileVisible: false,
releaseFileRules: {
name: [{ required: true, message: '请输入文件任务名', trigger: 'blur' }],
name: [{ required: true, message: this.$tl('p.pleaseInputFileTaskName'), trigger: 'blur' }],
taskDataIds: [{ required: true, message: '请选择发布的SSH', trigger: 'blur' }]
taskDataIds: [{ required: true, message: this.$tl('p.pleaseSelectPublishSsh'), trigger: 'blur' }]
},
viewFileVisible: false
}
@ -421,6 +427,9 @@ export default {
this.loadData()
},
methods: {
$tl(key, ...args) {
return this.$t(`pages.fileManager.releaseTask.list.${key}`, ...args)
},
CHANGE_PAGE,
renderSize,
parseTime,
@ -445,11 +454,11 @@ export default {
//
handleDelete(row) {
$confirm({
title: '系统提示',
title: this.$tl('c.systemPrompt'),
zIndex: 1009,
content: '真的要删除该执行记录吗?',
okText: '确认',
cancelText: '取消',
content: this.$tl('p.reallyDeleteRecord'),
okText: this.$tl('c.confirm'),
cancelText: this.$tl('c.cancel'),
onOk: () => {
return deleteReleaseTask({
id: row.id
@ -538,11 +547,11 @@ export default {
//
handleCancelTask(record) {
$confirm({
title: '系统提示',
title: this.$tl('c.systemPrompt'),
zIndex: 1009,
content: '真的取消当前发布任务吗?',
okText: '确认',
cancelText: '取消',
content: this.$tl('p.reallyCancelTask'),
okText: this.$tl('c.confirm'),
cancelText: this.$tl('c.cancel'),
oonOk: () => {
return cancelReleaseTask({ id: record.id }).then((res) => {
if (res.code === 200) {
@ -568,7 +577,7 @@ export default {
this.viewFileVisible = true
} else {
$notification.warning({
message: '文件不存在啦'
message: this.$tl('c.fileNotExist')
})
}
}
@ -583,7 +592,7 @@ export default {
this.viewFileVisible = true
} else {
$notification.warning({
message: '文件不存在啦'
message: this.$tl('c.fileNotExist')
})
}
}

View File

@ -24,28 +24,28 @@
<a-space>
<a-input
v-model:value="listQuery['%name%']"
placeholder="文件名称"
:placeholder="$tl('p.fileName')"
class="search-input-item"
@press-enter="loadData"
/>
<a-input
v-model:value="listQuery['extName']"
placeholder="后缀,精准搜索"
:placeholder="$tl('p.suffixSearch')"
class="search-input-item"
@press-enter="loadData"
/>
<a-input
v-model:value="listQuery['id']"
placeholder="文件id,精准搜索"
:placeholder="$tl('p.fileIdSearch')"
class="search-input-item"
@press-enter="loadData"
/>
<a-tooltip title="按住 Ctr 或者 Alt/Option 键点击按钮快速回到第一页">
<a-button type="primary" :loading="loading" @click="loadData">搜索</a-button>
<a-tooltip :title="$tl('p.quickBackToFirstPage')">
<a-button type="primary" :loading="loading" @click="loadData">{{ $tl('p.search') }}</a-button>
</a-tooltip>
<!-- <a-button type="primary" @click="handleUpload">上传文件</a-button> -->
<a-button type="primary" @click="reScanner">扫描</a-button>
<a-button type="primary" @click="reScanner">{{ $tl('p.scan') }}</a-button>
<a-button
type="primary"
@ -53,7 +53,7 @@
:disabled="!tableSelections || tableSelections.length <= 0"
@click="handleBatchDelete"
>
批量删除
{{ $tl('p.batchDelete') }}
</a-button>
<a-button
size="small"
@ -64,7 +64,7 @@
}
"
>
<InfoCircleOutlined /> 配置目录
<InfoCircleOutlined /> {{ $tl('p.configDirectory') }}
</a-button>
</a-space>
</template>
@ -81,11 +81,11 @@
</a-tooltip>
</template>
<template v-else-if="column.dataIndex === 'name'">
<a-popover title="文件信息">
<a-popover :title="$tl('p.fileInfo')">
<template #content>
<p>文件ID{{ record.id }}</p>
<p>文件名{{ text }}</p>
<p>文件描述{{ record.description }}</p>
<p>{{ $tl('p.fileId') }}{{ record.id }}</p>
<p>{{ $tl('p.fileNameLabel') }}{{ text }}</p>
<p>{{ $tl('p.fileDescriptionLabel') }}{{ record.description }}</p>
</template>
<!-- {{ text }} -->
<a-button type="link" style="padding: 0" size="small" @click="handleEdit(record)">{{ text }}</a-button>
@ -98,19 +98,19 @@
</a-tooltip>
</template>
<template v-else-if="column.dataIndex === 'source'">
<a-tooltip placement="topLeft" :title="`${sourceMap[text] || '未知'}`">
<span>{{ sourceMap[text] || '未知' }}</span>
<a-tooltip placement="topLeft" :title="`${sourceMap[text] || $tl('c.content1')}`">
<span>{{ sourceMap[text] || $tl('c.content1') }}</span>
</a-tooltip>
</template>
<template v-else-if="column.dataIndex === 'status'">
<a-tag v-if="text === 1" color="green">存在</a-tag>
<a-tag v-else color="red">丢失</a-tag>
<a-tag v-if="text === 1" color="green">{{ $tl('p.exist') }}</a-tag>
<a-tag v-else color="red">{{ $tl('p.missing') }}</a-tag>
</template>
<template v-else-if="column.dataIndex === 'type'">
<a-tag v-if="text === 1">文件</a-tag>
<a-tag v-else>文件夹</a-tag>
<a-tag v-if="text === 1">{{ $tl('p.file') }}</a-tag>
<a-tag v-else>{{ $tl('p.folder') }}</a-tag>
</template>
<template v-else-if="column.dataIndex === 'operation'">
@ -122,16 +122,18 @@
type="primary"
@click="handleDownloadUrl(record)"
>
下载</a-button
{{ $tl('p.download') }}</a-button
>
<a-button
size="small"
:disabled="!(record.status === 1 && record.type === 1)"
type="primary"
@click="handleReleaseFile(record)"
>发布</a-button
>{{ $tl('p.publish') }}</a-button
>
<a-button type="primary" danger size="small" @click="handleDelete(record)">删除</a-button>
<a-button type="primary" danger size="small" @click="handleDelete(record)">{{
$tl('p.deleteFile')
}}</a-button>
</a-space>
</template>
</template>
@ -141,18 +143,18 @@
<a-modal
v-model:open="editVisible"
destroy-on-close
:title="`修改文件`"
:title="`${$tl('p.modifyFile')}`"
:confirm-loading="confirmLoading"
:mask-closable="false"
@ok="handleEditOk"
>
<a-form ref="editForm" :rules="rules" :model="temp" :label-col="{ span: 4 }" :wrapper-col="{ span: 20 }">
<a-form-item label="文件名" name="name">
<a-input v-model:value="temp.name" placeholder="文件名" :disabled="true" />
<a-form-item :label="$tl('c.fileName')" name="name">
<a-input v-model:value="temp.name" :placeholder="$tl('c.fileName')" :disabled="true" />
</a-form-item>
<a-form-item label="文件描述" name="description">
<a-textarea v-model:value="temp.description" placeholder="请输入文件描述" />
<a-form-item :label="$tl('p.fileDescription')" name="description">
<a-textarea v-model:value="temp.description" :placeholder="$tl('p.pleaseEnterFileDescription')" />
</a-form-item>
</a-form>
</a-modal>
@ -161,7 +163,7 @@
<a-modal
v-model:open="triggerVisible"
destroy-on-close
title="断点/分片下载"
:title="$tl('p.chunkedDownload')"
width="50%"
:footer="null"
:mask-closable="false"
@ -169,13 +171,13 @@
<a-form ref="editTriggerForm" :model="temp" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }">
<a-tabs default-active-key="1">
<template #rightExtra>
<a-tooltip title="重置下载 token 信息,重置后之前的下载 token 将失效">
<a-button type="primary" size="small" @click="resetTrigger">重置</a-button>
<a-tooltip :title="$tl('p.resetDownloadToken')">
<a-button type="primary" size="small" @click="resetTrigger">{{ $tl('p.reset') }}</a-button>
</a-tooltip>
</template>
<a-tab-pane key="1" tab="断点/分片单文件下载">
<a-tab-pane key="1" :tab="$tl('p.chunkedSingleFileDownload')">
<a-space direction="vertical" style="width: 100%">
<a-alert type="info" :message="`下载地址(点击可以复制)`">
<a-alert type="info" :message="`${$tl('c.downloadAddress')}(${$tl('c.copyTip')})`">
<template #description>
<a-typography-paragraph :copyable="{ text: temp.triggerDownloadUrl }">
<a-tag>GET</a-tag>
@ -184,26 +186,26 @@
</template>
</a-alert>
<a :href="temp.triggerDownloadUrl" target="_blank">
<a-button size="small" type="primary"><DownloadOutlined />立即下载</a-button>
<a-button size="small" type="primary"><DownloadOutlined />{{ $tl('c.downloadNow') }}</a-button>
</a>
</a-space>
</a-tab-pane>
<a-tab-pane v-if="temp.triggerAliasDownloadUrl" tab="断点/分片别名下载">
<a-tab-pane v-if="temp.triggerAliasDownloadUrl" :tab="$tl('p.chunkedAliasDownload')">
<a-space direction="vertical" style="width: 100%">
<a-alert message="温馨提示" type="warning">
<a-alert :message="$tl('p.warmPrompt')" type="warning">
<template #description>
<ul>
<li>
支持自定义排序字段sort=createTimeMillis:desc
{{ $tl('p.customSortField') }}=createTimeMillis:desc
<p>描述根据创建时间升序第一个</p>
<p>{{ $tl('p.descSortAscFirst') }}</p>
</li>
<li>支持的字段可以通过接口返回的查看</li>
<li>通用的字段有createTimeMillismodifyTimeMillis</li>
<li>{{ $tl('p.supportedFields') }}</li>
<li>{{ $tl('p.commonFields') }}</li>
</ul>
</template>
</a-alert>
<a-alert type="info" :message="`下载地址(点击可以复制)`">
<a-alert type="info" :message="`${$tl('c.downloadAddress')}(${$tl('c.copyTip')})`">
<template #description>
<a-typography-paragraph :copyable="{ text: temp.triggerAliasDownloadUrl }">
<a-tag>GET</a-tag>
@ -212,7 +214,7 @@
</template>
</a-alert>
<a :href="temp.triggerAliasDownloadUrl" target="_blank">
<a-button size="small" type="primary"><DownloadOutlined />立即下载</a-button>
<a-button size="small" type="primary"><DownloadOutlined />{{ $tl('c.downloadNow') }}</a-button>
</a>
</a-space>
</a-tab-pane>
@ -223,7 +225,7 @@
<a-modal
v-model:open="releaseFileVisible"
destroy-on-close
title="发布文件"
:title="$tl('p.publishFile')"
width="50%"
:mask-closable="false"
:confirm-loading="confirmLoading"
@ -237,7 +239,7 @@
<a-modal
v-model:open="configDir"
destroy-on-close
:title="`配置授权目录`"
:title="`${$tl('p.configAuthDirectory')}`"
:footer="null"
width="50vw"
:mask-closable="false"
@ -296,27 +298,27 @@ export default {
list: [],
columns: [
{
title: '名称',
title: this.$tl('p.name'),
dataIndex: 'name',
ellipsis: true,
width: 150
},
{
title: '描述',
title: this.$tl('p.desc'),
dataIndex: 'description',
ellipsis: true,
width: 150,
tooltip: true
},
{
title: '路径',
title: this.$tl('p.path'),
dataIndex: 'absolutePath',
ellipsis: true,
width: 150,
tooltip: true
},
{
title: '大小',
title: this.$tl('p.size'),
dataIndex: 'size',
sorter: true,
ellipsis: true,
@ -324,7 +326,7 @@ export default {
width: '100px'
},
{
title: '后缀',
title: this.$tl('p.suffix'),
dataIndex: 'extName',
ellipsis: true,
@ -332,14 +334,14 @@ export default {
width: '80px'
},
{
title: '类型',
title: this.$tl('p.type'),
dataIndex: 'type',
ellipsis: true,
width: '80px'
},
{
title: '文件状态',
title: this.$tl('p.fileStatus'),
dataIndex: 'status',
ellipsis: true,
@ -347,7 +349,7 @@ export default {
},
{
title: '文件修改时间',
title: this.$tl('p.fileModifyTime'),
dataIndex: 'lastModified',
sorter: true,
customRender: ({ text }) => parseTime(text),
@ -355,7 +357,7 @@ export default {
},
{
title: '操作',
title: this.$tl('p.operation'),
dataIndex: 'operation',
align: 'center',
ellipsis: true,
@ -365,8 +367,8 @@ export default {
}
],
rules: {
name: [{ required: true, message: '请输入文件名称', trigger: 'blur' }],
url: [{ required: true, message: '请输入远程地址', trigger: 'blur' }]
name: [{ required: true, message: this.$tl('p.pleaseEnterFileName'), trigger: 'blur' }],
url: [{ required: true, message: this.$tl('p.pleaseEnterRemoteAddress'), trigger: 'blur' }]
},
temp: {},
@ -402,6 +404,9 @@ export default {
this.loadData()
},
methods: {
$tl(key, ...args) {
return this.$t(`pages.fileManager.staticFileStorage.list.${key}`, ...args)
},
randomStr,
CHANGE_PAGE,
renderSize,
@ -454,11 +459,11 @@ export default {
//
handleDelete(record) {
$confirm({
title: '系统提示',
title: this.$tl('c.systemPrompt'),
zIndex: 1009,
content: '真的要删除当前文件么?' + record.name,
okText: '确认',
cancelText: '取消',
content: this.$tl('p.confirmDeleteFile') + record.name,
okText: this.$tl('c.confirm'),
cancelText: this.$tl('c.cancel'),
onOk: () => {
return delFile({
id: record.id,
@ -478,16 +483,16 @@ export default {
handleBatchDelete() {
if (!this.tableSelections || this.tableSelections.length <= 0) {
$notification.warning({
message: '没有选择任何数据'
message: this.$tl('p.noDataSelected')
})
return
}
$confirm({
title: '系统提示',
title: this.$tl('c.systemPrompt'),
zIndex: 1009,
content: '真的要删除这些文件么?',
okText: '确认',
cancelText: '取消',
content: this.$tl('p.confirmDeleteFiles'),
okText: this.$tl('c.confirm'),
cancelText: this.$tl('c.cancel'),
onOk: () => {
return delFile({
ids: this.tableSelections.join(','),
@ -575,7 +580,7 @@ export default {
handerConfirm() {
if (!this.tableSelections.length) {
$notification.warning({
message: '请选择要使用的文件'
message: this.$tl('c.pleaseSelectFile')
})
return
}
@ -584,7 +589,7 @@ export default {
})
if (!selectData.length) {
$notification.warning({
message: '请选择要使用的文件'
message: this.$tl('c.pleaseSelectFile')
})
return
}