minor update

This commit is contained in:
sawka 2022-10-27 15:25:58 -07:00
parent bb7f475055
commit f8d23a68f3
2 changed files with 34 additions and 11 deletions

View File

@ -136,6 +136,27 @@ function getLineDateStr(ts : number) : string {
}
}
@mobxReact.observer
class LineAvatar extends React.Component<{line : LineType, cmd : Cmd}, {}> {
render() {
let {line, cmd} = this.props;
let lineNumStr = (line.linenumtemp ? "~" : "") + String(line.linenum);
let status = (cmd != null ? cmd.getStatus() : "done");
let rtnstate = (cmd != null ? cmd.getRtnState() : false);
return (
<div className={cn("avatar", "num-"+lineNumStr.length, "status-" + status, {"ephemeral": line.ephemeral}, {"rtnstate": rtnstate})}>
{lineNumStr}
<If condition={status == "hangup" || status == "error"}>
<i className="fa fa-exclamation-triangle status-icon"/>
</If>
<If condition={status == "detached"}>
<i className="fa fa-refresh status-icon"/>
</If>
</div>
);
}
}
@mobxReact.observer
class LineText extends React.Component<{sw : ScreenWindow, line : LineType}, {}> {
render() {
@ -362,6 +383,12 @@ class LineCmd extends React.Component<{sw : ScreenWindow, line : LineType, width
this.checkLoad();
this.checkStateDiffLoad();
}
@boundMethod
handleClick() {
let {line} = this.props;
GlobalCommandRunner.swSelectLine(String(line.linenum), "cmd");
}
render() {
let {sw, line, width, staticRender, visible} = this.props;
@ -391,18 +418,10 @@ class LineCmd extends React.Component<{sw : ScreenWindow, line : LineType, width
let isFgFocused = isPhysicalFocused && swFocusType == "cmd-fg";
let isStatic = staticRender;
return (
<div className={cn("line", "line-cmd", {"focus": isFocused}, {"has-rtnstate": cmd.getRtnState()})} id={"line-" + getLineId(line)} ref={this.lineRef} style={{position: "relative"}} data-lineid={line.lineid} data-linenum={line.linenum} data-windowid={line.windowid} data-cmdid={line.cmdid}>
<div onClick={this.handleClick} className={cn("line", "line-cmd", {"focus": isFocused}, {"has-rtnstate": cmd.getRtnState()})} id={"line-" + getLineId(line)} ref={this.lineRef} style={{position: "relative"}} data-lineid={line.lineid} data-linenum={line.linenum} data-windowid={line.windowid} data-cmdid={line.cmdid}>
<div className={cn("focus-indicator", {"selected": isSelected}, {"active": isSelected && isFocused}, {"fg-focus": isFgFocused})}/>
<div className="line-header">
<div className={cn("avatar", "num-"+lineNumStr.length, "status-" + status, {"ephemeral": line.ephemeral})} onClick={this.doRefresh}>
{lineNumStr}
<If condition={status == "hangup" || status == "error"}>
<i className="fa fa-exclamation-triangle status-icon"/>
</If>
<If condition={status == "detached"}>
<i className="fa fa-refresh status-icon"/>
</If>
</div>
<LineAvatar line={line} cmd={cmd}/>
<div className="meta-wrap">
<div className="meta">
<div className="user" style={{display: "none"}}>{line.userid}</div>

View File

@ -469,7 +469,7 @@ html, body, #main {
}
.cmd-rtnstate-diff {
color: @term-white;
color: @term-cyan;
.mono-font(12px);
white-space: pre;
margin-left: 15px;
@ -556,6 +556,10 @@ html, body, #main {
margin-right: 10px;
border-radius: 5px;
position: relative;
&.rtnstate {
border: 1px solid white;
}
.status-icon {
font-size: 8px;