Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(docker): label gpu as nvidia only [EE-6999] #11729

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,12 @@
<!-- other -->
<div class="col-sm-12 form-section-title"> Other </div>
<div class="form-group">
<div class="col-sm-12">
<gpus-insights></gpus-insights>
<div class="col-sm-12" ng-if="!$ctrl.isDockerStandaloneEnv">
<text-tip children="'Showing GPU in the UI is currently only available with Docker Standalone and is limited to NVIDIA graphics cards.'" color="'blue'" />
</div>
</div>

<div class="form-group">
<div class="col-sm-12">
<por-switch-field
label="'Show GPU in the UI'"
Expand All @@ -164,11 +167,20 @@
disabled="!$ctrl.isDockerStandaloneEnv"
></por-switch-field>
</div>
<div class="col-sm-12">
<div class="pl-4">
<gpus-list ng-if="$ctrl.state.enableGPUManagement && $ctrl.endpoint" value="$ctrl.endpoint.Gpus" on-change="($ctrl.onGpusChange)"></gpus-list>

<div ng-if="$ctrl.state.enableGPUManagement">
<div class="col-sm-12">
<text-tip children="'GPU support is currently limited to NVIDIA graphics cards only.'" color="'blue'" />
</div>
<div class="col-sm-12">
<div class="pl-4">
<gpus-list ng-if="$ctrl.state.enableGPUManagement" value="$ctrl.endpoint.Gpus" on-change="($ctrl.onGpusChange)"></gpus-list>
</div>
</div>
</div>
</div>

<div class="form-group">
<div class="col-sm-12">
<por-switch-field
label="'Show image up to date indicators for Stacks, Services and Containers'"
Expand Down
12 changes: 12 additions & 0 deletions app/portainer/react/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { TagButton } from '@@/TagButton';
import { BETeaserButton } from '@@/BETeaserButton';
import { CodeEditor } from '@@/CodeEditor';
import { HelpLink } from '@@/HelpLink';
import { TextTip } from '@@/Tip/TextTip';

import { fileUploadField } from './file-upload-field';
import { switchField } from './switch-field';
Expand Down Expand Up @@ -231,6 +232,17 @@ export const ngModule = angular
'data-cy',
])
)
.component(
'textTip',
r2a(TextTip, [
'className',
'color',
'icon',
'inline',
'children',
'childrenWrapperClassName',
])
)
.component(
'groupAssociationTable',
r2a(withReactQuery(GroupAssociationTable), [
Expand Down
8 changes: 4 additions & 4 deletions app/react/components/Tip/TextTip/TextTip.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PropsWithChildren } from 'react';
import { ReactNode } from 'react';
import { AlertCircle } from 'lucide-react';
import clsx from 'clsx';

Expand All @@ -12,6 +12,7 @@ export interface Props {
className?: string;
childrenWrapperClassName?: string;
inline?: boolean;
children: ReactNode;
}

export function TextTip({
Expand All @@ -20,8 +21,8 @@ export function TextTip({
inline = true,
className,
children,
childrenWrapperClassName = 'text-muted',
}: PropsWithChildren<Props>) {
childrenWrapperClassName,
}: Props) {
return (
<div
className={clsx(
Expand All @@ -32,7 +33,6 @@ export function TextTip({
role="status"
>
<Icon icon={icon} mode={getMode(color)} className="!mt-0.5 flex-none" />

<span className={childrenWrapperClassName}>{children}</span>
</div>
);
Expand Down