Skip to content

Commit

Permalink
fix: Guide special products to web debugging. (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
yini-chen authored Jun 13, 2024
1 parent 28181e5 commit 94e60d2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
37 changes: 22 additions & 15 deletions media/src/components/APIPage/APIDebugger/APIDebugger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { APIPageContext } from "../context";
import { APIGuide } from "./APIGuide";
import RegionSelector from "./RegionSelector";
import { xconsoleWidgets } from "./widgets/xconsole";
import { debugForbiddenProducts } from "../../../utils/utils";

export class APIDebuggerProps {}

Expand Down Expand Up @@ -53,21 +54,27 @@ export const APIDebugger: React.FC<APIDebuggerProps> = (props) => {
>
{I18N.main.explorer.empty}
</Button>
<Button
type="primary"
onClick={() => {
changeMode("debug");
onDebug({
paramsValue: schemaForm.formData,
apiMeta: apiMeta,
product,
version,
endpoint: endpoint,
});
}}
>
{I18N.main.explorer.debug}
</Button>
{debugForbiddenProducts?.includes(`${product}__${version}`) ? (
<a href={apiMeta?.externalDocs?.url}>
<Button type="primary">去门户网页版调试</Button>
</a>
) : (
<Button
type="primary"
onClick={() => {
changeMode("debug");
onDebug({
paramsValue: schemaForm.formData,
apiMeta: apiMeta,
product,
version,
endpoint: endpoint,
});
}}
>
{I18N.main.explorer.debug}
</Button>
)}
</div>
</div>
);
Expand Down
1 change: 1 addition & 0 deletions media/src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ export const getSpecInfoFromName = (name: string): SpecInfo => {
};
};

export const debugForbiddenProducts = ["Kms__2016-01-20", "Oss__2019-05-17", "pds__2022-03-01", "Sls__2020-12-30"];

0 comments on commit 94e60d2

Please sign in to comment.