mirror of
https://github.com/woodchen-ink/clash-and-dashboard.git
synced 2025-07-18 14:01:56 +08:00
Chore: cleanup code
This commit is contained in:
parent
d193373419
commit
c9c0ecd37f
@ -17,8 +17,7 @@ export class Switch extends React.Component<SwitchProps, {}> {
|
|||||||
onChange: () => {}
|
onChange: () => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleClick = (e: React.MouseEvent<HTMLElement>) => {
|
handleClick = () => {
|
||||||
e.stopPropagation()
|
|
||||||
if (!this.props.disabled) {
|
if (!this.props.disabled) {
|
||||||
this.props.onChange(!this.props.checked)
|
this.props.onChange(!this.props.checked)
|
||||||
}
|
}
|
||||||
|
@ -3,12 +3,11 @@ import { Route } from 'react-router-dom'
|
|||||||
import { I18nProps } from '@i18n'
|
import { I18nProps } from '@i18n'
|
||||||
import './App.scss'
|
import './App.scss'
|
||||||
|
|
||||||
import Overview from '@views/Overview'
|
import Overview from '@containers/Overview'
|
||||||
import Proxies from '@views/Proxies'
|
import Proxies from '@containers/Proxies'
|
||||||
import Logs from '@views/Logs'
|
import Logs from '@containers/Logs'
|
||||||
import Rules from '@views/Rules'
|
import Rules from '@containers/Rules'
|
||||||
import Settings from '@views/Settings'
|
import Settings from '@containers/Settings'
|
||||||
|
|
||||||
import SlideBar from '@containers/Sidebar'
|
import SlideBar from '@containers/Sidebar'
|
||||||
|
|
||||||
export interface AppProps extends I18nProps {
|
export interface AppProps extends I18nProps {
|
@ -1,16 +1,19 @@
|
|||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import { Header, Icon, Proxy } from '@components'
|
import { Header, Icon, Proxy } from '@components'
|
||||||
import { ProxyType } from '@models'
|
import { ProxyType } from '@models'
|
||||||
|
|
||||||
import './style.scss'
|
import './style.scss'
|
||||||
|
|
||||||
export default class Proxies extends React.Component<{}, {}> {
|
export class Proxies extends React.Component<{}, {}> {
|
||||||
render () {
|
render () {
|
||||||
const proxies: { type: ProxyType, name: string }[] = [
|
const proxies: { type: ProxyType, name: string }[] = [
|
||||||
{ type: ProxyType.Shadowsocks, name: 'shadowsocks' },
|
{ type: ProxyType.Shadowsocks, name: 'shadowsocks' },
|
||||||
{ type: ProxyType.Vmess, name: 'vmess' }
|
{ type: ProxyType.Vmess, name: 'vmess' }
|
||||||
]
|
]
|
||||||
|
|
||||||
return <div className="proxies-container">
|
return (
|
||||||
|
<div className="page">
|
||||||
|
<div className="proxies-container">
|
||||||
<Header title="代理" >
|
<Header title="代理" >
|
||||||
<Icon type="plus" size={20} style={{ fontWeight: 'bold' }} />
|
<Icon type="plus" size={20} style={{ fontWeight: 'bold' }} />
|
||||||
</Header>
|
</Header>
|
||||||
@ -26,5 +29,12 @@ export default class Proxies extends React.Component<{}, {}> {
|
|||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="proxies-container">
|
||||||
|
<Header title="策略组" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default Proxies
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
import * as React from 'react'
|
|
||||||
import { Header } from '@components'
|
|
||||||
|
|
||||||
export default class ProxyGroup extends React.Component<{}, {}> {
|
|
||||||
render () {
|
|
||||||
return <div className="container">
|
|
||||||
<Header title="策略组" />
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
@import '~@styles/variables';
|
|
@ -5,7 +5,7 @@ import { HashRouter } from 'react-router-dom'
|
|||||||
import { I18nextProvider } from 'react-i18next'
|
import { I18nextProvider } from 'react-i18next'
|
||||||
import { AppContainer } from 'react-hot-loader'
|
import { AppContainer } from 'react-hot-loader'
|
||||||
import { rootStores } from '@lib/createStore'
|
import { rootStores } from '@lib/createStore'
|
||||||
import App from '@views/App'
|
import App from '@containers/App'
|
||||||
import i18n from '@i18n'
|
import i18n from '@i18n'
|
||||||
|
|
||||||
const rootEl = document.getElementById('root')
|
const rootEl = document.getElementById('root')
|
||||||
@ -28,8 +28,8 @@ export default function renderApp () {
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (module.hot) {
|
if (module.hot) {
|
||||||
module.hot.accept('./views/App', () => {
|
module.hot.accept('./containers/App', () => {
|
||||||
const NewApp = require('./views/App').default
|
const NewApp = require('./containers/App').default
|
||||||
render(
|
render(
|
||||||
<AppContainer>
|
<AppContainer>
|
||||||
<Provider {...rootStores}>
|
<Provider {...rootStores}>
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
import * as React from 'react'
|
|
||||||
|
|
||||||
// containers
|
|
||||||
import ProxiesContainer from '@containers/Proxies'
|
|
||||||
import ProxyGroupContainer from '@containers/ProxyGroup'
|
|
||||||
|
|
||||||
const Proxies: React.SFC = () => (
|
|
||||||
<div className="page">
|
|
||||||
<ProxiesContainer />
|
|
||||||
<ProxyGroupContainer />
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
|
|
||||||
export default Proxies
|
|
@ -19,8 +19,6 @@
|
|||||||
"@components/*": ["src/components/*"],
|
"@components/*": ["src/components/*"],
|
||||||
"@containers": ["src/containers"],
|
"@containers": ["src/containers"],
|
||||||
"@containers/*": ["src/containers/*"],
|
"@containers/*": ["src/containers/*"],
|
||||||
"@views": ["src/views"],
|
|
||||||
"@views/*": ["src/views/*"],
|
|
||||||
"@i18n": ["src/i18n"],
|
"@i18n": ["src/i18n"],
|
||||||
"@i18n/*": ["src/i18n/*"],
|
"@i18n/*": ["src/i18n/*"],
|
||||||
"@stores": ["src/stores"],
|
"@stores": ["src/stores"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user