mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2025-06-27 11:20:40 -04:00
not doing any more
This commit is contained in:
parent
5ab9f0b2c2
commit
b11e7978d0
10 changed files with 49 additions and 23 deletions
1
file-uploader/README.md
Normal file
1
file-uploader/README.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
this is not my best work
|
|
@ -0,0 +1,2 @@
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "File" ADD COLUMN "modifiedAt" TIMESTAMP(3) NOT NULL DEFAULT '2020-03-19 14:21:00 +02:00';
|
|
@ -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;
|
|
@ -34,8 +34,7 @@ const passwordValid = () => {
|
||||||
|
|
||||||
const passwordValidityCheck = (password) => {
|
const passwordValidityCheck = (password) => {
|
||||||
if (!/\d/.test(password)) return false;
|
if (!/\d/.test(password)) return false;
|
||||||
if (!/[\!@#%\^&\*\(\)\_\+\-=\[\]{}\|;':",\.\/\<\>\~\`]/.test(password))
|
if (!/[!@#%^&*()_+\-=[\]{}|;':",./<>~`]/.test(password)) return false;
|
||||||
return false;
|
|
||||||
if (password.length < 8) return false;
|
if (password.length < 8) return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
10
file-uploader/public/js/script.js
Normal file
10
file-uploader/public/js/script.js
Normal 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();
|
|
@ -11,6 +11,6 @@ fileRouter.post(
|
||||||
);
|
);
|
||||||
fileRouter.post('/directory', loggedIn, fileController.createDirectory);
|
fileRouter.post('/directory', loggedIn, fileController.createDirectory);
|
||||||
fileRouter.get('/directory', loggedIn, fileController.directoryContents);
|
fileRouter.get('/directory', loggedIn, fileController.directoryContents);
|
||||||
fileRouter.get('/file', loggedIn, fileController.getFileData);
|
fileRouter.get('/detail', loggedIn, fileController.getFileData);
|
||||||
|
|
||||||
module.exports = fileRouter;
|
module.exports = fileRouter;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
<% if (isDirectory) { %>
|
<% if (isDirectory) { %>
|
||||||
d <a href="/fs/<%= currentUser.username %>/<%= item.id %>"><%= item.name %></a> /
|
d <a href="/fs/<%= currentUser.username %>/<%= item.id %>"><%= item.name %></a> /
|
||||||
<% } else { %>
|
<% } 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>
|
||||||
<div class="col file-size">
|
<div class="col file-size">
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
<div class="container">
|
<%- include('header', {pageTitle: file.name}) %>
|
||||||
|
<main class="app">
|
||||||
<div class="file-metadata">
|
<div class="container">
|
||||||
<h2>File: <%= file.name %> </h2>
|
<div class="file-metadata">
|
||||||
<p>Size: <%= file.size %> </p>
|
<h2>File: <%= file.name %> </h2>
|
||||||
<p>Created At: <%= file.createdAt %></p>
|
<p>Size: <%= file.size %> </p>
|
||||||
<p>Modified At: <%= file?.modifiedAt %></p>
|
<p>Created At: <%= file.createdAt %></p>
|
||||||
</div>
|
<p>Modified At: <%= file?.modifiedAt %></p>
|
||||||
<a href="/fs/<%= currentUser.username %>/<%= file.folderId %>">Back</a>
|
</div>
|
||||||
</div>
|
<a href="/fs/<%= currentUser.username %>/<%= file.folderId %>">Back</a>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<script src="/js/script.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
<form action="/file/directory" method="post">
|
<section class="new-directory">
|
||||||
<div class="container">
|
<form action="/file/directory" method="post">
|
||||||
<div class="form-item">
|
<div class="container">
|
||||||
<label for="directory-name">Directory Name:</label>
|
<div class="form-item">
|
||||||
<input type="text" name="directory-name" placeholder="" required>
|
<label for="directory-name">Directory Name:</label>
|
||||||
|
<input type="text" name="directory-name" placeholder="" required>
|
||||||
|
</div>
|
||||||
|
<input type="hidden" name="parentId" value=<%= folder.id %>>
|
||||||
|
<button class="btn">Create Directory</button>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="parentId" value=<%= folder.id %>>
|
</form>
|
||||||
<button class="btn">Create Directory</button>
|
</section>
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue