Frontend rewritten in TypeScript, added Node 18 support

This commit is contained in:
Igor Lobanov
2024-06-05 11:40:32 +02:00
parent 4392255d7e
commit 2ab738b303
301 changed files with 32512 additions and 33018 deletions

View File

@@ -28,7 +28,7 @@ type URLFilterID = int
// The IDs of built-in filter lists.
//
// NOTE: Do not change without the need for it and keep in sync with
// client/src/helpers/constants.js.
// client/src/helpers/constants.ts.
//
// TODO(a.garipov): Add type [URLFilterID] once it is used consistently in
// package filtering.

View File

@@ -6,6 +6,7 @@ import (
"net"
"net/http"
"net/url"
"time"
)
// httpClient returns a new HTTP client that uses the AdGuard Home's own DNS
@@ -22,7 +23,7 @@ func httpClient() (c *http.Client) {
return &http.Client{
// TODO(a.garipov): Make configurable.
Timeout: writeTimeout,
Timeout: time.Minute * 5,
Transport: &http.Transport{
DialContext: dialContext,
Proxy: httpProxy,

View File

@@ -14,7 +14,7 @@ type Theme string
// Allowed [Theme] values.
//
// Keep in sync with client/src/helpers/constants.js.
// Keep in sync with client/src/helpers/constants.ts.
const (
ThemeAuto Theme = "auto"
ThemeLight Theme = "light"

View File

@@ -23,7 +23,6 @@ import (
"golang.org/x/net/http2/h2c"
)
// TODO(a.garipov): Make configurable.
const (
// readTimeout is the maximum duration for reading the entire request,
// including the body.
@@ -32,7 +31,7 @@ const (
readHdrTimeout = 60 * time.Second
// writeTimeout is the maximum duration before timing out writes of the
// response.
writeTimeout = 5 * time.Minute
writeTimeout = 60 * time.Second
)
type webConfig struct {