This commit is contained in:
Haishan 2022-12-10 18:57:31 +08:00
parent 63f2af9d8f
commit bfd154b8f1
3 changed files with 7 additions and 8 deletions

View file

@ -266,13 +266,14 @@ function ConfigImpl({
</div> </div>
<div> <div>
<div className={s0.label}>{t('current_backend')} <div className={s0.label}>
{t('current_backend')}
<p>{apiConfig.baseURL}</p> <p>{apiConfig.baseURL}</p>
</div> </div>
<div className={s0.label}>Action</div> <div className={s0.label}>Action</div>
<Button <Button
start={<LogOut size={16} />} start={<LogOut size={16} />}
label={t("switch_backend")} label={t('switch_backend')}
onClick={openAPIConfigModal} onClick={openAPIConfigModal}
/> />
</div> </div>

View file

@ -12,12 +12,12 @@ import useRemainingViewPortHeight from '../hooks/useRemainingViewPortHeight';
import { getClashAPIConfig } from '../store/app'; import { getClashAPIConfig } from '../store/app';
import s from './Connections.module.scss'; import s from './Connections.module.scss';
import ConnectionTable from './ConnectionTable'; import ConnectionTable from './ConnectionTable';
import { MutableConnRefCtx } from './conns/ConnCtx';
import ContentHeader from './ContentHeader'; import ContentHeader from './ContentHeader';
import ModalCloseAllConnections from './ModalCloseAllConnections'; import ModalCloseAllConnections from './ModalCloseAllConnections';
import { Action, Fab, position as fabPosition } from './shared/Fab'; import { Action, Fab, position as fabPosition } from './shared/Fab';
import { connect } from './StateProvider'; import { connect } from './StateProvider';
import SvgYacd from './SvgYacd'; import SvgYacd from './SvgYacd';
import { MutableConnRefCtx } from './conns/ConnCtx';
const { useEffect, useState, useRef, useCallback } = React; const { useEffect, useState, useRef, useCallback } = React;
@ -138,9 +138,7 @@ function Conn({ apiConfig }) {
const openCloseAllModal = useCallback(() => setIsCloseAllModalOpen(true), []); const openCloseAllModal = useCallback(() => setIsCloseAllModalOpen(true), []);
const closeCloseAllModal = useCallback(() => setIsCloseAllModalOpen(false), []); const closeCloseAllModal = useCallback(() => setIsCloseAllModalOpen(false), []);
const [isRefreshPaused, setIsRefreshPaused] = useState(false); const [isRefreshPaused, setIsRefreshPaused] = useState(false);
const toggleIsRefreshPaused = useCallback(() => { const toggleIsRefreshPaused = useCallback(() => setIsRefreshPaused((x) => !x), []);
setIsRefreshPaused((x) => !x);
}, []);
const closeAllConnections = useCallback(() => { const closeAllConnections = useCallback(() => {
connAPI.closeAllConnections(apiConfig); connAPI.closeAllConnections(apiConfig);
closeCloseAllModal(); closeCloseAllModal();
@ -172,7 +170,7 @@ function Conn({ apiConfig }) {
prevConnsRef.current = x; prevConnsRef.current = x;
} }
}, },
[setConns, isRefreshPaused] [setConns, isRefreshPaused, connCtx]
); );
useEffect(() => { useEffect(() => {
return connAPI.fetchData(apiConfig, read); return connAPI.fetchData(apiConfig, read);

View file

@ -27,7 +27,7 @@ export const data = {
Connections: 'Connections', Connections: 'Connections',
current_backend: 'Current Backend', current_backend: 'Current Backend',
Active: 'Active', Active: 'Active',
switch_backend: 'Switch backend"', switch_backend: 'Switch backend',
Closed: 'Closed', Closed: 'Closed',
switch_theme: 'Switch theme', switch_theme: 'Switch theme',
theme: 'theme', theme: 'theme',