From c52dc734f659855efd5747495ff5240166c667b9 Mon Sep 17 00:00:00 2001
From: root
Date: Wed, 28 Jun 2023 16:45:24 +0700
Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?=
=?UTF-8?q?=D0=BF=D0=BE=D0=B8=D1=81=D0=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
web/app.py | 27 +++++++------------
web/static/main.css | 25 ++++++++++++++++-
web/templates/WebCall.html | 21 +++++++++++++--
.../{TestCall.html => _WebCall.html} | 19 ++++++++++---
4 files changed, 69 insertions(+), 23 deletions(-)
rename web/templates/{TestCall.html => _WebCall.html} (65%)
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 @@
Входящий вызов принят
Входящий вызов не принят
Перезвонили
-
+
+
+
+
+
|