not doing any more

This commit is contained in:
Smigz 2025-06-26 16:30:30 -04:00
parent 5ab9f0b2c2
commit b11e7978d0
10 changed files with 49 additions and 23 deletions

1
file-uploader/README.md Normal file
View file

@ -0,0 +1 @@
this is not my best work

View file

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "File" ADD COLUMN "modifiedAt" TIMESTAMP(3) NOT NULL DEFAULT '2020-03-19 14:21:00 +02:00';

View file

@ -0,0 +1,9 @@
/*
Warnings:
- You are about to drop the column `creation_date` on the `Folder` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "Folder" DROP COLUMN "creation_date",
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;

View file

@ -34,8 +34,7 @@ const passwordValid = () => {
const passwordValidityCheck = (password) => {
if (!/\d/.test(password)) return false;
if (!/[\!@#%\^&\*\(\)\_\+\-=\[\]{}\|;':",\.\/\<\>\~\`]/.test(password))
return false;
if (!/[!@#%^&*()_+\-=[\]{}|;':",./<>~`]/.test(password)) return false;
if (password.length < 8) return false;
return true;

View file

@ -0,0 +1,10 @@
function directoryButton() {
const btn = document.querySelector('.new-directory>form>.container>button');
const formItem = document.querySelector(
'.new-directory>form>.container>div.form-item',
);
console.log(btn);
// formItem.style.display = 'none';
}
directoryButton();

View file

@ -11,6 +11,6 @@ fileRouter.post(
);
fileRouter.post('/directory', loggedIn, fileController.createDirectory);
fileRouter.get('/directory', loggedIn, fileController.directoryContents);
fileRouter.get('/file', loggedIn, fileController.getFileData);
fileRouter.get('/detail', loggedIn, fileController.getFileData);
module.exports = fileRouter;

View file

@ -19,7 +19,7 @@
<% if (isDirectory) { %>
d <a href="/fs/<%= currentUser.username %>/<%= item.id %>"><%= item.name %></a> /
<% } else { %>
- <%= item.name %> <a href="/file/file?fileId=<%= item.id %>">Details</a>
- <%= item.name %> <a href="/file/detail?fileId=<%= item.id %>">Details</a>
<% } %>
</div>
<div class="col file-size">

View file

@ -1,5 +1,6 @@
<div class="container">
<%- include('header', {pageTitle: file.name}) %>
<main class="app">
<div class="container">
<div class="file-metadata">
<h2>File: <%= file.name %> </h2>
<p>Size: <%= file.size %> </p>
@ -7,4 +8,5 @@
<p>Modified At: <%= file?.modifiedAt %></p>
</div>
<a href="/fs/<%= currentUser.username %>/<%= file.folderId %>">Back</a>
</div>
</div>
</main>

View file

@ -1,3 +1,4 @@
<script src="/js/script.js"></script>
</body>
</html>

View file

@ -1,4 +1,5 @@
<form action="/file/directory" method="post">
<section class="new-directory">
<form action="/file/directory" method="post">
<div class="container">
<div class="form-item">
<label for="directory-name">Directory Name:</label>
@ -7,4 +8,5 @@
<input type="hidden" name="parentId" value=<%= folder.id %>>
<button class="btn">Create Directory</button>
</div>
</form>
</form>
</section>