Skip to content

Commit

Permalink
fix: remove planDataMod
Browse files Browse the repository at this point in the history
  • Loading branch information
hamster1963 committed Dec 3, 2024
1 parent 3f87876 commit 20b4f47
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion src/components/ServiceTracker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useQuery } from "@tanstack/react-query";
import { fetchService } from "@/lib/nezha-api";
import { ServiceData } from "@/types/nezha-api";
import { CycleTransferStatsCard } from "./CycleTransferStats";
import { Loader } from "./loading/Loader";

export const ServiceTracker: React.FC = () => {
const { data: serviceData, isLoading } = useQuery({
Expand Down Expand Up @@ -36,7 +37,7 @@ export const ServiceTracker: React.FC = () => {
};

if (isLoading) {
return <div className="mt-4">Loading...</div>;
return <div className="mt-4 text-sm font-medium flex items-center gap-1"><Loader visible={true} />Loading...</div>;
}

if (
Expand Down
30 changes: 15 additions & 15 deletions src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ interface PlanData {

interface PublicNoteData {
billingDataMod: BillingData;
planDataMod: PlanData;
// planDataMod: PlanData;
}

export function parsePublicNote(publicNote: string): PublicNoteData | null {
Expand All @@ -146,21 +146,21 @@ export function parsePublicNote(publicNote: string): PublicNoteData | null {
const data = JSON.parse(publicNote);
return {
billingDataMod: {
startDate: data.billingDataMod.startDate,
startDate: data.billingDataMod.startDate || "",
endDate: data.billingDataMod.endDate,
autoRenewal: data.billingDataMod.autoRenewal,
cycle: data.billingDataMod.cycle,
amount: data.billingDataMod.amount,
},
planDataMod: {
bandwidth: data.planDataMod.bandwidth,
trafficVol: data.planDataMod.trafficVol,
trafficType: data.planDataMod.trafficType,
IPv4: data.planDataMod.IPv4,
IPv6: data.planDataMod.IPv6,
networkRoute: data.planDataMod.networkRoute,
extra: data.planDataMod.extra,
},
autoRenewal: data.billingDataMod.autoRenewal || "",
cycle: data.billingDataMod.cycle || "",
amount: data.billingDataMod.amount || "",
}
// planDataMod: {
// bandwidth: data.planDataMod.bandwidth || "",
// trafficVol: data.planDataMod.trafficVol || "",
// trafficType: data.planDataMod.trafficType || "",
// IPv4: data.planDataMod.IPv4 || "",
// IPv6: data.planDataMod.IPv6 || "",
// networkRoute: data.planDataMod.networkRoute || "",
// extra: data.planDataMod.extra || "",
// },
};
} catch (error) {
console.error("Error parsing public note:", error);
Expand Down

0 comments on commit 20b4f47

Please sign in to comment.