248 lines
8.0 KiB
HTML
248 lines
8.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Multi File Upload & Edit</title>
|
|
<link rel="icon" type="image/svg+xml" href="logo.svg">
|
|
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
|
<link rel="shortcut icon" href="logo.svg">
|
|
<!-- Google Fonts and Material Icons -->
|
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
|
|
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
|
<!-- Bootstrap CSS -->
|
|
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
|
|
<!-- Scripts (order is important) -->
|
|
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
|
<script type="module" src="utils.js"></script>
|
|
<script type="module" src="auth.js"></script>
|
|
<script type="module" src="upload.js"></script>
|
|
<script type="module" src="displayFileList.js"></script>
|
|
|
|
<style>
|
|
/* General styles */
|
|
body {
|
|
font-family: 'Roboto', sans-serif;
|
|
background-color: #f5f5f5;
|
|
}
|
|
.container {
|
|
margin-top: 30px;
|
|
}
|
|
header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
background-color: #2196F3;
|
|
padding: 20px;
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
min-height: 80px;
|
|
}
|
|
.header-left,
|
|
.header-buttons {
|
|
width: 150px;
|
|
}
|
|
.header-title {
|
|
flex: 1;
|
|
text-align: center;
|
|
}
|
|
.header-title h1 {
|
|
margin: 0;
|
|
font-weight: 500;
|
|
color: white;
|
|
}
|
|
.header-buttons {
|
|
display: flex;
|
|
gap: 10px;
|
|
justify-content: flex-end;
|
|
align-items: center;
|
|
}
|
|
.header-buttons button {
|
|
background: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
padding: 10px;
|
|
border-radius: 50%;
|
|
transition: background-color 0.2s ease, box-shadow 0.2s ease;
|
|
}
|
|
.header-buttons button:hover {
|
|
background-color: rgba(255, 255, 255, 0.2);
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
}
|
|
.material-icons {
|
|
font-size: 24px;
|
|
vertical-align: middle;
|
|
color: white;
|
|
}
|
|
#loginForm {
|
|
margin: 0 auto;
|
|
max-width: 400px;
|
|
background: white;
|
|
padding: 20px;
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
border-radius: 4px;
|
|
}
|
|
.modal {
|
|
display: none;
|
|
position: fixed;
|
|
top: 50%;
|
|
left: 50%;
|
|
transform: translate(-50%, -50%);
|
|
background: white;
|
|
padding: 20px;
|
|
border: 1px solid #ccc;
|
|
border-radius: 4px;
|
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
|
z-index: 1000;
|
|
width: 350px;
|
|
max-width: 90%;
|
|
height: auto;
|
|
}
|
|
.editor-modal {
|
|
width: 80vw;
|
|
max-width: 90vw;
|
|
min-width: 400px;
|
|
height: 600px;
|
|
max-height: 80vh;
|
|
overflow: auto;
|
|
resize: both;
|
|
}
|
|
table.table th {
|
|
cursor: pointer;
|
|
text-decoration: underline;
|
|
white-space: nowrap;
|
|
}
|
|
.container {
|
|
margin-top: 20px;
|
|
}
|
|
.progress {
|
|
background-color: #e9ecef;
|
|
border-radius: 5px;
|
|
overflow: hidden;
|
|
margin-bottom: 10px;
|
|
height: 20px;
|
|
}
|
|
.progress-bar {
|
|
background-color: #007bff;
|
|
height: 100%;
|
|
line-height: 20px;
|
|
color: #fff;
|
|
text-align: center;
|
|
transition: width 0.4s ease;
|
|
}
|
|
.card {
|
|
margin-bottom: 20px;
|
|
}
|
|
.actions-cell {
|
|
white-space: nowrap;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<!-- Header -->
|
|
<header>
|
|
<div class="header-left">
|
|
<img src="logo.svg" alt="Filing Cabinet Logo" style="height: 60px; width: auto;">
|
|
</div>
|
|
<div class="header-title">
|
|
<h1>Multi File Upload & Edit</h1>
|
|
</div>
|
|
<div class="header-buttons">
|
|
<button id="logoutBtn" title="Logout" style="display: none;">
|
|
<i class="material-icons">exit_to_app</i>
|
|
</button>
|
|
<button id="addUserBtn" title="Add User" style="display: none;">
|
|
<i class="material-icons">person_add</i>
|
|
</button>
|
|
<button id="removeUserBtn" title="Remove User" style="display: none;">
|
|
<i class="material-icons">person_remove</i>
|
|
</button>
|
|
</div>
|
|
</header>
|
|
<div class="container">
|
|
<!-- Login Form -->
|
|
<div class="row" id="loginForm">
|
|
<div class="col-12">
|
|
<form id="authForm" method="post">
|
|
<div class="form-group">
|
|
<label for="loginUsername">User:</label>
|
|
<input type="text" class="form-control" id="loginUsername" name="username" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="loginPassword">Password:</label>
|
|
<input type="password" class="form-control" id="loginPassword" name="password" required>
|
|
</div>
|
|
<button type="submit" class="btn btn-primary btn-block">Login</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<!-- Main Operations: Upload and Folder Management -->
|
|
<div id="mainOperations" style="display: none;">
|
|
<div class="row" id="uploadFolderRow">
|
|
<!-- Upload Card: 60% width -->
|
|
<div class="col-md-7 d-flex">
|
|
<div class="card flex-fill">
|
|
<div class="card-header">Upload Files</div>
|
|
<div class="card-body">
|
|
<form id="uploadFileForm" method="post" enctype="multipart/form-data">
|
|
<div class="form-group">
|
|
<label for="file">Choose files to upload:</label>
|
|
<input type="file" id="file" name="file[]" class="form-control-file" multiple required>
|
|
</div>
|
|
<button type="submit" id="uploadBtn" class="btn btn-primary">Upload</button>
|
|
<div id="uploadProgressContainer"></div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Folder Management Card: 40% width -->
|
|
<div class="col-md-5 d-flex">
|
|
<div class="card flex-fill">
|
|
<div class="card-header">Folder Management</div>
|
|
<div class="card-body">
|
|
<button id="createFolderBtn" class="btn btn-primary mb-3">Create Folder</button>
|
|
<div class="form-group d-flex align-items-center">
|
|
<select id="folderSelect" class="form-control"></select>
|
|
<button id="renameFolderBtn" class="btn btn-secondary ml-2" title="Rename Folder">
|
|
<i class="material-icons">edit</i>
|
|
</button>
|
|
<button id="deleteFolderBtn" class="btn btn-danger ml-2" title="Delete Folder">
|
|
<i class="material-icons">delete</i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- File List Section -->
|
|
<div id="fileListContainer">
|
|
<h2 id="fileListTitle">Files in (Root)</h2>
|
|
<button id="deleteSelectedBtn" class="btn btn-danger" style="margin-bottom: 10px; display: none;">Delete Selected</button>
|
|
<div id="fileList"></div>
|
|
</div>
|
|
</div>
|
|
<!-- Add User Modal -->
|
|
<div id="addUserModal" class="modal">
|
|
<h3>Create New User</h3>
|
|
<label for="newUsername">Username:</label>
|
|
<input type="text" id="newUsername" class="form-control">
|
|
<label for="newPassword">Password:</label>
|
|
<input type="password" id="newPassword" class="form-control">
|
|
<div id="adminCheckboxContainer">
|
|
<input type="checkbox" id="isAdmin">
|
|
<label for="isAdmin">Grant Admin Access</label>
|
|
</div>
|
|
<button id="saveUserBtn" class="btn btn-primary">Save User</button>
|
|
<button id="cancelUserBtn" class="btn btn-secondary">Cancel</button>
|
|
</div>
|
|
<!-- Remove User Modal -->
|
|
<div id="removeUserModal" class="modal">
|
|
<h3>Remove User</h3>
|
|
<label for="removeUsernameSelect">Select a user to remove:</label>
|
|
<select id="removeUsernameSelect" class="form-control"></select>
|
|
<button id="deleteUserBtn" class="btn btn-danger">Delete User</button>
|
|
<button id="cancelRemoveUserBtn" class="btn btn-secondary">Cancel</button>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|