This commit is contained in:
Ildar Kamalov
2025-08-11 12:40:49 +03:00
parent 87eb68e519
commit d0cf6ad5ab
23 changed files with 45 additions and 47 deletions

View File

@@ -1,11 +1,10 @@
import { createAction } from 'redux-actions';
import i18next from 'i18next';
import intl from 'panel/common/intl';
import { apiClient } from '../api/Api';
import { splitByNewLine } from '../helpers/helpers';
import { addErrorToast, addSuccessToast } from './toasts';
import intl from 'panel/common/intl';
export const getDnsConfigRequest = createAction('GET_DNS_CONFIG_REQUEST');
export const getDnsConfigFailure = createAction('GET_DNS_CONFIG_FAILURE');

View File

@@ -1,9 +1,9 @@
import { createAction } from 'redux-actions';
import intl from 'panel/common/intl';
import { apiClient } from '../api/Api';
import { redirectToCurrentProtocol } from '../helpers/helpers';
import { addErrorToast, addSuccessToast } from './toasts';
import intl from 'panel/common/intl';
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');

View File

@@ -6,6 +6,8 @@ import endsWith from 'lodash/endsWith';
import escapeRegExp from 'lodash/escapeRegExp';
import React from 'react';
import { compose } from 'redux';
import type { Dispatch } from 'redux';
import intl from 'panel/common/intl';
import {
splitByNewLine,
sortClients,
@@ -27,18 +29,16 @@ import { getTlsStatus } from './encryption';
import { apiClient } from '../api/Api';
import { addErrorToast, addNoticeToast, addSuccessToast } from './toasts';
import { getFilteringStatus, setRules } from './filtering';
import type { Dispatch } from 'redux';
import intl from 'panel/common/intl';
export const toggleSettingStatus = createAction<{
settingKey: keyof typeof SETTINGS_NAMES;
value?: boolean | SafeSearchConfig;
}>('SETTING_STATUS_TOGGLE');
export const showSettingsFailure = createAction('SETTINGS_FAILURE_SHOW');
type SafeSearchConfig = Record<string, boolean> & { enabled: boolean };
type ToggleSettingKey = keyof typeof SETTINGS_NAMES;
export const toggleSettingStatus = createAction<{
settingKey: ToggleSettingKey;
value?: boolean | SafeSearchConfig;
}>('SETTING_STATUS_TOGGLE');
export const showSettingsFailure = createAction('SETTINGS_FAILURE_SHOW');
/**
*
* @param {*} settingKey = SETTINGS_NAMES

View File

@@ -1,11 +1,11 @@
import { createAction } from 'redux-actions';
import intl from 'panel/common/intl';
import { apiClient } from '../api/Api';
import { normalizeLogs } from '../helpers/helpers';
import { DEFAULT_LOGS_FILTER, QUERY_LOGS_PAGE_LIMIT } from '../helpers/constants';
import { addErrorToast, addSuccessToast } from './toasts';
import intl from 'panel/common/intl';
type SearchFormValues = {
search: string;

View File

@@ -1,9 +1,9 @@
import { createAction } from 'redux-actions';
import intl from 'panel/common/intl';
import { apiClient } from '../api/Api';
import { normalizeTopStats, secondsToMilliseconds, getParamsForClientsSearch, addClientInfo } from '../helpers/helpers';
import { addErrorToast, addSuccessToast } from './toasts';
import intl from 'panel/common/intl';
export const getStatsConfigRequest = createAction('GET_STATS_CONFIG_REQUEST');
export const getStatsConfigFailure = createAction('GET_STATS_CONFIG_FAILURE');

View File

@@ -1,4 +1,4 @@
import React, { ChangeEvent, ComponentProps, MouseEvent, ReactNode } from 'react';
import React, { ComponentProps, MouseEvent, ReactNode } from 'react';
import cn from 'clsx';
import theme from 'panel/lib/theme';
import { Icon } from 'panel/common/ui/Icon';

View File

@@ -1,4 +1,4 @@
import React, { ChangeEvent, ComponentProps, forwardRef, type ReactNode, useState } from 'react';
import React, { ComponentProps, forwardRef, type ReactNode, useState } from 'react';
import cn from 'clsx';
import s from './Input.module.pcss';

View File

@@ -1,8 +1,8 @@
import React from 'react';
import cn from 'clsx';
import s from './Radio.module.pcss';
import { Icon } from 'panel/common/ui/Icon';
import s from './Radio.module.pcss';
type Props<T> = {
className?: string;

View File

@@ -22,8 +22,8 @@ export type ISelectValue<T, Multi extends boolean> = Multi extends true ? IOptio
const CustomMenuList = <
T,
Multi extends boolean,
Group extends GroupBase<IOption<T> & ExtendOption>,
ExtendOption extends Record<string, any>,
Group extends GroupBase<IOption<T> & ExtendOption>,
>(
props: MenuListProps<IOption<T> & ExtendOption, Multi, Group>,
): React.ReactElement => {
@@ -45,8 +45,8 @@ const CustomMenuList = <
interface SelectProps<
T,
Multi extends boolean,
Group extends GroupBase<IOption<T> & ExtendOption>,
ExtendOption extends Record<string, any>,
Group extends GroupBase<IOption<T> & ExtendOption>,
> {
size?: ISelectSize;
height?: ISelectHeight;
@@ -84,7 +84,7 @@ interface SelectProps<
export const Select = <
T,
Multi extends boolean = false,
ExtendOption extends Record<any, any> = {},
ExtendOption extends Record<any, any> = object,
Group extends GroupBase<IOption<T> & ExtendOption> = GroupBase<IOption<T> & ExtendOption>,
>({
autoFocus,
@@ -118,7 +118,7 @@ export const Select = <
isDropdownSelect,
onMenuOpen,
onMenuClose,
}: SelectProps<T, Multi, Group, ExtendOption>) => {
}: SelectProps<T, Multi, ExtendOption, Group>) => {
const selectClass = cn(
{ 'desktop-select-always': mobile === false },
{ 'mobile-select-always': mobile },

View File

@@ -51,4 +51,4 @@ export const Switch = forwardRef(
},
);
export default Switch;
Switch.displayName = 'Switch';

View File

@@ -53,3 +53,5 @@ export const Textarea = forwardRef<HTMLTextAreaElement, Props>(
</div>
),
);
Textarea.displayName = 'Textarea';

View File

@@ -5,6 +5,7 @@ import cn from 'clsx';
import theme from 'panel/lib/theme';
import { Dropdown } from 'panel/common/ui/Dropdown';
import { Icon } from 'panel/common/ui/Icon';
import intl, { LocalesType } from 'panel/common/intl';
import { REPOSITORY, PRIVACY_POLICY_LINK, THEMES } from '../../../helpers/constants';
import { LANGUAGES } from '../../../helpers/twosky';
@@ -13,7 +14,6 @@ import { changeTheme, changeLanguage as changeLanguageAction } from '../../../ac
import { RootState } from '../../../initialState';
import s from './styles.module.pcss';
import intl, { LocalesType } from 'panel/common/intl';
const linksData = [
{

View File

@@ -328,23 +328,23 @@ export const Icons = memo(() => (
r="9"
transform="matrix(1 0 0 -1 3 21)"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M12 8V14"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M11.997 16.4045C12.009 16.4025 11.997 16.5955 11.997 16.5955"
stroke="currentColor"
stroke-width="1.5"
stroke-linecap="round"
stroke-linejoin="round"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</symbol>
</svg>

View File

@@ -36,7 +36,7 @@ export const Menu = ({ headerMenu }: Props) => {
return false;
}
const normalizedPath = p.endsWith('/') ? p : p + '/';
const normalizedPath = p.endsWith('/') ? p : `${p}/`;
return currentPath.startsWith(normalizedPath);
});
};

View File

@@ -7,18 +7,16 @@ 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 Settings from 'panel/containers/Settings';
import Toasts from '../Toasts';
import i18n from '../../i18n';
import { THEMES } from '../../helpers/constants';
import { setHtmlLangAttr, setUITheme } from '../../helpers/helpers';
import { changeLanguage, getDnsStatus, getTimerStatus } from '../../actions';
import { RootState } from '../../initialState';
import s from './styles.module.pcss';
import Settings from 'panel/containers/Settings';
type RouteConfig = {
path: string;

View File

@@ -3,16 +3,15 @@ import { Controller, type Control, type UseFormSetValue } from 'react-hook-form'
import cn from 'clsx';
import { Textarea } from 'panel/common/controls/Textarea';
import { SwitchGroup } from '../SettingsGroup';
import intl from 'panel/common/intl';
import { trimLinesAndRemoveEmpty } from 'panel/helpers/helpers';
import s from './styles.module.pcss';
import { Dropdown } from 'panel/common/ui/Dropdown';
import theme from 'panel/lib/theme';
import { Icon } from 'panel/common/ui/Icon';
import s from './styles.module.pcss';
import { SwitchGroup } from '../SettingsGroup';
type Props = {
control: Control<any>;
processing: boolean;

View File

@@ -1,10 +1,10 @@
import React, { useState } from 'react';
import { Form, FormValues } from './Form';
import { ConfirmDialog } from 'panel/common/ui/ConfirmDialog';
import intl from 'panel/common/intl';
import { HOUR } from 'panel/helpers/constants';
import { formatIntervalText } from 'panel/components/Settings/helpers';
import { Form, FormValues } from './Form';
export type LogsConfigPayload = {
enabled: boolean;

View File

@@ -1,10 +1,10 @@
import React, { useEffect } from 'react';
import { getIntervalTitle } from '../helpers';
import { Controller, useForm } from 'react-hook-form';
import { Button } from 'panel/common/ui/Button';
import intl from 'panel/common/intl';
import theme from 'panel/lib/theme';
import { getIntervalTitle } from '../helpers';
import { STATS_INTERVALS_DAYS, DAY, RETENTION_CUSTOM } from '../../../helpers/constants';
import { RadioGroup, SwitchGroup } from '../SettingsGroup';

View File

@@ -1,11 +1,11 @@
import React, { useEffect, useState } from 'react';
import { useDispatch } from 'react-redux';
import { Icon } from 'panel/common/ui/Icon';
import cn from 'clsx';
import { TOAST_TIMEOUTS } from '../../helpers/constants';
import { removeToast } from '../../actions';
import { Icon } from 'panel/common/ui/Icon';
import s from './styles.module.pcss';
import cn from 'clsx';
interface ToastProps {
id: string;

View File

@@ -1,9 +1,9 @@
import React from 'react';
import theme from 'panel/lib/theme';
import { getIpList, getDnsAddress, getWebAddress } from '../../helpers/helpers';
import { ALL_INTERFACES_IP } from '../../helpers/constants';
import { InstallInterface } from '../../initialState';
import theme from 'panel/lib/theme';
interface renderItemProps {
ip: string;

View File

@@ -1,9 +1,9 @@
import React from 'react';
import { Controller, useForm } from 'react-hook-form';
import { Trans, useTranslation } from 'react-i18next';
import { Input } from 'panel/common/controls/Input';
import Controls from './Controls';
import { validatePasswordLength, validateRequiredValue } from '../../helpers/validators';
import { Input } from 'panel/common/controls/Input';
type AuthFormValues = {
username: string;

View File

@@ -2,8 +2,8 @@ import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Trans } from 'react-i18next';
import * as actionCreators from '../../actions/install';
import { Button } from 'panel/common/ui/Button';
import * as actionCreators from '../../actions/install';
interface ControlsProps {
install: {

View File

@@ -3,6 +3,7 @@ import { useForm, Controller } from 'react-hook-form';
import { Trans, useTranslation } from 'react-i18next';
import i18n from 'i18next';
import { Input } from 'panel/common/controls/Input';
import Controls from './Controls';
import AddressList from './AddressList';
@@ -21,7 +22,6 @@ import {
import { validateRequiredValue } from '../../helpers/validators';
import { InstallInterface } from '../../initialState';
import { toNumber } from '../../helpers/form';
import { Input } from 'panel/common/controls/Input';
const validateInstallPort = (value: number) => {
if (value < MIN_PORT || value > MAX_PORT) {