import * as React from 'react'; import { Stack } from '@fluentui/react'; import { AllExperimentList } from '../../static/interface'; import CopyButton from '../public-child/CopyButton'; interface TrialIdColumnProps { item: AllExperimentList; } class TrialIdColumn extends React.Component { constructor(props: TrialIdColumnProps) { super(props); } render(): React.ReactNode { const { item } = this.props; const hostname = window.location.hostname; const protocol = window.location.protocol; const webuiPortal = item.prefixUrl === null ? `${protocol}//${hostname}:${item.port}/oview` : `${protocol}//${hostname}:${item.port}/${this.formatPrefix(item.prefixUrl)}/oview`; return ( {item.status === 'STOPPED' ? (
{item.id}
) : ( {item.id} )}
); } private formatPrefix(prefix): string { if (prefix.startsWith('/')) { prefix = prefix.slice(1); } if (prefix.endsWith('/')) { prefix = prefix.slice(0, prefix.length - 1); } return prefix; } } export default TrialIdColumn;