filesharing/views/download.pug

42 lines
1.5 KiB
Plaintext
Raw Normal View History

2022-08-26 12:28:03 +00:00
doctype html
html(lang='zh')
head
meta(charset='UTF-8')
meta(http-equiv='X-UA-Compatible' content='IE=edge')
meta(name='viewport' content='width=device-width, initial-scale=1.0')
2022-09-04 11:49:22 +00:00
link(rel='icon' href='/share/favicon.ico' type='image/x-icon')
link(rel='stylesheet' href='/share/style.css')
title #{file.filename} | 文件下载
2022-08-26 12:28:03 +00:00
body
2022-08-26 12:46:06 +00:00
h1 文件下载
p
2022-09-04 11:49:22 +00:00
a(href='/share') 返回首页
2022-08-26 12:28:03 +00:00
form(method='POST')
label 文件
label= file.filename
label 类型
label= file.mimetype
2022-08-26 12:28:03 +00:00
label 大小
2022-08-27 02:33:20 +00:00
label= filesize(file.size)
label 上传
label= moment(file.createdAt).fromNow()
label 热度
2022-08-26 12:28:03 +00:00
label= file.downloads
|   次下载
2022-08-26 12:28:03 +00:00
if file.password
label(for='password_input') 密码
input(id='password_input' name='password' type='password' autocomplete='off' required)
button(id='download_button' type='submit') 下载
2022-08-26 16:46:04 +00:00
if !file.password
2022-08-27 03:42:33 +00:00
- const mimetype = file.mimetype.split('/')[0]
2022-09-04 11:49:22 +00:00
- const src = '/share/file/' + file.md5
2022-08-26 16:46:04 +00:00
if mimetype == 'image'
p 预览
img(src=src)
if mimetype == 'audio'
p 预览
audio(controls src=src)
2022-08-27 03:42:33 +00:00
if mimetype == 'video'
p 预览
video(controls src=src)