Skip to content

Commit 802cdc1

Browse files
Some more design work on the control page of the server
1 parent 5f0f112 commit 802cdc1

File tree

9 files changed

+187
-48
lines changed

9 files changed

+187
-48
lines changed

src/Types/Auth/forgotPasswordTypes.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ declare interface ForgotPasswordTypes {
33
loginBarColor: string,
44
loginHidden: boolean,
55
emptyEmail: boolean | undefined,
6+
67
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare interface LockedScreenTypes {
2+
emptyPassword: boolean | undefined,
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare interface LockedScreenValuesTypes {
2+
password: string | null,
3+
}

src/components/ProjectSpecific/Dashboard/DashboardSubtitle.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ export default class DashboardSubtitle extends React.Component<{}, any> {
55

66
render() {
77
return (
8-
<p className={"md:inline-block md:align-bottom leading-4 text-sm font-light"}>{this.props.children}</p>
8+
<div className={"ml-2 flex flex-col-reverse leading-4 text-sm font-light"}>
9+
<p className={""}>{this.props.children}</p>
10+
</div>
911
)
1012
}
1113
}

src/components/ProjectSpecific/Drawer/Drawer.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {Link} from 'react-router-dom';
1515
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
1616
import Time from "../../Time";
1717
import Version from "../../Version";
18+
import {faPowerOff} from "@fortawesome/free-solid-svg-icons/faPowerOff";
1819

1920
export default class Drawer extends React.Component<any, { signoutDropdown: boolean, hidden: boolean }> {
2021
state = {
@@ -95,12 +96,12 @@ export default class Drawer extends React.Component<any, { signoutDropdown: bool
9596
</div>
9697
</div>
9798
<div className={"flex"}>
98-
<Link className={"self-center md:mr-2 mr-4"} to={"/lockscreen"}><FontAwesomeIcon
99-
className={"text-2xl md:text-xl hover:text-white"}
100-
icon={faLock}/></Link>
101-
<Link className={"self-center text-2xl md:text-xl"} to={"/login"}><FontAwesomeIcon
102-
className={"text-2xl md:text-xl hover:text-red-700"}
103-
icon={faSignOutAlt}/></Link>
99+
{/*<Link className={"self-center px-2 mr-1 py-2 hover:bg-gray-700 hover:text-red-700 rounded"} to={"/lockscreen"}><FontAwesomeIcon*/}
100+
{/* className={"text-2xl md:text-xl hover:text-white"}*/}
101+
{/* icon={faLock}/></Link>*/}
102+
{/*<Link className={"self-center px-2 py-2 hover:bg-gray-700 hover:text-red-700 rounded"} to={"/login"}><FontAwesomeIcon*/}
103+
{/* className={"text-2xl md:text-xl"}*/}
104+
{/* icon={faSignOutAlt}/></Link>*/}
104105
</div>
105106
</div>
106107
<a href={"https://systemmanager.io"} referrerPolicy={"_blank"}

src/css/tailwind.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ html {
1010
}
1111

1212
.serverbooting {
13-
-webkit-animation: blinker 2s linear infinite;
14-
animation: blinker 2s linear infinite;
13+
-webkit-animation: blinker 0.5s linear infinite;
14+
animation: blinker 0.5s linear infinite;
1515
}
1616

1717
@-webkit-keyframes blinker {
1818
50% {
19-
opacity: 0;
19+
background-color: #c53030;
2020
}
2121
}
2222

2323
@keyframes blinker {
2424
50% {
25-
opacity: 0;
25+
background-color: #c53030;
2626
}
2727
}
2828

src/pages/auth/Locked.tsx

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,47 @@ import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
55
import Time from "../../components/Time";
66
import Version from "../../components/Version";
77

8-
interface IProps {
9-
}
8+
export default class Locked extends React.Component<any, LockedScreenTypes> {
109

11-
export default class Locked extends React.Component<IProps, ForgotPasswordTypes> {
12-
13-
private loginValues: ForgotPasswordValuesTypes = {
14-
email: null,
10+
private loginValues: LockedScreenValuesTypes = {
11+
password: null,
1512
};
1613

17-
public state: ForgotPasswordTypes = {
18-
loginText: "Forgot Password",
19-
loginBarColor: "gray",
20-
emptyEmail: false,
21-
loginHidden: false,
14+
public state: LockedScreenTypes = {
15+
emptyPassword: false,
2216
};
2317

2418
unlock = (): void => {
2519
const emptyString = /^$/;
26-
this.setState({emptyEmail: false});
20+
this.setState({emptyPassword: false});
2721
let valueEmpty: boolean = false;
28-
if (this.loginValues.email == null || emptyString.test(this.loginValues.email)) {
29-
this.setState({emptyEmail: true});
22+
if (this.loginValues.password == null || emptyString.test(this.loginValues.password)) {
23+
this.setState({emptyPassword: true});
3024
valueEmpty = true;
3125
}
3226
if (valueEmpty) return;
27+
3328
}
3429

35-
handleChange = (name: "email") => (event: any) => {
30+
handleChange = (name: "password") => (event: any) => {
31+
32+
// const emptyString = /^$/;
33+
// this.setState({emptyPassword: false});
34+
// if (this.loginValues.password == null || emptyString.test(this.loginValues.password)) {
35+
// this.setState({emptyPassword: true});
36+
// }
3637
this.loginValues[name] = event.target.value;
3738
};
3839

3940
render() {
4041

4142
return (
4243
<div
43-
className=" min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
44-
<div className="max-w-md w-full">
44+
className={`min-h-screen flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8`}>
45+
{/*<div className={"absolute top-0 text-white py-3 px-4"}><h1 className={"text-6xl"}>1 SERVER OFFLINE</h1></div>*/}
46+
<div className={"absolute top-0 bg-gray-800 rounded left-0 text-gray-600 py-3 px-4"}><p className={""}>1
47+
SERVER OFFLINE</p></div>
48+
<div className="bg-gray-800 rounded-lg p-4 max-w-md w-full">
4549
<div>
4650
<img className="mx-auto h-32 rounded-full w-32"
4751
src="https://genericdevelopment.nl/static/media/profilepicture.66f5dc0f.png"
@@ -53,29 +57,32 @@ export default class Locked extends React.Component<IProps, ForgotPasswordTypes>
5357
</div>
5458
<div className={"mt-8"}>
5559
<input type="hidden" name="remember" value="true"/>
56-
<div className="rounded-md shadow-sm">
60+
<div className="rounded-md border-red-700 shadow-sm">
5761
<div>
58-
<input aria-label="Password" name="password" type="password" required
62+
<input onChange={this.handleChange("password")}
63+
aria-label="Password" name="password" type="password" required
5964
className="appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-md focus:outline-none focus:shadow-outline-blue focus:border-blue-300 focus:z-10 sm:text-sm sm:leading-5"
6065
placeholder="Password"/>
6166
</div>
62-
</div>
6367

68+
</div>
69+
<p className={`${this.state.emptyPassword ? "block" : "hidden"} text-xs text-red-700`}>You can
70+
not have any empty password field</p>
6471
<div className="mt-6 flex">
65-
<Link to={"/dashboard/overview"} type="submit"
72+
<button onClick={this.unlock.bind(this)} type="submit"
6673
className="group text-center relative flex-1 justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-l-md text-white bg-indigo-600 hover:bg-indigo-500 focus:outline-none focus:border-indigo-700 focus:shadow-outline-indigo active:bg-indigo-700 transition duration-150 ease-in-out">
6774
Unlock
68-
</Link>
75+
</button>
6976
<Link to={"/login"} type="submit"
70-
className="group relative flex justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-r-md text-white bg-red-600 hover:bg-red-500 focus:outline-none focus:border-red-700 focus:shadow-outline-red active:bg-red-700 transition duration-150 ease-in-out">
77+
className="group relative flex justify-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-r-md text-white bg-red-600 hover:bg-red-500 focus:outline-none focus:border-red-700 focus:shadow-outline-red active:bg-red-700 transition duration-150 ease-in-out">
7178
<FontAwesomeIcon className={"self-center text-2xl md:text-xl hover:text-red-700"}
7279
icon={faSignOutAlt}/>
7380
</Link>
7481
</div>
7582
</div>
7683
</div>
7784
<div className={"absolute bottom-0 left-0 text-gray-600 py-3 px-4"}>
78-
<Time /> <Version/>
85+
<Time/> <Version/>
7986
</div>
8087
</div>
8188
);

0 commit comments

Comments
 (0)