1
0
Fork 0
mirror of https://github.com/fastogt/fastocloud_admin.git synced 2025-03-09 23:38:52 +00:00

Show anonim

This commit is contained in:
topilski 2020-02-14 12:14:55 -05:00
parent bbec75d225
commit 7f75eaf40b
3 changed files with 77 additions and 1 deletions

View file

@ -13,10 +13,16 @@ from pyfastocloud_models.utils.utils import is_valid_http_url
class M3uParseView(FlaskView): class M3uParseView(FlaskView):
route_base = '/m3uparse/' route_base = '/m3uparse/'
@login_required
def show(self): def show(self):
m3u = M3uParse.objects() m3u = M3uParse.objects()
return render_template('autofill/show.html', m3u=m3u) return render_template('autofill/show.html', m3u=m3u)
@login_required
def show_anonim(self):
m3u = M3uParse.objects()
return render_template('autofill/show_anonim.html', m3u=m3u)
@route('/search/<sid>', methods=['GET']) @route('/search/<sid>', methods=['GET'])
def search(self, sid): def search(self, sid):
lines = M3uParse.objects(id=sid) lines = M3uParse.objects(id=sid)

View file

@ -0,0 +1,70 @@
{% extends 'layouts/layout_user.html' %}
{% from 'bootstrap/wtf.html' import form_field %}
{% block title %}
M3U | {{ config['PUBLIC_CONFIG'].site.title }}
{% endblock %}
{% block styles %}
<style>
table {
table-layout: fixed;
}
th.number {
width: 2%;
}
th.name {
width: 88%;
}
th.actions {
width: 10%;
}
</style>
{{super()}}
{% endblock %}
{% block content %}
<div class="panel panel-default">
<div class="panel-heading">
<h1 class="panel-title">
<div class="col-md-11">
<a href="{{ url_for('HomeView:index') }}">{{ config['PUBLIC_CONFIG'].site.title }}</a>
</div>
<div>Version: {{ config['PUBLIC_CONFIG'].project.version }}</div>
</h1>
</div>
<div class="panel-body">
<div class="container-fluid">
<div class="row well">
<div class="row">
<table id='m3u_table' class="table">
<thead>
<tr>
<th class="number">#</th>
<th class="name">Name</th>
<th class="actions">Actions</th>
</tr>
</thead>
<tbody>
{% for line in m3u %}
<tr id='{{ line.id }}'>
<td>{{ loop.index }}</td>
<td>{{ line.name }}</td>
<td>
<a href="{{ url_for('M3uParseView:search', sid=line.id) }}" role="button"
target="_blank" class="btn btn-success btn-xs">
Show
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
{{ super() }}
{% endblock %}

View file

@ -20,7 +20,7 @@
<a href={{ url_for('HomeView:signup') }} class="btn btn-warning">Sign Up</a> <a href={{ url_for('HomeView:signup') }} class="btn btn-warning">Sign Up</a>
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<a href={{ url_for('M3uParseView:show') }} class="btn btn-success">Meta</a> <a href={{ url_for('M3uParseView:show_anonim') }} class="btn btn-success">Meta</a>
</div> </div>
</div> </div>
<div> <div>