This repository has been archived by the owner on Sep 19, 2023. It is now read-only.
forked from cyanray/cx-auto-sign
-
Notifications
You must be signed in to change notification settings - Fork 2
建议webapi可以一个端口输出所有JSON信息 #20
Labels
enhancement
New feature or request
Comments
没接触过html和php,这两天摸索着做的,大家想用的话自取! <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>超星自动签到状态</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mdui@1.0.2/dist/css/mdui.min.css" />
</head>
<body>
<?php
$data = file_get_contents('http://localhost:5743/status');
$arr = json_decode($data,true);
$status = $arr['cxAutoSignEnabled'];
if ($status==1) {
$status = "正在运行";
} else {
$status = "停止运行";
}
echo <<<END
<div class="mdui-container">
<div class="mdui-panel" mdui-panel >
<div class="mdui-panel-item">
<div class="mdui-panel-item-header">
<div class="mdui-panel-item-title">帅哥</div>
<div class="mdui-panel-item-summary">运行状态:$status</div>
<i class="mdui-panel-item-arrow mdui-icon material-icons">keyboard_arrow_down</i>
</div>
<div class="mdui-panel-item-body">
<div class="mdui-panel-item-actions">
<form method="post">
<button class="mdui-btn mdui-ripple" type="submit" name="button1">开启</button>
<button class="mdui-btn mdui-ripple" type="submit" name="button2">关闭</button>
</form>
</div>
</div>
</div>
</div>
</div>
END;
if(isset($_POST['button1'])) {
fopen("http://localhost:5743/status/enable","r");
header('location: '.$_SERVER['HTTP_REFERER']);
}
if(isset($_POST['button2'])) {
fopen("http://localhost:5743/status/disable","r");
header('location: '.$_SERVER['HTTP_REFERER']);
}
?>
<script src="https://cdn.jsdelivr.net/npm/mdui@1.0.2/dist/js/mdui.min.js"></script>
</body>
</html> |
Closed
搞起来搞起来 |
C# WEB 不会搞,用 Go 重写了一个,BUG 多多:https://github.com/moeshin/cx-im |
搞复杂了啊,这个的输出信息改一下就行了,不用写网页 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
这样直接在网页上就可以直接添加用户了,前端监控的代码量也少得多,方便和朋友一起用!
建议直接整合到 start.sh !
简单做了一个
The text was updated successfully, but these errors were encountered: