瀏覽代碼

Merge branch 'refactor/removing-unused-webpage-logic' of kirkleon/rollbot3 into master

kirkleon 6 年之前
父節點
當前提交
ef7e7a93fa
共有 3 個文件被更改,包括 2 次插入147 次删除
  1. 2 12
      src/app.py
  2. 0 119
      src/static/rollbot.css
  3. 0 16
      src/templates/teamspeak.html

+ 2 - 12
src/app.py

@@ -2,7 +2,7 @@ import atexit
 from logging.config import dictConfig
 from threading import Thread
 
-from flask import Flask, request, render_template
+from flask import Flask, request
 
 import db
 from config import BOTS_LOOKUP, get_config, get_secret
@@ -48,17 +48,7 @@ rollbot.start_plugins()
 atexit.register(rollbot.shutdown_plugins)
 
 
-@app.route("/teamspeak", methods=["GET"])
-def teamspeak():
-    response = rollbot.run_command(RollbotMessage("MANUAL", None, None, None, None, "!teamspeak", False))
-    if response.is_success:
-        response = response.txt
-    else:
-        response = response.failure_msg
-    return render_template("teamspeak.html", r=response, scrolling=get_config("teamspeak.scrolling"))
-
-
-@app.route("/rollbot", methods=["POST"])
+@app.route("/", methods=["POST"])
 def execute():
     json = request.get_json()
     msg = RollbotMessage.from_groupme(json, global_admins=GLOBAL_ADMINS, group_admins=GROUP_ADMINS)

+ 0 - 119
src/static/rollbot.css

@@ -1,119 +0,0 @@
-/* Taken from http://www.thenoodleincident.com/tutorials/box_lesson/basic_fixed.html */
-
-body {
-    margin: 0px 0px 0px 0px;
-    padding: 0px 0px 0px 0px;
-    font-family: verdana, arial, helvetica, sans-serif;
-    color: #ccc;
-    background-color: #333;
-    }
-a {
-    text-decoration: none;
-    font-weight: bold;
-    color:  #ccc;
-    outline: none;
-    }
-a:visited {
-    color:  #ccc;
-    }
-a:active {
-    color:  #ccc;
-    }
-a:hover {
-    color: #ccc;
-    text-decoration: underline;
-    }
-.ahem {
-    display: none;
-    }
-strong, b {
-    font-weight: bold;
-    }
-p {
-    font-size: 12px;
-    line-height: 22px;
-    margin-top: 20px;
-    margin-bottom: 10px;
-    }
-
-/* weird ie5win bug: all line-height to font-size ratios must agree or box gets pushed around. UPDATE: this has turned out to be very rare. my current recommendation is IGNORE this warning. at the moment i'm leaving it in only in case the issue turns up again. possibly the original bug in march 2001 was caused by an unusual combination of factors, although this solved it at the time.*/
-
-h1 {
-    font-size: 24px;
-    line-height: 44px;
-    font-weight: bold;
-    margin-top: 0;
-    margin-bottom: 0;
-    }
-h2 {
-    font-size: 18px;
-    line-height: 40px;
-    font-weight: bold;
-    margin-top: 0;
-    margin-bottom: 0;
-    }
-h3 {
-    font-size: 16px;
-    line-height: 22px;
-    font-weight: bold;
-    margin-top: 0;
-    margin-bottom: 0;
-    }
-h4 {
-    font-size: 14px;
-    line-height: 26px;
-    font-weight: bold;
-    margin-top: 0;
-    margin-bottom: 0;
-    }
-h5 {
-    font-size: 12px;
-    line-height: 22px;
-    font-weight: bold;
-    margin-top: 0;
-    margin-bottom: 0;
-    }
-h6 {
-    font-size: 10px;
-    line-height: 18px;
-    font-weight: bold;
-    margin-top: 0;
-    margin-bottom: 0;
-    }
-img {
-    border: 0;
-    }
-.nowrap {
-    white-space: nowrap;
-    font-size: 10px;
-    font-weight: bold;
-    margin-top: 0;
-    margin-bottom: 0;
-/* must be combined with nobr in html for ie5win */
-    }
-.tiny {
-    font-size: 9px;
-    line-height: 16px;
-    margin-top: 15px;
-    margin-bottom: 5px;
-    }
-#content {
-    float: left;
-    padding: 10px;
-    margin: 20px;
-    background: #666;
-    border: 5px solid #ccc;
-    width: 400px; /* ie5win fudge begins */
-    voice-family: "\"}\"";
-    voice-family:inherit;
-    width: 370px;
-    }
-html>body #content {
-    width: 370px; /* ie5win fudge ends */
-    }
-pre {
-    font-size: 12px;
-    line-height: 22px;
-    margin-top: 20px;
-    margin-bottom: 10px;
-    }

+ 0 - 16
src/templates/teamspeak.html

@@ -1,16 +0,0 @@
-<!doctype html>
-<title>Rollbot 3.0 - Teamspeak Server Status</title>
-<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='rollbot.css') }}">
-{% if scrolling %}
-<marquee direction="up" style="height 600px" behavior="alternate">
-<marquee direction="right" style="width 600px" behavior="alternate">
-{% endif %}
-<div class="page">
-    <h1>Rollbot 3.0 - TeamSpeak Server Status</h1>
-    {{ r }}
-</div>
-{% if scrolling %}
-</marquee>
-</marquee>
-{% endif %}
-