mirror of
https://github.com/rikkaneko/paste.git
synced 2025-06-06 08:35:44 +00:00
Update paste info formatting
Update paste.html style Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
parent
5cb9fef9a7
commit
3562fe2d24
2 changed files with 9 additions and 7 deletions
|
@ -51,15 +51,15 @@
|
|||
<div>
|
||||
<h4>Settings</h4>
|
||||
<label for="pass_input">Password: </label>
|
||||
<input id="pass_input" type="password" name="pass">
|
||||
<input id="pass_input" type="password" name="pass" style="margin-left: 7px;">
|
||||
<input id="show_pass_button" type="checkbox">
|
||||
<label for="show_pass_button">Show</label>
|
||||
</div>
|
||||
<div>
|
||||
<div style="margin-top: 1px;">
|
||||
<label for="read_limit_input">Read limit: </label>
|
||||
<input id="read_limit_input" type="number" name="read-limit" min="1" style="width: 3em">
|
||||
<input id="read_limit_input" type="number" name="read-limit" min="1" style="margin-left: 2px; width: 3em">
|
||||
</div>
|
||||
<div>
|
||||
<div style="margin-top: 2px;">
|
||||
<input id="show_qr_checkbox" type="checkbox" name="qrcode" checked>
|
||||
<label for="show_qr_checkbox">Show QR code on sumbitted</label>
|
||||
</div>
|
||||
|
|
|
@ -512,19 +512,21 @@ export default {
|
|||
};
|
||||
|
||||
async function get_paste_info(uuid: string, descriptor: PasteIndexEntry, env: Env, use_html: boolean = true, need_qr: boolean = false): Promise<Response> {
|
||||
const date = new Date(descriptor.last_modified);
|
||||
const created = new Date(descriptor.last_modified);
|
||||
const expired = new Date(descriptor.last_modified + 2419200000);
|
||||
const link = `https://${SERVICE_URL}/${uuid}`;
|
||||
let content = dedent`
|
||||
id: ${uuid}
|
||||
link: ${link}
|
||||
title: ${descriptor.title || '<empty>'}
|
||||
title: ${descriptor.title?.trim() || '-'}
|
||||
mime-type: ${descriptor.mime_type ?? '-'}
|
||||
size: ${descriptor.size} bytes (${to_human_readable_size(descriptor.size)})
|
||||
password: ${(!!descriptor.password)}
|
||||
editable: ${descriptor.editable ? descriptor.editable : true}
|
||||
remaining read count: ${descriptor.read_count_remain !== undefined ?
|
||||
descriptor.read_count_remain ? descriptor.read_count_remain : `0 (expired)` : '-'}
|
||||
created at ${date.toISOString()}
|
||||
created at ${created.toISOString()}
|
||||
expired at ${expired.toISOString()}
|
||||
`;
|
||||
|
||||
// Browser response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue