mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2025-07-09 03:04:26 -04:00
Merge pull request #812 from DL6ER/new/lt_hide_api
Add --hide-api to hide the API request/response fields from the web interface
This commit is contained in:
commit
2b3f51a28b
@ -204,6 +204,7 @@ Arguments passed to the process or set via environment variables are split into
|
|||||||
| --disable-web-ui | Disable web ui | `Web Ui enabled` | LT_DISABLE_WEB_UI |
|
| --disable-web-ui | Disable web ui | `Web Ui enabled` | LT_DISABLE_WEB_UI |
|
||||||
| --update-models | Update language models at startup | `Only on if no models found` | LT_UPDATE_MODELS |
|
| --update-models | Update language models at startup | `Only on if no models found` | LT_UPDATE_MODELS |
|
||||||
| --metrics | Enable the /metrics endpoint for exporting [Prometheus](https://prometheus.io/) usage metrics | `Disabled` | LT_METRICS |
|
| --metrics | Enable the /metrics endpoint for exporting [Prometheus](https://prometheus.io/) usage metrics | `Disabled` | LT_METRICS |
|
||||||
|
| --hide-api | Hide the API request/response section in the web UI | `Disabled` | LT_HIDE_API |
|
||||||
|
|
||||||
### Configuration Parameters
|
### Configuration Parameters
|
||||||
|
|
||||||
|
@ -446,6 +446,7 @@ def create_app(args):
|
|||||||
current_locale=get_locale(),
|
current_locale=get_locale(),
|
||||||
alternate_locales=get_alternate_locale_links(),
|
alternate_locales=get_alternate_locale_links(),
|
||||||
under_attack=args.under_attack,
|
under_attack=args.under_attack,
|
||||||
|
hide_api=args.hide_api,
|
||||||
))
|
))
|
||||||
|
|
||||||
if args.require_api_key_secret:
|
if args.require_api_key_secret:
|
||||||
|
@ -166,6 +166,11 @@ _default_options_objects = [
|
|||||||
'default_value': False,
|
'default_value': False,
|
||||||
'value_type': 'bool'
|
'value_type': 'bool'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
'name': 'HIDE_API',
|
||||||
|
'default_value': False,
|
||||||
|
'value_type': 'bool'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
'name': 'SHARED_STORAGE',
|
'name': 'SHARED_STORAGE',
|
||||||
'default_value': 'memory://',
|
'default_value': 'memory://',
|
||||||
|
@ -160,6 +160,12 @@ def get_args():
|
|||||||
action="store_true",
|
action="store_true",
|
||||||
help="Require use of an API key for programmatic access to the API, unless the client also matches a fingerprint",
|
help="Require use of an API key for programmatic access to the API, unless the client also matches a fingerprint",
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--hide-api",
|
||||||
|
default=DEFARGS['HIDE_API'],
|
||||||
|
action="store_true",
|
||||||
|
help="Hide the API request/response fields in the frontend",
|
||||||
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--under-attack",
|
"--under-attack",
|
||||||
default=DEFARGS['UNDER_ATTACK'],
|
default=DEFARGS['UNDER_ATTACK'],
|
||||||
|
@ -296,6 +296,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if not hide_api %}
|
||||||
<div class="section no-pad-bot" v-if="translationType !== 'files'">
|
<div class="section no-pad-bot" v-if="translationType !== 'files'">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row center">
|
<div class="row center">
|
||||||
@ -318,6 +319,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% if web_version %}
|
{% if web_version %}
|
||||||
<div class="section no-pad-bot">
|
<div class="section no-pad-bot">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user