TrialIdColumn.tsx 934 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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' ? (
                    <div>{id}</div>
                ) : (
                    <a href={webuiPortal} className='link' target='_blank' rel='noopener noreferrer'>
                        {id}
                    </a>
                )}
            </div>
        );
    }
}

export default TrialIdColumn;