diff --git a/web/app.py b/web/app.py index 3d0e437..5a37b31 100644 --- a/web/app.py +++ b/web/app.py @@ -16,7 +16,7 @@ app = Flask(__name__) internal = {} external = {} State = "" - +findLimit = 1000 @app.route("/") def root(): @@ -32,27 +32,20 @@ def WebCall(): call = coll_call.find().sort('time', -1) return render_template("WebCall.html", call=call) - -@app.route("/web/call/test/") -def GetTest(): - call = coll_call.find({'client': {'$nin': IgnoreList}}).sort('time', -1) - return render_template("TestCall.html", call=call) - - -@app.route("/web/call/test/") -def GetTestId(id): - call = coll_call.find( - {'client': {'$nin': IgnoreList}, 'status': int(id)}).sort('time', -1) - return render_template("TestCall.html", call=call) - - @app.route("/web/call/status/") def WebCallStatus(id): - call = coll_call.find({"status": int(id)}).sort('time', -1) call = coll_call.find( - {'client': {'$nin': IgnoreList}, 'status': int(id)}).sort('time', -1) + {'client': {'$nin': IgnoreList}, 'status': int(id)}).limit(findLimit).sort('time', -1) return render_template("WebCall.html", call=call) +@app.route("/web/call/find/", methods=["GET"]) +def WebCallFind(): + try: + id = str(request.args.get("client")) + call = coll_call.find({"client": {"$regex": str(id)}}).limit(findLimit).sort('time', -1) + return(render_template("WebCall.html", call=call)) + except Exception as e: + return(str(e)) if __name__ == "__main__": app.debug = True diff --git a/web/static/main.css b/web/static/main.css index 2e8a484..36ffc38 100644 --- a/web/static/main.css +++ b/web/static/main.css @@ -42,6 +42,29 @@ a { } header { - height: 50px; + height: 80px; vertical-align: middle; +} + +.search { + height: 30px; +} + +.search_label { + color: chocolate; + font-family: Verdana, Geneva, Tahoma, sans-serif; + font-weight: bold; +} + +.search_text { + color: chocolate; + font-family: Verdana, Geneva, Tahoma, sans-serif; + font-weight: bold; + width: 200px; +} + +.search_btn { + color: chocolate; + font-family: Verdana, Geneva, Tahoma, sans-serif; + font-weight: bold; } \ No newline at end of file diff --git a/web/templates/WebCall.html b/web/templates/WebCall.html index 6d8e05c..e1dbf50 100644 --- a/web/templates/WebCall.html +++ b/web/templates/WebCall.html @@ -12,13 +12,19 @@ Входящий вызов принят Входящий вызов не принят Перезвонили - +

+

+

- + @@ -33,6 +39,17 @@ {% endif %} +
Номер клиента Дата времяСтатус звонка Ссылка на запись
{{ entry.time }} + {% if entry.status == 0 %} + Вызов принят + {% elif entry.status == 1 %} + Вызов не принят + {% elif entry.status == 2 %} + Перезвонили + {% elif entry.status == 9 %} + Абонент заблокирован + {% endif %} + {% if entry.recordUrl|length > 1 %} diff --git a/web/templates/TestCall.html b/web/templates/_WebCall.html similarity index 65% rename from web/templates/TestCall.html rename to web/templates/_WebCall.html index 021dbf5..9210f5d 100644 --- a/web/templates/TestCall.html +++ b/web/templates/_WebCall.html @@ -12,21 +12,34 @@ Входящий вызов принят Входящий вызов не принят Перезвонили - + +
+ + + +
+ + + - + + {% for entry in call %} - + {% if entry.important == True %} + + {% else %} + + {% endif %}
Номер клиента Дата времяДата время события Ссылка на запись
{{ "%s %s %s %s"|format(entry.client[0:1], entry.client[1:4], entry.client[4:7], entry.client[7:11]) }}{{ "%s %s %s %s"|format(entry.client[0:1], entry.client[1:4], entry.client[4:7], entry.client[7:11]) }}{{ "%s %s %s %s"|format(entry.client[0:1], entry.client[1:4], entry.client[4:7], entry.client[7:11]) }} {{ entry.time }}