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

301 lines
14 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>
2023-01-04 02:30:13 +00:00
<th>{{_('Email')}}</th>
<th>{{_('Send to eReader Email')}}</th>
<th>{{_('Downloads')}}</th>
<th class="hidden-xs ">{{_('Admin')}}</th>
<th class="hidden-xs hidden-sm">{{_('Password')}}</th>
{% if config.config_uploading %}
<th class="hidden-xs hidden-sm">{{_('Upload')}}</th>
{% endif %}
<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 class="session" 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>
{% if config.config_uploading %}
<td class="hidden-xs hidden-sm">{{ display_bool_setting(user.role_upload()) }}</td>
{% endif %}
<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 %}
{% if not simple %}
<a class="btn btn-default" id="admin_user_table" href="{{url_for('admin.edit_user_table')}}">{{_('Edit Users')}}</a>
{% endif %}
<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">
2023-01-04 02:30:13 +00:00
<h2>{{_('Email Server Settings')}}</h2>
2020-12-11 19:54:24 +00:00
{% if config.get_mail_server_configured() %}
2022-07-02 15:45:24 +00:00
{% if config.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>
2022-07-02 15:45:24 +00:00
<div class="col-xs-6 col-sm-3">{{config.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>
2022-07-02 15:45:24 +00:00
<div class="col-xs-6 col-sm-3">{{config.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>
2022-07-02 15:45:24 +00:00
<div class="col-xs-6 col-sm-3">{{ display_bool_setting(config.mail_use_ssl) }}</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-3">{{_('SMTP Login')}}</div>
2022-07-02 15:45:24 +00:00
<div class="col-xs-6 col-sm-3">{{config.mail_login}}</div>
</div>
<div class="row">
2023-01-04 02:30:13 +00:00
<div class="col-xs-6 col-sm-3">{{_('From Email')}}</div>
2022-07-02 15:45:24 +00:00
<div class="col-xs-6 col-sm-3">{{config.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">
2023-01-04 02:30:13 +00:00
<div class="col-xs-6 col-sm-3">{{_('Email Service')}}</div>
<div class="col-xs-6 col-sm-3">{{_('Gmail via Oauth2')}}</div>
</div>
<div class="row">
2023-01-04 02:30:13 +00:00
<div class="col-xs-6 col-sm-3">{{_('From Email')}}</div>
2022-07-02 15:45:24 +00:00
<div class="col-xs-6 col-sm-3">{{config.mail_gmail_token['email']}}</div>
</div>
2020-12-11 19:54:24 +00:00
</div>
{% endif %}
{% endif %}
2023-01-04 02:30:13 +00:00
<a class="btn btn-default emailconfig" id="admin_edit_email" href="{{url_for('admin.edit_mailsettings')}}">{{_('Edit Email 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="db_config" href="{{url_for('admin.db_configuration')}}">{{_('Edit Calibre Database Configuration')}}</a>
<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>
{% if feature_support['scheduler'] %}
2021-09-26 07:02:48 +00:00
<div class="row">
<div class="col">
<h2>{{_('Scheduled Tasks')}}</h2>
<div class="col-xs-12 col-sm-12 scheduled_tasks_details">
2021-09-26 07:02:48 +00:00
<div class="row">
2023-01-04 02:30:13 +00:00
<div class="col-xs-6 col-sm-3">{{_('Start Time')}}</div>
<div class="col-xs-6 col-sm-3">{{schedule_time}}</div>
2021-09-26 07:02:48 +00:00
</div>
<div class="row">
2023-01-04 02:30:13 +00:00
<div class="col-xs-6 col-sm-3">{{_('Maximum Duration')}}</div>
<div class="col-xs-6 col-sm-3">{{schedule_duration}}</div>
2021-09-26 07:02:48 +00:00
</div>
<div class="row">
2023-01-04 02:30:13 +00:00
<div class="col-xs-6 col-sm-3">{{_('Generate Thumbnails')}}</div>
2021-09-26 07:02:48 +00:00
<div class="col-xs-6 col-sm-3">{{ display_bool_setting(config.schedule_generate_book_covers) }}</div>
</div>
2022-04-24 09:05:22 +00:00
<!--div class="row">
2021-09-26 07:02:48 +00:00
<div class="col-xs-6 col-sm-3">{{_('Generate series cover thumbnails')}}</div>
<div class="col-xs-6 col-sm-3">{{ display_bool_setting(config.schedule_generate_series_covers) }}</div>
2022-04-24 09:05:22 +00:00
</div-->
<div class="row">
2023-01-04 02:30:13 +00:00
<div class="col-xs-6 col-sm-3">{{_('Reconnect Calibre Database')}}</div>
<div class="col-xs-6 col-sm-3">{{ display_bool_setting(config.schedule_reconnect) }}</div>
</div>
2023-03-25 09:42:36 +00:00
<div class="row">
<div class="col-xs-6 col-sm-3">{{_('Generate Metadata Backup Files')}}</div>
<div class="col-xs-6 col-sm-3">{{ display_bool_setting(config.schedule_metadata_backup) }}</div>
</div>
2021-09-26 07:02:48 +00:00
</div>
<a class="btn btn-default scheduledtasks" id="admin_edit_scheduled_tasks" href="{{url_for('admin.edit_scheduledtasks')}}">{{_('Edit Scheduled Tasks Settings')}}</a>
{% if config.schedule_generate_book_covers %}
2023-01-04 02:30:13 +00:00
<a class="btn btn-default" id="admin_refresh_cover_cache">{{_('Refresh Thumbnail Cache')}}</a>
{% endif %}
2021-09-26 07:02:48 +00:00
</div>
</div>
{% endif %}
<div class="row form-group">
<h2>{{_('Administration')}}</h2>
2021-09-17 03:58:54 +00:00
<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>
<div class="row form-group">
<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>
2023-03-25 09:42:36 +00:00
{% if config.schedule_metadata_backup %}
2022-09-19 20:39:40 +00:00
<div class="row form-group">
<div class="btn btn-default" id="metadata_backup" data-toggle="modal" data-target="#StatusDialog">{{_('Queue all books for metadata backup')}}</div>
</div>
2023-03-25 09:42:36 +00:00
{% endif %}
<div class="row">
<div class="col">
<h2>{{_('Version Information')}}</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>
2023-01-04 02:30:13 +00:00
<td><i>{{_('Current Version')}}</i></td>
</tr>
</tbody>
</table>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
{% 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 %}
{% block modal %}
{{ change_confirm_modal() }}
{% endblock %}