Files
qctool/index.html

107 lines
4.0 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="zh-cmn-Hans">
2021-10-22 20:00:32 +08:00
<head>
<meta charset="UTF-8">
2022-07-16 00:43:41 +08:00
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
2022-07-17 23:08:46 +08:00
<link rel="stylesheet" href="./github.css">
<link rel="stylesheet" href="./theme.css">
2022-07-21 13:21:06 +08:00
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
let page = 10
let url = `https://api.github.com/repos/hbk01/hbk01.github.io/commits?per_page=${page}`
let functions = [
{
"name": "标水",
"location": "./titer.html"
},
{
"name": "干燥失重",
"location": "./lod.html"
},
{
"name": "炽灼残渣",
"location": "./roi.html"
},
{
"name": "进样时间",
"location": "./injection-sequence.html"
},
{
"name": "设备信息",
"location": "./equipment.html"
},
{
"name": "L414-5KR 相关物质",
"location": "./L414-5KR-impurities.html"
},
{
"name": "L014-1 相关物质",
"location": "./L014-1-impurities.html"
}
]
2022-07-21 13:21:06 +08:00
$(document).ready(() => {
// var getRandomColor = () => '#' + (Math.random() * 0xffffff << 0).toString(16)
// 加载功能列表
functions.forEach(value => {
let div = `<div class="item" onclick="window.location.href='${value.location}'">${value.name}</div>`
$(".list").append(div)
})
// 加载最近的 commit 记录
2022-07-21 13:21:06 +08:00
$.getJSON(url, data => {
let color1 = '#f9f9f9'
let color2 = '#f3f3f3'
let changeColor = false
2022-07-21 13:21:06 +08:00
data.forEach(element => {
// 处理换行和+号
let message = element.commit.message.replaceAll("\n", "<br>")
2022-07-21 13:21:06 +08:00
if (message.startsWith("+")) {
message = message.replace("+", "<br>&nbsp;&nbsp;<strong>&bull;</strong>")
2022-07-21 13:21:06 +08:00
}
message = message.replaceAll("+", "&nbsp;&nbsp;<strong>&bull;</strong>")
// 处理提交的日期
let date = new Date(element.commit.committer.date) // "2022-10-08T10:54:36Z"
date = new Date(+ new Date(date) + 28800000).toISOString()
date = date.replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '')
// 组装标题信息
let verifiedString = "<span style='color: green;'><strong>Verified</strong></span>"
let hash = `<a href='${element.html_url}'>${element.sha.slice(0, 7)}</a>`
let verified = `${element.commit.verification.verified ? verifiedString : ""}`
let header = `${hash} ${date} ${verified}`
changeColor = !changeColor
let color = `${changeColor ? color1 : color2}`
let msg = `
<div style="background-color: ${color}; padding: 5px 0px 5px 10px">
${header}
${message}
</div>`
$(".changelog").append(msg)
})
})
})
2022-07-21 13:21:06 +08:00
</script>
<title>QC TOOL</title>
</head>
2021-10-22 20:00:32 +08:00
<body>
<h4>功能列表</h4>
<div class="list"></div>
<h4>关于</h4>
2022-07-21 13:21:06 +08:00
<div class="about">
<p>建议使用系统自带浏览器,以完善使用体验!</p>
本项目开源于
<a href="https://github.com/hbk01/hbk01.github.io">Github</a> ,并由
<a href="https://docs.github.com/en/pages">Github Pages</a> 提供页面构建及部署服务。
2022-07-21 13:21:06 +08:00
</div>
<h4>变更日志</h4>
<div class="changelog" style="width: 100%;"></div>
</body>
2021-10-22 20:00:32 +08:00
</html>