Skip to content

Commit

Permalink
feat: add copy button for full image name in session launcher and env…
Browse files Browse the repository at this point in the history
…ironments page
  • Loading branch information
ironAiken2 committed Sep 19, 2024
1 parent c1270fc commit 054f20d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
26 changes: 22 additions & 4 deletions react/src/components/ImageEnvironmentSelectFormItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ import {
ImageEnvironmentSelectFormItemsQuery,
ImageEnvironmentSelectFormItemsQuery$data,
} from './__generated__/ImageEnvironmentSelectFormItemsQuery.graphql';
import { Divider, Form, Input, RefSelectProps, Select, Tag, theme } from 'antd';
import {
Divider,
Form,
Input,
RefSelectProps,
Select,
Tag,
theme,
Typography,
} from 'antd';
import graphql from 'babel-plugin-relay/macro';
import _ from 'lodash';
import React, { useEffect, useMemo, useRef, useState } from 'react';
Expand Down Expand Up @@ -327,9 +336,18 @@ const ImageEnvironmentSelectFormItems: React.FC<
<Form.Item
className="image-environment-select-form-item"
name={['environments', 'environment']}
label={`${t('session.launcher.Environments')} / ${t(
'session.launcher.Version',
)}`}
label={
<Typography.Text
copyable={{
text: getImageFullName(
form.getFieldValue(['environments', 'image']),
),
}}
>
{t('session.launcher.Environments')} /
{t('session.launcher.Version')}
</Typography.Text>
}
rules={[{ required: _.isEmpty(environments?.manual) }]}
style={{ marginBottom: 10 }}
>
Expand Down
8 changes: 8 additions & 0 deletions react/src/components/ImageList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ImageListQuery,
ImageListQuery$data,
} from './__generated__/ImageListQuery.graphql';
import CopyButton from './lablupTalkativotUI/CopyButton';
import {
AppstoreOutlined,
ReloadOutlined,
Expand Down Expand Up @@ -292,6 +293,13 @@ const ImageList: React.FC<{ style?: React.CSSProperties }> = ({ style }) => {
e.stopPropagation();
}}
>
<CopyButton
type="text"
style={{ color: token.colorPrimary }}
copyable={{
text: getImageFullName(row) || '',
}}
></CopyButton>
<Button
type="text"
icon={
Expand Down

0 comments on commit 054f20d

Please sign in to comment.