Merged CEO and Client App
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 4.2 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 30 KiB |
@@ -0,0 +1,79 @@
|
||||
body, html {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: "Pridi", sans-serif;
|
||||
background-color: #4A628A;
|
||||
}
|
||||
|
||||
.container {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.header {
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 48px;
|
||||
font-weight: 500;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.announcement-body {
|
||||
max-height: 300px; /* Limit the height to make it scrollable if content overflows */
|
||||
width: 80%;
|
||||
overflow-y: auto; /* Enable vertical scrolling */
|
||||
padding: 20px;
|
||||
color: white;
|
||||
background-color: rgba(0, 0, 0, 0.2); /* Slight background to make text stand out */
|
||||
border-radius: 8px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Customize scrollbar appearance */
|
||||
.announcement-body::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
}
|
||||
|
||||
.announcement-body::-webkit-scrollbar-track {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.announcement-body::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(255, 255, 255, 0.8);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.announcement-body::-webkit-scrollbar-thumb:hover {
|
||||
background-color: rgb(158, 158, 158);
|
||||
}
|
||||
|
||||
.announcement-footer {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#closeButton {
|
||||
padding: 10px 20px;
|
||||
margin-bottom: 15px;
|
||||
font-size: 16px;
|
||||
color: #4A628A;
|
||||
background-color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
#closeButton:hover {
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
body, html {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
|
||||
background-color: #4A628A;
|
||||
}
|
||||
|
||||
h4, h2, h1{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.container{
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 48px;
|
||||
font-weight: 500;
|
||||
letter-spacing: -1px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
img{
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
p{
|
||||
color: white;
|
||||
}
|
||||
|
||||
.loading-section{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.spinner {
|
||||
margin-bottom: 8px;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
border: 3px solid #f3f3f3;
|
||||
border-top: 3px solid #2196F3;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
body, html {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
|
||||
background-color: #4A628A;
|
||||
}
|
||||
|
||||
h4, h2, h1{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.page{
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.container {
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(to bottom, rgba(74, 98, 138, 0.0) 30%, rgba(186, 237, 255, 0.7));
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-evenly;
|
||||
height: 90%;
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
.header{
|
||||
text-align: center;
|
||||
padding-bottom: 16px;
|
||||
padding-top: 16px;
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 48px;
|
||||
font-weight: 500;
|
||||
letter-spacing: -1px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.subheading{
|
||||
padding-top: 8px;
|
||||
font-size: 16px;
|
||||
letter-spacing: -0.5px;
|
||||
color: rgba(255,255,255, 0.8);
|
||||
}
|
||||
|
||||
.login-form{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.login-title {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: white;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.login-form-content input {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
margin: 10px 0;
|
||||
border: 1px solid #ccc; /* Light gray border */
|
||||
border-radius: 8px; /* Rounded corners */
|
||||
font-size: 1em;
|
||||
font-family: inherit;
|
||||
box-sizing: border-box;
|
||||
background-color: #f9f9f9; /* Light background */
|
||||
color: #333; /* Dark text color */
|
||||
transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for interaction */
|
||||
}
|
||||
|
||||
/* Placeholder Text Styling */
|
||||
.login-form-content input::placeholder {
|
||||
color: #aaa; /* Lighter color for placeholders */
|
||||
}
|
||||
|
||||
/* Focus State Styling */
|
||||
.login-form-content input:focus {
|
||||
outline: none; /* Remove default focus outline */
|
||||
border-color: #4A628A; /* Blue border on focus */
|
||||
box-shadow: 0 0 5px rgba(74, 98, 138, 0.5); /* Subtle shadow for focus */
|
||||
background-color: #fff; /* Slightly brighter background on focus */
|
||||
}
|
||||
|
||||
/* Input Field Hover Effect */
|
||||
.login-form-content input:hover {
|
||||
border-color: #888; /* Darker gray border on hover */
|
||||
}
|
||||
|
||||
/* Disabled Input Styling */
|
||||
.login-form-content input:disabled {
|
||||
background-color: #e0e0e0; /* Light gray background for disabled input */
|
||||
cursor: not-allowed; /* Show "not allowed" cursor */
|
||||
opacity: 0.7; /* Slight transparency */
|
||||
}
|
||||
|
||||
.login-form-footer {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
justify-content: space-between; /* Align buttons next to each other */
|
||||
align-items: center;
|
||||
gap: 10px; /* Space between buttons */
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* Styling for buttons */
|
||||
.login-form-footer button {
|
||||
flex: 1; /* Ensure buttons are equal width */
|
||||
padding: 16px;
|
||||
font-weight: 300;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
button[name="underline"] {
|
||||
background-color: transparent; /* No background */
|
||||
border: none; /* Remove default button border */
|
||||
color: #4A628A; /* Set text color */
|
||||
font-size: 1em; /* Set font size */
|
||||
cursor: pointer; /* Add pointer cursor for interactivity */
|
||||
text-decoration: underline; /* Underline text */
|
||||
padding: 0; /* Remove default padding */
|
||||
}
|
||||
|
||||
button[name="submit"] {
|
||||
width: 100%;
|
||||
background-color: #4A628A; /* Blue background */
|
||||
color: white; /* White text color */
|
||||
}
|
||||
@@ -0,0 +1,204 @@
|
||||
body, html {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
|
||||
background-color: #4A628A;
|
||||
}
|
||||
|
||||
h4, h2, h1{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 32px;
|
||||
font-weight: 500;
|
||||
letter-spacing: -1px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.user{
|
||||
display: inline;
|
||||
color: white;
|
||||
}
|
||||
.navbar{
|
||||
padding-top: 8px;
|
||||
padding-right: 32px;
|
||||
padding-left: 32px;
|
||||
height: 10%;
|
||||
display:flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
.welcome{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
img{
|
||||
padding-right: 8px;
|
||||
width:25px;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.page{
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.container{
|
||||
width:100%;
|
||||
height:100%;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.left_block{
|
||||
background: linear-gradient(to bottom, #131A24, #4A628A);
|
||||
width: 25%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.notification-title{
|
||||
padding-top: 16px;
|
||||
padding-bottom: 16px;
|
||||
text-align: center;
|
||||
height: 10%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.notifications{
|
||||
overflow-y: auto;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-grow: 1; /* Allow it to take available space */
|
||||
max-height: calc(90% - 80px);
|
||||
}
|
||||
|
||||
.right_block_content button:last-child {
|
||||
background-color: #FF6347;
|
||||
}
|
||||
|
||||
.right_block_content button:last-child:hover {
|
||||
background-color: #fd4c29;
|
||||
}
|
||||
|
||||
.alert, .logout-button{
|
||||
cursor: pointer;
|
||||
border-radius: 15px;
|
||||
width: 80%;
|
||||
min-height: 64px;
|
||||
height: auto;
|
||||
padding:12px;
|
||||
background: #FF6347;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
}
|
||||
.notification{
|
||||
cursor: pointer;
|
||||
border-radius: 15px;
|
||||
width: 80%;
|
||||
min-height: 64px;
|
||||
height: auto;
|
||||
padding:12px;
|
||||
background: rgba(186, 229, 255);
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.notification:hover{
|
||||
background: #d9efff;
|
||||
}
|
||||
|
||||
.alert:hover, .logout-button:hover{
|
||||
background: rgb(244, 44, 44);
|
||||
}
|
||||
|
||||
.notif-title{
|
||||
font-size: 24px;
|
||||
font-weight: 300;
|
||||
letter-spacing: -1px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.left-content{
|
||||
height: 90%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.left_block_footer{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
.right_block_content{
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
.right_block{
|
||||
width: 75%;
|
||||
display:flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.right_block_content {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr); /* 3 equal-width columns */
|
||||
gap: 8px; /* Spacing between buttons */
|
||||
padding: 32px; /* Optional padding */
|
||||
}
|
||||
|
||||
button[name="menu_button"] {
|
||||
padding: 10px 20px;
|
||||
font-size: 16px;
|
||||
background-color: rgba(186,229,244,0.4); /* Button background */
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
button[name="menu_button"]:hover {
|
||||
background-color: #3B5173; /* Darker background on hover */
|
||||
}
|
||||
|
||||
.notifications::-webkit-scrollbar {
|
||||
width: 4px; /* Width of the scrollbar */
|
||||
}
|
||||
|
||||
.notifications::-webkit-scrollbar-track {
|
||||
background: rgba(255, 255, 255, 0.1); /* Track background color */
|
||||
border-radius: 10px; /* Rounded corners for the track */
|
||||
}
|
||||
|
||||
.notifications::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(74, 98, 138, 0.8); /* Scrollbar handle color */
|
||||
border-radius: 10px; /* Rounded corners for the scrollbar handle */
|
||||
}
|
||||
|
||||
.notifications::-webkit-scrollbar-thumb:hover {
|
||||
background-color: rgba(74, 98, 138, 1); /* Darker color on hover */
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre, hr
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td,
|
||||
article, aside, canvas, details, embed,
|
||||
figure, figcaption, footer, header, hgroup,
|
||||
menu, nav, output, ruby, section, summary,
|
||||
time, mark, audio, video {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
font: inherit;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
/* HTML5 display-role reset for older browsers */
|
||||
article, aside, details, figcaption, figure,
|
||||
footer, header, hgroup, menu, nav, section {
|
||||
display: block;
|
||||
}
|
||||
body {
|
||||
line-height: 1;
|
||||
}
|
||||
ol, ul {
|
||||
list-style: none;
|
||||
}
|
||||
blockquote, q {
|
||||
quotes: none;
|
||||
}
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: none;
|
||||
}
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
body, html {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
|
||||
background-color: #4A628A;
|
||||
}
|
||||
|
||||
h4, h2, h1{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.page{
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.container {
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(to bottom, rgba(74, 98, 138, 0.0) 30%, rgba(186, 237, 255, 0.7));
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-evenly;
|
||||
height: 90%;
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
.header{
|
||||
text-align: center;
|
||||
padding-bottom: 16px;
|
||||
padding-top: 16px;
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 48px;
|
||||
font-weight: 500;
|
||||
letter-spacing: -1px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.subheading{
|
||||
padding-top: 8px;
|
||||
font-size: 16px;
|
||||
letter-spacing: -0.5px;
|
||||
color: rgba(255,255,255, 0.8);
|
||||
}
|
||||
|
||||
.profile-form{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.profile-form-content input {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
margin: 10px 0;
|
||||
border: 1px solid #ccc; /* Light gray border */
|
||||
border-radius: 8px; /* Rounded corners */
|
||||
font-size: 1em;
|
||||
font-family: inherit;
|
||||
box-sizing: border-box;
|
||||
background-color: #f9f9f9; /* Light background */
|
||||
color: #333; /* Dark text color */
|
||||
transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for interaction */
|
||||
}
|
||||
|
||||
/* Placeholder Text Styling */
|
||||
.profile-form-content input::placeholder {
|
||||
color: #aaa; /* Lighter color for placeholders */
|
||||
}
|
||||
|
||||
/* Focus State Styling */
|
||||
.profile-form-content input:focus {
|
||||
outline: none; /* Remove default focus outline */
|
||||
border-color: #4A628A; /* Blue border on focus */
|
||||
box-shadow: 0 0 5px rgba(74, 98, 138, 0.5); /* Subtle shadow for focus */
|
||||
background-color: #fff; /* Slightly brighter background on focus */
|
||||
}
|
||||
|
||||
/* Input Field Hover Effect */
|
||||
.profile-form-content input:hover {
|
||||
border-color: #888; /* Darker gray border on hover */
|
||||
}
|
||||
|
||||
/* Disabled Input Styling */
|
||||
.profile-form-content input:disabled {
|
||||
background-color: #e0e0e0; /* Light gray background for disabled input */
|
||||
cursor: not-allowed; /* Show "not allowed" cursor */
|
||||
opacity: 0.7; /* Slight transparency */
|
||||
}
|
||||
|
||||
.profile-form-footer {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
justify-content: space-between; /* Align buttons next to each other */
|
||||
align-items: center;
|
||||
gap: 10px; /* Space between buttons */
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* Styling for buttons */
|
||||
.profile-form button {
|
||||
flex: 1; /* Ensure buttons are equal width */
|
||||
padding: 16px;
|
||||
font-weight: 300;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
button[name="underline"] {
|
||||
background-color: transparent; /* No background */
|
||||
border: none; /* Remove default button border */
|
||||
color: #4A628A; /* Set text color */
|
||||
font-size: 1em; /* Set font size */
|
||||
cursor: pointer; /* Add pointer cursor for interactivity */
|
||||
text-decoration: underline; /* Underline text */
|
||||
padding: 0; /* Remove default padding */
|
||||
}
|
||||
|
||||
button[name="submit"] {
|
||||
width: 100%;
|
||||
background-color: #4A628A; /* Blue background */
|
||||
color: white; /* White text color */
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
body, html {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
|
||||
background-color: #4A628A;
|
||||
}
|
||||
|
||||
h4, h2, h1{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.page{
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.container {
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(to bottom, rgba(74, 98, 138, 0.0) 30%, rgba(186, 237, 255, 0.7));
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 90%;
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
.header{
|
||||
display: flex;
|
||||
width: 80%;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 20%;
|
||||
text-align: center;
|
||||
padding-bottom: 16px;
|
||||
padding-top: 16px;
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 48px;
|
||||
font-weight: 500;
|
||||
letter-spacing: -1px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.subheading{
|
||||
font-size: 16px;
|
||||
letter-spacing: -0.5px;
|
||||
padding-top: 8px;
|
||||
color: rgba(255,255,255, 0.8);
|
||||
}
|
||||
|
||||
.login-form{
|
||||
height: 80%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.login-title {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: white;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.login-form-content input {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
margin: 10px 0;
|
||||
border: 1px solid #ccc; /* Light gray border */
|
||||
border-radius: 8px; /* Rounded corners */
|
||||
font-size: 1em;
|
||||
font-family: inherit;
|
||||
box-sizing: border-box;
|
||||
background-color: #f9f9f9; /* Light background */
|
||||
color: #333; /* Dark text color */
|
||||
transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for interaction */
|
||||
}
|
||||
|
||||
/* Placeholder Text Styling */
|
||||
.login-form-content input::placeholder {
|
||||
color: #aaa; /* Lighter color for placeholders */
|
||||
}
|
||||
|
||||
/* Focus State Styling */
|
||||
.login-form-content input:focus {
|
||||
outline: none; /* Remove default focus outline */
|
||||
border-color: #4A628A; /* Blue border on focus */
|
||||
box-shadow: 0 0 5px rgba(74, 98, 138, 0.5); /* Subtle shadow for focus */
|
||||
background-color: #fff; /* Slightly brighter background on focus */
|
||||
}
|
||||
|
||||
/* Input Field Hover Effect */
|
||||
.login-form-content input:hover {
|
||||
border-color: #888; /* Darker gray border on hover */
|
||||
}
|
||||
|
||||
/* Disabled Input Styling */
|
||||
.login-form-content input:disabled {
|
||||
background-color: #e0e0e0; /* Light gray background for disabled input */
|
||||
cursor: not-allowed; /* Show "not allowed" cursor */
|
||||
opacity: 0.7; /* Slight transparency */
|
||||
}
|
||||
|
||||
.login-form-footer {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-direction: column;
|
||||
justify-content: space-between; /* Align buttons next to each other */
|
||||
align-items: center;
|
||||
gap: 10px; /* Space between buttons */
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* Styling for buttons */
|
||||
.login-form-footer button {
|
||||
flex: 1; /* Ensure buttons are equal width */
|
||||
padding: 16px;
|
||||
font-weight: 300;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
button[name="underline"] {
|
||||
background-color: transparent; /* No background */
|
||||
border: none; /* Remove default button border */
|
||||
color: #4A628A; /* Set text color */
|
||||
font-size: 1em; /* Set font size */
|
||||
cursor: pointer; /* Add pointer cursor for interactivity */
|
||||
text-decoration: underline; /* Underline text */
|
||||
padding: 0; /* Remove default padding */
|
||||
}
|
||||
|
||||
button[name="submit"] {
|
||||
width: 100%;
|
||||
background-color: #4A628A; /* Blue background */
|
||||
color: white; /* White text color */
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
body, html {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
|
||||
background-color: #4A628A;
|
||||
}
|
||||
|
||||
h4, h2, h1{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.page{
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.container {
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(to bottom, rgba(74, 98, 138, 0.0) 30%, rgba(186, 237, 255, 0.7));
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
height: 90%;
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
.header{
|
||||
text-align: center;
|
||||
padding-bottom: 16px;
|
||||
padding-top: 32px;
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 48px;
|
||||
font-weight: 500;
|
||||
letter-spacing: -1px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.subheading{
|
||||
padding-top: 8px;
|
||||
font-size: 16px;
|
||||
letter-spacing: -0.5px;
|
||||
color: rgba(255,255,255, 0.8);
|
||||
}
|
||||
|
||||
.form{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.footer {
|
||||
padding-bottom: 16px;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
flex-direction: row;
|
||||
justify-content: space-between; /* Align buttons next to each other */
|
||||
align-items: center;
|
||||
gap: 10px; /* Space between buttons */
|
||||
}
|
||||
|
||||
.filename-title{
|
||||
font-size: 16px;
|
||||
font-weight: 300;
|
||||
color: white;
|
||||
padding: 48px 24px 48px 24px;
|
||||
background-color: rgba(0,0,0,0.25);
|
||||
border-radius: 10px;
|
||||
margin-top: 16px;
|
||||
box-shadow: 2px 2px 2px 1px rgb(0 0 0 / 20%);
|
||||
}
|
||||
|
||||
.users_block{
|
||||
padding-top: 16px;
|
||||
}
|
||||
|
||||
label{
|
||||
margin-top: 8px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.choose_user_form_content {
|
||||
overflow-y: hidden;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
max-height: 180px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
h5{
|
||||
font-size: 20px;
|
||||
font-weight: 300;
|
||||
text-align: center;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* Styling for buttons */
|
||||
.form button {
|
||||
flex: 1; /* Ensure buttons are equal width */
|
||||
padding: 16px;
|
||||
font-weight: 300;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
button[name="underline"] {
|
||||
background-color: transparent; /* No background */
|
||||
border: none; /* Remove default button border */
|
||||
color: #4A628A; /* Set text color */
|
||||
font-size: 1em; /* Set font size */
|
||||
cursor: pointer; /* Add pointer cursor for interactivity */
|
||||
text-decoration: underline; /* Underline text */
|
||||
padding: 0; /* Remove default padding */
|
||||
}
|
||||
|
||||
button[name="submit"] {
|
||||
width: 100%;
|
||||
background-color: #4A628A; /* Blue background */
|
||||
color: white; /* White text color */
|
||||
}
|
||||
|
||||
button[name="submit"]:hover {
|
||||
background-color: #3B5173; /* Darker background on hover */
|
||||
}
|
||||
|
||||
.choose_user_form_content::-webkit-scrollbar {
|
||||
width: 4px; /* Width of the scrollbar */
|
||||
}
|
||||
|
||||
.choose_user_form_content::-webkit-scrollbar-track {
|
||||
background: rgba(255, 255, 255, 0.1); /* Track background color */
|
||||
border-radius: 10px; /* Rounded corners for the track */
|
||||
}
|
||||
|
||||
.choose_user_form_content::-webkit-scrollbar-thumb {
|
||||
background-color: rgba(74, 98, 138, 0.8); /* Scrollbar handle color */
|
||||
border-radius: 10px; /* Rounded corners for the scrollbar handle */
|
||||
}
|
||||
|
||||
.choose_user_form_content::-webkit-scrollbar-thumb:hover {
|
||||
background-color: rgba(74, 98, 138, 1); /* Darker color on hover */
|
||||
}
|
||||
|
||||
.choose_user_form_content:empty {
|
||||
overflow-y: hidden;
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/* General Styles */
|
||||
body, html {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
||||
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
|
||||
background-color: #4A628A; /* Background color */
|
||||
}
|
||||
|
||||
h4, h2, h1 {
|
||||
margin: 0; /* Remove default margin */
|
||||
}
|
||||
|
||||
/* Page Layout */
|
||||
.page {
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.container{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
/* Active Step Styles */
|
||||
.step {
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(to bottom, rgba(74, 98, 138, 0.0) 30%, rgba(186, 237, 255, 0.7));
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: stretch;
|
||||
height: 90%;
|
||||
width: 35%;
|
||||
}
|
||||
|
||||
/* Header Styling */
|
||||
.header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 20%;
|
||||
text-align: center;
|
||||
padding-bottom: 16px;
|
||||
padding-top: 16px;
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 48px;
|
||||
font-weight: 500;
|
||||
letter-spacing: -1px;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.subheading{
|
||||
font-size: 16px;
|
||||
letter-spacing: -0.5px;
|
||||
padding-top: 8px;
|
||||
color: rgba(255,255,255, 0.8);
|
||||
}
|
||||
|
||||
/* Signup Form Styles */
|
||||
.signup-form {
|
||||
display: flex;
|
||||
height: 80%;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 80%; /* Width of the form */
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.signup-form-title {
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: white;
|
||||
margin-bottom: 16px; /* Space below title */
|
||||
}
|
||||
|
||||
/* Input Styles */
|
||||
.signup-form-content input {
|
||||
width: 100%;
|
||||
padding: 15px;
|
||||
margin: 10px 0;
|
||||
border: 1px solid #ccc; /* Light gray border */
|
||||
border-radius: 8px; /* Rounded corners */
|
||||
font-size: 1em;
|
||||
font-family: inherit;
|
||||
box-sizing: border-box;
|
||||
background-color: #f9f9f9; /* Light background */
|
||||
color: #333; /* Dark text color */
|
||||
transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for interaction */
|
||||
}
|
||||
|
||||
/* Placeholder Text Styling */
|
||||
.signup-form-content input::placeholder {
|
||||
color: #aaa; /* Lighter color for placeholders */
|
||||
}
|
||||
|
||||
.signup-form-content-radio{
|
||||
width: 100%;
|
||||
display: flex; /* Use flexbox to arrange items in a row */
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.signup-form-content-radio label {
|
||||
width: 100%;
|
||||
display: flex; /* Make label a flex container */
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
cursor: pointer; /* Change cursor to pointer when hovering */
|
||||
}
|
||||
|
||||
/* Optional: Styling the radio button */
|
||||
.signup-form-content-radio input[type="radio"] {
|
||||
margin-right: 8px; /* Space between radio button and label text */
|
||||
}
|
||||
/* Focus State Styling */
|
||||
.signup-form-content input:focus {
|
||||
outline: none; /* Remove default focus outline */
|
||||
border-color: #4A628A; /* Change border color on focus */
|
||||
box-shadow: 0 0 5px rgba(74, 98, 138, 0.5); /* Subtle shadow for focus */
|
||||
background-color: #fff; /* Slightly brighter background on focus */
|
||||
}
|
||||
|
||||
/* Input Field Hover Effect */
|
||||
.signup-form-content input:hover {
|
||||
border-color: #888; /* Darker gray border on hover */
|
||||
}
|
||||
|
||||
/* Disabled Input Styling */
|
||||
.signup-form-content input:disabled {
|
||||
background-color: #e0e0e0; /* Light gray background for disabled input */
|
||||
cursor: not-allowed; /* Show "not allowed" cursor */
|
||||
opacity: 0.7; /* Slight transparency */
|
||||
}
|
||||
|
||||
/* Signup Form Footer */
|
||||
.signup-form-footer {
|
||||
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between; /* Align buttons next to each other */
|
||||
align-items: center;
|
||||
gap: 10px; /* Space between buttons */
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/* Button Styles */
|
||||
.signup-form-footer button {
|
||||
flex: 1; /* Ensure buttons are equal width */
|
||||
padding: 16px;
|
||||
font-weight: 300;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
button[name="back"] {
|
||||
background-color: transparent; /* No background for 'back' button */
|
||||
color: #4A628A; /* Set text color */
|
||||
text-decoration: underline; /* Underline text */
|
||||
}
|
||||
|
||||
button[name="continue"] {
|
||||
width: 100%;
|
||||
background-color: #4A628A; /* Blue background */
|
||||
color: white; /* White text color */
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
.fade-in {
|
||||
animation: fadeInAnimation 0.5s ease-in forwards;
|
||||
}
|
||||
|
||||
.fade-out {
|
||||
animation: fadeOutAnimation 0.5s ease-out forwards;
|
||||
}
|
||||
|
||||
@keyframes fadeInAnimation {
|
||||
from {
|
||||
opacity: 0;
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes fadeOutAnimation {
|
||||
from {
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
|
||||
<link href="../css/normalizer.css" rel="stylesheet">
|
||||
<link href="../css/announcement.css" rel="stylesheet">
|
||||
<link href="../css/transition.css" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<script src="../js/announcement.js"></script>
|
||||
<script src="../js/helpers.js"></script>
|
||||
<title>Announcement</title>
|
||||
</head>
|
||||
<body onload="loadAnnouncement(); fadeIn()">
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1 class="title">Announcement</h1>
|
||||
</div>
|
||||
<div class="announcement-body">
|
||||
<p id="announcement-content">Loading announcement...</p>
|
||||
</div>
|
||||
<div class="announcement-footer">
|
||||
<button id="closeButton" onclick="closeWindow()">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
|
||||
<link href="../css/normalizer.css" rel="stylesheet">
|
||||
<!-- Reuse the same CSS files as UC Not Found -->
|
||||
<link href="../css/loading.css" rel="stylesheet">
|
||||
<link href="../css/transition.css" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<script src="../js/helpers.js"></script>
|
||||
<title>Welcome</title>
|
||||
</head>
|
||||
<body onload="fadeIn()">
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1 class="title">Team Vault</h1>
|
||||
</div>
|
||||
<img src="../assets/refresh-data.webp" alt="Backup Fetcher" class="backup-img">
|
||||
<div class="loading-section">
|
||||
<div class="spinner"></div>
|
||||
<p>Backup is now searched, please wait...</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
|
||||
<link href="../css/normalizer.css" rel="stylesheet">
|
||||
<link href="../css/login.css" rel="stylesheet">
|
||||
<link href="../css/transition.css" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<title>Login</title>
|
||||
</head>
|
||||
<body onload="fadeIn()">
|
||||
<div class="page">
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1 class="title">TeamVault</h1>
|
||||
<h4 class="subheading">Do we know each other?</h4>
|
||||
</div>
|
||||
<form class="login-form" id="loginForm">
|
||||
<div class="login-form-title">
|
||||
<h2 class="login-title">Login</h2>
|
||||
</div>
|
||||
<div class="login-form-content">
|
||||
<input name="email" placeholder="Email" type="email">
|
||||
<input name="password" placeholder="Password" type="password">
|
||||
</div>
|
||||
<div class="login-form-footer">
|
||||
<div>
|
||||
<button id="signup" name="underline" type="button">Sign Up</button>
|
||||
<button id="resetPassword" name="underline" type="button">Reset Password</button>
|
||||
</div>
|
||||
<button id="submit" name="submit" type="submit">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="../js/login.js"></script>
|
||||
<script src="../js/helpers.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
|
||||
<link href="../css/normalizer.css" rel="stylesheet">
|
||||
<link href="../css/main_menu.css" rel="stylesheet">
|
||||
<link href="../css/transition.css" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<script src="../js/main_menu.js"></script>
|
||||
<script src="../js/helpers.js"></script>
|
||||
|
||||
<title>Main Page</title>
|
||||
|
||||
</head>
|
||||
<body onload="initialSetup(); fadeIn()">
|
||||
<div class="page">
|
||||
<div class="container">
|
||||
<div class="left_block">
|
||||
<div class="notification-title">
|
||||
<h1 class="notif-title">Notifications</h1>
|
||||
</div>
|
||||
<div class=left-content>
|
||||
<div class="notifications" id="notifications">
|
||||
<!--Notifications are generated here-->
|
||||
</div>
|
||||
<div class="left_block_footer">
|
||||
<button class="logout-button" id="logout" name="logout">Logout</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="right_block">
|
||||
<div class="navbar">
|
||||
<div class="welcome">
|
||||
<img alt="" src="../assets/user_1144760.png">
|
||||
<h3 class="user">Welcome Back, </h3>
|
||||
<h3 class="user" id="username-field"></h3>
|
||||
<h3 class="user">!</h3>
|
||||
|
||||
</div>
|
||||
<h1 class="title">TeamVault</h1>
|
||||
</div>
|
||||
|
||||
<div class="right_block_content">
|
||||
<button id="change-info" name="menu_button">Change your info</button>
|
||||
<button id="share-file" name="menu_button">Share a file</button>
|
||||
<button id="backup-dir" name="menu_button">Set backup directory</button>
|
||||
<button id="department-dir" name="menu_button">Set department directory</button>
|
||||
<button id="share-dir" name="menu_button">Set share directory</button>
|
||||
<button id="restore-backup" name="menu_button">Restore backup</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
|
||||
<link href="../css/normalizer.css" rel="stylesheet">
|
||||
<link href="../css/profile.css" rel="stylesheet">
|
||||
<link href="../css/transition.css" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<script src="../js/profile.js"></script>
|
||||
<script src="../js/helpers.js"></script>
|
||||
|
||||
<title>Profile</title>
|
||||
</head>
|
||||
<body onload="fadeIn()">
|
||||
<div class="page">
|
||||
<div class="container">
|
||||
<form class="profile-form" id="profileForm">
|
||||
<div class="header">
|
||||
<h1 class="title">Profile</h1>
|
||||
<h3 class="subheading">Who are you?</h3>
|
||||
</div>
|
||||
<div class="profile-form-content">
|
||||
<input name="email" placeholder="Email" type="email">
|
||||
<input name="username" placeholder="Username" type="text">
|
||||
<input name="password" placeholder="Password" type="password">
|
||||
</div>
|
||||
<div class="profile-form-footer">
|
||||
<button id="back" name="underline" type="button">Back</button>
|
||||
<button id="submit" name="submit" type="submit">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
|
||||
<link href="../css/normalizer.css" rel="stylesheet">
|
||||
<!-- Reuse the same CSS files as UC Not Found -->
|
||||
<link href="../css/loading.css" rel="stylesheet">
|
||||
<link href="../css/transition.css" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<script src="../js/helpers.js"></script>
|
||||
<script src="../js/reset_database.js"></script>
|
||||
<title>Welcome</title>
|
||||
</head>
|
||||
<body onload="fadeIn()">
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1 class="title">Welcome to TeamVault</h1>
|
||||
</div>
|
||||
<img src="../assets/2581896.png" style="margin-left: 20px" alt="Connecting to server" class="server-img">
|
||||
<div class="loading-section">
|
||||
<div class="spinner"></div>
|
||||
<p>The CEO initialized a complete reset, please wait...</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="../css/normalizer.css" rel="stylesheet">
|
||||
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
|
||||
<link href="../css/reset_password.css" rel="stylesheet">
|
||||
<link href="../css/transition.css" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<title>Reset Password</title>
|
||||
</head>
|
||||
<body onload="fadeIn()">
|
||||
<div class="page">
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1 class="title">TeamVault</h1>
|
||||
<h3 class="subheading">Forgot your password? No worries, it happens to the best of us!</h3>
|
||||
</div>
|
||||
<form class="login-form" id="resetPasswordForm">
|
||||
<div class="login-form-title">
|
||||
<h2 class="login-title">Reset Password</h2>
|
||||
</div>
|
||||
<div class="login-form-content">
|
||||
<input name="email" placeholder="Email" type="email" required>
|
||||
<input name="newPassword" placeholder="New Password" type="password" required>
|
||||
</div>
|
||||
<div class="login-form-footer">
|
||||
<button id="backToLogin" name="underline" type="button">Back to Login</button>
|
||||
<button id="resetPassword" name="submit" type="submit">Reset Password</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../js/reset_password.js"></script>
|
||||
<script src="../js/helpers.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
|
||||
<link href="../css/normalizer.css" rel="stylesheet">
|
||||
<link href="../css/share_file.css" rel="stylesheet">
|
||||
<link href="../css/transition.css" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<script src="../js/share_file.js"></script>
|
||||
<script src="../js/helpers.js"></script>
|
||||
|
||||
<title>Share File</title>
|
||||
</head>
|
||||
<body onload="fetchUsersAndCreateCheckboxes(); updateFileName(); fadeIn()">
|
||||
<div class="page">
|
||||
<div class="container">
|
||||
<div class="form">
|
||||
<div class="header">
|
||||
<h1 class="title">Share a File</h1>
|
||||
<h3 class="subheading">First select the file you want to share.</h3>
|
||||
<button class="filename-title" id="selectFile" name="submit" type="button">Select</button>
|
||||
<form class="users_block" id="userDestForm">
|
||||
<h5>Users</h5>
|
||||
<h3 class="subheading">Select the users you want to share the file with.</h3>
|
||||
<div id="choose_user_form_content" class="choose_user_form_content">
|
||||
<!-- Insert the users from the database -->
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="footer">
|
||||
<button id="backButton" name="underline" type="button">Back</button>
|
||||
<button id="submitButton" name="submit" type="submit">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="../css/normalizer.css" rel="stylesheet">
|
||||
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
|
||||
<link href="../css/transition.css" rel="stylesheet">
|
||||
<link href="../css/sign_up.css" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
<title>Signup Process</title>
|
||||
</head>
|
||||
<body onload="fadeIn()">
|
||||
<div class="page">
|
||||
<div class="container">
|
||||
<!-- Step 1: Profile Information -->
|
||||
<div class="step active" id="step1">
|
||||
<div class="header">
|
||||
<h1 class="title">TeamVault</h1>
|
||||
<h3 class="subheading">Let us meet each other</h3>
|
||||
</div>
|
||||
<form class="signup-form" id="signupForm">
|
||||
<div class="signup-form-title">
|
||||
<h2>Sign Up</h2>
|
||||
</div>
|
||||
<div class="signup-form-content">
|
||||
<input name="email" placeholder="Email" type="email" required>
|
||||
<input name="name" placeholder="Username" type="text" required>
|
||||
<input name="password" placeholder="Password" type="password" required>
|
||||
</div>
|
||||
<div class="signup-form-footer">
|
||||
<button id="backToLogin" name="back" type="button">Cancel</button>
|
||||
<button id="nextToStep2" name="continue" type="submit">Next</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Step 2: Department Selection -->
|
||||
<div class="step" id="step2" style="display: none;">
|
||||
<div class="header">
|
||||
<h1 class="title">TeamVault</h1>
|
||||
<h3 class="subheading">Tell me more about your work</h3>
|
||||
</div>
|
||||
<form class="signup-form" id="departmentForm">
|
||||
<div class="signup-form-title">
|
||||
<h2>Choose your department</h2>
|
||||
</div>
|
||||
<div class="signup-form-content-radio" id="departmentList">
|
||||
<!-- List of departments will be dynamically inserted here -->
|
||||
</div>
|
||||
<div class="signup-form-footer">
|
||||
<button id="backToStep1" name="back" type="button">Back</button>
|
||||
<button id="submitSignup" name="continue" type="submit">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../js/sign_up.js"></script>
|
||||
<script src="../js/helpers.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
|
||||
<link href="../css/normalizer.css" rel="stylesheet">
|
||||
<link href="../css/loading.css" rel="stylesheet">
|
||||
<link href="../css/transition.css" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<script src="../js/helpers.js"></script>
|
||||
|
||||
<title>UC Not Found</title>
|
||||
</head>
|
||||
<body onload="fadeIn()">
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1 class="title">TeamVault</h1>
|
||||
</div>
|
||||
<img src="../assets/cloud-computing.webp" alt="Connecting to server" class="server-img">
|
||||
<div class="loading-section">
|
||||
<div class="spinner"></div>
|
||||
<p>Please wait while we try to connect to the server.</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="width=device-width, initial-scale=1.0" name="viewport">
|
||||
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
|
||||
<link href="../css/normalizer.css" rel="stylesheet">
|
||||
<!-- Reuse the same CSS files as UC Not Found -->
|
||||
<link href="../css/loading.css" rel="stylesheet">
|
||||
<link href="../css/transition.css" rel="stylesheet">
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<script src="../js/helpers.js"></script>
|
||||
<title>Welcome</title>
|
||||
</head>
|
||||
<body onload="fadeIn()">
|
||||
<div class="container">
|
||||
<div class="header">
|
||||
<h1 class="title">Welcome to TeamVault</h1>
|
||||
</div>
|
||||
<div class="loading-section">
|
||||
<div class="spinner"></div>
|
||||
<p>Initializing the application, please wait...</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,26 @@
|
||||
// Load announcement content from the application info when the page loads
|
||||
async function loadAnnouncement() {
|
||||
try {
|
||||
const announcementText = await window.electronAPI.readAnnouncement();
|
||||
const announcementContent = document.getElementById('announcement-content');
|
||||
if (announcementContent && announcementText) {
|
||||
announcementContent.innerHTML = formatTextForHtml(announcementText);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to load announcement:', error);
|
||||
document.getElementById('announcement-content').textContent = 'Failed to load announcement.';
|
||||
}
|
||||
}
|
||||
|
||||
function formatTextForHtml(text) {
|
||||
let formattedText = text.replace(/\n/g, '<br>');
|
||||
formattedText = formattedText.replace(/\t/g, ' ');
|
||||
formattedText = formattedText.replace(/ /g, ' ');
|
||||
|
||||
return formattedText;
|
||||
}
|
||||
|
||||
// Close the window when the close button is clicked
|
||||
function closeWindow() {
|
||||
window.electronAPI.closeAnnouncementWindow();
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
function fadeIn() {
|
||||
document.querySelector('.container').classList.remove('fade-out');
|
||||
document.querySelector('.container').classList.add('fade-in');
|
||||
}
|
||||
|
||||
function fadeOut(destination) {
|
||||
const container = document.querySelector('.container');
|
||||
container.classList.remove('fade-in');
|
||||
container.classList.add('fade-out');
|
||||
|
||||
console.log(destination);
|
||||
setTimeout(() => {}, 5000);
|
||||
|
||||
container.addEventListener('animationend', async () => {
|
||||
try {
|
||||
await window.uiAPI.changeContent(destination);
|
||||
console.log('Navigated to', destination);
|
||||
} catch (error) {
|
||||
console.error('Error navigating:', error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function waitForResponse() {
|
||||
return new Promise((resolve) => {
|
||||
const idResponseCheck = setInterval(async () => {
|
||||
if (await window.networkAPI.hasResponseArrived()) {
|
||||
clearInterval(idResponseCheck);
|
||||
resolve(await window.networkAPI.getLastUcResult()); // Resolve the response or null if not available
|
||||
}
|
||||
}, 100); // Check every 100 milliseconds if the response has arrived
|
||||
});
|
||||
}
|
||||
|
||||
function toggleScroll(idComponent, scrollHeight = 180) {
|
||||
const element = document.getElementById(idComponent); // Using getElementById
|
||||
if (!element) {
|
||||
console.error(`Element with ID '${idComponent}' not found.`);
|
||||
return;
|
||||
}
|
||||
if (element.scrollHeight > scrollHeight) {
|
||||
element.style.overflowY = 'auto'; // Enable scroll if content overflows
|
||||
} else {
|
||||
element.style.overflowY = 'hidden'; // Disable scroll if content fits
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
let codeLogin = '';
|
||||
let codeFindByEmail = '';
|
||||
let codeFindKeyByUser = '';
|
||||
let codeOk = '';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async function () {
|
||||
const submitButton = document.getElementById('submit');
|
||||
const resetPasswordButton = document.getElementById('resetPassword');
|
||||
const signUpButton = document.getElementById('signup');
|
||||
|
||||
await window.databaseAPI.setLoginStatus(false);
|
||||
|
||||
// Retrieve the operation codes via IPC
|
||||
const operationCodes = await window.networkAPI.getOperationsCodes();
|
||||
if (!operationCodes) {
|
||||
await window.uiAPI.showAlert('Internal error of the application. Failed to retrieve operation codes.');
|
||||
return;
|
||||
}
|
||||
|
||||
codeLogin = operationCodes.LOGIN;
|
||||
codeFindByEmail = operationCodes.FIND_BY_EMAIL;
|
||||
codeFindKeyByUser = operationCodes.FIND_KEY_BY_USER_ID;
|
||||
codeOk = operationCodes.OK;
|
||||
|
||||
resetPasswordButton.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
window.uiAPI.changeContent('reset_password');
|
||||
});
|
||||
|
||||
signUpButton.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
window.uiAPI.changeContent('sign_up');
|
||||
});
|
||||
|
||||
// Submit button logic (handle login)
|
||||
submitButton.addEventListener('click', async function (e) {
|
||||
e.preventDefault();
|
||||
console.log('Submit button clicked');
|
||||
|
||||
const form = document.getElementById('loginForm');
|
||||
const formData = new FormData(form);
|
||||
|
||||
const email = formData.get('email');
|
||||
const password = formData.get('password');
|
||||
|
||||
// Open a TCP socket to the stored IP
|
||||
if (!await window.networkAPI.openUcSocket()) {
|
||||
await window.uiAPI.showAlert('Internal error of the application. Unable to open socket.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Attempt login
|
||||
if (!await attemptLogin(email, password)) {
|
||||
await window.networkAPI.closeUcSocket();
|
||||
return;
|
||||
}
|
||||
|
||||
// Fetch and store user info
|
||||
if (!await fetchAndStoreUserInfo(email)) {
|
||||
await window.networkAPI.closeUcSocket();
|
||||
return;
|
||||
}
|
||||
|
||||
// Fetch user info from local storage
|
||||
const userInfo = await window.databaseAPI.getUserInfo('user_info');
|
||||
if (!userInfo) {
|
||||
await window.networkAPI.closeUcSocket();
|
||||
await window.uiAPI.showAlert('Failed to fetch user info.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Fetch and store encryption key
|
||||
if (!await fetchAndStoreEncryptionKey(userInfo.id)) {
|
||||
await window.networkAPI.closeUcSocket();
|
||||
return;
|
||||
}
|
||||
|
||||
// Close the socket and navigate to main menu after success
|
||||
await window.networkAPI.closeUcSocket();
|
||||
await window.workersAPI.startWorkers();
|
||||
await window.databaseAPI.setLoginStatus(true);
|
||||
await window.uiAPI.changeContent('main_menu');
|
||||
});
|
||||
});
|
||||
|
||||
async function attemptLogin(email, password) {
|
||||
const app_type = await window.databaseAPI.getAppType();
|
||||
const messageData = {email, password, app_type};
|
||||
|
||||
// Send the login message to the server
|
||||
if (!await window.networkAPI.sendUcMessage(codeLogin, messageData)) {
|
||||
await window.uiAPI.showAlert('Failed to send login request.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Wait for the response using waitForResponse
|
||||
const response = await waitForResponse();
|
||||
|
||||
if (!response) {
|
||||
await window.uiAPI.showAlert('No response from server.');
|
||||
return false;
|
||||
}
|
||||
|
||||
if (response.operationCode !== codeOk) {
|
||||
await window.uiAPI.showAlert(response.metaInfo.message);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
async function fetchAndStoreUserInfo(userEmail) {
|
||||
if (!await window.networkAPI.sendUcMessage(codeFindByEmail, {email: userEmail})) {
|
||||
await window.uiAPI.showAlert('Failed to send request to fetch user info.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Wait for the response using waitForResponse
|
||||
const response = await waitForResponse();
|
||||
if (response && response.operationCode === codeOk) {
|
||||
const userInfo = {};
|
||||
userInfo.id = response.metaInfo.id;
|
||||
userInfo.email = response.metaInfo.email;
|
||||
userInfo.departmentId = response.metaInfo.departmentId;
|
||||
userInfo.name = response.metaInfo.name || 'User';
|
||||
|
||||
await window.databaseAPI.writeUserInfo(userInfo);
|
||||
return true;
|
||||
}
|
||||
|
||||
await window.uiAPI.showAlert('Failed to fetch user info from server.');
|
||||
return false;
|
||||
}
|
||||
|
||||
async function fetchAndStoreEncryptionKey(userId) {
|
||||
if (!await window.networkAPI.sendUcMessage(codeFindKeyByUser, {userId})) {
|
||||
await window.uiAPI.showAlert('Failed to send request to fetch encryption key.');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Wait for the response using waitForResponse
|
||||
const response = await waitForResponse();
|
||||
if (response && response.operationCode === codeOk) {
|
||||
const encryptionKey = {
|
||||
key: response.metaInfo.key.key,
|
||||
iv: response.metaInfo.key.iv,
|
||||
};
|
||||
|
||||
await window.databaseAPI.writeEncryptionKey(encryptionKey);
|
||||
return true;
|
||||
}
|
||||
|
||||
await window.uiAPI.showAlert('Failed to fetch encryption key from server.');
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,173 @@
|
||||
let backupDirId = '';
|
||||
let shareDirId = '';
|
||||
let departmentDirId = '';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async function () {
|
||||
setInterval(loadReceivedFiles, 3000); // Call loadReceivedFiles every 3000 ms (3 seconds)
|
||||
|
||||
const backupButton = document.getElementById('backup-dir');
|
||||
const shareButton = document.getElementById('share-dir');
|
||||
const departmentButton = document.getElementById('department-dir');
|
||||
|
||||
const changeInfoButton = document.getElementById('change-info');
|
||||
const shareFileButton = document.getElementById('share-file');
|
||||
const logoutButton = document.getElementById('logout');
|
||||
const restoreBackupButton = document.getElementById('restore-backup');
|
||||
|
||||
backupButton.addEventListener('click', async function () {
|
||||
await setPath('backupDirectory');
|
||||
});
|
||||
|
||||
shareButton.addEventListener('click', async function () {
|
||||
await setPath('shareDirectory');
|
||||
});
|
||||
|
||||
departmentButton.addEventListener('click', async function () {
|
||||
await setPath('departmentDirectory');
|
||||
});
|
||||
|
||||
changeInfoButton.addEventListener('click', function () {
|
||||
fadeOut('profile');
|
||||
});
|
||||
|
||||
shareFileButton.addEventListener('click', function () {
|
||||
fadeOut('share_file');
|
||||
});
|
||||
|
||||
logoutButton.addEventListener('click', async function () {
|
||||
fadeOut('login');
|
||||
});
|
||||
|
||||
// Add event listener for the restore backup button
|
||||
restoreBackupButton.addEventListener('click', async function () {
|
||||
await restoreBackup();
|
||||
});
|
||||
});
|
||||
|
||||
async function initialSetup(){
|
||||
await checkAndSetAllDirectories();
|
||||
await loadReceivedFiles();
|
||||
await fetchUserInfo();
|
||||
}
|
||||
|
||||
async function restoreBackup() {
|
||||
const backupDirectory = await window.databaseAPI.isBackupSet();
|
||||
|
||||
if (backupDirectory) {
|
||||
await window.uiAPI.showAlert('You have already set a backup directory. You cannot restore again.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Prompt the user to choose the destination for the restored backup
|
||||
const destinationPath = await window.uiAPI.selectDirectory();
|
||||
if (!destinationPath) {
|
||||
return; // User canceled the directory selection
|
||||
}
|
||||
|
||||
// Call the IPC method to initiate the backup retrieval process
|
||||
window.workersAPI.startBackupRetrieval(destinationPath);
|
||||
|
||||
// Switch the content to the 'backup_retrieve' page
|
||||
fadeOut('backup_retrieve');
|
||||
}
|
||||
|
||||
async function checkAndSetAllDirectories() {
|
||||
const directorySchemes = await window.databaseAPI.getLocalResources();
|
||||
|
||||
backupDirId = directorySchemes.backup.id;
|
||||
shareDirId = directorySchemes.shared.id;
|
||||
departmentDirId = directorySchemes.department.id;
|
||||
|
||||
await attachNotificationButton(backupDirId, 'Set your backup directory!', 'backup_alert', 'alert');
|
||||
await attachNotificationButton(shareDirId, 'Set your share directory!', 'share_alert', 'alert');
|
||||
await attachNotificationButton(departmentDirId, 'Set your department directory!', 'department_alert', 'alert');
|
||||
}
|
||||
|
||||
async function checkPathExistence(id) {
|
||||
const dirInfo = await window.databaseAPI.getDirectoryInfo(id);
|
||||
return dirInfo.path !== ''
|
||||
}
|
||||
|
||||
async function setPath(id){
|
||||
const path = await window.uiAPI.selectDirectory();
|
||||
if (path === undefined) return false;
|
||||
|
||||
return await window.databaseAPI.writeDirectoryPath(id, path);
|
||||
}
|
||||
|
||||
async function attachNotificationButton(entryId, buttonText, buttonId, buttonName) {
|
||||
const path = await checkPathExistence(entryId);
|
||||
if (!path) {
|
||||
const notificationsDiv = document.getElementById('notifications');
|
||||
const button = document.createElement('button');
|
||||
button.className='alert';
|
||||
button.id = buttonId;
|
||||
button.name = buttonName;
|
||||
button.textContent = buttonText;
|
||||
button.addEventListener('click', async function () {
|
||||
if(await setPath(entryId)) button.remove();
|
||||
});
|
||||
notificationsDiv.appendChild(button);
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchUserInfo() {
|
||||
const usernameField = document.getElementById('username-field');
|
||||
|
||||
// Read the user credentials from the userConfig
|
||||
let userInfo = await window.databaseAPI.getUserInfo();
|
||||
if (userInfo && userInfo.name) {
|
||||
usernameField.textContent = userInfo.name;
|
||||
return;
|
||||
}
|
||||
|
||||
// Update the greeting with the fetched user's name
|
||||
if (usernameField) {
|
||||
usernameField.textContent = userInfo.name;
|
||||
} else {
|
||||
console.error("Username field is not available in the DOM.");
|
||||
}
|
||||
}
|
||||
|
||||
async function loadReceivedFiles() {
|
||||
// Read the shareDirectory from applicationInfo
|
||||
const shareDirData = await window.databaseAPI.getDirectoryInfo(shareDirId);
|
||||
|
||||
console.log('Loading received files:', shareDirData);
|
||||
|
||||
const notificationsDiv = document.getElementById('notifications');
|
||||
const existingButtons = Array.from(notificationsDiv.children).map(button => button.getAttribute('data-filepath'));
|
||||
|
||||
// Iterate over each user and their files in the structure
|
||||
Object.keys(shareDirData.structure).forEach(userName => {
|
||||
const userFiles = shareDirData.structure[userName];
|
||||
|
||||
// Iterate over each file of the user
|
||||
Object.keys(userFiles).forEach(fileName => {
|
||||
const filePath = userFiles[fileName];
|
||||
|
||||
// Check if a button for this file path already exists
|
||||
if (!existingButtons.includes(filePath)) {
|
||||
const button = document.createElement('button');
|
||||
button.setAttribute('data-filepath', filePath); // Set a custom attribute to track the file path
|
||||
button.className = 'notification';
|
||||
button.name = 'notification';
|
||||
button.textContent = `You received a file "${fileName}" from ${userName}`; // Display the userName and file name
|
||||
button.addEventListener('click', () => handleFileReceivedButtonPressed(filePath, button));
|
||||
notificationsDiv.appendChild(button);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function handleFileReceivedButtonPressed(filePath, button) {
|
||||
console.log('Notification button clicked!');
|
||||
|
||||
// Open the file in the file explorer
|
||||
await window.uiAPI.showFileInExplorer(filePath)
|
||||
.then(() => console.log('File explorer opened for: ' + filePath))
|
||||
.catch(error => console.error('Error opening file explorer:', error));
|
||||
|
||||
// Remove the button after opening the file
|
||||
button.remove();
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
let id = '';
|
||||
let departmentId = '';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async function () {
|
||||
const {id: userId, name, email, departmentId: userDepartmentId} = await window.databaseAPI.getUserInfo();
|
||||
|
||||
const emailInput = document.querySelector('input[name="email"]');
|
||||
const usernameInput = document.querySelector('input[name="username"]');
|
||||
const passwordInput = document.querySelector('input[name="password"]');
|
||||
|
||||
// Pre-fill form fields with existing data
|
||||
id = userId
|
||||
departmentId = userDepartmentId;
|
||||
usernameInput.value = name;
|
||||
emailInput.value = email;
|
||||
passwordInput.value = '';
|
||||
|
||||
const backButton = document.getElementById('back');
|
||||
const submitButton = document.getElementById('submit');
|
||||
|
||||
// Get operation codes from the backend
|
||||
const operationCodes = await window.networkAPI.getOperationsCodes();
|
||||
if (!operationCodes) {
|
||||
await window.uiAPI.showAlert('Internal error of the application.');
|
||||
return;
|
||||
}
|
||||
|
||||
const codeModifyUser = operationCodes.MODIFY_USER;
|
||||
const codeOk = operationCodes.OK;
|
||||
|
||||
// Handle the back button click
|
||||
backButton.addEventListener('click', async function () {
|
||||
console.log('Back button clicked!');
|
||||
fadeOut('main_menu');
|
||||
});
|
||||
|
||||
// Handle the submit button click
|
||||
submitButton.addEventListener('click', async function (e) {
|
||||
e.preventDefault();
|
||||
console.log('Submit button clicked!');
|
||||
|
||||
// Fetch form values
|
||||
const email = emailInput.value;
|
||||
const name = usernameInput.value;
|
||||
const password = passwordInput.value;
|
||||
|
||||
const app_type = await window.databaseAPI.getAppType();
|
||||
|
||||
// Prepare the data to be sent via the UC socket
|
||||
const messageData = {
|
||||
id: id,
|
||||
name: name,
|
||||
email: email,
|
||||
password: password,
|
||||
departmentId: departmentId,
|
||||
app_type: app_type
|
||||
};
|
||||
|
||||
// Open UC socket
|
||||
if (!await window.networkAPI.openUcSocket()) {
|
||||
await window.uiAPI.showAlert('Failed to open socket. Internal error of the application.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Send the message to the server using the UC socket
|
||||
if (!await window.networkAPI.sendUcMessage(codeModifyUser, messageData)) {
|
||||
await window.uiAPI.showAlert('Failed to send message.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Wait for the response
|
||||
const response = await waitForResponse();
|
||||
if (response && response.operationCode === codeOk) {
|
||||
console.log('User update successful.');
|
||||
|
||||
// Save updated user info to the userConfig
|
||||
await window.databaseAPI.writeUserInfo({ id: id, email: email, name: name, departmentId: departmentId });
|
||||
|
||||
// Navigate back to the main menu
|
||||
fadeOut('main_menu');
|
||||
} else {
|
||||
console.log('Error updating user:', response?.metaInfo?.message || 'Unknown error');
|
||||
await window.electronAPI.showAlert(response?.metaInfo?.message || 'Unknown error occurred');
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
document.addEventListener('DOMContentLoaded', async function () {
|
||||
await new Promise(resolve => setTimeout(resolve, 7000));
|
||||
await window.databaseAPI.resetInternalDatabase();
|
||||
await window.workersAPI.stopWorkers();
|
||||
await window.uiAPI.changeContent('welcome');
|
||||
});
|
||||
@@ -0,0 +1,66 @@
|
||||
let codeResetPassword = '';
|
||||
let codeOk = '';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async function () {
|
||||
const backToLoginButton = document.getElementById('backToLogin');
|
||||
const resetPasswordButton = document.getElementById('resetPassword');
|
||||
|
||||
// Retrieve the operation codes via IPC
|
||||
const operationCodes = await window.networkAPI.getOperationsCodes();
|
||||
if (!operationCodes) {
|
||||
await window.uiAPI.showAlert('Internal error of the application.');
|
||||
return;
|
||||
}
|
||||
|
||||
codeResetPassword = operationCodes.RESET_PASSWORD;
|
||||
codeOk = operationCodes.OK;
|
||||
|
||||
// Back to login
|
||||
backToLoginButton.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
window.uiAPI.changeContent('login');
|
||||
});
|
||||
|
||||
// Reset password logic
|
||||
resetPasswordButton.addEventListener('click', async function (e) {
|
||||
e.preventDefault();
|
||||
if (!await window.networkAPI.openUcSocket()) {
|
||||
await window.uiAPI.showAlert('Internal error of the application.');
|
||||
return;
|
||||
}
|
||||
|
||||
const form = document.getElementById('resetPasswordForm');
|
||||
const formData = new FormData(form);
|
||||
const email = formData.get('email');
|
||||
const newPassword = formData.get('newPassword');
|
||||
|
||||
// Ensure the email and new password are provided
|
||||
if (!email || !newPassword) {
|
||||
await window.uiAPI.showAlert('Please provide both email and new password.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!await attemptResetPassword(email, newPassword)) {
|
||||
return;
|
||||
}
|
||||
|
||||
await window.networkAPI.closeUcSocket();
|
||||
await window.uiAPI.showAlert('Password reset successfully.');
|
||||
await window.uiAPI.changeContent('login');
|
||||
});
|
||||
});
|
||||
|
||||
async function attemptResetPassword(email, newPassword) {
|
||||
const app_type = await window.databaseAPI.getAppType();
|
||||
const messageData = { email, newPassword, app_type };
|
||||
|
||||
if (!await window.networkAPI.sendUcMessage(codeResetPassword, messageData)) return false;
|
||||
|
||||
const response = await waitForResponse();
|
||||
if (response && response.operationCode === codeOk) {
|
||||
return true;
|
||||
} else {
|
||||
await window.uiAPI.showAlert(response?.metaInfo?.message || 'Error resetting password.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
let pathToFile = '';
|
||||
let fetchUsersInterval = null;
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async function () {
|
||||
const selectFileButton = document.getElementById('selectFile');
|
||||
const submitButton = document.getElementById('submitButton');
|
||||
const backButton = document.getElementById('backButton');
|
||||
|
||||
selectFileButton.addEventListener('click', async function (event) {
|
||||
event.preventDefault();
|
||||
try {
|
||||
pathToFile = await window.uiAPI.selectFile();
|
||||
updateFileName();
|
||||
} catch (error) {
|
||||
console.error('Error opening file dialog:', error);
|
||||
}
|
||||
});
|
||||
submitButton.addEventListener('click', async function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
// Check if a file was chosen
|
||||
if (!pathToFile.trim()) {
|
||||
await window.uiAPI.showAlert('File not chosen!');
|
||||
return;
|
||||
}
|
||||
|
||||
const user_info = await window.databaseAPI.getUserInfo();
|
||||
if (!user_info) {
|
||||
return;
|
||||
}
|
||||
|
||||
const form = document.getElementById('userDestForm');
|
||||
const checkboxes = form.querySelectorAll('input[name="users"]');
|
||||
const selectedUserIps = Array.from(checkboxes)
|
||||
.filter(checkbox => checkbox.checked)
|
||||
.map(checkbox => checkbox.value); // Get IP of the selected users
|
||||
|
||||
if (!selectedUserIps.length) {
|
||||
await window.uiAPI.showAlert('No user selected!');
|
||||
return;
|
||||
}
|
||||
|
||||
for (const selectedUserIp of selectedUserIps) {
|
||||
try {
|
||||
// Add task to send file to the queue
|
||||
const task = {
|
||||
ip: selectedUserIp, // Destination IP for the file
|
||||
path: pathToFile, // File path
|
||||
userName: user_info.name // Sender's username from userConfig
|
||||
};
|
||||
await window.databaseAPI.addTaskToSendFileQueue(task);
|
||||
await window.uiAPI.showAlert('File sent to the queue.');
|
||||
console.log(`Task added to send file to IP ${selectedUserIp}`);
|
||||
} catch (error) {
|
||||
console.error(`Error processing IP ${selectedUserIp}:`, error);
|
||||
}
|
||||
}
|
||||
});
|
||||
backButton.addEventListener('click', function (event) {
|
||||
event.preventDefault();
|
||||
fadeOut('main_menu');
|
||||
});
|
||||
|
||||
setInterval(fetchUsersAndCreateCheckboxes, 5000);
|
||||
});
|
||||
|
||||
// Function to update the file name display
|
||||
function updateFileName() {
|
||||
const fileNameElement = document.getElementById('selectFile');
|
||||
if (!fileNameElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pathToFile.trim() === '') {
|
||||
fileNameElement.textContent = 'No file chosen';
|
||||
} else {
|
||||
fileNameElement.textContent = pathToFile.split('\\').pop().split('/').pop();
|
||||
}
|
||||
}
|
||||
|
||||
async function fetchUsersAndCreateCheckboxes() {
|
||||
// Step 1: Get the currently checked users before refreshing the list
|
||||
const selectedUserIps = new Set(
|
||||
Array.from(document.querySelectorAll('input[name="users"]:checked'))
|
||||
.map(checkbox => checkbox.value)
|
||||
);
|
||||
|
||||
const usersInfo = await window.databaseAPI.getActiveUsers();
|
||||
const filteredUsers = usersInfo.filter(user => user.id !== '');
|
||||
if (!filteredUsers.length === 0) {
|
||||
await window.uiAPI.showAlert('No active users found.');
|
||||
clearInterval(fetchUsersInterval);
|
||||
fetchUsersInterval = null;
|
||||
await window.uiAPI.changeContent('main_menu');
|
||||
return;
|
||||
}
|
||||
|
||||
const usersDiv = document.getElementById('choose_user_form_content');
|
||||
usersDiv.innerHTML = ''; // Clear the list before updating
|
||||
|
||||
usersInfo.forEach(user => {
|
||||
const checkbox = document.createElement('input');
|
||||
checkbox.type = 'checkbox';
|
||||
checkbox.name = 'users';
|
||||
checkbox.value = user.ip; // Store user's IP in the value
|
||||
|
||||
// Step 2: Check if this user was previously selected
|
||||
if (selectedUserIps.has(user.ip)) {
|
||||
checkbox.checked = true; // Restore checked state
|
||||
}
|
||||
|
||||
const label = document.createElement('label');
|
||||
label.innerHTML = `${user.name}`;
|
||||
label.insertBefore(checkbox, label.firstChild);
|
||||
|
||||
usersDiv.appendChild(label);
|
||||
});
|
||||
|
||||
toggleScroll('choose_user_form_content');
|
||||
}
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
let codeOk = '';
|
||||
let codeGetDepartments = '';
|
||||
let codeSignUp = '';
|
||||
let userData = {
|
||||
email: null,
|
||||
name: null,
|
||||
password: null,
|
||||
app_type: null,
|
||||
departmentId: null
|
||||
};
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async function () {
|
||||
const nextToStep2Button = document.getElementById('nextToStep2');
|
||||
const backToStep1Button = document.getElementById('backToStep1');
|
||||
const submitSignupButton = document.getElementById('submitSignup');
|
||||
const backToLogin = document.getElementById('backToLogin');
|
||||
|
||||
const step1 = document.getElementById('step1');
|
||||
const step2 = document.getElementById('step2');
|
||||
|
||||
if (!await window.networkAPI.openUcSocket()) {
|
||||
alert('Internal error of the application.');
|
||||
return;
|
||||
}
|
||||
|
||||
const operationCodes = await window.networkAPI.getOperationsCodes();
|
||||
if (!operationCodes) {
|
||||
await window.electronAPI.showAlert('Internal error of the application.');
|
||||
return;
|
||||
}
|
||||
|
||||
codeGetDepartments = operationCodes.GET_DEPARTMENTS;
|
||||
codeSignUp = operationCodes.SIGN_UP;
|
||||
codeOk = operationCodes.OK;
|
||||
|
||||
let departments = await getDepartments();
|
||||
if (departments === null) {
|
||||
await window.uiAPI.showAlert('Failed to fetch departments.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle form submission for Step 1 (Profile Information)
|
||||
nextToStep2Button.addEventListener('click', async function (e) {
|
||||
e.preventDefault(); // Prevent the default form submission
|
||||
|
||||
// Collect data from Step 1 inputs
|
||||
userData.email = document.querySelector('input[name="email"]').value;
|
||||
userData.name = document.querySelector('input[name="name"]').value;
|
||||
userData.password = document.querySelector('input[name="password"]').value;
|
||||
userData.app_type = await window.databaseAPI.getAppType();
|
||||
|
||||
// Move to Step 2
|
||||
const departmentList = document.getElementById('departmentList');
|
||||
departmentList.innerHTML = ''; // Clear existing departments
|
||||
|
||||
// Populate department list
|
||||
departments.forEach(department => {
|
||||
if (department.name !== 'CEO' && department.name !== 'ADMIN') {
|
||||
const label = document.createElement('label');
|
||||
label.innerHTML = `
|
||||
<input type="radio" name="dept" value="${department.id}">
|
||||
${department.name}
|
||||
`;
|
||||
departmentList.appendChild(label);
|
||||
}
|
||||
});
|
||||
|
||||
switchStep(step1, step2);
|
||||
});
|
||||
|
||||
// Handle form submission for Step 2 (Department Selection)
|
||||
submitSignupButton.addEventListener('click', async function (e) {
|
||||
e.preventDefault(); // Prevent form from being submitted in the usual way
|
||||
|
||||
// Get the selected department
|
||||
userData.departmentId = document.querySelector('input[name="dept"]:checked')?.value;
|
||||
if (!userData.departmentId) {
|
||||
await window.uiAPI.showAlert('Please select a department.');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!await attemptSignUp()) {
|
||||
switchStep(step2, step1);
|
||||
return;
|
||||
}
|
||||
|
||||
await window.uiAPI.showAlert('Signup successful!');
|
||||
await window.uiAPI.changeContent('login');
|
||||
});
|
||||
|
||||
// Back to Step 1 from Step 2
|
||||
backToStep1Button.addEventListener('click', function () {
|
||||
switchStep(step2, step1);
|
||||
});
|
||||
|
||||
// Back to login
|
||||
backToLogin.addEventListener('click', async function (e) {
|
||||
e.preventDefault();
|
||||
await window.networkAPI.closeUcSocket();
|
||||
await window.uiAPI.changeContent('login');
|
||||
});
|
||||
});
|
||||
|
||||
async function getDepartments() {
|
||||
if (!await window.networkAPI.sendUcMessage('GET_DEPARTMENTS')) return null;
|
||||
|
||||
const response = await waitForResponse();
|
||||
console.log(response);
|
||||
if (response && response.operationCode === codeOk) {
|
||||
return response.metaInfo.departments;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async function attemptSignUp() {
|
||||
if (!await window.networkAPI.sendUcMessage(codeSignUp, userData)) return false;
|
||||
|
||||
const response = await waitForResponse();
|
||||
if (response && response.operationCode === codeOk) {
|
||||
return true;
|
||||
}
|
||||
await window.uiAPI.showAlert(`Signup failed: ${response?.metaInfo?.message || 'Unknown error'}`);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Function to switch between steps
|
||||
function switchStep(fromStep, toStep) {
|
||||
fromStep.classList.remove('active'); // Fade out the current step
|
||||
setTimeout(() => {
|
||||
fromStep.style.display = 'none'; // Hide the current step after transition
|
||||
toStep.style.display = 'flex'; // Ensure display is flex for the next step
|
||||
setTimeout(() => {
|
||||
toStep.classList.add('active'); // Fade in the next step
|
||||
}, 20); // Small delay to allow display change before applying opacity
|
||||
}, 500); // Transition duration (0.5s)
|
||||
}
|
||||