You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.6 KiB
71 lines
1.6 KiB
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title></title>
|
|
<link rel="stylesheet" href="../../../component/pear/css/pear.css" />
|
|
|
|
</head>
|
|
|
|
<body class="pear-container layui-form">
|
|
|
|
<pre class="layui-code code-demo" id="logs">
|
|
|
|
</pre>
|
|
|
|
<script src="../../../component/layui/layui.js"></script>
|
|
<script src="../../../component/pear/pear.js"></script>
|
|
|
|
<script>
|
|
layui.use(function () {
|
|
var $ = layui.jquery;
|
|
// code
|
|
|
|
var ts = GetQueryString('ts');
|
|
|
|
getTextFile('/QingLong/Logs/' + ts + '.log');
|
|
|
|
function getTextFile(url) {
|
|
let loading = layer.load();
|
|
fetch(url)
|
|
.then(response => {
|
|
if (!response.ok) {
|
|
layer.close(loading);
|
|
layer.msg('读取失败!', { icon: 2 });
|
|
} else {
|
|
return response.text();
|
|
}
|
|
|
|
})
|
|
.then(content => {
|
|
layer.close(loading);
|
|
layui.code({
|
|
elem: '.code-demo',
|
|
code: content
|
|
});
|
|
})
|
|
.catch(error => {
|
|
layer.close(loading);
|
|
layer.msg('读取失败!', { icon: 2 });
|
|
});
|
|
}
|
|
|
|
|
|
function GetQueryString(name, istop) {
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
|
var r = window.location.search.substr(1).match(reg);
|
|
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
|
|
|
|
if (r != null) return unescape(r[2]);
|
|
return null;
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
</html> |