Skip to content

Commit 94e60d2

Browse files
authored
fix: Guide special products to web debugging. (#83)
1 parent 28181e5 commit 94e60d2

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

media/src/components/APIPage/APIDebugger/APIDebugger.tsx

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { APIPageContext } from "../context";
1010
import { APIGuide } from "./APIGuide";
1111
import RegionSelector from "./RegionSelector";
1212
import { xconsoleWidgets } from "./widgets/xconsole";
13+
import { debugForbiddenProducts } from "../../../utils/utils";
1314

1415
export class APIDebuggerProps {}
1516

@@ -53,21 +54,27 @@ export const APIDebugger: React.FC<APIDebuggerProps> = (props) => {
5354
>
5455
{I18N.main.explorer.empty}
5556
</Button>
56-
<Button
57-
type="primary"
58-
onClick={() => {
59-
changeMode("debug");
60-
onDebug({
61-
paramsValue: schemaForm.formData,
62-
apiMeta: apiMeta,
63-
product,
64-
version,
65-
endpoint: endpoint,
66-
});
67-
}}
68-
>
69-
{I18N.main.explorer.debug}
70-
</Button>
57+
{debugForbiddenProducts?.includes(`${product}__${version}`) ? (
58+
<a href={apiMeta?.externalDocs?.url}>
59+
<Button type="primary">去门户网页版调试</Button>
60+
</a>
61+
) : (
62+
<Button
63+
type="primary"
64+
onClick={() => {
65+
changeMode("debug");
66+
onDebug({
67+
paramsValue: schemaForm.formData,
68+
apiMeta: apiMeta,
69+
product,
70+
version,
71+
endpoint: endpoint,
72+
});
73+
}}
74+
>
75+
{I18N.main.explorer.debug}
76+
</Button>
77+
)}
7178
</div>
7279
</div>
7380
);

media/src/utils/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ export const getSpecInfoFromName = (name: string): SpecInfo => {
5454
};
5555
};
5656

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

0 commit comments

Comments
 (0)