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) => {
|
||||
if (!/\d/.test(password)) return false;
|
||||
if (!/[\!@#%\^&\*\(\)\_\+\-=\[\]{}\|;':",\.\/\<\>\~\`]/.test(password))
|
||||
return false;
|
||||
if (!/[!@#%^&*()_+\-=[\]{}|;':",./<>~`]/.test(password)) return false;
|
||||
if (password.length < 8) return false;
|
||||
|
||||
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.get('/directory', loggedIn, fileController.directoryContents);
|
||||
fileRouter.get('/file', loggedIn, fileController.getFileData);
|
||||
fileRouter.get('/detail', loggedIn, fileController.getFileData);
|
||||
|
||||
module.exports = fileRouter;
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<script src="/js/script.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue