added downloadConfirm string to noStream page
This commit is contained in:
parent
81e9d81dab
commit
e2425cd6c9
|
@ -19,9 +19,9 @@ module.exports = function(state, emit) {
|
||||||
<form class="md:w-128" onsubmit=${submit}>
|
<form class="md:w-128" onsubmit=${submit}>
|
||||||
<fieldset class="border rounded p-4 my-4" onchange=${optionChanged}>
|
<fieldset class="border rounded p-4 my-4" onchange=${optionChanged}>
|
||||||
<div class="flex items-center mb-2">
|
<div class="flex items-center mb-2">
|
||||||
<img class="mr-3 flex-shrink-0" src="${assets.get(
|
<svg class="h-8 w-6 mr-3 flex-shrink-0 text-white dark:text-grey-90">
|
||||||
'blue_file.svg'
|
<use xlink:href="${assets.get('blue_file.svg')}#icon"/>
|
||||||
)}"/>
|
</svg>
|
||||||
<p class="flex-grow">
|
<p class="flex-grow">
|
||||||
<h1 class="text-base font-medium word-break-all">${
|
<h1 class="text-base font-medium word-break-all">${
|
||||||
archive.name
|
archive.name
|
||||||
|
@ -55,6 +55,11 @@ module.exports = function(state, emit) {
|
||||||
value="${state.translate('copyLinkButton')}"
|
value="${state.translate('copyLinkButton')}"
|
||||||
title="${state.translate('copyLinkButton')}"
|
title="${state.translate('copyLinkButton')}"
|
||||||
type="submit" />
|
type="submit" />
|
||||||
|
<p
|
||||||
|
class="text-grey-80 leading-normal dark:text-grey-40 font-semibold text-center md:my-8 md:text-left"
|
||||||
|
>
|
||||||
|
${state.translate('downloadConfirmDescription')}
|
||||||
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@ -64,6 +69,7 @@ module.exports = function(state, emit) {
|
||||||
const choice = event.target.value;
|
const choice = event.target.value;
|
||||||
const button = event.currentTarget.nextElementSibling;
|
const button = event.currentTarget.nextElementSibling;
|
||||||
let title = button.title;
|
let title = button.title;
|
||||||
|
console.error(choice, title);
|
||||||
switch (choice) {
|
switch (choice) {
|
||||||
case 'copy':
|
case 'copy':
|
||||||
title = state.translate('copyLinkButton');
|
title = state.translate('copyLinkButton');
|
||||||
|
|
|
@ -15,7 +15,13 @@ module.exports = async function(req, res) {
|
||||||
agent: req.ua.browser.name || req.ua.ua.substring(0, 6)
|
agent: req.ua.browser.name || req.ua.ua.substring(0, 6)
|
||||||
});
|
});
|
||||||
await storage.incrementField(id, 'dl');
|
await storage.incrementField(id, 'dl');
|
||||||
if (meta.dlToken >= meta.dlimit) {
|
if (meta.dl + 1 >= meta.dlimit) {
|
||||||
|
// Only dlimit number of tokens will be issued
|
||||||
|
// after which /download/token will return 403
|
||||||
|
// however the protocol doesn't prevent one token
|
||||||
|
// from making all the downloads and assumes
|
||||||
|
// clients are well behaved. If this becomes
|
||||||
|
// a problem we can keep track of used tokens.
|
||||||
await storage.kill(id);
|
await storage.kill(id);
|
||||||
}
|
}
|
||||||
res.sendStatus(200);
|
res.sendStatus(200);
|
||||||
|
|
Loading…
Reference in New Issue