feat(config, i18n): add integration guide documentation page with multi-language support
Added new integration guide page accessible from config hub, providing SSO and wallet integration documentation for client engineering teams. Includes translations in English, Nepali, and Chinese. Refactored percentage conversion utilities across agent management modules to use consistent `percentValueToUi` function, removing deprecated `ratioToPercentUi` and `percentUiToRatio` helpers.
This commit is contained in:
@@ -21,7 +21,7 @@ import { AgentsPlayersPanel } from "@/modules/agents/agents-players-panel";
|
||||
import { AgentProfileFields, type AgentProfileFieldsProps } from "@/modules/agents/agent-profile-fields";
|
||||
import { formatCredit } from "@/modules/agents/agent-line-sidebar";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ratioToPercentUi } from "@/lib/admin-rate-percent";
|
||||
import { percentValueToUi } from "@/lib/admin-rate-percent";
|
||||
import { resolveRoleStatusTone } from "@/lib/admin-status-tone";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { AgentNodeProfileSummary, AgentNodeRow, AgentProfileRow } from "@/types/api/admin-agent";
|
||||
@@ -366,7 +366,7 @@ function OverviewTab({
|
||||
const { t } = useTranslation(["agents", "common"]);
|
||||
|
||||
const rebateCap =
|
||||
profile && !profileLoading ? ratioToPercentUi(profile.rebate_limit ?? 0) : null;
|
||||
profile && !profileLoading ? percentValueToUi(profile.rebate_limit ?? 0) : null;
|
||||
|
||||
return (
|
||||
<div className="mx-auto max-w-5xl space-y-6">
|
||||
@@ -421,8 +421,8 @@ function OverviewTab({
|
||||
<p className="text-xs text-muted-foreground">
|
||||
{t("lineUi.profileFootnote", {
|
||||
defaultValue: "回水上限 {{rebate}}% · 默认回水 {{defaultRebate}}% · {{cycle}}",
|
||||
rebate: ratioToPercentUi(profile.rebate_limit ?? 0),
|
||||
defaultRebate: ratioToPercentUi(profile.default_player_rebate ?? 0),
|
||||
rebate: percentValueToUi(profile.rebate_limit ?? 0),
|
||||
defaultRebate: percentValueToUi(profile.default_player_rebate ?? 0),
|
||||
cycle: cycleLabel,
|
||||
})}
|
||||
{(profile.risk_tags?.length ?? 0) > 0
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
} from "@/components/ui/select";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { useAsyncEffect } from "@/hooks/use-async-effect";
|
||||
import { percentUiToRatio } from "@/lib/admin-rate-percent";
|
||||
import { percentValueToUi } from "@/lib/admin-rate-percent";
|
||||
import { adminSiteCodeLabel } from "@/lib/admin-select-display";
|
||||
import { LotteryApiBizError } from "@/types/api/errors";
|
||||
import type { AdminIntegrationSiteRow } from "@/types/api/admin-integration-site";
|
||||
@@ -73,8 +73,8 @@ export function AgentLineProvisionWizard(): React.ReactElement {
|
||||
password: form.password,
|
||||
total_share_rate: Number.parseFloat(form.total_share_rate) || 0,
|
||||
credit_limit: Number.parseInt(form.credit_limit, 10) || 0,
|
||||
rebate_limit: percentUiToRatio(form.rebate_limit),
|
||||
default_player_rebate: percentUiToRatio(form.default_player_rebate),
|
||||
rebate_limit: Number.parseFloat(form.rebate_limit) || 0,
|
||||
default_player_rebate: Number.parseFloat(form.default_player_rebate) || 0,
|
||||
settlement_cycle: form.settlement_cycle,
|
||||
can_grant_extra_rebate: form.can_grant_extra_rebate,
|
||||
});
|
||||
|
||||
@@ -34,10 +34,8 @@ import { useAsyncEffect } from "@/hooks/use-async-effect";
|
||||
import { useConfirmAction } from "@/hooks/use-confirm-action";
|
||||
import { useTranslationRef } from "@/hooks/use-translation-ref";
|
||||
import {
|
||||
percentUiToRatio,
|
||||
percentValueToUi,
|
||||
parsePercentUi,
|
||||
ratioToPercentUi,
|
||||
} from "@/lib/admin-rate-percent";
|
||||
import { adminHasAnyPermission } from "@/lib/admin-permissions";
|
||||
import {
|
||||
@@ -168,8 +166,8 @@ export function AgentsConsole(): React.ReactElement {
|
||||
setProfileShareRate(percentValueToUi(row.total_share_rate ?? 0));
|
||||
}
|
||||
setProfileCreditLimit(String(row.credit_limit ?? 0));
|
||||
setProfileRebateLimit(ratioToPercentUi(row.rebate_limit ?? 0));
|
||||
setProfileDefaultRebate(ratioToPercentUi(row.default_player_rebate ?? 0));
|
||||
setProfileRebateLimit(percentValueToUi(row.rebate_limit ?? 0));
|
||||
setProfileDefaultRebate(percentValueToUi(row.default_player_rebate ?? 0));
|
||||
setProfileSettlementCycle(normalizeAgentSettlementCycle(row.settlement_cycle));
|
||||
setProfileExtraRebate(Boolean(row.can_grant_extra_rebate));
|
||||
setProfileCanCreateChild(Boolean(row.can_create_child_agent));
|
||||
@@ -183,8 +181,8 @@ export function AgentsConsole(): React.ReactElement {
|
||||
const shareRate = Number.parseFloat(profileShareRate) || 0;
|
||||
const base = {
|
||||
credit_limit: Number.parseInt(profileCreditLimit, 10) || 0,
|
||||
rebate_limit: percentUiToRatio(profileRebateLimit),
|
||||
default_player_rebate: percentUiToRatio(profileDefaultRebate),
|
||||
rebate_limit: Number.parseFloat(profileRebateLimit) || 0,
|
||||
default_player_rebate: Number.parseFloat(profileDefaultRebate) || 0,
|
||||
settlement_cycle: normalizeAgentSettlementCycle(profileSettlementCycle),
|
||||
can_grant_extra_rebate: profileExtraRebate,
|
||||
can_create_child_agent: profileCanCreateChild,
|
||||
|
||||
Reference in New Issue
Block a user