mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
add line starring
This commit is contained in:
@@ -389,6 +389,17 @@ class LineCmd extends React.Component<{sw : ScreenWindow, line : LineType, width
|
||||
let {line} = this.props;
|
||||
GlobalCommandRunner.swSelectLine(String(line.linenum), "cmd");
|
||||
}
|
||||
|
||||
@boundMethod
|
||||
clickStar() {
|
||||
let {line} = this.props;
|
||||
if (!line.star || line.star == 0) {
|
||||
GlobalCommandRunner.lineStar(line.lineid, 1);
|
||||
}
|
||||
else {
|
||||
GlobalCommandRunner.lineStar(line.lineid, 0);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
let {sw, line, width, staticRender, visible} = this.props;
|
||||
@@ -446,6 +457,15 @@ class LineCmd extends React.Component<{sw : ScreenWindow, line : LineType, width
|
||||
{this.renderCmdText(cmd, remote)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex-spacer"/>
|
||||
<div className={cn("line-star", {"active": line.star > 0})} onClick={this.clickStar}>
|
||||
<If condition={!line.star || line.star == 0}>
|
||||
<i className="fa fa-star-o"/>
|
||||
</If>
|
||||
<If condition={line.star > 0}>
|
||||
<i className="fa fa-star"/>
|
||||
</If>
|
||||
</div>
|
||||
</div>
|
||||
<div className={cn("terminal-wrapper", {"focus": isFocused}, {"cmd-done": !cmd.isRunning()}, {"zero-height": (termHeight == 0)})}>
|
||||
<If condition={!isFocused}>
|
||||
|
||||
@@ -2299,6 +2299,10 @@ class CommandRunner {
|
||||
swSetFocus(focusVal : string) : void {
|
||||
GlobalModel.submitCommand("sw", "set", null, {"focus": focusVal, "nohist": "1"}, true);
|
||||
}
|
||||
|
||||
lineStar(lineId : string, starVal : number) {
|
||||
GlobalModel.submitCommand("line", "star", [lineId, String(starVal)], {"nohist": "1"}, true);
|
||||
}
|
||||
};
|
||||
|
||||
function cmdPacketString(pk : FeCmdPacketType) : string {
|
||||
|
||||
@@ -407,6 +407,22 @@ html, body, #main {
|
||||
}
|
||||
}
|
||||
|
||||
.line-star {
|
||||
display: none;
|
||||
cursor: pointer;
|
||||
padding: 3px;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.line-star.active {
|
||||
display: block;
|
||||
color: @term-bright-yellow;
|
||||
}
|
||||
|
||||
&:hover .line-star {
|
||||
display: block;
|
||||
}
|
||||
|
||||
&.has-rtnstate .terminal-wrapper {
|
||||
padding-bottom: 0;
|
||||
margin-bottom: -5px;
|
||||
@@ -1420,3 +1436,7 @@ input[type=checkbox] {
|
||||
font-size: 12px;
|
||||
margin-left: -3px;
|
||||
}
|
||||
|
||||
.flex-spacer {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ type LineType = {
|
||||
text : string,
|
||||
cmdid : string,
|
||||
contentheight : number,
|
||||
star : number,
|
||||
ephemeral? : boolean,
|
||||
remove? : boolean,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user