feat: config option to choose default field: search or URL
This commit is contained in:
parent
40b908d5b1
commit
3e3ce025da
@ -15,6 +15,8 @@ IMG_COMPRESS=true # enable image compressing; proxy_res is required
|
|||||||
## Documentation
|
## Documentation
|
||||||
SWAGGER=false # whether to add API docs route
|
SWAGGER=false # whether to add API docs route
|
||||||
|
|
||||||
|
SEARCH_BY_DEFAULT=false # whether to show search instead of URL field
|
||||||
|
|
||||||
## Third-party
|
## Third-party
|
||||||
SEARX_URL="https://searx.dc09.ru" # SearXNG base URL, enables search.
|
SEARX_URL="https://searx.dc09.ru" # SearXNG base URL, enables search.
|
||||||
WEBDER_URL="http://webder.example.com" # WebDer base URL, enables browser rendering.
|
WEBDER_URL="http://webder.example.com" # WebDer base URL, enables browser rendering.
|
@ -7,6 +7,7 @@ class EnvConfig {
|
|||||||
public readonly reverse_proxy: boolean;
|
public readonly reverse_proxy: boolean;
|
||||||
public readonly proxy: ProxyConfig;
|
public readonly proxy: ProxyConfig;
|
||||||
public readonly swagger: boolean;
|
public readonly swagger: boolean;
|
||||||
|
public readonly search_by_default: boolean;
|
||||||
public readonly third_party: ThirdPartyConfig;
|
public readonly third_party: ThirdPartyConfig;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@ -26,6 +27,8 @@ class EnvConfig {
|
|||||||
|
|
||||||
this.swagger = this.parseBool(process.env.SWAGGER, false);
|
this.swagger = this.parseBool(process.env.SWAGGER, false);
|
||||||
|
|
||||||
|
this.search_by_default = this.parseBool(process.env.SEARCH_BY_DEFAULT, false);
|
||||||
|
|
||||||
this.third_party = {
|
this.third_party = {
|
||||||
searx_url: process.env.SEARX_URL,
|
searx_url: process.env.SEARX_URL,
|
||||||
webder_url: process.env.WEBDER_URL,
|
webder_url: process.env.WEBDER_URL,
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
if (search) {
|
if (search) {
|
||||||
%>
|
%>
|
||||||
<input type="checkbox" id="switch-search" checked>
|
<input type="checkbox" id="switch-search" <%= config.env.search_by_default ? "checked" : "" %>>
|
||||||
|
|
||||||
<label for="switch-search" class="switch-label">
|
<label for="switch-search" class="switch-label">
|
||||||
<span>URL</span>
|
<span>URL</span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user