TrialIdColumn.tsx 1.07 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as React from 'react';

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 (
            <div className='succeed-padding ellipsis'>
                {status === 'STOPPED' ? (
22
                    <div className='idColor'>{id}</div>
23
                ) : (
24
25
26
27
28
29
                    <a
                        href={webuiPortal}
                        className='link toAnotherExp idColor'
                        target='_blank'
                        rel='noopener noreferrer'
                    >
30
31
32
33
34
35
36
37
38
                        {id}
                    </a>
                )}
            </div>
        );
    }
}

export default TrialIdColumn;