mirror of
https://github.com/fastogt/fastocloud_admin.git
synced 2025-03-09 23:38:52 +00:00
Tests tab
This commit is contained in:
parent
7e50d92e61
commit
49da9bc1d3
2 changed files with 147 additions and 11 deletions
|
@ -21,6 +21,7 @@ class ProviderView(FlaskView):
|
||||||
proxy = []
|
proxy = []
|
||||||
catchups = []
|
catchups = []
|
||||||
events = []
|
events = []
|
||||||
|
tests = []
|
||||||
for stream in streams:
|
for stream in streams:
|
||||||
front = stream.to_dict()
|
front = stream.to_dict()
|
||||||
type = stream.get_type()
|
type = stream.get_type()
|
||||||
|
@ -34,13 +35,15 @@ class ProviderView(FlaskView):
|
||||||
catchups.append(front)
|
catchups.append(front)
|
||||||
elif type == constants.StreamType.EVENT:
|
elif type == constants.StreamType.EVENT:
|
||||||
events.append(front)
|
events.append(front)
|
||||||
|
elif type == constants.StreamType.TEST_LIFE:
|
||||||
|
tests.append(front)
|
||||||
else:
|
else:
|
||||||
streams_relay_encoder_timeshifts.append(front)
|
streams_relay_encoder_timeshifts.append(front)
|
||||||
|
|
||||||
role = server.get_user_role_by_id(current_user.id)
|
role = server.get_user_role_by_id(current_user.id)
|
||||||
return render_template('provider/dashboard.html', streams=streams_relay_encoder_timeshifts, vods=vods,
|
return render_template('provider/dashboard.html', streams=streams_relay_encoder_timeshifts, vods=vods,
|
||||||
cods=cods, proxies=proxy, catchups=catchups, events=events, service=server,
|
cods=cods, proxies=proxy, catchups=catchups, events=events, tests=tests,
|
||||||
servers=current_user.servers, role=role)
|
service=server, servers=current_user.servers, role=role)
|
||||||
|
|
||||||
return redirect(url_for('ProviderView:settings'))
|
return redirect(url_for('ProviderView:settings'))
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ Dashboard | {{ config['PUBLIC_CONFIG'].site.title }}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
{{super()}}
|
{{super()}}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -293,6 +294,7 @@ Dashboard | {{ config['PUBLIC_CONFIG'].site.title }}
|
||||||
<li><a href="#catchups" data-toggle="tab">Catchups</a></li>
|
<li><a href="#catchups" data-toggle="tab">Catchups</a></li>
|
||||||
<li><a href="#events" data-toggle="tab">Events (Pay per view)</a></li>
|
<li><a href="#events" data-toggle="tab">Events (Pay per view)</a></li>
|
||||||
<li><a href="#series" data-toggle="tab">Series</a></li>
|
<li><a href="#series" data-toggle="tab">Series</a></li>
|
||||||
|
<li><a href="#tests" data-toggle="tab">Tests</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
@ -427,23 +429,20 @@ Dashboard | {{ config['PUBLIC_CONFIG'].site.title }}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<button class="btn btn-success btn-send col-md-2" onclick="add_relay_stream()">
|
<button class="btn btn-success btn-send col-md-3" onclick="add_relay_stream()">
|
||||||
Add relay
|
Add relay
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-success btn-send col-md-2" onclick="add_encode_stream()">
|
<button class="btn btn-success btn-send col-md-3" onclick="add_encode_stream()">
|
||||||
Add encode
|
Add encode
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-success btn-send col-md-2"
|
<button class="btn btn-success btn-send col-md-3"
|
||||||
onclick="add_timeshift_recorder_stream()">
|
onclick="add_timeshift_recorder_stream()">
|
||||||
Add timeshift recorder
|
Add timeshift recorder
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-success btn-send col-md-2"
|
<button class="btn btn-success btn-send col-md-3"
|
||||||
onclick="add_timeshift_player_stream()">
|
onclick="add_timeshift_player_stream()">
|
||||||
Add timeshift player
|
Add timeshift player
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-success btn-send col-md-2" onclick="add_test_life_stream()">
|
|
||||||
Add test life
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade" id="vods">
|
<div class="tab-pane fade" id="vods">
|
||||||
|
@ -992,6 +991,142 @@ Dashboard | {{ config['PUBLIC_CONFIG'].site.title }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab-pane fade in active" id="tests">
|
||||||
|
<div class="row">
|
||||||
|
<table id='tests_table' class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="stream_number">#</th>
|
||||||
|
<th class="stream_name">Name</th>
|
||||||
|
<th class="stream_type">Type</th>
|
||||||
|
<th class="stream_status">Status</th>
|
||||||
|
<th class="stream_restarts">Restarts</th>
|
||||||
|
<th class="stream_cpu">CPU (%)</th>
|
||||||
|
<th class="stream_rss">RSS (MB)</th>
|
||||||
|
<th class="stream_inbps">In (Mbps)</th>
|
||||||
|
<th class="stream_outbps">Out (Mbps)</th>
|
||||||
|
<th class="stream_work_time">TTL (sec)</th>
|
||||||
|
<th class="stream_live_time">RTL (sec)</th>
|
||||||
|
<th class="stream_quality">Quality (%)</th>
|
||||||
|
<th class="stream_price">Price ($)</th>
|
||||||
|
<th class="stream_actions">Actions</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for test in tests %}
|
||||||
|
<tr id='{{ test.id }}'>
|
||||||
|
<td>{{ loop.index }}</td>
|
||||||
|
<td>
|
||||||
|
<img width="32px" height="32px" src="{{test.icon}}"/>
|
||||||
|
{{ test.name }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ ['PROXY','VOD_PROXY','RELAY', 'ENCODE', 'TIMESHIFT_PLAYER',
|
||||||
|
'TIMESHIFT_RECORDER',
|
||||||
|
'CATCHUP', 'TEST_LIFE', 'VOD_RELAY', 'VOD_ENCODE', 'COD_RELAY',
|
||||||
|
'COD_ENCODE', 'EVENT'][test.type] }}
|
||||||
|
</td>
|
||||||
|
<td>{{ ['NEW', 'INIT', 'STARTED', 'READY', 'PLAYING', 'FROZEN',
|
||||||
|
'WAITING'][test.status] }}
|
||||||
|
</td>
|
||||||
|
<td>{{ test.restarts }}</td>
|
||||||
|
<td>{{ test.cpu | round(2, 'floor') }}</td>
|
||||||
|
<td>{{ (test.rss / (1024 * 1024)) | round(4, 'floor') }}</td>
|
||||||
|
<td>{{ (test.input_streams|sum(attribute='bps') / (1024 * 1024 / 8)) | round(4,
|
||||||
|
'floor') }}
|
||||||
|
</td>
|
||||||
|
<td>{{ (test.output_streams|sum(attribute='bps') / (1024 * 1024 / 8))| round(4,
|
||||||
|
'floor') }}
|
||||||
|
</td>
|
||||||
|
<td>{{ (test.timestamp - test.start_time)/1000 }}</td>
|
||||||
|
<td>{{ (test.timestamp - test.loop_start_time)/1000 }}</td>
|
||||||
|
<td>{{ test.quality | round(2, 'floor') }}
|
||||||
|
</td>
|
||||||
|
<td>{{ test.price }}</td>
|
||||||
|
<td>
|
||||||
|
<button type="submit"
|
||||||
|
{% if (service.status== service.status.ACTIVE) %}
|
||||||
|
class="btn btn-success btn-xs"
|
||||||
|
{% else %}
|
||||||
|
class="btn btn-success btn-xs" disabled
|
||||||
|
{% endif %}
|
||||||
|
onclick="start_stream(this, '{{ test.id }}')">
|
||||||
|
Start
|
||||||
|
</button>
|
||||||
|
<button type="submit"
|
||||||
|
{% if (service.status== service.status.ACTIVE) %}
|
||||||
|
class="btn btn-success btn-xs"
|
||||||
|
{% else %}
|
||||||
|
class="btn btn-success btn-xs" disabled
|
||||||
|
{% endif %}
|
||||||
|
onclick="stop_stream(this, '{{ test.id }}')">
|
||||||
|
Stop
|
||||||
|
</button>
|
||||||
|
<button type="submit"
|
||||||
|
{% if (service.status== service.status.ACTIVE) %}
|
||||||
|
class="btn btn-success btn-xs"
|
||||||
|
{% else %}
|
||||||
|
class="btn btn-success btn-xs" disabled
|
||||||
|
{% endif %}
|
||||||
|
onclick="restart_stream(this, '{{ test.id }}')">
|
||||||
|
Restart
|
||||||
|
</button>
|
||||||
|
<a href="{{ url_for('StreamView:play', sid=test.id) }}"
|
||||||
|
class="btn btn-info btn-xs"
|
||||||
|
role="button">
|
||||||
|
Play
|
||||||
|
</a>
|
||||||
|
<button type="submit" class="btn btn-success btn-xs"
|
||||||
|
onclick="edit_stream('{{ test.id }}')">
|
||||||
|
Edit
|
||||||
|
</button>
|
||||||
|
<button type="submit" class="btn btn-danger btn-xs"
|
||||||
|
onclick="remove_stream('{{ test.id }}')">
|
||||||
|
Remove
|
||||||
|
</button>
|
||||||
|
{% if (role == 2) %}
|
||||||
|
<button type="submit"
|
||||||
|
{% if (service.status== service.status.ACTIVE) %}
|
||||||
|
class="btn btn-success btn-xs"
|
||||||
|
{% else %}
|
||||||
|
class="btn btn-success btn-xs" disabled
|
||||||
|
{% endif %}
|
||||||
|
onclick="get_log_stream('{{ test.id }}')">
|
||||||
|
Get log
|
||||||
|
</button>
|
||||||
|
<a href="{{ url_for('StreamView:view_log', sid=test.id) }}"
|
||||||
|
class="btn btn-info btn-xs"
|
||||||
|
role="button">
|
||||||
|
View log
|
||||||
|
</a>
|
||||||
|
<button type="submit"
|
||||||
|
{% if (service.status== service.status.ACTIVE) %}
|
||||||
|
class="btn btn-success btn-xs"
|
||||||
|
{% else %}
|
||||||
|
class="btn btn-success btn-xs" disabled
|
||||||
|
{% endif %}
|
||||||
|
onclick="get_pipeline_stream('{{ test.id }}')">
|
||||||
|
GPL
|
||||||
|
</button>
|
||||||
|
<a href="{{ url_for('StreamView:view_pipeline', sid=test.id) }}"
|
||||||
|
class="btn btn-info btn-xs"
|
||||||
|
role="button">
|
||||||
|
VPL
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<button class="btn btn-success btn-send col-md-12" onclick="add_test_life_stream()">
|
||||||
|
Add test life
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1491,7 +1626,5 @@ Dashboard | {{ config['PUBLIC_CONFIG'].site.title }}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue