1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-25 09:30:31 +00:00
calibre-web/cps/templates/admin.html

248 lines
11 KiB
HTML
Raw Normal View History

{% extends "layout.html" %}
{% macro display_bool_setting(setting_value) -%}
2019-12-13 02:31:17 +00:00
{% if setting_value %}<span class="glyphicon glyphicon-ok"></span>{% else %}<span class="glyphicon glyphicon-remove"></span>{% endif %}
{%- endmacro %}
{% block body %}
<div class="container-fluid">
2018-09-09 11:51:28 +00:00
<div class="row">
<div class="col">
<h2>{{_('Users')}}</h2>
2021-01-31 09:17:40 +00:00
{% if allUser.__len__() < 10 %}
2018-09-09 11:51:28 +00:00
<table class="table table-striped" id="table_user">
<tr>
<th>{{_('Username')}}</th>
<th>{{_('E-mail Address')}}</th>
<th>{{_('Send to Kindle E-mail Address')}}</th>
<th>{{_('Downloads')}}</th>
<th class="hidden-xs ">{{_('Admin')}}</th>
<th class="hidden-xs hidden-sm">{{_('Password')}}</th>
<th class="hidden-xs hidden-sm">{{_('Upload')}}</th>
<th class="hidden-xs hidden-sm">{{_('Download')}}</th>
<th class="hidden-xs hidden-sm hidden-md">{{_('View Books')}}</th>
<th class="hidden-xs hidden-sm hidden-md">{{_('Edit')}}</th>
<th class="hidden-xs hidden-sm hidden-md">{{_('Delete')}}</th>
<th class="hidden-xs hidden-sm hidden-md">{{_('Public Shelf')}}</th>
2018-09-09 11:51:28 +00:00
</tr>
{% for user in allUser %}
2018-09-09 11:51:28 +00:00
{% if not user.role_anonymous() or config.config_anonbrowse %}
<tr>
<td><a href="{{url_for('admin.edit_user', user_id=user.id)}}">{{user.name}}</a></td>
2018-09-09 11:51:28 +00:00
<td>{{user.email}}</td>
<td>{{user.kindle_mail}}</td>
<td>{{user.downloads.count()}}</td>
<td class="hidden-xs">{{ display_bool_setting(user.role_admin()) }}</td>
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_passwd()) }}</td>
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_upload()) }}</td>
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_download()) }}</td>
<td class="hidden-xs hidden-sm hidden-md">{{ display_bool_setting(user.role_viewer()) }}</td>
<td class="hidden-xs hidden-sm hidden-md">{{ display_bool_setting(user.role_edit()) }}</td>
<td class="hidden-xs hidden-sm hidden-md">{{ display_bool_setting(user.role_delete_books()) }}</td>
<td class="hidden-xs hidden-sm hidden-md">{{ display_bool_setting(user.role_edit_shelfs()) }}</td>
2018-09-09 11:51:28 +00:00
</tr>
{% endif %}
{% endfor %}
</table>
2021-03-27 08:40:45 +00:00
{% endif %}
<a class="btn btn-default" id="admin_user_table" href="{{url_for('admin.edit_user_table')}}">{{_('Edit Users')}}</a>
<a class="btn btn-default" id="admin_new_user" href="{{url_for('admin.new_user')}}">{{_('Add New User')}}</a>
{% if (config.config_login_type == 1) %}
<div class="btn btn-default" id="import_ldap_users" data-toggle="modal" data-target="#StatusDialog">{{_('Import LDAP Users')}}</div>
2019-12-28 06:12:18 +00:00
{% endif %}
</div>
</div>
2018-09-09 11:51:28 +00:00
<div class="row">
<div class="col">
<h2>{{_('E-mail Server Settings')}}</h2>
2020-12-11 19:54:24 +00:00
{% if config.get_mail_server_configured() %}
{% if email.mail_server_type == 0 %}
<div class="col-xs-12 col-sm-12">
<div class="row">
2020-12-11 19:54:24 +00:00
<div class="col-xs-6 col-sm-3">{{_('SMTP Hostname')}}</div>
<div class="col-xs-6 col-sm-3">{{email.mail_server}}</div>
</div>
<div class="row">
2020-12-11 19:54:24 +00:00
<div class="col-xs-6 col-sm-3">{{_('SMTP Port')}}</div>
<div class="col-xs-6 col-sm-3">{{email.mail_port}}</div>
</div>
<div class="row">
2020-12-11 19:54:24 +00:00
<div class="col-xs-6 col-sm-3">{{_('Encryption')}}</div>
<div class="col-xs-6 col-sm-3">{{ display_bool_setting(email.mail_use_ssl) }}</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-3">{{_('SMTP Login')}}</div>
<div class="col-xs-6 col-sm-3">{{email.mail_login}}</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-3">{{_('From E-mail')}}</div>
<div class="col-xs-6 col-sm-3">{{email.mail_from}}</div>
</div>
2020-12-11 19:54:24 +00:00
</div>
{% else %}
<div class="col-xs-12 col-sm-12">
<div class="row">
<div class="col-xs-6 col-sm-3">{{_('E-Mail Service')}}</div>
<div class="col-xs-6 col-sm-3">{{_('Gmail via Oauth2')}}</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-3">{{_('From E-mail')}}</div>
<div class="col-xs-6 col-sm-3">{{email.mail_gmail_token['email']}}</div>
</div>
2020-12-11 19:54:24 +00:00
</div>
{% endif %}
{% endif %}
<a class="btn btn-default emailconfig" id="admin_edit_email" href="{{url_for('admin.edit_mailsettings')}}">{{_('Edit E-mail Server Settings')}}</a>
2018-08-30 07:32:42 +00:00
</div>
2018-09-09 11:51:28 +00:00
</div>
<div class="row">
<div class="col">
<h2>{{_('Configuration')}}</h2>
<div class="col-xs-12 col-sm-6">
<div class="row">
<div class="col-xs-6 col-sm-6">{{_('Calibre Database Directory')}}</div>
<div class="col-xs-6 col-sm-6">{{config.config_calibre_dir}}</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-6">{{_('Log Level')}}</div>
<div class="col-xs-6 col-sm-6">{{config.get_log_level()}}</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-6">{{_('Port')}}</div>
<div class="col-xs-6 col-sm-6">{{config.config_port}}</div>
</div>
{% if kobo_support and config.config_port != config.config_external_port %}
<div class="row">
<div class="col-xs-6 col-sm-6">{{_('External Port')}}</div>
<div class="col-xs-6 col-sm-6">{{config.config_external_port}}</div>
</div>
{% endif %}
</div>
<div class="col-xs-12 col-sm-6">
<div class="row">
<div class="col-xs-6 col-sm-7">{{_('Books per Page')}}</div>
<div class="col-xs-6 col-sm-5">{{config.config_books_per_page}}</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-7">{{_('Uploads')}}</div>
<div class="col-xs-6 col-sm-5">{{ display_bool_setting(config.config_uploading) }}</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-7">{{_('Anonymous Browsing')}}</div>
<div class="col-xs-6 col-sm-5">{{ display_bool_setting(config.config_anonbrowse) }}</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-7">{{_('Public Registration')}}</div>
<div class="col-xs-6 col-sm-5">{{ display_bool_setting(config.config_public_reg) }}</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-7">{{_('Magic Link Remote Login')}}</div>
<div class="col-xs-6 col-sm-5">{{ display_bool_setting(config.config_remote_login) }}</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-7">{{_('Reverse Proxy Login')}}</div>
<div class="col-xs-6 col-sm-5">{{ display_bool_setting(config.config_allow_reverse_proxy_header_login) }}</div>
</div>
{% if config.config_allow_reverse_proxy_header_login %}
<div class="row">
<div class="col-xs-6 col-sm-7">{{_('Reverse proxy header name')}}</div>
<div class="col-xs-6 col-sm-5">{{ config.config_reverse_proxy_login_header_name }}</div>
</div>
{% endif %}
</div>
<a class="btn btn-default" id="basic_config" href="{{url_for('admin.configuration')}}">{{_('Edit Basic Configuration')}}</a>
<a class="btn btn-default" id="view_config" href="{{url_for('admin.view_configuration')}}">{{_('Edit UI Configuration')}}</a>
</div>
</div>
2018-09-09 11:51:28 +00:00
<div class="row form-group">
<h2>{{_('Administration')}}</h2>
<a class="btn btn-default" id="debug" href="{{url_for('admin.download_debug')}}">{{_('Download Debug Package')}}</a>
<a class="btn btn-default" id="logfile" href="{{url_for('admin.view_logfile')}}">{{_('View Logs')}}</a>
</div>
<div class="row form-group">
<div class="btn btn-default" id="restart_database" data-toggle="modal" data-target="#StatusDialog">{{_('Reconnect Calibre Database')}}</div>
<div class="btn btn-default" id="admin_restart" data-toggle="modal" data-target="#RestartDialog">{{_('Restart')}}</div>
<div class="btn btn-default" id="admin_stop" data-toggle="modal" data-target="#ShutdownDialog">{{_('Shutdown')}}</div>
</div>
<div class="row">
<div class="col">
<h2>{{_('Update')}}</h2>
<table class="table table-striped" id="update_table">
<thead>
<tr>
<th class="col-xs-3">{{_('Version')}}</th>
<th class="col-xl-8">{{_('Details')}}</th>
</tr>
</thead>
<tbody>
<tr id="current_version">
<td>{{commit}} </td>
<td><i>{{_('Current version')}}</i></td>
</tr>
</tbody>
</table>
{% if feature_support['updater'] %}
<div class="hidden" id="update_error"> <span>{{update_error}}</span></div>
<div class="btn btn-primary" id="check_for_update">{{_('Check for Update')}}</div>
<div class="btn btn-primary hidden" id="perform_update" data-toggle="modal" data-target="#StatusDialog">{{_('Perform Update')}}</div>
{% endif %}
</div>
2018-09-09 11:51:28 +00:00
</div>
</div>
<!-- Modal -->
<div id="RestartDialog" class="modal fade" role="dialog">
<div class="modal-dialog modal-sm">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header bg-info"></div>
<div class="modal-body text-center">
<p>{{_('Are you sure you want to restart?')}}</p>
<div id="spinner" class="spinner" style="display:none;">
2019-05-16 17:42:59 +00:00
<img id="img-spinner" src="{{ url_for('static', filename='css/libs/images/loading-icon.gif') }}"/>
</div>
<p></p>
<button type="button" class="btn btn-default" id="restart" >{{_('OK')}}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{_('Cancel')}}</button>
</div>
</div>
</div>
</div>
<div id="ShutdownDialog" class="modal fade" role="dialog">
<div class="modal-dialog modal-sm">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header bg-info">
</div>
<div class="modal-body text-center">
<p>{{_('Are you sure you want to shutdown?')}}</p>
<button type="button" class="btn btn-default" id="shutdown" data-dismiss="modal">{{_('OK')}}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{_('Cancel')}}</button>
</div>
</div>
</div>
</div>
<div id="StatusDialog" class="modal fade" role="dialog">
<div class="modal-dialog modal-sm">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header bg-info text-center">
<span id="DialogHeader">{{_('Updating, please do not reload this page')}}</span>
</div>
<div class="modal-body text-center">
<div id="spinner2" class="spinner2" style="display:none;">
2019-05-16 17:42:59 +00:00
<img id="img-spinner2" src="{{ url_for('static', filename='css/libs/images/loading-icon.gif') }}"/>
</div>
<p></p>
<div id="DialogContent"></div>
<p></p>
<button type="button" class="btn btn-default hidden" id="DialogFinished" data-dismiss="modal">{{_('OK')}}</button>
</div>
</div>
</div>
</div>
{% endblock %}