mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-22 01:30:40 +08:00
页面调整,添加状态检测
This commit is contained in:
@@ -1,23 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<%- include("./component/header.html"); %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%- include("./component/navbar.html"); %>
|
||||
|
||||
<div class="main" align="center">
|
||||
<div class="siteTitle">
|
||||
<h1>书栖网</h1>
|
||||
</div>
|
||||
|
||||
<div class="sloganBox">
|
||||
<p class="emphasize">
|
||||
一个完全免费无门槛的计算机类电子书下载网站
|
||||
</p>
|
||||
</div>
|
||||
<h1>书栖网</h1>
|
||||
<p>一个完全免费无门槛的计算机类电子书下载网站</p>
|
||||
|
||||
<h2>随便唠唠</h2>
|
||||
<p>本网站是“计算机类电子书”仓库的前身,我们希望能够搭建一个电子书共享平台,供大家在学习中方便搜索以及下载。</p>
|
||||
@@ -40,14 +30,11 @@
|
||||
<hr>
|
||||
<p>最后,还是要说一下版权的问题。我们十分重视版权。我们所整理的电子书全部来自于互联网,其中部分来自于下载站、公众号等。如果其中包含您的作品,且您不希望我们将您的作品作为免费分享出来,请联系<span>contact@only4.work</span>并提供相应证明材料,我们核实后将会第一时间删除。同时,您在本网站上下载的所有电子书文件,仅供学习交流使用,不可二次传播,特别是不可设置扫码关注等门槛二次分享。
|
||||
</p>
|
||||
<hr>
|
||||
|
||||
<h2>特别说明</h2>
|
||||
<p>本站电子书由“张小弟之家”整理,出于方便学习之目的,您从本站下载的电子书仅供学习交流使用,如需他用请联系原作者。<a href="https://gitee.com/only4/computer-related-books" target="_blank">查看同步更新Gitee仓库</a></p>
|
||||
<p>由于信息量较大,我们无法做到一一确认相关电子书的权属管理,如本站不慎侵犯了您的权利,请发送邮件至<b>contact@only4.work</b>,来信请注明相关链接以及您的相关证明材料,我们收到邮件后会第一时间与您取得联系并积极处理,多谢理解!</p>
|
||||
|
||||
</div>
|
||||
|
||||
<%- include("./component/footer.html"); %>
|
||||
</body>
|
||||
|
||||
</html>
|
24
bookshelfplus-frontend/views/book.html
Normal file
24
bookshelfplus-frontend/views/book.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<%- include("./component/header.html"); %>
|
||||
</head>
|
||||
<body>
|
||||
<%- include("./component/navbar.html"); %>
|
||||
<main class="main">
|
||||
<h1><%= title %></h1>
|
||||
<div id="container">
|
||||
</div>
|
||||
</main>
|
||||
<%- include("./component/footer.html"); %>
|
||||
|
||||
<script>
|
||||
getRequest("/book/get", { id: 1 })
|
||||
.then(function (response) {
|
||||
console.log(response.data);
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -1,21 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<%- include("./component/header.html"); %>
|
||||
</head>
|
||||
<body>
|
||||
<%- include("./component/navbar.html"); %>
|
||||
|
||||
<h1><%= title %></h1>
|
||||
|
||||
<main class="main">
|
||||
<h1><%= title %></h1>
|
||||
<div id="container">
|
||||
<a href="./book">书本详情页</a>
|
||||
</div>
|
||||
</main>
|
||||
<%- include("./component/footer.html"); %>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@@ -1,6 +1,13 @@
|
||||
<div class="footer">
|
||||
<div class="footer" style="margin-top: 10vh;">
|
||||
<hr>
|
||||
<p>书栖网 • 2021-2022</p>
|
||||
<p>
|
||||
书栖网 • 2021-2022
|
||||
<br>
|
||||
<small>
|
||||
<a href="/status">网站状态检测</a>
|
||||
</small>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- https://gist.github.com/macbookandrew/f33dbbc0aa582d0515919dc5fb95c00a -->
|
||||
@@ -14,10 +21,7 @@
|
||||
return res;
|
||||
}
|
||||
function fontmin(text) {
|
||||
// 设置post type
|
||||
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||
// 接口地址
|
||||
axios.post('/fontmin/getfont', { text: text, font: "" })
|
||||
axios.post('../fontmin/getfont', { text: text, font: "" })
|
||||
.then(function (response) {
|
||||
// 当接口成功返回时,动态设置css
|
||||
let styleDom = document.createElement('style');
|
||||
|
@@ -4,7 +4,15 @@
|
||||
<title><%= title; %></title>
|
||||
|
||||
<link rel="stylesheet" href="./assets/stylesheets/style.css">
|
||||
<!-- <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js"></script> -->
|
||||
<script src="./assets/lib/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="./assets/lib/axios/0.26.1/axios.min.js"></script>
|
||||
|
||||
<script src="./assets/lib/axios/0.20.0/axios.min.js"></script>
|
||||
<script src="./assets/javascripts/httpRequest.js"></script>
|
||||
<script>
|
||||
// API地址
|
||||
const APIHOST = '<%= global.site.api.prefix %>';
|
||||
axios.defaults.baseURL = APIHOST;
|
||||
|
||||
// 请求头 Content-Type
|
||||
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||
</script>
|
52
bookshelfplus-frontend/views/component/searchbox.html
Normal file
52
bookshelfplus-frontend/views/component/searchbox.html
Normal file
@@ -0,0 +1,52 @@
|
||||
<div class="searchBox">
|
||||
<input id="searchInput" type="text" placeholder="只需两步:搜索、下载 就这么简单" />
|
||||
<input id="searchButton" type="button" value="搜一下" />
|
||||
</div>
|
||||
<script>
|
||||
// /**
|
||||
// * 内容改变时并不会触发事件,但是在失去焦点的时候会触发。
|
||||
// */
|
||||
// $("#inputid").change(function () {
|
||||
// console.log($(this).val());
|
||||
// });
|
||||
// /**
|
||||
// * 只要文本类容发生改变,就会触发该事件
|
||||
// */
|
||||
// $("#inputid").bind("input propertychange", function () {
|
||||
// console.log($(this).val());
|
||||
// });
|
||||
|
||||
// // 搜索框文字改变事件(实时)
|
||||
// $("#searchInput").bind("input propertychange", function () {
|
||||
// if ($('#searchInput').val() !== "")
|
||||
// $('#searchInput').val("这个功能还没做呢,再等等吧");
|
||||
// });
|
||||
|
||||
// 搜索框获得焦点事件
|
||||
$('#searchInput').focus(() => {
|
||||
// $('#searchInput').val("");
|
||||
$('#searchInput').attr('placeholder', "在这里输入您想搜索的电子书吧")
|
||||
})
|
||||
|
||||
// 搜索框失去焦点事件
|
||||
$('#searchInput').blur((that) => {
|
||||
// $('#searchInput').val("");
|
||||
$('#searchInput').attr('placeholder', "只需两步:搜索、下载 就这么简单")
|
||||
})
|
||||
|
||||
// 文本框回车事件
|
||||
$('#searchInput').keydown(function (e) {
|
||||
var curKey = e.which;
|
||||
if (curKey == 13) {
|
||||
$("#searchButton").click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// 搜索按钮点击事件
|
||||
$('#searchButton').click(function () {
|
||||
if ($('#searchInput').val() !== "") {
|
||||
location.href = "search?keyword=" + encodeURIComponent($('#searchInput').val());
|
||||
}
|
||||
});
|
||||
</script>
|
@@ -1,5 +1,4 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<%- include("./component/header.html"); %>
|
||||
|
@@ -1,82 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<%- include("./component/header.html"); %>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<%- include("./component/navbar.html"); %>
|
||||
|
||||
<div class="main" align="center">
|
||||
<div class="main">
|
||||
<div class="siteTitle">
|
||||
<h1>书栖网</h1>
|
||||
<h1>书栖网</h1>
|
||||
</div>
|
||||
|
||||
<div class="searchBox">
|
||||
<input id="searchInput" type="text" placeholder="只需两步:搜索、下载 就这么简单" />
|
||||
<input id="searchButton" type="button" value="搜一下" />
|
||||
</div>
|
||||
|
||||
<%- include("./component/searchbox.html"); %>
|
||||
<div class="sloganBox">
|
||||
<p class="emphasize">
|
||||
一个完全免费无门槛的计算机类电子书下载网站
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 30vh;"></div>
|
||||
|
||||
<%- include("./component/footer.html"); %>
|
||||
|
||||
<script>
|
||||
// /**
|
||||
// * 内容改变时并不会触发事件,但是在失去焦点的时候会触发。
|
||||
// */
|
||||
// $("#inputid").change(function () {
|
||||
// console.log($(this).val());
|
||||
// });
|
||||
// /**
|
||||
// * 只要文本类容发生改变,就会触发该事件
|
||||
// */
|
||||
// $("#inputid").bind("input propertychange", function () {
|
||||
// console.log($(this).val());
|
||||
// });
|
||||
|
||||
// // 搜索框文字改变事件(实时)
|
||||
// $("#searchInput").bind("input propertychange", function () {
|
||||
// if ($('#searchInput').val() !== "")
|
||||
// $('#searchInput').val("这个功能还没做呢,再等等吧");
|
||||
// });
|
||||
|
||||
// 搜索框获得焦点事件
|
||||
$('#searchInput').focus(() => {
|
||||
// $('#searchInput').val("");
|
||||
$('#searchInput').attr('placeholder', "在这里输入您想搜索的电子书吧")
|
||||
})
|
||||
|
||||
// 搜索框失去焦点事件
|
||||
$('#searchInput').blur((that) => {
|
||||
// $('#searchInput').val("");
|
||||
$('#searchInput').attr('placeholder', "只需两步:搜索、下载 就这么简单")
|
||||
})
|
||||
|
||||
// 文本框回车事件
|
||||
$('#searchInput').keydown(function (e) {
|
||||
var curKey = e.which;
|
||||
if (curKey == 13) {
|
||||
$("#searchButton").click();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// 搜索按钮点击事件
|
||||
$('#searchButton').click(function () {
|
||||
if ($('#searchInput').val() !== "") {
|
||||
location.href = "search?keyword=" + encodeURIComponent($('#searchInput').val());
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@@ -1,21 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<%- include("./component/header.html"); %>
|
||||
</head>
|
||||
<body>
|
||||
<%- include("./component/navbar.html"); %>
|
||||
|
||||
<h1><%= title %></h1>
|
||||
|
||||
<main class="main">
|
||||
<h1><%= title %></h1>
|
||||
<div id="container">
|
||||
</div>
|
||||
</main>
|
||||
<%- include("./component/footer.html"); %>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
104
bookshelfplus-frontend/views/status.html
Normal file
104
bookshelfplus-frontend/views/status.html
Normal file
@@ -0,0 +1,104 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<%- include("./component/header.html"); %>
|
||||
<style>
|
||||
.info-disabled {
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<%- include("./component/navbar.html"); %>
|
||||
<main class="main">
|
||||
<h1>
|
||||
<%= title %>
|
||||
</h1>
|
||||
<div id="container">
|
||||
<input id="checkBtn" type="button" value="检测" onclick="startCheck()">
|
||||
|
||||
<div class="parentNode">
|
||||
<div class="childrenNode">
|
||||
<h3 class="title">网络连通性</h3>
|
||||
<span id="onlineStatus" class="info"></span>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="title">网络后台状态</h3>
|
||||
<span id="backendStatus" class="info"></span>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="title">网络数据库状态</h3>
|
||||
<span id="databaseStatus" class="info info-disabled">暂不提供检测</span>
|
||||
</div>
|
||||
<div>
|
||||
<h3 class="title">服务器时间与本机时间差</h3>
|
||||
<span id="timeOff" class="info">正在计算</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<%- include("./component/footer.html"); %>
|
||||
<script>
|
||||
var timeout = null;
|
||||
$('.info').css("display", "none");
|
||||
|
||||
function startCheck() {
|
||||
if (timeout) clearTimeout(timeout);
|
||||
|
||||
document.getElementById("checkBtn").value = "检测中";
|
||||
document.getElementById("checkBtn").disabled = "disabled";
|
||||
$('.info').html("loading...");
|
||||
$('.info-disabled').html("暂不提供检测");
|
||||
$('.info').css("display", "");
|
||||
|
||||
var i = 0, timeSpan = 300;
|
||||
setTimeout(checkOnlineStatus, timeSpan * ++i);
|
||||
setTimeout(checkBackendStatus, timeSpan * ++i);
|
||||
setTimeout(checkTimeOff, timeSpan * ++i);
|
||||
setTimeout(finishCheck, timeSpan * ++i);
|
||||
}
|
||||
|
||||
function checkOnlineStatus() {
|
||||
var onlineStatus = window.navigator.onLine;
|
||||
$("#onlineStatus").text(onlineStatus ? "已连接" : "您当前未连接互联网");
|
||||
}
|
||||
|
||||
function checkBackendStatus() {
|
||||
var backendStatus = false;
|
||||
getRequest("/status/getProcessCpu", {})
|
||||
.then(function (response) {
|
||||
console.log("response.data", response.data);
|
||||
if (response.data == 0) {
|
||||
backendStatus = true;
|
||||
}
|
||||
$("#backendStatus").text("后台连接正常");
|
||||
})
|
||||
.catch(function (error) {
|
||||
$("#backendStatus").text("后台连接异常");
|
||||
});
|
||||
}
|
||||
|
||||
function checkTimeOff() {
|
||||
var oldScriptDom = document.getElementById("timeCalibrationScript");
|
||||
if (oldScriptDom) oldScriptDom.parentNode.removeChild(oldScriptDom);
|
||||
|
||||
oldScriptDom = document.createElement("script");
|
||||
oldScriptDom.id = "timeCalibrationScript";
|
||||
oldScriptDom.src = "./assets/javascripts/timeCalibration.js?" + Date.now() + "-" + new Date().getTime();
|
||||
document.body.appendChild(oldScriptDom);
|
||||
}
|
||||
|
||||
function finishCheck() {
|
||||
document.getElementById("checkBtn").value = "重新检测";
|
||||
document.getElementById("checkBtn").disabled = "";
|
||||
|
||||
if (timeout) clearTimeout(timeout);
|
||||
timeout = setTimeout(startCheck, 5000);
|
||||
}
|
||||
|
||||
// $(document).ready(function () {
|
||||
// startCheck();
|
||||
// });
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user