diff --git a/src/linecomps.tsx b/src/linecomps.tsx index 4f4684ae..9a56cf96 100644 --- a/src/linecomps.tsx +++ b/src/linecomps.tsx @@ -16,6 +16,7 @@ import {renderCmdText} from "./elements"; import {SimpleBlobRendererModel, SimpleBlobRenderer} from "./simplerenderer"; import {isBlank} from "./util"; import {PluginModel} from "./plugins"; +import {PtyDataBuffer} from "./ptydata"; import * as lineutil from "./lineutil"; dayjs.extend(localizedFormat) @@ -107,6 +108,237 @@ class LineAvatar extends React.Component<{line : LineType, cmd : Cmd, onRightCli } } +@mobxReact.observer +class SmallLineAvatar extends React.Component<{line : LineType, cmd : Cmd, onRightClick? : (e : any) => void}, {}> { + 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); + let isComment = (line.linetype == "text"); + let icon : string = null; + let iconTitle = null; + if (isComment) { + icon = "fa-comment"; + iconTitle = "comment"; + } + else if (status == "done") { + icon = "fa-check"; + iconTitle = "done"; + } + else if (status == "hangup" || status == "error") { + icon = "fa-triangle-exclamation"; + iconTitle = status; + } + else if (status == "running" || "detached") { + icon = "fa-rotate fa-spin"; + iconTitle = "running"; + } + else { + icon = "fa-square-question"; + iconTitle = "unknown"; + } + return ( +