mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-22 02:47:14 +00:00
feat(xray): preview export in a modal and switch rule enable toggle
Routing and Outbounds export now opens a TextModal showing the JSON with copy/download buttons instead of auto-downloading the file. Routing import and export are collapsed into a "More" dropdown to match the Outbounds tab. The rule form Enabled field becomes a Switch instead of an Enabled/Disabled Select.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Form, Input, Modal, Select, Space, Tooltip } from 'antd';
|
||||
import { Button, Form, Input, Modal, Select, Space, Switch, Tooltip } from 'antd';
|
||||
import { PlusOutlined, MinusOutlined, QuestionCircleOutlined } from '@ant-design/icons';
|
||||
import { InputAddon } from '@/components/ui';
|
||||
import { useInboundOptions } from '@/api/queries/useInboundOptions';
|
||||
@@ -156,14 +156,10 @@ export default function RuleFormModal({
|
||||
>
|
||||
<Form colon={false} labelCol={{ md: { span: 8 } }} wrapperCol={{ md: { span: 14 } }}>
|
||||
<Form.Item label={t('enable')}>
|
||||
<Select
|
||||
value={form.enabled}
|
||||
onChange={(v) => update('enabled', v)}
|
||||
<Switch
|
||||
checked={form.enabled}
|
||||
onChange={(checked) => update('enabled', checked)}
|
||||
disabled={isApiRule(rule ?? {})}
|
||||
options={[
|
||||
{ value: true, label: t('enable') },
|
||||
{ value: false, label: t('disable') },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user