1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>QbApp Control Panel</title>
- <script src="{{ url_for('static', filename='js/jquery-3.7.1.min.js') }}"></script>
- </head>
- <body>
- <h1>Add Magnet Link</h1>
- <form id="addMagnetForm" action="/add" method="post">
- <input type="text" name="magnet_link" placeholder="Enter magnet link here">
- <button type="submit">Add</button>
- </form>
- <button id="startButton">Start Monitoring</button>
- <button id="stopButton">Stop Monitoring</button>
- <!-- 加入跳转监控页面的按钮 -->
- <a href="/monitor" class="button">Go to Monitor Page</a>
- <script>
- $(document).ready(function(){
- // Handle the form submission
- $("#addMagnetForm").on("submit", function(e) {
- e.preventDefault(); // Prevent the default form submission
- var magnetLink = $(this).find("input[name='magnet_link']").val();
- $.ajax({
- type: "POST",
- url: "/add",
- contentType: "application/json",
- data: JSON.stringify({ magnet_link: magnetLink }),
- success: function(response) {
- alert("Magnet link added successfully.");
- },
- error: function(response) {
- alert("Failed to add magnet link.");
- }
- });
- });
- $("#startButton").click(function() {
- $.ajax({
- type: "POST",
- url: "/start",
- success: function(response) {
- alert("Monitoring start successfully.");
- },
- error: function(response) {
- alert("Failed to stop monitoring.");
- }
- });
- });
- // Handle the Stop Monitoring button click
- $("#stopButton").click(function() {
- $.ajax({
- type: "POST",
- url: "/stop",
- success: function(response) {
- alert("Monitoring stopped successfully.");
- },
- error: function(response) {
- alert("Failed to stop monitoring.");
- }
- });
- });
- });
- </script>
- </body>
- </html>
|