diff --git a/src/pages/options/sections/rules/rule-group-card.tsx b/src/pages/options/sections/rules/rule-group-card.tsx
index ae690e6..8dece91 100644
--- a/src/pages/options/sections/rules/rule-group-card.tsx
+++ b/src/pages/options/sections/rules/rule-group-card.tsx
@@ -26,6 +26,7 @@ import type { InitdRule, Rule } from '@/share/core/types';
import { VIRTUAL_KEY, TABLE_NAMES_ARR } from '@/share/core/constant';
import useMarkCommon from '@/share/hooks/use-mark-common';
import RuleContentSwitcher from '@/share/components/rule-content-switcher';
+import { textEllipsis } from '@/share/pages/styles';
import { remove, toggleRule } from './utils';
import type { ColumnProps, RowSelectionProps } from '@douyinfe/semi-ui/lib/es/table';
@@ -88,7 +89,7 @@ const RuleGroupCard = (props: RuleCardProps) => {
dataIndex: 'name',
render: (value: string, item: InitdRule) => (
} style={{ maxWidth: '300px' }}>
-
{value}
+ {value}
),
},
@@ -103,7 +104,7 @@ const RuleGroupCard = (props: RuleCardProps) => {
title: t('action'),
className: 'cell-action',
dataIndex: 'action',
- width: 128,
+ width: 160,
render: (v, item: InitdRule) => {
const isMarked = commonRuleKeys.includes(item[VIRTUAL_KEY]);
return (
@@ -114,7 +115,7 @@ const RuleGroupCard = (props: RuleCardProps) => {
-
+
} />
{
pagination={false}
rowSelection={rowSelection}
columns={tableColumns}
+ style={{ tableLayout: 'fixed' }}
/>
);
diff --git a/src/pages/popup/rule/rules.tsx b/src/pages/popup/rule/rules.tsx
index 4a66a6c..2ab9cec 100644
--- a/src/pages/popup/rule/rules.tsx
+++ b/src/pages/popup/rule/rules.tsx
@@ -10,6 +10,7 @@ import useMarkCommon from '@/share/hooks/use-mark-common';
import RuleDetail from '@/share/components/rule-detail';
import notify from '@/share/core/notify';
import RuleContentSwitcher from '@/share/components/rule-content-switcher';
+import { textEllipsis } from '@/share/pages/styles';
const Rules = () => {
const { keys } = useMarkCommon('rule');
@@ -73,6 +74,7 @@ const Rules = () => {
dataSource={data}
showHeader={false}
size="small"
+ style={{ tableLayout: 'fixed' }}
columns={[
{
title: 'enable',
@@ -98,7 +100,7 @@ const Rules = () => {
dataIndex: 'name',
render: (value: string, item: Rule) => (
} style={{ maxWidth: '300px' }}>
- {value}
+ {value}
),
},
diff --git a/src/share/components/rule-content-switcher.tsx b/src/share/components/rule-content-switcher.tsx
index 2bb7a15..803ee8b 100644
--- a/src/share/components/rule-content-switcher.tsx
+++ b/src/share/components/rule-content-switcher.tsx
@@ -106,7 +106,7 @@ const RuleContentSwitcher: FC = (props) => {
return result;
}, [add, value]);
- if (![RULE_TYPE.MODIFY_SEND_HEADER, RULE_TYPE.MODIFY_RECV_HEADER, RULE_TYPE.REDIRECT].includes(type)) {
+ if (![RULE_TYPE.MODIFY_SEND_HEADER, RULE_TYPE.MODIFY_RECV_HEADER, RULE_TYPE.REDIRECT].includes(type) || menu.length === 0) {
return null;
}
diff --git a/src/share/pages/styles.ts b/src/share/pages/styles.ts
new file mode 100644
index 0000000..c0dc903
--- /dev/null
+++ b/src/share/pages/styles.ts
@@ -0,0 +1,7 @@
+import { css } from '@emotion/css';
+
+export const textEllipsis = css`
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+`;