TrialIdColumn.tsx 1.21 KB
Newer Older
1
import * as React from 'react';
2
3
import { Stack } from '@fluentui/react';
import CopyButton from '../public-child/CopyButton';
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

interface TrialIdColumnProps {
    port: number;
    id: string;
    status: string;
}

class TrialIdColumn extends React.Component<TrialIdColumnProps, {}> {
    constructor(props: TrialIdColumnProps) {
        super(props);
    }

    render(): React.ReactNode {
        const { port, id, status } = this.props;
        const hostname = window.location.hostname;
        const protocol = window.location.protocol;
        const webuiPortal = `${protocol}//${hostname}:${port}/oview`;
        return (
22
            <Stack horizontal className='ellipsis idCopy'>
23
                {status === 'STOPPED' ? (
24
                    <div className='idColor'>{id}</div>
25
                ) : (
26
27
28
29
30
31
                    <a
                        href={webuiPortal}
                        className='link toAnotherExp idColor'
                        target='_blank'
                        rel='noopener noreferrer'
                    >
32
33
34
                        {id}
                    </a>
                )}
35
36
                <CopyButton value={id} />
            </Stack>
37
38
39
40
41
        );
    }
}

export default TrialIdColumn;