mirror of
https://git.vectorsigma.ru/public/AdGuardHome.git
synced 2026-07-29 02:09:07 +00:00
review fix
This commit is contained in:
@@ -1,141 +1,131 @@
|
||||
{
|
||||
"name": "dashboard",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build-dev": "cross-env NODE_ENV=development BUILD_ENV=dev webpack --config webpack.dev.js",
|
||||
"build-prod": "cross-env BUILD_ENV=prod webpack --config webpack.prod.js",
|
||||
"watch": "cross-env BUILD_ENV=dev webpack --config webpack.dev.js --watch",
|
||||
"watch:hot": "cross-env BUILD_ENV=dev webpack-dev-server --config webpack.dev.js",
|
||||
"lint": "eslint --ext .ts,.tsx src",
|
||||
"lint:fix": "eslint --ext .ts,.tsx src --fix",
|
||||
"test": "vitest --run",
|
||||
"test:watch": "vitest --watch",
|
||||
"test:e2e": "npx playwright test tests/e2e",
|
||||
"test:e2e:interactive": "npx playwright test --ui",
|
||||
"test:e2e:debug": "npx playwright test --debug",
|
||||
"test:e2e:codegen": "npx playwright codegen",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"typecheck:watch": "tsc --noEmit --watch",
|
||||
"storybook": "storybook dev -p 6006",
|
||||
"build-storybook": "storybook build"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@adguard/translate": "^1.0.2",
|
||||
"@nivo/line": "^0.64.0",
|
||||
"axios": "^0.19.2",
|
||||
"classnames": "^2.5.1",
|
||||
"clsx": "^2.1.1",
|
||||
"countries-and-timezones": "^3.6.0",
|
||||
"date-fns": "^1.29.0",
|
||||
"i18next": "^19.6.2",
|
||||
"i18next-browser-languagedetector": "^4.2.0",
|
||||
"ipaddr.js": "^1.9.1",
|
||||
"js-yaml": "^3.14.0",
|
||||
"lodash": "^4.17.19",
|
||||
"nanoid": "^3.1.9",
|
||||
"popper.js": "^1.16.1",
|
||||
"prop-types": "^15.8.1",
|
||||
"qs": "^6.14.0",
|
||||
"query-string": "^6.13.1",
|
||||
"rc-dialog": "^10.0.0",
|
||||
"rc-dropdown": "^4.2.1",
|
||||
"react": "^16.13.1",
|
||||
"react-click-outside": "^3.0.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-hook-form": "^7.54.0",
|
||||
"react-i18next": "^11.7.2",
|
||||
"react-modal": "^3.11.2",
|
||||
"react-popper-tooltip": "^2.11.1",
|
||||
"react-redux": "^7.2.0",
|
||||
"react-redux-loading-bar": "^4.6.0",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"react-router-hash-link": "^1.2.2",
|
||||
"react-select": "^5.3.2",
|
||||
"react-table": "^6.11.4",
|
||||
"react-transition-group": "^4.4.5",
|
||||
"redux": "^4.0.5",
|
||||
"redux-actions": "^2.6.5",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"ts-migrate": "^0.1.35",
|
||||
"url-polyfill": "^1.1.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.24.5",
|
||||
"@babel/plugin-transform-class-properties": "^7.24.1",
|
||||
"@babel/plugin-transform-nullish-coalescing-operator": "^7.24.1",
|
||||
"@babel/plugin-transform-object-rest-spread": "^7.24.5",
|
||||
"@babel/plugin-transform-optional-chaining": "^7.24.5",
|
||||
"@babel/plugin-transform-runtime": "^7.24.3",
|
||||
"@babel/preset-env": "^7.24.5",
|
||||
"@babel/preset-react": "^7.24.1",
|
||||
"@playwright/test": "1.50.1",
|
||||
"@storybook/addon-docs": "^9.0.18",
|
||||
"@storybook/addon-onboarding": "^9.0.18",
|
||||
"@storybook/addon-webpack5-compiler-swc": "^3.0.0",
|
||||
"@storybook/react-webpack5": "^9.0.18",
|
||||
"@types/lodash": "^4.17.4",
|
||||
"@types/node": "^22.13.10",
|
||||
"@types/react": "^17.0.80",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@types/react-redux": "^7.1.33",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@types/react-table": "^7.7.20",
|
||||
"@types/redux-actions": "^2.6.5",
|
||||
"@typescript-eslint/eslint-plugin": "^7.11.0",
|
||||
"@typescript-eslint/parser": "^7.10.0",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"babel-loader": "^9.1.3",
|
||||
"clean-webpack-plugin": "^4.0.0",
|
||||
"copy-webpack-plugin": "^12.0.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^7.1.2",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"eslint-plugin-react": "^7.34.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.2",
|
||||
"eslint-plugin-storybook": "^9.0.18",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-webpack-plugin": "^5.6.0",
|
||||
"jscodeshift": "^0.15.2",
|
||||
"mini-css-extract-plugin": "^2.9.0",
|
||||
"path": "^0.12.7",
|
||||
"postcss": "^8.5.6",
|
||||
"postcss-custom-media": "^11.0.6",
|
||||
"postcss-import": "^16.1.1",
|
||||
"postcss-loader": "^8.1.1",
|
||||
"postcss-nested": "^7.0.2",
|
||||
"prettier": "^3.2.5",
|
||||
"react-hot-loader": "^4.13.1",
|
||||
"storybook": "^9.0.18",
|
||||
"style-loader": "^4.0.0",
|
||||
"stylelint": "^16.5.0",
|
||||
"ts-loader": "^9.5.1",
|
||||
"url-loader": "^4.1.1",
|
||||
"user-agent-data-types": "^0.4.2",
|
||||
"vitest": "^3.1.1",
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^5.0.4",
|
||||
"webpack-merge": "^5.10.0"
|
||||
},
|
||||
"browserslist": {
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
],
|
||||
"production": [
|
||||
">1%",
|
||||
"last 4 chrome version",
|
||||
"last 4 firefox version",
|
||||
"last 4 safari version",
|
||||
"firefox esr",
|
||||
"not ie < 9"
|
||||
]
|
||||
}
|
||||
"name": "dashboard",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build-dev": "cross-env NODE_ENV=development BUILD_ENV=dev webpack --config webpack.dev.js",
|
||||
"build-prod": "cross-env BUILD_ENV=prod webpack --config webpack.prod.js",
|
||||
"watch": "cross-env BUILD_ENV=dev webpack --config webpack.dev.js --watch",
|
||||
"watch:hot": "cross-env BUILD_ENV=dev webpack-dev-server --config webpack.dev.js",
|
||||
"lint": "eslint --ext .ts,.tsx src",
|
||||
"lint:fix": "eslint --ext .ts,.tsx src --fix",
|
||||
"test": "vitest --run",
|
||||
"test:watch": "vitest --watch",
|
||||
"test:e2e": "npx playwright test tests/e2e",
|
||||
"test:e2e:interactive": "npx playwright test --ui",
|
||||
"test:e2e:debug": "npx playwright test --debug",
|
||||
"test:e2e:codegen": "npx playwright codegen",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"typecheck:watch": "tsc --noEmit --watch",
|
||||
"storybook": "storybook dev -p 6006",
|
||||
"build-storybook": "storybook build"
|
||||
},
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@adguard/translate": "^1.0.2",
|
||||
"axios": "^0.19.2",
|
||||
"clsx": "^2.1.1",
|
||||
"countries-and-timezones": "^3.6.0",
|
||||
"date-fns": "^1.29.0",
|
||||
"i18next": "^19.6.2",
|
||||
"i18next-browser-languagedetector": "^4.2.0",
|
||||
"ipaddr.js": "^1.9.1",
|
||||
"js-yaml": "^3.14.0",
|
||||
"lodash": "^4.17.19",
|
||||
"nanoid": "^3.1.9",
|
||||
"prop-types": "^15.8.1",
|
||||
"qs": "^6.14.0",
|
||||
"rc-dialog": "^10.0.0",
|
||||
"rc-dropdown": "^4.2.1",
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-hook-form": "^7.54.0",
|
||||
"react-i18next": "^11.7.2",
|
||||
"react-modal": "^3.11.2",
|
||||
"react-redux": "^7.2.0",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"react-select": "^5.3.2",
|
||||
"react-table": "^6.11.4",
|
||||
"react-transition-group": "^4.4.5",
|
||||
"redux": "^4.0.5",
|
||||
"redux-actions": "^2.6.5",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"url-polyfill": "^1.1.12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.24.5",
|
||||
"@babel/plugin-transform-class-properties": "^7.24.1",
|
||||
"@babel/plugin-transform-nullish-coalescing-operator": "^7.24.1",
|
||||
"@babel/plugin-transform-object-rest-spread": "^7.24.5",
|
||||
"@babel/plugin-transform-optional-chaining": "^7.24.5",
|
||||
"@babel/plugin-transform-runtime": "^7.24.3",
|
||||
"@babel/preset-env": "^7.24.5",
|
||||
"@babel/preset-react": "^7.24.1",
|
||||
"@playwright/test": "1.50.1",
|
||||
"@storybook/addon-docs": "^9.0.18",
|
||||
"@storybook/addon-webpack5-compiler-swc": "^3.0.0",
|
||||
"@storybook/react-webpack5": "^9.0.18",
|
||||
"@types/lodash": "^4.17.4",
|
||||
"@types/node": "^22.13.10",
|
||||
"@types/react": "^17.0.80",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@types/react-redux": "^7.1.33",
|
||||
"@types/react-router-dom": "^5.3.3",
|
||||
"@types/react-table": "^7.7.20",
|
||||
"@types/redux-actions": "^2.6.5",
|
||||
"@typescript-eslint/eslint-plugin": "^7.11.0",
|
||||
"@typescript-eslint/parser": "^7.10.0",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"babel-loader": "^9.1.3",
|
||||
"clean-webpack-plugin": "^4.0.0",
|
||||
"copy-webpack-plugin": "^12.0.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^7.1.2",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.8.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"eslint-plugin-react": "^7.34.1",
|
||||
"eslint-plugin-react-hooks": "^4.6.2",
|
||||
"eslint-plugin-storybook": "^9.0.18",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-webpack-plugin": "^5.6.0",
|
||||
"jscodeshift": "^0.15.2",
|
||||
"mini-css-extract-plugin": "^2.9.0",
|
||||
"path": "^0.12.7",
|
||||
"postcss": "^8.5.6",
|
||||
"postcss-custom-media": "^11.0.6",
|
||||
"postcss-import": "^16.1.1",
|
||||
"postcss-loader": "^8.1.1",
|
||||
"postcss-nested": "^7.0.2",
|
||||
"prettier": "^3.2.5",
|
||||
"react-hot-loader": "^4.13.1",
|
||||
"storybook": "^9.0.18",
|
||||
"style-loader": "^4.0.0",
|
||||
"stylelint": "^16.5.0",
|
||||
"ts-loader": "^9.5.1",
|
||||
"url-loader": "^4.1.1",
|
||||
"user-agent-data-types": "^0.4.2",
|
||||
"vitest": "^3.1.1",
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^5.0.4",
|
||||
"webpack-merge": "^5.10.0"
|
||||
},
|
||||
"browserslist": {
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
],
|
||||
"production": [
|
||||
">1%",
|
||||
"last 4 chrome version",
|
||||
"last 4 firefox version",
|
||||
"last 4 safari version",
|
||||
"firefox esr",
|
||||
"not ie < 9"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
2063
client_v2/pnpm-lock.yaml
generated
2063
client_v2/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import i18next from 'i18next';
|
||||
|
||||
import apiClient from '../api/Api';
|
||||
import { apiClient } from '../api/Api';
|
||||
import { addErrorToast, addSuccessToast } from './toasts';
|
||||
|
||||
import { splitByNewLine } from '../helpers/helpers';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import i18next from 'i18next';
|
||||
import apiClient from '../api/Api';
|
||||
import { apiClient } from '../api/Api';
|
||||
|
||||
import { getClients } from './index';
|
||||
import { addErrorToast, addSuccessToast } from './toasts';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import i18next from 'i18next';
|
||||
|
||||
import apiClient from '../api/Api';
|
||||
import { apiClient } from '../api/Api';
|
||||
|
||||
import { splitByNewLine } from '../helpers/helpers';
|
||||
import { addErrorToast, addSuccessToast } from './toasts';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import apiClient from '../api/Api';
|
||||
import { apiClient } from '../api/Api';
|
||||
|
||||
import { redirectToCurrentProtocol } from '../helpers/helpers';
|
||||
import { addErrorToast, addSuccessToast } from './toasts';
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import { showLoading, hideLoading } from 'react-redux-loading-bar';
|
||||
import i18next from 'i18next';
|
||||
|
||||
import { normalizeFilteringStatus, normalizeRulesTextarea } from '../helpers/helpers';
|
||||
import apiClient from '../api/Api';
|
||||
import { apiClient } from '../api/Api';
|
||||
import { addErrorToast, addSuccessToast } from './toasts';
|
||||
|
||||
export const toggleFilteringModal = createAction('FILTERING_MODAL_TOGGLE');
|
||||
@@ -133,7 +132,6 @@ export const refreshFiltersSuccess = createAction('FILTERING_REFRESH_SUCCESS');
|
||||
|
||||
export const refreshFilters = (config: any) => async (dispatch: any) => {
|
||||
dispatch(refreshFiltersRequest());
|
||||
dispatch(showLoading());
|
||||
try {
|
||||
const data = await apiClient.refreshFilters(config);
|
||||
const { updated } = data;
|
||||
@@ -146,11 +144,9 @@ export const refreshFilters = (config: any) => async (dispatch: any) => {
|
||||
}
|
||||
|
||||
dispatch(getFilteringStatus());
|
||||
dispatch(hideLoading());
|
||||
} catch (error) {
|
||||
dispatch(addErrorToast({ error }));
|
||||
dispatch(refreshFiltersFailure());
|
||||
dispatch(hideLoading());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
} from '../helpers/constants';
|
||||
import { areEqualVersions } from '../helpers/version';
|
||||
import { getTlsStatus } from './encryption';
|
||||
import apiClient from '../api/Api';
|
||||
import { apiClient } from '../api/Api';
|
||||
import { addErrorToast, addNoticeToast, addSuccessToast } from './toasts';
|
||||
import { getFilteringStatus, setRules } from './filtering';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import apiClient from '../api/Api';
|
||||
import { apiClient } from '../api/Api';
|
||||
import { addErrorToast, addSuccessToast } from './toasts';
|
||||
|
||||
export const nextStep = createAction('NEXT_STEP');
|
||||
@@ -49,11 +49,13 @@ export const checkConfig = (values: any) => async (dispatch: any) => {
|
||||
dispatch(checkConfigRequest());
|
||||
try {
|
||||
const check = await apiClient.checkConfig(values);
|
||||
dispatch(checkConfigSuccess({
|
||||
web: { ...values.web, ...check.web },
|
||||
dns: { ...values.dns, ...check.dns },
|
||||
static_ip: check.static_ip,
|
||||
}));
|
||||
dispatch(
|
||||
checkConfigSuccess({
|
||||
web: { ...values.web, ...check.web },
|
||||
dns: { ...values.dns, ...check.dns },
|
||||
static_ip: check.static_ip,
|
||||
}),
|
||||
);
|
||||
} catch (error) {
|
||||
dispatch(addErrorToast({ error }));
|
||||
dispatch(checkConfigFailure());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
|
||||
import apiClient from '../api/Api';
|
||||
import { apiClient } from '../api/Api';
|
||||
import { addErrorToast } from './toasts';
|
||||
import { HTML_PAGES } from '../helpers/constants';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
|
||||
import apiClient from '../api/Api';
|
||||
import { apiClient } from '../api/Api';
|
||||
|
||||
import { normalizeLogs } from '../helpers/helpers';
|
||||
import { DEFAULT_LOGS_FILTER, QUERY_LOGS_PAGE_LIMIT } from '../helpers/constants';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import i18next from 'i18next';
|
||||
import apiClient from '../api/Api';
|
||||
import { apiClient } from '../api/Api';
|
||||
import { addErrorToast, addSuccessToast } from './toasts';
|
||||
|
||||
export const toggleRewritesModal = createAction('TOGGLE_REWRITES_MODAL');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
import apiClient from '../api/Api';
|
||||
import { apiClient } from '../api/Api';
|
||||
import { addErrorToast, addSuccessToast } from './toasts';
|
||||
|
||||
export const getBlockedServicesRequest = createAction('GET_BLOCKED_SERVICES_REQUEST');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createAction } from 'redux-actions';
|
||||
|
||||
import apiClient from '../api/Api';
|
||||
import { apiClient } from '../api/Api';
|
||||
import { normalizeTopStats, secondsToMilliseconds, getParamsForClientsSearch, addClientInfo } from '../helpers/helpers';
|
||||
import { addErrorToast, addSuccessToast } from './toasts';
|
||||
|
||||
|
||||
@@ -8,7 +8,11 @@ import i18n from '../i18n';
|
||||
import { LANGUAGES } from '../helpers/twosky';
|
||||
|
||||
class Api {
|
||||
baseUrl = BASE_URL;
|
||||
baseUrl: string;
|
||||
|
||||
constructor(baseUrl: string) {
|
||||
this.baseUrl = baseUrl;
|
||||
}
|
||||
|
||||
async makeRequest(path: any, method = 'POST', config: any = {}) {
|
||||
const url = `${this.baseUrl}/${path}`;
|
||||
@@ -690,5 +694,4 @@ class Api {
|
||||
}
|
||||
}
|
||||
|
||||
const apiClient = new Api();
|
||||
export default apiClient;
|
||||
export const apiClient = new Api(BASE_URL);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { ClearIndicatorProps } from 'react-select';
|
||||
import { Icon } from 'panel/common/ui';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
export const CustomClearIndicator = <OptionType extends Record<string, any> = any, IsMulti extends boolean = false>(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { DropdownIndicatorProps } from 'react-select';
|
||||
import cn from 'clsx';
|
||||
import { Icon } from 'panel/common/ui';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
export const CustomDropdownIndicator = <OptionType extends Record<string, any> = any, IsMulti extends boolean = false>(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { Loader } from 'panel/common/ui';
|
||||
import { Loader } from 'panel/common/ui/Loader';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
export const CustomLoadingIndicator = () => (
|
||||
|
||||
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import { components, GroupBase, NoticeProps } from 'react-select';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
import { Loader } from 'panel/common/ui';
|
||||
import { Loader } from 'panel/common/ui/Loader';
|
||||
|
||||
export const CustomLoadingMessage = <
|
||||
Option,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { GroupBase, OptionProps } from 'react-select';
|
||||
import cn from 'clsx';
|
||||
import { Icon } from 'panel/common/ui';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
export const CustomOption = <
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import cn from 'clsx';
|
||||
import { Icon } from 'panel/common/ui';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
type Props = {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
import cn from 'clsx';
|
||||
import intl from 'panel/common/intl';
|
||||
import { Icon, Loader } from 'panel/common/ui';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
import { Loader } from 'panel/common/ui/Loader';
|
||||
import { IOption } from 'panel/lib/helpers/utils';
|
||||
import theme from 'panel/lib/theme';
|
||||
import { ISelectValue } from './Select';
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
export { Checkbox } from './Checkbox';
|
||||
export { Input } from './Input';
|
||||
export { Radio } from './Radio';
|
||||
export { Textarea } from './Textarea';
|
||||
export { Switch } from './Switch';
|
||||
export { Select } from './Select';
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import cn from 'clsx';
|
||||
import { Icon, Link } from 'panel/common/ui';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
import { Link } from 'panel/common/ui/Link';
|
||||
import { RoutePathKey } from 'panel/components/Routes/Paths';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { ReactNode } from 'react';
|
||||
import cn from 'clsx';
|
||||
import { Button, ButtonProps, Dialog } from 'panel/common/ui';
|
||||
import { Button, ButtonProps } from 'panel/common/ui/Button';
|
||||
import { Dialog } from 'panel/common/ui/Dialog';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
import s from './ConfirmDialog.module.pcss';
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import React, { type ReactNode } from 'react';
|
||||
import RCDialog from 'rc-dialog';
|
||||
import cn from 'clsx';
|
||||
|
||||
import { Icon } from 'panel/common/ui';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
import './Dialog.pcss';
|
||||
@@ -13,36 +12,17 @@ type Props = {
|
||||
className?: string;
|
||||
onClose: () => void;
|
||||
title?: ReactNode;
|
||||
dark?: boolean;
|
||||
minHeight?: boolean;
|
||||
wrapClassName?: string;
|
||||
children?: ReactNode;
|
||||
};
|
||||
|
||||
export const Dialog = ({
|
||||
children,
|
||||
className,
|
||||
onClose,
|
||||
visible,
|
||||
title,
|
||||
mask = true,
|
||||
dark,
|
||||
minHeight,
|
||||
wrapClassName,
|
||||
}: Props) => {
|
||||
const dialogClass = cn(
|
||||
{
|
||||
'dark-mode': dark,
|
||||
'min-height': minHeight,
|
||||
},
|
||||
className,
|
||||
);
|
||||
export const Dialog = ({ children, className, onClose, visible, title, mask = true, wrapClassName }: Props) => {
|
||||
return (
|
||||
<RCDialog
|
||||
title={title}
|
||||
visible={visible}
|
||||
mask={mask}
|
||||
className={dialogClass}
|
||||
className={className}
|
||||
onClose={onClose}
|
||||
closeIcon={<Icon className={theme.dialog.close} icon="cross" />}
|
||||
classNames={{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { ReactNode, useEffect, useRef, useState } from 'react';
|
||||
import cn from 'clsx';
|
||||
import { Icon } from 'panel/common/ui';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
import RCDropdown from 'rc-dropdown';
|
||||
|
||||
import './Dropdown.pcss';
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import React, { useState, useEffect, useCallback, useMemo } from 'react';
|
||||
import React, { useState, useMemo } from 'react';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import cn from 'classnames';
|
||||
import cn from 'clsx';
|
||||
|
||||
import theme from 'panel/lib/theme';
|
||||
import { Dropdown, Icon } from 'panel/common/ui';
|
||||
import { Dropdown } from 'panel/common/ui/Dropdown';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
|
||||
import { REPOSITORY, PRIVACY_POLICY_LINK, THEMES } from '../../../helpers/constants';
|
||||
import { LANGUAGES } from '../../../helpers/twosky';
|
||||
@@ -60,11 +61,13 @@ export const Footer = () => {
|
||||
|
||||
if (activeTheme === THEMES.auto) {
|
||||
return 'theme_auto';
|
||||
} else if (activeTheme === THEMES.dark) {
|
||||
return 'theme_dark';
|
||||
} else {
|
||||
return 'theme_light';
|
||||
}
|
||||
|
||||
if (activeTheme === THEMES.dark) {
|
||||
return 'theme_dark';
|
||||
}
|
||||
|
||||
return 'theme_light';
|
||||
};
|
||||
|
||||
const changeLanguage = (newLang: LocalesType) => {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import React, { MouseEvent, useState } from 'react';
|
||||
import cn from 'clsx';
|
||||
import { Icon, Link, Menu } from 'panel/common/ui';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
import { Link } from 'panel/common/ui/Link';
|
||||
import { Menu } from 'panel/common/ui/Menu';
|
||||
import { RoutePath } from 'panel/components/Routes/Paths';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import cn from 'clsx';
|
||||
import { Icon, IconType } from 'panel/common/ui';
|
||||
import { Icon, IconType } from 'panel/common/ui/Icon';
|
||||
|
||||
import s from './Loader.module.pcss';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import cn from 'clsx';
|
||||
import { Icon, IconType } from 'panel/common/ui';
|
||||
import { Icon, IconType } from 'panel/common/ui/Icon';
|
||||
|
||||
import s from './Loader.module.pcss';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import cn from 'clsx';
|
||||
import { Icon, Link, IconType } from 'panel/common/ui';
|
||||
import { Icon, IconType } from 'panel/common/ui/Icon';
|
||||
import { Link } from 'panel/common/ui/Link';
|
||||
import { RoutePathKey } from 'panel/components/Routes/Paths';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import React from 'react';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import cn from 'clsx';
|
||||
import { Icon, Link } from 'panel/common/ui';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
import { Link } from 'panel/common/ui/Link';
|
||||
import { Paths, RoutePath } from 'panel/components/Routes/Paths';
|
||||
import theme from 'panel/lib/theme';
|
||||
import intl from 'panel/common/intl';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import React, { useContext, useState } from 'react';
|
||||
import { Icon, Link } from 'panel/common/ui';
|
||||
import React, { useState } from 'react';
|
||||
import { Link } from 'panel/common/ui/Link';
|
||||
import { Menu } from 'panel/common/ui/Menu';
|
||||
import { RoutePath } from 'panel/components/Routes/Paths';
|
||||
|
||||
import s from './styles.module.pcss';
|
||||
import { Menu } from '../Menu/Menu';
|
||||
import { Logo } from './Logo';
|
||||
|
||||
export const Sidebar = () => {
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
export { Button, ButtonProps } from './Button';
|
||||
export { ConfirmDialog } from './ConfirmDialog';
|
||||
export { Icon, IconType } from './Icon';
|
||||
export { Dialog } from './Dialog';
|
||||
export { Link } from './Link';
|
||||
export { Dropdown } from './Dropdown';
|
||||
export { Breadcrumbs } from './Breadcrumbs';
|
||||
export { Sidebar, Logo } from './Sidebar';
|
||||
export { Icons } from './Icons';
|
||||
export { Footer } from './Footer';
|
||||
export { Menu } from './Menu';
|
||||
export { Header } from './Header';
|
||||
export { Loader, InlineLoader } from './Loader';
|
||||
@@ -3,7 +3,10 @@ import React, { useEffect } from 'react';
|
||||
import { HashRouter, Route } from 'react-router-dom';
|
||||
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
||||
|
||||
import { Sidebar, Icons, Footer, Header } from 'panel/common/ui';
|
||||
import { Sidebar } from 'panel/common/ui/Sidebar';
|
||||
import { Icons } from 'panel/common/ui/Icons';
|
||||
import { Footer } from 'panel/common/ui/Footer';
|
||||
import { Header } from 'panel/common/ui/Header';
|
||||
|
||||
import Toasts from '../Toasts';
|
||||
import i18n from '../../i18n';
|
||||
|
||||
@@ -5,7 +5,7 @@ import round from 'lodash/round';
|
||||
import axios from 'axios';
|
||||
import i18n from 'i18next';
|
||||
import ipaddr, { IPv4, IPv6 } from 'ipaddr.js';
|
||||
import queryString from 'query-string';
|
||||
import queryString from 'qs';
|
||||
import React from 'react';
|
||||
import { getTrackerData } from './trackers/trackers';
|
||||
|
||||
@@ -675,9 +675,7 @@ export const formatElapsedMs = (elapsedMs: string, t: (key: string) => string) =
|
||||
return elapsedMs;
|
||||
}
|
||||
|
||||
const formattedValue = parsedElapsedMs < 1
|
||||
? parsedElapsedMs.toFixed(2)
|
||||
: Math.floor(parsedElapsedMs).toString();
|
||||
const formattedValue = parsedElapsedMs < 1 ? parsedElapsedMs.toFixed(2) : Math.floor(parsedElapsedMs).toString();
|
||||
|
||||
return `${formattedValue} ${t('milliseconds_abbreviation')}`;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import classnames from 'clsx';
|
||||
import { COMMENT_LINE_DEFAULT_TOKEN } from './constants';
|
||||
|
||||
const renderHighlightedLine = (line: any, idx: any, commentLineTokens = [COMMENT_LINE_DEFAULT_TOKEN]) => {
|
||||
|
||||
@@ -390,7 +390,6 @@ export type RootState = {
|
||||
stats?: StatsData;
|
||||
install?: InstallData;
|
||||
toasts: { notices: any[] };
|
||||
loadingBar: any;
|
||||
};
|
||||
|
||||
export type InstallState = {
|
||||
@@ -615,5 +614,4 @@ export const initialState: RootState = {
|
||||
topUpstreamsResponses: [],
|
||||
},
|
||||
toasts: { notices: [] },
|
||||
loadingBar: {},
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { combineReducers } from 'redux';
|
||||
import { loadingBarReducer } from 'react-redux-loading-bar';
|
||||
|
||||
import toasts from './toasts';
|
||||
import encryption from './encryption';
|
||||
@@ -29,5 +28,4 @@ export default combineReducers({
|
||||
services,
|
||||
stats,
|
||||
dnsConfig,
|
||||
loadingBar: loadingBarReducer,
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from 'react';
|
||||
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
||||
import { Checkbox } from '../../common/controls';
|
||||
import { Checkbox } from 'panel/common/controls/Checkbox';
|
||||
|
||||
const meta: Meta<typeof Checkbox> = {
|
||||
title: 'Controls/Checkbox',
|
||||
@@ -127,7 +127,8 @@ export const PlusStyleChecked: Story = {
|
||||
export const WithOverflow: Story = {
|
||||
render: CheckboxWithState,
|
||||
args: {
|
||||
children: 'This is a very long label text that should demonstrate the overflow behavior when the text is too long to fit in the available space',
|
||||
children:
|
||||
'This is a very long label text that should demonstrate the overflow behavior when the text is too long to fit in the available space',
|
||||
overflow: true,
|
||||
id: 'overflow-checkbox',
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
||||
import { Input } from '../../common/controls';
|
||||
import { Icon } from 'panel/common/ui';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
import { Input } from 'panel/common/controls/Input';
|
||||
|
||||
const meta: Meta<typeof Input> = {
|
||||
title: 'Controls/Input',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from 'react';
|
||||
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
||||
import { Radio } from '../../common/controls';
|
||||
import { Radio } from 'panel/common/controls/Radio';
|
||||
|
||||
const meta: Meta<typeof Radio> = {
|
||||
title: 'Controls/Radio',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
||||
import { Select } from '../../common/controls';
|
||||
import { Select } from 'panel/common/controls/Select';
|
||||
|
||||
const meta: Meta<typeof Select> = {
|
||||
title: 'Controls/Select',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from 'react';
|
||||
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
||||
import { Switch } from '../../common/controls';
|
||||
import { Switch } from 'panel/common/controls/Switch';
|
||||
|
||||
const SwitchWrapper = (props: any) => {
|
||||
const [checked, setChecked] = useState(props.checked || false);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
||||
import { Textarea } from '../../common/controls';
|
||||
import { Textarea } from 'panel/common/controls/Textarea';
|
||||
|
||||
const meta: Meta<typeof Textarea> = {
|
||||
title: 'Controls/Textarea',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
||||
import { Button } from '../../common/ui';
|
||||
import { Button } from 'panel/common/ui/Button';
|
||||
|
||||
const meta: Meta<typeof Button> = {
|
||||
title: 'UI/Button',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useState } from 'react';
|
||||
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
||||
import { ConfirmDialog } from '../../common/ui';
|
||||
import { Button } from '../../common/ui';
|
||||
import { ConfirmDialog } from 'panel/common/ui/ConfirmDialog';
|
||||
import { Button } from 'panel/common/ui/Button';
|
||||
|
||||
const meta: Meta<typeof ConfirmDialog> = {
|
||||
title: 'UI/ConfirmDialog',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
||||
import { Dropdown } from '../../common/ui';
|
||||
import { Dropdown } from 'panel/common/ui/Dropdown';
|
||||
import theme from 'panel/lib/theme';
|
||||
|
||||
const meta: Meta<typeof Dropdown> = {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
||||
import { ICON_VALUES } from '../../common/ui/Icons';
|
||||
import { Icon } from '../../common/ui';
|
||||
import { ICON_VALUES } from 'panel/common/ui/Icons';
|
||||
import { Icon } from 'panel/common/ui/Icon';
|
||||
|
||||
import s from './Icons.module.pcss';
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
||||
import { Loader, InlineLoader, Button } from '../../common/ui';
|
||||
import { Loader, InlineLoader } from 'panel/common/ui/Loader';
|
||||
import { Button } from 'panel/common/ui/Button';
|
||||
|
||||
const meta: Meta<typeof Loader> = {
|
||||
title: 'UI/Loader',
|
||||
|
||||
Reference in New Issue
Block a user