ui: fix files link & title (#773)

This commit is contained in:
panda authored and GitHub committed 2024-04-01 20:17:11 +08:00
1 parent b540412382
commit 64c858cdf7
2 files changed
+4 -1

No files matched your search

+2
View File
@@ -376,6 +376,7 @@ homework_detail_problem_submit: 递交作业题目
homework_detail_problem: 题目详情
homework_detail: 作业详情
homework_edit: 编辑作业
homework_files: 作业文件
homework_main: 作业
homework_scoreboard: 作业成绩表
homework_status: 作业成绩表
@@ -816,6 +817,7 @@ Training requirement is not satisfied.: 不满足训练条件。
training_create: 创建训练
training_detail: 训练详情
training_edit: 编辑训练
training_files: 训练文件
training_main: 训练
Training: 训练
Trainings per page: 每页展示的训练数量
@@ -46,7 +46,8 @@ const dialogAction = (id) => [
];
function bindCopyLink(id, src: string) {
const url = !(window.location.href.endsWith('file') || window.location.href.endsWith('files')) || window.location.href.match('contest/.*/file')
const url = !(window.location.href.endsWith('file') || window.location.href.endsWith('files'))
|| window.location.href.match('homework/.*/file') || window.location.href.match('training/.*/file')
? `file://${src.substring(src.lastIndexOf('/') + 1)}` : src;
const clip = new Clipboard(`#copy-${id}`, { text: () => `${url}` });
clip.on('success', () => Notification.success(i18n(`${url.startsWith('file://') ? 'Reference' : 'Download'} link copied to clipboard!`)));