mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
colorize prompt for remotes
This commit is contained in:
+5
-2
@@ -205,9 +205,12 @@ class Prompt extends React.Component<{rptr : RemotePtrType, festate : FeStateTyp
|
||||
isRoot = true;
|
||||
}
|
||||
}
|
||||
let className = (isRoot ? "term-bright-red" : "term-bright-green");
|
||||
let colorClass = (isRoot ? "color-red" : "color-green");
|
||||
if (remote && remote.remoteopts && remote.remoteopts.color) {
|
||||
colorClass = "color-" + remote.remoteopts.color;
|
||||
}
|
||||
return (
|
||||
<span className="term-bright-green">[{remoteStr}] {cwd} {isRoot ? "#" : "$"}</span>
|
||||
<span className={cn("term-prompt", colorClass)}>[{remoteStr}] {cwd} {isRoot ? "#" : "$"}</span>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1248,6 +1248,42 @@ input[type=checkbox] {
|
||||
color: @term-bright-red;
|
||||
}
|
||||
|
||||
#main .term-prompt {
|
||||
color: @term-bright-green;
|
||||
|
||||
&.color-green {
|
||||
color: @term-bright-green;
|
||||
}
|
||||
|
||||
&.color-red {
|
||||
color: @term-bright-red;
|
||||
}
|
||||
|
||||
&.color-blue {
|
||||
color: @term-bright-blue;
|
||||
}
|
||||
|
||||
&.color-yellow {
|
||||
color: @term-bright-yellow;
|
||||
}
|
||||
|
||||
&.color-magenta {
|
||||
color: @term-bright-magenta;
|
||||
}
|
||||
|
||||
&.color-cyan {
|
||||
color: @term-bright-cyan;
|
||||
}
|
||||
|
||||
&.color-white {
|
||||
color: @term-bright-white;
|
||||
}
|
||||
|
||||
&.color-orange {
|
||||
color: @tab-orange;
|
||||
}
|
||||
}
|
||||
|
||||
#main .screen-tabs .screen-tab {
|
||||
&.color-green {
|
||||
color: @tab-black-text;
|
||||
|
||||
@@ -80,6 +80,10 @@ type ScreenWindowType = {
|
||||
remove? : boolean,
|
||||
};
|
||||
|
||||
type RemoteOptsType = {
|
||||
color : string,
|
||||
};
|
||||
|
||||
type RemoteType = {
|
||||
remotetype : string,
|
||||
remoteid : string,
|
||||
@@ -100,6 +104,7 @@ type RemoteType = {
|
||||
mshellversion : string,
|
||||
needsmshellupgrade : boolean,
|
||||
waitingforpassword : boolean,
|
||||
remoteopts? : RemoteOptsType,
|
||||
local : boolean,
|
||||
remove? : boolean,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user