forked from openlabs/python-cloudfront-streaming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
107 lines (93 loc) · 3.21 KB
/
index.html
File metadata and controls
107 lines (93 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{% extends 'base.html' %}
{% macro render_parameters(status, parameters) %}
<table class="table table-bordered">
{% for parameter in parameters %}
<tr>
<td>{{ parameters[parameter] }}</td>
<td>
{% if status|attr(parameter) %}
<span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span>
{% else %}
<span class="glyphicon glyphicon-remove text-danger" aria-hidden="true"></span>
{% endif %}
</td>
</tr>
{% endfor %}
</table>
{% endmacro %}
{% macro form_fields() %}
<div class="form-group">
<label for="s3key">S3 Key</label>
<input class="form-control" id="s3key"
name="s3key" placeholder="ex: file.mp4">
<label for="resource">Resource Path (optional)</label>
<input class="form-control" id="resource"
name="resource" placeholder="ex: * or video-1/*">
</div>
<div class="form-group">
<label for="scheme">Scheme</label>
<select class="form-control" name="scheme">
<option value="http">http</option>
<option value="https">https</option>
</select>
</div>
<button type="submit" class="btn btn-default">Submit</button>
{% endmacro %}
{% block container %}
<div class="row">
{% block status %}
<div class="col-xs-12 col-md-3 col-sm-3">
<h2>Config</h2>
<br/>
{{ render_parameters(status, status.config_parameters) }}
</div>
<div class="col-xs-12 col-md-3 col-sm-3">
<h2>Connection</h2>
<br/>
{{ render_parameters(status, status.connection_parameters) }}
<h2>Signed Cookies</h2>
<br/>
{{ render_parameters(status, status.signed_cookie_parameters) }}
</div>
{% endblock status %}
{% block generator %}
<div class="col-xs-12 col-md-6 col-sm-6">
<div role="tabpanel">
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#url" aria-controls="url" role="tab" data-toggle="tab">Signed URL</a>
</li>
<li role="presentation">
<a href="#cookie" aria-controls="cookie" role="tab" data-toggle="tab">Signed Cookie</a>
</li>
</ul>
<!-- Tab panes -->
<div class="tab-content">
<!-- Signed URL -->
<div role="tabpanel" class="tab-pane active" id="url">
<form action="{{ url_for('generate_signed_url') }}" method="POST">
{{ form_fields() }}
</form>
</div>
<!-- End::Signed URL -->
<!-- Signed Cookie -->
<div role="tabpanel" class="tab-pane" id="cookie">
{% if request.host.endswith(status.cookie_domain) %}
<form action="{{ url_for('generate_signed_cookie') }}" method="POST">
{{ form_fields() }}
</form>
{% else %}
<div class="alert alert-danger" role="alert">
<strong>Cookie Domains Matter!</strong>
Cookies will be dropped with domain <em>{{ status.cookie_domain }}</em> and the host is <em>{{ request.host }}</em>
</div>
{% endif %}
</div>
<!-- End::Signed Cookie -->
</div>
</div>
</div>
{% endblock generator %}
</div>
{% endblock container %}