This commit is contained in:
sawka
2022-12-12 12:26:55 -08:00
parent 90d32731db
commit cb6712202f
2 changed files with 24 additions and 6 deletions
+6 -4
View File
@@ -1491,7 +1491,7 @@ class InfoRemoteEdit extends React.Component<{}, {}> {
<input type="checkbox" onChange={this.onChangeAutoInstall} checked={this.autoInstallBool.get()}/>
</div>
</div>
<div key="color" className="remote-input-field">
<div key="color" className="remote-input-field" style={{display: "none"}}>
<div className="remote-field-label">color</div>
<div className="remote-field-control select-input">
<select onChange={this.onChangeColorStr} value={this.colorStr.get()}>
@@ -1515,9 +1515,11 @@ class InfoRemoteEdit extends React.Component<{}, {}> {
<div key="controls" style={{marginTop: 15, marginBottom: 10}} className="remote-input-field">
<a tabIndex={0} style={{marginRight: 20}} onClick={this.doSubmitRemote} onKeyDown={this.keyDownCreateRemote} className="text-button success-button">[{isEditMode ? "update" : "create"} remote]</a>
{"|"}
<a tabIndex={0} style={{marginLeft: 20, marginRight: 5}} onClick={this.doArchiveRemote} onKeyDown={this.keyDownCreateRemote} className={cn("text-button", (this.archiveConfirm.get() ? "error-button" : "disabled-button"))}>[archive remote]</a>
<input onChange={this.updateArchiveConfirm} checked={this.archiveConfirm.get()} style={{marginRight: 20}} type="checkbox"/>
{"|"}
<If condition={isEditMode}>
<a tabIndex={0} style={{marginLeft: 20, marginRight: 5}} onClick={this.doArchiveRemote} onKeyDown={this.keyDownCreateRemote} className={cn("text-button", (this.archiveConfirm.get() ? "error-button" : "disabled-button"))}>[archive remote]</a>
<input onChange={this.updateArchiveConfirm} checked={this.archiveConfirm.get()} style={{marginRight: 20}} type="checkbox"/>
{"|"}
</If>
<a tabIndex={0} style={{marginLeft: 20}} onClick={this.doCancel} onKeyDown={this.keyDownCancel} className="text-button grey-button">[cancel (ESC)]</a>
</div>
</form>
+18 -2
View File
@@ -1562,6 +1562,22 @@ class Model {
getApi().onBracketCmd(this.onBracketCmd.bind(this));
getApi().onDigitCmd(this.onDigitCmd.bind(this));
getApi().onLocalServerStatusChange(this.onLocalServerStatusChange.bind(this));
document.addEventListener("keydown", this.docKeyDownHandler.bind(this));
}
docKeyDownHandler(e : any) {
if (isModKeyPress(e)) {
return;
}
if (e.code == "Escape") {
e.preventDefault();
let inputModel = this.inputModel;
inputModel.toggleInfoMsg();
if (inputModel.inputMode.get() != null) {
inputModel.resetInputMode();
}
return;
}
}
restartLocalServer() : void {
@@ -2263,11 +2279,11 @@ class CommandRunner {
let kwargs = Object.assign({}, kwargsArg);
kwargs["nohist"] = "1";
kwargs["remote"] = remoteid;
GlobalModel.submitCommand("remote", "edit", null, kwargs, true);
GlobalModel.submitCommand("remote", "set", null, kwargs, true);
}
openEditRemote(remoteid : string) : void {
GlobalModel.submitCommand("remote", "edit", null, {"remote": remoteid, "nohist": "1", "visual": "1"}, true);
GlobalModel.submitCommand("remote", "set", null, {"remote": remoteid, "nohist": "1", "visual": "1"}, true);
}
archiveRemote(remoteid : string) {