Skip to content

Commit

Permalink
fix: set the popup container to shadowRoot always (#1860)
Browse files Browse the repository at this point in the history
* set the popup container to shadowRoot always

* set Form.Item tooltips on service launcher modal
  • Loading branch information
yomybaby authored Aug 14, 2023
1 parent d2a5840 commit 9a2162a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
3 changes: 0 additions & 3 deletions react/src/components/DefaultProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ const DefaultProviders: React.FC<DefaultProvidersProps> = ({
<ConfigProvider
// @ts-ignore
getPopupContainer={(triggerNode) => {
if (triggerNode?.parentNode) {
return triggerNode.parentNode;
}
return shadowRoot;
}}
//TODO: apply other supported locales
Expand Down
17 changes: 11 additions & 6 deletions react/src/components/ServiceLauncherModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Card, Form, Input, Modal, ModalProps, theme, Switch } from "antd";
import React, { Suspense } from "react";
import { useTranslation } from "react-i18next";
import { Trans, useTranslation } from "react-i18next";
import { useSuspendedBackendaiClient } from "../hooks";
import SliderInputItem from "./SliderInputFormItem";
import ImageEnvironmentSelectFormItems, {
Expand Down Expand Up @@ -276,8 +276,7 @@ const ServiceLauncherModal: React.FC<ServiceLauncherProps> = ({
<SliderInputItem
name={"cpu"}
label={t("session.launcher.CPU")}
// tooltip={t("session.launcher.DescCPU")}

tooltip={<Trans i18nKey={"session.launcher.DescCPU"} />}
min={parseInt(
_.find(
currentImage?.resource_limits,
Expand All @@ -303,7 +302,9 @@ const ServiceLauncherModal: React.FC<ServiceLauncherProps> = ({
<SliderInputItem
name={"mem"}
label={t("session.launcher.Memory")}
// tooltip={t("session.launcher.DescMemory")}
tooltip={
<Trans i18nKey={"session.launcher.DescMemory"} />
}
max={30}
inputNumberProps={{
addonAfter: "GB",
Expand All @@ -319,7 +320,9 @@ const ServiceLauncherModal: React.FC<ServiceLauncherProps> = ({
<SliderInputItem
name={"shmem"}
label={t("session.launcher.SharedMemory")}
// tooltip={t("session.launcher.DescSharedMemory")}
tooltip={
<Trans i18nKey={"session.launcher.DescSharedMemory"} />
}
max={30}
step={0.1}
inputNumberProps={{
Expand All @@ -336,7 +339,9 @@ const ServiceLauncherModal: React.FC<ServiceLauncherProps> = ({
style={{ marginBottom: 0 }}
name={"gpu"}
label={t("session.launcher.AIAccelerator")}
// tooltip={t("session.launcher.DescAIAccelerator")}
tooltip={
<Trans i18nKey={"session.launcher.DescAIAccelerator"} />
}
max={30}
step={0.1}
inputNumberProps={{
Expand Down

0 comments on commit 9a2162a

Please sign in to comment.