65 lines
2.4 KiB
HTML
65 lines
2.4 KiB
HTML
{% extends "default/_layout.html" %}
|
|
|
|
{% block title %}Баланс{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row">
|
|
<div class="large-12 columns">
|
|
<h2>Учётная запись</h2>
|
|
</div>
|
|
<div class="large-12 columns">
|
|
{% include "default/id/_menu.html" %}
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="large-12 columns">
|
|
<h3>API</h3>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="large-12 columns">
|
|
{% if g.errors['total'] > 0 %}
|
|
<div class="alert-box alert">
|
|
<ul>
|
|
{% for error in g.errors['items'] %}
|
|
<li>{{ error }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<form action="{{ url_for('account.api_update') }}" method="post">
|
|
<input type="hidden" name="method" value="secret_update" />
|
|
<label>
|
|
Email
|
|
<input type="text" name="email" value="{{ session['email'] }}" disabled />
|
|
</label>
|
|
<label>
|
|
Ключ API
|
|
<input type="text" name="secret" value="{{ user_secret.secret }}" id="secret" />
|
|
</label>
|
|
<label for="acl">
|
|
IP
|
|
<input type="text" name="acl" value="{{ user_secret.acl }}" id="acl" />
|
|
</label>
|
|
<input type="button" value="Обновить ключ API" class="button small default" id="generate_secret" />
|
|
<input type="submit" value="Сохранить изменения" class="button small success" />
|
|
|
|
<input type="radio" name="status" value="0" {% if user_secret.status == 0 or not user_secret.status %}checked="checked"{% endif %} /> Неактивно
|
|
<input type="radio" name="status" value="1" {% if user_secret.status == 1 %}checked="checked"{% endif %} /> Активно
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
$('#generate_secret').click(function() {
|
|
var length = 32;
|
|
var text = "";
|
|
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
for( var i=0; i < length; i++ ) {
|
|
text += possible.charAt(Math.floor(Math.random() * possible.length));
|
|
}
|
|
$('#secret').val(text);
|
|
})
|
|
</script>
|
|
{% endblock %}
|