repair functions

This commit is contained in:
filimonov
2024-01-23 20:51:42 +07:00
parent 85dda3de3c
commit 9518a916a6
15 changed files with 282 additions and 61 deletions

View File

@@ -16,7 +16,7 @@ app = Flask(__name__)
internal = {}
external = {}
State = ""
findLimit = 1000
@app.route("/")
def root():
@@ -32,20 +32,27 @@ def WebCall():
call = coll_call.find().limit(findLimit).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/<id>")
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/<id>")
def WebCallStatus(id):
call = coll_call.find({"status": int(id)}).sort('time', -1)
call = coll_call.find(
{'client': {'$nin': IgnoreList}, 'status': int(id)}).limit(findLimit).sort('time', -1)
{'client': {'$nin': IgnoreList}, 'status': int(id)}).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

View File

@@ -42,29 +42,6 @@ a {
}
header {
height: 80px;
height: 50px;
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;
}

View File

@@ -12,34 +12,21 @@
<a href="/web/call/status/0">Входящий вызов принят</a>
<a href="/web/call/status/1">Входящий вызов не принят</a>
<a href="/web/call/status/2">Перезвонили</a>
</header>
<form name="search" action="/web/call/find/" method="get">
<label>Поиск</label>
<input type="text" name="client" value="">
<input type="submit" title="Найти">
</form>
</script>
<table>
<tr>
<td>Номер клиента</td>
<!-- <td>Номер оператора</td> -->
<td>Дата время события</td>
<td>Дата время</td>
<td>Ссылка на запись</td>
</tr>
<body>
{% for entry in call %}
<tr>
<!-- <td>{{ entry.client }}</td> -->
{% if entry.important == True %}
<td><font color="#C30000">{{ "%s %s %s %s"|format(entry.client[0:1], entry.client[1:4], entry.client[4:7], entry.client[7:11]) }}</font></td>
{% else %}
<td >{{ "%s %s %s %s"|format(entry.client[0:1], entry.client[1:4], entry.client[4:7], entry.client[7:11]) }}</td>
{% endif %}
<td><a href="tel:{{ entry.client }}">{{ "%s %s %s %s"|format(entry.client[0:1], entry.client[1:4], entry.client[4:7], entry.client[7:11]) }}</a></td>
<!-- <td>{{ entry.Operator }}</td> -->
<td>{{ entry.time }}</td>
<td>

View File

@@ -11,6 +11,7 @@
<header>
<a href="/web/call/status/0">Входящий вызов принят</a>
<a href="/web/call/status/1">Входящий вызов не принят</a>
<<<<<<< HEAD
<a href="/web/call/status/2">Перезвонили успешно</a>
<a href="/web/call/status/4">Перезвонили безуспешно</a>
<p>
@@ -20,12 +21,16 @@
<input class="search_btn" type="submit" title="Найти">
</form>
</p>
=======
<a href="/web/call/status/2">Перезвонили</a>
>>>>>>> parent of c52dc73 (Добавил поиск)
</header>
<table>
<tr>
<td>Номер клиента</td>
<!-- <td>Номер оператора</td> -->
<td>Дата время</td>
<td>Статус звонка</td>
<td>Ссылка на запись</td>
</tr>
@@ -45,6 +50,7 @@
<!-- <td>{{ entry.Operator }}</td> -->
<td>{{ entry.time }}</td>
<td>
<<<<<<< HEAD
{% if entry.status == 0 %}
Вызов принят
{% elif entry.status == 1 %}
@@ -58,6 +64,8 @@
{% endif %}
</td>
<td>
=======
>>>>>>> parent of c52dc73 (Добавил поиск)
{% if entry.recordUrl|length > 1 %}
<audio src="{{ entry.recordUrl }}" type="audio/mp3" preload="none" controls>Запись</audio>
{% endif %}