Service Junk Drawer at /attic
This commit is contained in:
@@ -8,7 +8,6 @@ import {
|
||||
Render,
|
||||
Req,
|
||||
Res,
|
||||
UploadedFile,
|
||||
UploadedFiles,
|
||||
UseInterceptors,
|
||||
} from '@nestjs/common';
|
||||
@@ -20,8 +19,8 @@ import { JunkDrawerMetadata } from './types';
|
||||
import { Request, Response } from 'express';
|
||||
import { ipFromRequest } from 'src/utils/ip';
|
||||
|
||||
@Controller('junk-drawer')
|
||||
@ApiTags('junk-drawer')
|
||||
@Controller(['junk-drawer', 'attic'])
|
||||
@ApiTags('attic')
|
||||
export class JunkDrawerController {
|
||||
constructor(private readonly junkDrawerService: JunkDrawerService) {}
|
||||
|
||||
@@ -119,6 +118,6 @@ export class JunkDrawerController {
|
||||
if (remember && ip && !privateIsh) {
|
||||
await this.junkDrawerService.recordItemForIp(ip, uniqueSlug);
|
||||
}
|
||||
return { url: `/junk-drawer/${uniqueSlug}` };
|
||||
return { url: `/attic/${uniqueSlug}` };
|
||||
}
|
||||
}
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<title>Junk Drawer</title>
|
||||
<title>Chip's Attic</title>
|
||||
<script src='https://cdn.tailwindcss.com'></script>
|
||||
<meta name='viewport' content='width=device-width, initial-scale=1' />
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<form
|
||||
method='post'
|
||||
action='/junk-drawer/upload'
|
||||
action='/attic/upload'
|
||||
enctype='multipart/form-data'
|
||||
>
|
||||
<div>
|
||||
|
@@ -4,35 +4,35 @@
|
||||
|
||||
<head>
|
||||
<meta charset='utf-8' />
|
||||
<title>Junk Drawer</title>
|
||||
<title>Chip's Attic</title>
|
||||
<script src='https://cdn.tailwindcss.com'></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div>
|
||||
<h1 class="text-xl">Junk Drawer Item</h1>
|
||||
<p>The junk drawer item was uploaded {{lastModified}}</p>
|
||||
<h1 class="text-xl">Attic Item</h1>
|
||||
<p>The attic item was uploaded {{lastModified}}</p>
|
||||
<h2>Description</h2>
|
||||
<p class="bg-slate-100 px-2 py-4">{{description}}</p>
|
||||
<p>Right-click copy: <a class="text-blue-500 underline" href='/junk-drawer/{{slug}}'>{{slug}}</a></p>
|
||||
<p>Right-click copy: <a class="text-blue-500 underline" href='/attic/{{slug}}'>{{slug}}</a></p>
|
||||
{{#if items}}
|
||||
<p class="text-lg">Files:</p>
|
||||
<div class="list-disc list-inside ml-1">
|
||||
{{#each items}}
|
||||
<div>
|
||||
<a target="_blank" class="text-emerald-600" href='/junk-drawer/{{../slug}}/{{filename}}'>
|
||||
<a target="_blank" class="text-emerald-600" href='/attic/{{../slug}}/{{filename}}'>
|
||||
<p>
|
||||
{{filename}}
|
||||
</p>
|
||||
{{#if isImage}}
|
||||
<img height="150" width="150" src='/junk-drawer/{{../slug}}/{{filename}}' alt='{{filename}}' />
|
||||
<img height="150" width="150" src='/attic/{{../slug}}/{{filename}}' alt='{{filename}}' />
|
||||
{{/if}}
|
||||
</a>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<p><a class="text-blue-500 underline" href='/junk-drawer'>Upload another file</a></p>
|
||||
<p><a class="text-blue-500 underline" href='/attic'>Upload another file</a></p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
Reference in New Issue
Block a user