This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebUI] Show trial log for pai and k8s (#580)
* [WebUI] Show trial log for pai and k8s * fix lint * Fix comments
- Loading branch information
Showing
13 changed files
with
541 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import * as React from 'react'; | ||
import { Row, Button } from 'antd'; | ||
import { DOWNLOAD_IP } from '../../static/const'; | ||
|
||
interface PaiTrialChildProps { | ||
logString: string; | ||
id: string; | ||
showLogModal: Function; | ||
isdisLogbtn?: boolean; | ||
} | ||
|
||
class PaiTrialChild extends React.Component<PaiTrialChildProps, {}> { | ||
|
||
constructor(props: PaiTrialChildProps) { | ||
super(props); | ||
|
||
} | ||
|
||
render() { | ||
const { logString, id, showLogModal, isdisLogbtn } = this.props; | ||
return ( | ||
<div> | ||
{ | ||
logString === '' | ||
? | ||
<div /> | ||
: | ||
<Row> | ||
<Row> | ||
<a | ||
target="_blank" | ||
href={`${DOWNLOAD_IP}/trial_${id}.log`} | ||
style={{ marginRight: 10 }} | ||
> | ||
trial stdout | ||
</a> | ||
</Row> | ||
<Row> | ||
<Button | ||
disabled={isdisLogbtn} | ||
type="primary" | ||
className="tableButton" | ||
onClick={showLogModal.bind(this, id)} | ||
> | ||
View | ||
</Button> | ||
</Row> | ||
</Row> | ||
} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default PaiTrialChild; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import * as React from 'react'; | ||
import { Row, Button } from 'antd'; | ||
import { DOWNLOAD_IP } from '../../static/const'; | ||
import PaiTrialChild from './PaiTrialChild'; | ||
|
||
interface PaitrialLogProps { | ||
logStr: string; | ||
id: string; | ||
showLogModal: Function; | ||
trialStatus?: string; | ||
isdisLogbutton?: boolean; | ||
} | ||
|
||
class PaitrialLog extends React.Component<PaitrialLogProps, {}> { | ||
|
||
constructor(props: PaitrialLogProps) { | ||
super(props); | ||
|
||
} | ||
|
||
render() { | ||
const { logStr, id, showLogModal, | ||
isdisLogbutton | ||
} = this.props; | ||
const isTwopath = logStr.indexOf(',') !== -1 | ||
? | ||
true | ||
: | ||
false; | ||
return ( | ||
<div> | ||
<div> | ||
{ | ||
isTwopath | ||
? | ||
<Row> | ||
<Row> | ||
<a | ||
target="_blank" | ||
href={`${DOWNLOAD_IP}/trial_${id}.log`} | ||
style={{ marginRight: 10 }} | ||
> | ||
trial stdout | ||
</a> | ||
<a target="_blank" href={logStr.split(',')[1]}>hdfsLog</a> | ||
</Row> | ||
<Row> | ||
<Button | ||
disabled={isdisLogbutton} | ||
type="primary" | ||
className="tableButton" | ||
onClick={showLogModal.bind(this, id)} | ||
> | ||
View | ||
</Button> | ||
</Row> | ||
</Row> | ||
: | ||
<PaiTrialChild | ||
logString={logStr} | ||
id={id} | ||
showLogModal={showLogModal} | ||
isdisLogbtn={isdisLogbutton} | ||
/> | ||
} | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default PaitrialLog; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import * as React from 'react'; | ||
import LogPathChild from './LogPathChild'; | ||
|
||
interface TrialLogProps { | ||
logStr: string; | ||
id: string; | ||
} | ||
|
||
class TrialLog extends React.Component<TrialLogProps, {}> { | ||
|
||
constructor(props: TrialLogProps) { | ||
super(props); | ||
|
||
} | ||
|
||
render() { | ||
const { logStr } = this.props; | ||
|
||
return ( | ||
<div> | ||
<LogPathChild | ||
eachLogpath={logStr} | ||
logName="LogPath:" | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default TrialLog; |
Oops, something went wrong.