dodanie pobierania klucza publicznego
This commit is contained in:
parent
fe6ff3ecbf
commit
b39f94aa5f
10
app.py
10
app.py
@ -155,6 +155,16 @@ def delete(image_id):
|
||||
return redirect(url_for('list_images'))
|
||||
|
||||
|
||||
|
||||
@app.route('/download_key/<int:image_id>', methods=['POST'])
|
||||
@login_required
|
||||
def download_key(image_id):
|
||||
filename = db.get_conf_image_id(image_id)
|
||||
|
||||
return send_file(os.path.join(
|
||||
app.config['UPLOAD_FOLDER'], filename.split(".")[0]+".pub"))
|
||||
|
||||
|
||||
@app.route("/api/getconf")
|
||||
def get_image():
|
||||
try:
|
||||
|
@ -13,6 +13,7 @@
|
||||
<th>Token</th>
|
||||
<th>Nazwa</th>
|
||||
<th>IP VPN</th>
|
||||
<th>Pobierz klucz</th>
|
||||
<th>Usuń</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -22,6 +23,11 @@
|
||||
<td>{{ image.token }}</td>
|
||||
<td>{{ image.name }}</td>
|
||||
<td>{{ image.vpn_ip }}</td>
|
||||
<td>
|
||||
<form action="{{ url_for('download_key', image_id=image.id) }}" method="post">
|
||||
<button type="submit" class="btn">Pobierz</button>
|
||||
</form>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ url_for('delete', image_id=image.id) }}" method="post">
|
||||
<button type="submit" class="btn btn-danger">Usuń</button>
|
||||
|
Loading…
Reference in New Issue
Block a user