mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-10 00:56:19 +01:00
Replace API key management w/ ported profile page
Shows characters on each API key, main character, API key status and the user groups.
This commit is contained in:
@@ -110,12 +110,6 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="{% navactive request 'auth_api_key_management auth_add_api_key' %}" href="{% url 'auth_api_key_management' %}">
|
||||
<i class="fa fa-key fa-fw grayiconecolor"></i>{% trans " Api Keys" %}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a class="{% navactive request 'auth_characters' %}" href="{% url 'auth_characters' %}">
|
||||
<i class="fa fa-users fa-fw grayiconecolor"></i>{% trans " Characters" %}
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
</div>
|
||||
<div class="col-lg-10 col-sm-2">
|
||||
<div class="alert alert-danger" role="alert">Character not registered!</div>
|
||||
This character is not part of any registered API-key. You must go to <a href=" {% url 'auth_api_key_management' %}">API key management</a> and add an API with the character on before being able to click fleet attendance links.
|
||||
This character is not part of any registered API-key. You must go to <a href=" {% url 'auth_dashboard' %}">API key management</a> and add an API with the character on before being able to click fleet attendance links.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
{% extends "public/base.html" %}
|
||||
{% load bootstrap %}
|
||||
{% load staticfiles %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}Alliance Auth{% endblock %}
|
||||
|
||||
{% block page_title %}{% trans "API Key Management" %}{% endblock page_title %}
|
||||
{% block extra_css %}{% endblock extra_css %}
|
||||
|
||||
{% block content %}
|
||||
<div class="col-lg-6 col-lg-offset-3">
|
||||
<div class="row">
|
||||
<h1 class="page-header text-center">{% trans "API Key Management" %}
|
||||
<div class="text-right">
|
||||
<a href="{% url 'auth_add_api_key' %}" class="btn btn-success">{% trans "Add Key" %}</a>
|
||||
</div>
|
||||
</h1>
|
||||
{% if apikeypairs %}
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th class="text-center">{% trans "API ID" %}</th>
|
||||
{% if api_sso_validation %}
|
||||
<th class="text-center">{% trans "SSO Verified" %}</th>
|
||||
{% endif %}
|
||||
<th class="text-center">{% trans "Action" %}</th>
|
||||
</tr>
|
||||
{% for pair in apikeypairs %}
|
||||
<tr>
|
||||
<td class="text-center">{{ pair.api_id }}</td>
|
||||
{% if api_sso_validation %}
|
||||
<th class="text-center" style="font-size: 2em;">
|
||||
{% if pair.sso_verified %}
|
||||
<span class="glyphicon glyphicon-ok text-success" title="API key verified"></span>
|
||||
{% else %}
|
||||
<span class="glyphicon glyphicon-remove text-danger" title="API key not verified">
|
||||
</span>
|
||||
{% endif %}
|
||||
</th>
|
||||
{% endif %}
|
||||
<td class="text-center">
|
||||
<a href="{% url 'auth_user_refresh_api' pair.api_id %}" class="btn btn-success">
|
||||
<span class="glyphicon glyphicon-refresh"></span>
|
||||
</a>
|
||||
<a href="{% url 'auth_api_key_removal' pair.api_id %}" class="btn btn-danger">
|
||||
<span class="glyphicon glyphicon-remove"></span>
|
||||
</a>
|
||||
{% if api_sso_validation and not pair.sso_verified %}
|
||||
<a href="{% url 'auth_api_sso' pair.api_id %}" class="btn btn-info"
|
||||
title="EVE SSO verify this key">
|
||||
<i class="fa fa-shield" aria-hidden="true"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="alert alert-danger" role="alert">{% trans "No api keys found" %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock content %}
|
||||
@@ -1,69 +1,122 @@
|
||||
{% extends "public/base.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load i18n %}
|
||||
{% block title %}Alliance Auth{% endblock %}
|
||||
{% block page_title %}{% trans "Dashboard" %}{% endblock page_title %}
|
||||
|
||||
{% block title %}{% trans "Dashboard" %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="col-lg-12">
|
||||
<h1 class="page-header text-center">{% trans "Dashboard" %}</h1>
|
||||
{% if STATE == MEMBER_STATE or user.is_superuser%}
|
||||
<div class="col-lg-12 container" id="example">
|
||||
|
||||
|
||||
<div class="col-lg-12 container">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
{% for character in characters %}
|
||||
{% ifequal character.character_id authinfo.main_char_id %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">{% trans "Main character" %}</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="col-lg-5 col-sm-2">
|
||||
<img class="ra-avatar img-responsive" src="https://image.eveonline.com/Character/{{ character.character_id }}_128.jpg">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-7 col-sm-2">
|
||||
<h4 class="">{{ character.character_name }}</h4>
|
||||
|
||||
<p>{{ character.corporation_name }}</p>
|
||||
|
||||
<p>{{ character.alliance_name }}</p>
|
||||
</div>
|
||||
<div class="col-lg-6 text-center">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">{% trans "Main Character" %}</div>
|
||||
<div class="panel-body">
|
||||
{% if main %}
|
||||
<div class="col-lg-4 col-sm-2">
|
||||
<table class="table">
|
||||
<tr><td class="text-center"><img class="ra-avatar" src="https://image.eveonline.com/Character/{{ main.character_id }}_128.jpg"></td></tr>
|
||||
<tr><td class="text-center">{{ main.character_name }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-4 col-sm-2">
|
||||
<table class="table">
|
||||
<tr><td class="text-center"><img class="ra-avatar" src="http://image.eveonline.com/Corporation/{{ main.corporation_id }}_128.png"></td></tr>
|
||||
<tr><td class="text-center">{{ main.corporation_name }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="col-lg-4 col-sm-2">
|
||||
{% if main.alliance_id != '0' %}
|
||||
<table class="table">
|
||||
<tr><td class="text-center"><img class="ra-avatar" src="https://image.eveonline.com/Alliance/{{ main.alliance_id }}_128.png"></td></tr>
|
||||
<tr><td class="text-center">{{ main.alliance_name }}</td><tr>
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-danger" role="alert">Missing main character model.</div>
|
||||
{% endif %}
|
||||
<div class="col-lg-6">
|
||||
<a href="{% url 'auth_add_api_key' %}" class="btn btn-block btn-success" label="Add API Key">Add API Key</a>
|
||||
</div>
|
||||
{% endifequal %}
|
||||
{% endfor %}
|
||||
<div class="col-lg-6">
|
||||
<a href="{% url 'auth_characters' %}" class="btn btn-block btn-info" label="Change Main Character">Change Main</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="panel panel-default">
|
||||
<div class="col-lg-6 text-center">
|
||||
<div class="panel panel-success">
|
||||
<div class="panel-heading">{% trans "Groups" %}</div>
|
||||
<div class="panel-body">
|
||||
<div style="height: 128px;overflow:-moz-scrollbars-vertical;overflow-y:auto;">
|
||||
<div style="height: 236px;overflow:-moz-scrollbars-vertical;overflow-y:auto;">
|
||||
<table class="table table-striped">
|
||||
{% for group in user.groups.all %}
|
||||
<tr>
|
||||
<td>
|
||||
<p class="">{{ group.name }}</p>
|
||||
<p>{{ group.name }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{% if IS_CORP %}
|
||||
<div class="alert alert-danger" role="alert">{% trans "Not a part of the corporation." %}</div>
|
||||
{% else %}
|
||||
<div class="alert alert-danger" role="alert">{% trans "Not a part of the alliance." %}</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
<div class="clearfix"></div>
|
||||
{% if apis %}
|
||||
{% for api in apis %}
|
||||
<div class="panel panel-{{ api.is_valid|yesno:"success,danger,default" }}">
|
||||
<div class="panel-heading" style="display:flex;">
|
||||
<div style="width: 25%;">
|
||||
{% trans "API ID" %} {{ api.id }} <span class="glyphicon glyphicon-{{ api.is_valid|yesno:"ok-sign,minus-sign,question-sign" }}"></span>
|
||||
</div>
|
||||
<div class="text-right" style="width: 75%;">
|
||||
<a href="{% url 'auth_user_refresh_api' api.id %}" class="btn btn-primary" title="Update"><span class="glyphicon glyphicon-refresh"></span></a>
|
||||
<a href="{% url 'auth_api_key_removal' api.id %}" class="btn btn-danger" title="Delete"><span class="glyphicon glyphicon-remove"></span></a>
|
||||
{% if api_sso_validation and not api.sso_verified %}
|
||||
<a href="{% url 'auth_api_sso' api.id %}" class="btn btn-info"
|
||||
title="EVE SSO verify this key">
|
||||
<span class="fa fa-shield"></span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th class="text-center"></th>
|
||||
<th class="text-center">{% trans "Name" %}</th>
|
||||
<th class="text-center">{% trans "Corp" %}</th>
|
||||
<th class="text-center">{% trans "Alliance" %}</th>
|
||||
</tr>
|
||||
{% for char in api.characters %}
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<img class="ra-avatar img-responsive" src="https://image.eveonline.com/Character/{{ char.character_id }}_32.jpg">
|
||||
</td>
|
||||
<td class="text-center">{{ char.character_name }}</td>
|
||||
<td class="text-center">{{ char.corporation_name }}</td>
|
||||
<td class="text-center">{{ char.alliance_name }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if api.corp %}
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<img class="ra-avatar img-responsive" src="https://image.eveonline.com/Corporation/{{ api.corporation_id }}_32.png">
|
||||
</td>
|
||||
<td class="text-center"></td>
|
||||
<td class="text-center">{{ api.corporation_name }}</td>
|
||||
<td class="text-center">{{ api.alliance_name }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</table>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<div class="alert alert-danger" role="alert">{% trans "No API keys found" %}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user