websoft9/cockpit/credential/index.html
chendelin1982 6af05e31b3 update
2022-11-02 13:51:49 +08:00

34 lines
No EOL
792 B
HTML

<html>
<head>
<title>Embedded Cockpit</title>
<script src="../base1/cockpit.js"></script>
<script src="../manifests.js"></script>
<script src="../*/po.js"></script>
<script>
function getInfo(){
cockpit.file("/credentials/password.txt").read().then((content, tag) => {
document.getElementById("sysinfo").innerText = content
})
.catch(error => {
alert("查看账户信息失败");
});
}
function clearInfo(){
document.getElementById("sysinfo").innerText = ""
}
</script>
</head>
<body>
<div>
<button type="button" onclick="getInfo()">查看账号密码</button>
<button type="button" onclick="clearInfo()">隐藏账号密码</button>
<div id="sysinfo">
</div>
</div>
</body>
</html>