mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-13 10:26:38 +08:00
prettier
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
import type {
|
||||
WAFIPGroup,
|
||||
WAFIPGroupPayload,
|
||||
} from '@/lib/services/openflare';
|
||||
import type { WAFIPGroup, WAFIPGroupPayload } from '@/lib/services/openflare';
|
||||
|
||||
export function getErrorMessage(error: unknown) {
|
||||
return error instanceof Error ? error.message : '操作失败';
|
||||
@@ -18,7 +15,6 @@ export function parseTextareaList(text: string) {
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
||||
|
||||
export function parseAutomaticConfig(text: string): Record<string, unknown> {
|
||||
const parsed = JSON.parse(text || '{}') as unknown;
|
||||
if (!parsed || Array.isArray(parsed) || typeof parsed !== 'object') {
|
||||
@@ -83,7 +79,9 @@ export function formatIPGroupBanRemaining(
|
||||
if (expireDate.getTime() <= now.getTime()) {
|
||||
return '已过期';
|
||||
}
|
||||
const diffMins = Math.round((expireDate.getTime() - now.getTime()) / (60 * 1000));
|
||||
const diffMins = Math.round(
|
||||
(expireDate.getTime() - now.getTime()) / (60 * 1000),
|
||||
);
|
||||
if (diffMins < 60) {
|
||||
return `${diffMins} 分钟后`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user