Giter Club home page Giter Club logo

Comments (4)

Epxir avatar Epxir commented on June 20, 2024

没接触过html和php,这两天摸索着做的,大家想用的话自取!
创建index.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/[email protected]/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/[email protected]/dist/js/mdui.min.js"></script>
</body>
</html>

from cx-auto-sign.

Epxir avatar Epxir commented on June 20, 2024

搞起来搞起来

from cx-auto-sign.

moeshin avatar moeshin commented on June 20, 2024

C# WEB 不会搞,用 Go 重写了一个,BUG 多多:https://github.com/moeshin/cx-im

from cx-auto-sign.

Epxir avatar Epxir commented on June 20, 2024

C# WEB 不会搞,用 Go 重写了一个,BUG 多多:https://github.com/moeshin/cx-im

搞复杂了啊,这个的输出信息改一下就行了,不用写网页

from cx-auto-sign.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.