mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-22 03:10:43 +08:00
ui v0.0.1-beta
This commit is contained in:
@@ -48,7 +48,7 @@ function updateProxyTypeSettings(proxyItem, config) {
|
||||
const serverSettings = proxyItem.querySelector('.proxy-server-settings');
|
||||
const pacSettings = proxyItem.querySelector('.pac-script-settings');
|
||||
|
||||
if (config.proxyType === 'fixed_server') {
|
||||
if (config.proxyType === 'fixed_servers') {
|
||||
serverSettings.style.display = 'block';
|
||||
pacSettings.style.display = 'none';
|
||||
|
||||
@@ -83,7 +83,7 @@ async function addNewProxy() {
|
||||
const newConfig = {
|
||||
id: Date.now().toString(),
|
||||
name: '新建代理',
|
||||
proxyType: 'fixed_server',
|
||||
proxyType: 'fixed_servers',
|
||||
scheme: 'http',
|
||||
host: '127.0.0.1',
|
||||
port: 8080
|
||||
@@ -109,7 +109,7 @@ async function handleProxyChange(e) {
|
||||
} else if (e.target.classList.contains('proxy-type-select')) {
|
||||
updatedConfig.proxyType = e.target.value;
|
||||
// 如果切换到固定服务器模式,设置默认值
|
||||
if (updatedConfig.proxyType === 'fixed_server' && !updatedConfig.scheme) {
|
||||
if (updatedConfig.proxyType === 'fixed_servers' && !updatedConfig.scheme) {
|
||||
updatedConfig.scheme = 'http';
|
||||
updatedConfig.host = '127.0.0.1';
|
||||
updatedConfig.port = 8080;
|
||||
|
||||
@@ -46,7 +46,7 @@ export const ProxySettings: React.FC<ProxySettingsProps> = ({
|
||||
disabled={record.id === 'direct'}
|
||||
options={[
|
||||
{ label: '直接连接', value: 'direct' },
|
||||
{ label: '代理服务器', value: 'fixed_server' },
|
||||
{ label: '代理服务器', value: 'fixed_servers' },
|
||||
{ label: 'PAC 脚本', value: 'pac_script' }
|
||||
]}
|
||||
/>
|
||||
@@ -57,7 +57,7 @@ export const ProxySettings: React.FC<ProxySettingsProps> = ({
|
||||
dataIndex: 'scheme',
|
||||
key: 'scheme',
|
||||
render: (text: string, record: ProxyConfig) => (
|
||||
record.proxyType === 'fixed_server' && (
|
||||
record.proxyType === 'fixed_servers' && (
|
||||
<Select
|
||||
value={text}
|
||||
onChange={value => onChange(record.id, 'scheme', value)}
|
||||
@@ -77,7 +77,7 @@ export const ProxySettings: React.FC<ProxySettingsProps> = ({
|
||||
dataIndex: 'host',
|
||||
key: 'host',
|
||||
render: (text: string, record: ProxyConfig) => (
|
||||
record.proxyType === 'fixed_server' && (
|
||||
record.proxyType === 'fixed_servers' && (
|
||||
<Input
|
||||
value={text}
|
||||
onChange={e => onChange(record.id, 'host', e.target.value)}
|
||||
@@ -91,7 +91,7 @@ export const ProxySettings: React.FC<ProxySettingsProps> = ({
|
||||
dataIndex: 'port',
|
||||
key: 'port',
|
||||
render: (text: number, record: ProxyConfig) => (
|
||||
record.proxyType === 'fixed_server' && (
|
||||
record.proxyType === 'fixed_servers' && (
|
||||
<InputNumber
|
||||
value={text}
|
||||
onChange={value => onChange(record.id, 'port', value)}
|
||||
|
||||
@@ -23,7 +23,7 @@ export const OptionsPage: React.FC = () => {
|
||||
const newConfig: ProxyConfig = {
|
||||
id: Date.now().toString(),
|
||||
name: '新建代理',
|
||||
proxyType: 'fixed_server',
|
||||
proxyType: 'fixed_servers',
|
||||
scheme: 'http',
|
||||
host: '127.0.0.1',
|
||||
port: 8080,
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ export interface ProxyConfig {
|
||||
host: string;
|
||||
port: number;
|
||||
scheme: 'http' | 'https' | 'socks5';
|
||||
proxyType: 'fixed_server';
|
||||
proxyType: 'fixed_servers';
|
||||
enabled?: boolean;
|
||||
id?: string;
|
||||
name?: string;
|
||||
|
||||
Reference in New Issue
Block a user