refactor: 优化eslint配置,提升代码质量 (#1341)
* feat: 统一并标准化eslint * lint: napcat.webui * lint: napcat.webui * lint: napcat.core * build: fix * lint: napcat.webui * refactor: 重构eslint * Update README.md
This commit is contained in:
651 files changed
+37978
-37584
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { Chip } from '@heroui/chip'
|
||||
import { Chip } from '@heroui/chip';
|
||||
|
||||
import NetworkDisplayCard from './common_card'
|
||||
import type { NetworkDisplayCardFields } from './common_card'
|
||||
import NetworkDisplayCard from './common_card';
|
||||
import type { NetworkDisplayCardFields } from './common_card';
|
||||
|
||||
interface HTTPServerDisplayCardProps {
|
||||
data: OneBotConfig['network']['httpServers'][0]
|
||||
@@ -13,8 +13,8 @@ interface HTTPServerDisplayCardProps {
|
||||
}
|
||||
|
||||
const HTTPServerDisplayCard: React.FC<HTTPServerDisplayCardProps> = (props) => {
|
||||
const { data, showType, onEdit, onEnable, onDelete, onEnableDebug } = props
|
||||
const { host, port, enableCors, enableWebsocket, messagePostFormat } = data
|
||||
const { data, showType, onEdit, onEnable, onDelete, onEnableDebug } = props;
|
||||
const { host, port, enableCors, enableWebsocket, messagePostFormat } = data;
|
||||
|
||||
const fields: NetworkDisplayCardFields<'httpServers'> = [
|
||||
{ label: '主机', value: host },
|
||||
@@ -24,34 +24,34 @@ const HTTPServerDisplayCard: React.FC<HTTPServerDisplayCardProps> = (props) => {
|
||||
label: 'CORS',
|
||||
value: enableCors,
|
||||
render: (value) => (
|
||||
<Chip color={value ? 'success' : 'default'} size="sm" variant="flat">
|
||||
<Chip color={value ? 'success' : 'default'} size='sm' variant='flat'>
|
||||
{value ? '已启用' : '未启用'}
|
||||
</Chip>
|
||||
)
|
||||
),
|
||||
},
|
||||
{
|
||||
label: 'WS',
|
||||
value: enableWebsocket,
|
||||
render: (value) => (
|
||||
<Chip color={value ? 'success' : 'default'} size="sm" variant="flat">
|
||||
<Chip color={value ? 'success' : 'default'} size='sm' variant='flat'>
|
||||
{value ? '已启用' : '未启用'}
|
||||
</Chip>
|
||||
)
|
||||
}
|
||||
]
|
||||
),
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<NetworkDisplayCard
|
||||
data={data}
|
||||
showType={showType}
|
||||
typeLabel="HTTP服务器"
|
||||
typeLabel='HTTP服务器'
|
||||
fields={fields}
|
||||
onEdit={onEdit}
|
||||
onEnable={onEnable}
|
||||
onDelete={onDelete}
|
||||
onEnableDebug={onEnableDebug}
|
||||
/>
|
||||
)
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
export default HTTPServerDisplayCard
|
||||
export default HTTPServerDisplayCard;
|
||||
Reference in new issue
Block a user