mirror of https://git.tuxpa.in/a/code-server.git
parent
7cc7aa51aa
commit
0efae1fcb6
|
@ -8,8 +8,7 @@
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="login">
|
<div class="login">
|
||||||
<div class="back">
|
<div class="back"> <- Back </div>
|
||||||
<- Back </div>
|
|
||||||
<h4 class="title">code-server</h4>
|
<h4 class="title">code-server</h4>
|
||||||
<h2 class="subtitle">
|
<h2 class="subtitle">
|
||||||
Enter server password
|
Enter server password
|
||||||
|
@ -22,7 +21,7 @@
|
||||||
<button id="submit" class="mdc-button mdc-button--unelevated">
|
<button id="submit" class="mdc-button mdc-button--unelevated">
|
||||||
<span class="mdc-button__label">Enter IDE</span>
|
<span class="mdc-button__label">Enter IDE</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
<div id="error-display"></div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
|
@ -106,3 +106,16 @@ body {
|
||||||
|
|
||||||
// transition: 500ms opacity ease;
|
// transition: 500ms opacity ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#error-display {
|
||||||
|
box-sizing: border-box;
|
||||||
|
color: #bb2d0f;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: 0.3px;
|
||||||
|
line-height: 12px;
|
||||||
|
padding: 8px;
|
||||||
|
padding-bottom: 0;
|
||||||
|
padding-top: 20px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
|
@ -28,3 +28,14 @@ submit.addEventListener("click", () => {
|
||||||
document.cookie = `password=${password.value}`;
|
document.cookie = `password=${password.value}`;
|
||||||
location.reload();
|
location.reload();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Notify user on load of page if previous password was unsuccessful
|
||||||
|
*/
|
||||||
|
const reg = new RegExp(`password=(\\w+);?`);
|
||||||
|
const matches = document.cookie.match(reg);
|
||||||
|
const errorDisplay = document.getElementById("error-display") as HTMLDivElement;
|
||||||
|
|
||||||
|
if (document.referrer === document.location.href && matches) {
|
||||||
|
errorDisplay.innerText = "Password is incorrect!";
|
||||||
|
}
|
Loading…
Reference in New Issue