|
@@ -136,21 +136,28 @@ const INDEX_HTML: &str = r#"<!DOCTYPE html>
|
|
|
border: 0.1rem solid black;
|
|
border: 0.1rem solid black;
|
|
|
padding: 1rem;
|
|
padding: 1rem;
|
|
|
}
|
|
}
|
|
|
- .auth-container .interface {
|
|
|
|
|
- display: none;
|
|
|
|
|
|
|
+ .auth-container .auth-interface {
|
|
|
|
|
+ display: flex;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
gap: 0.5rem;
|
|
gap: 0.5rem;
|
|
|
}
|
|
}
|
|
|
|
|
+ .loading .auth-interface {
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }
|
|
|
.auth-container input {
|
|
.auth-container input {
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
}
|
|
}
|
|
|
- .auth-container .loading {
|
|
|
|
|
|
|
+ .auth-container .load {
|
|
|
|
|
+ display: none;
|
|
|
color: white;
|
|
color: white;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
padding: 0.2rem;
|
|
padding: 0.2rem;
|
|
|
background-color: grey;
|
|
background-color: grey;
|
|
|
}
|
|
}
|
|
|
|
|
+ .loading .load {
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ }
|
|
|
.auth-container .log {
|
|
.auth-container .log {
|
|
|
border: 0.1rem solid black;
|
|
border: 0.1rem solid black;
|
|
|
padding: 0.5rem;
|
|
padding: 0.5rem;
|
|
@@ -165,11 +172,11 @@ const INDEX_HTML: &str = r#"<!DOCTYPE html>
|
|
|
</style>
|
|
</style>
|
|
|
</head>
|
|
</head>
|
|
|
<body>
|
|
<body>
|
|
|
- <form id="auth">
|
|
|
|
|
|
|
+ <form id="auth" class="loading">
|
|
|
<div class="auth-container">
|
|
<div class="auth-container">
|
|
|
<h1>PageOS 登录</h1>
|
|
<h1>PageOS 登录</h1>
|
|
|
- <span class="loading">正加载</span>
|
|
|
|
|
- <div class="interface">
|
|
|
|
|
|
|
+ <span class="load">正加载</span>
|
|
|
|
|
+ <div class="auth-interface">
|
|
|
<label class="prompt">
|
|
<label class="prompt">
|
|
|
<div>用户名:</div>
|
|
<div>用户名:</div>
|
|
|
</label>
|
|
</label>
|
|
@@ -207,26 +214,23 @@ const INDEX_HTML: &str = r#"<!DOCTYPE html>
|
|
|
<script>
|
|
<script>
|
|
|
(function () {
|
|
(function () {
|
|
|
// 获取表单元素
|
|
// 获取表单元素
|
|
|
- const loadElm = document.querySelector(".auth-container span.loading");
|
|
|
|
|
- const interface = document.querySelector(".auth-container .interface");
|
|
|
|
|
- const promptElm = document.querySelector(
|
|
|
|
|
- ".auth-container label.prompt"
|
|
|
|
|
- );
|
|
|
|
|
- const inputElm = document.querySelector(".auth-container input#input");
|
|
|
|
|
- const submitBtn = document.querySelector(".auth-container .submit-btn");
|
|
|
|
|
- const statusLog = document.querySelector(".auth-container .log");
|
|
|
|
|
|
|
+ const auth = document.getElementById("auth");
|
|
|
|
|
+ const loadElm = auth.querySelector(".auth-container span.load");
|
|
|
|
|
+ const ai = auth.querySelector(".auth-container .auth-interface");
|
|
|
|
|
+ const promptElm = auth.querySelector(".auth-container label.prompt");
|
|
|
|
|
+ const inputElm = auth.querySelector(".auth-container input#input");
|
|
|
|
|
+ const submitBtn = auth.querySelector(".auth-container .submit-btn");
|
|
|
|
|
+ const statusLog = auth.querySelector(".auth-container .log");
|
|
|
|
|
|
|
|
// 显示加载状态
|
|
// 显示加载状态
|
|
|
function showLoading(message = "正加载") {
|
|
function showLoading(message = "正加载") {
|
|
|
loadElm.textContent = message;
|
|
loadElm.textContent = message;
|
|
|
- loadElm.style.display = "block";
|
|
|
|
|
- interface.style.display = "none";
|
|
|
|
|
|
|
+ auth.classList.add("loading");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 隐藏加载状态
|
|
// 隐藏加载状态
|
|
|
function hideLoading() {
|
|
function hideLoading() {
|
|
|
- loadElm.style.display = "none";
|
|
|
|
|
- interface.style.display = "flex";
|
|
|
|
|
|
|
+ auth.classList.remove("loading");
|
|
|
inputElm.focus();
|
|
inputElm.focus();
|
|
|
}
|
|
}
|
|
|
|
|
|