DEV
This commit is contained in:
17
web/app.py
17
web/app.py
@@ -16,7 +16,7 @@ app = Flask(__name__)
|
||||
internal = {}
|
||||
external = {}
|
||||
State = ""
|
||||
|
||||
findLimit = 200
|
||||
|
||||
@app.route("/")
|
||||
def root():
|
||||
@@ -29,13 +29,14 @@ IgnoreList = ['83919865589', '83912051046', '83912051045', '84950213944', '84951
|
||||
|
||||
@app.route("/web/call/")
|
||||
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)
|
||||
call = coll_call.find({'client': {'$nin': IgnoreList}}).limit(findLimit).sort('time', -1)
|
||||
return render_template("TestCall.html", call=call)
|
||||
|
||||
|
||||
@@ -50,10 +51,20 @@ def GetTestId(id):
|
||||
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
|
||||
app.run(host="0.0.0.0", port=5001)
|
||||
|
||||
@@ -11,25 +11,21 @@
|
||||
<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>
|
||||
<form name="search" action="/web/call/find/" method="get" class="search">
|
||||
<label class="search_label">Поиск</label>
|
||||
<input class="search_text" type="text" name="client">
|
||||
<input class="search_btn" type="submit" title="Найти">
|
||||
</form>
|
||||
</p>
|
||||
=======
|
||||
<a href="/web/call/status/2">Перезвонили</a>
|
||||
|
||||
>>>>>>> parent of c52dc73 (Добавил поиск)
|
||||
|
||||
</header>
|
||||
|
||||
<form name="search" action="/web/call/find/" method="get" class="search">
|
||||
<label class="search_label">Поиск</label>
|
||||
<input class="search_text" type="text" name="client">
|
||||
<input class="search_btn" type="submit" title="Найти">
|
||||
</form>
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>Номер клиента</td>
|
||||
<!-- <td>Номер оператора</td> -->
|
||||
<td>Дата время</td>
|
||||
<td>Ссылка на запись</td>
|
||||
</tr>
|
||||
@@ -50,7 +46,6 @@
|
||||
<!-- <td>{{ entry.Operator }}</td> -->
|
||||
<td>{{ entry.time }}</td>
|
||||
<td>
|
||||
<<<<<<< HEAD
|
||||
{% if entry.status == 0 %}
|
||||
Вызов принят
|
||||
{% elif entry.status == 1 %}
|
||||
@@ -64,8 +59,6 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
=======
|
||||
>>>>>>> parent of c52dc73 (Добавил поиск)
|
||||
{% if entry.recordUrl|length > 1 %}
|
||||
<audio src="{{ entry.recordUrl }}" type="audio/mp3" preload="none" controls>Запись</audio>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user