mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Lens app source code (#119)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com> Signed-off-by: Cody Belcher <cody.t.belcher@gmail.com>
This commit is contained in:
1 parent
492ea272d1
commit
d057cb17c6
797 files changed
+73714
-215
No files matched your search
@@ -0,0 +1,51 @@
|
||||
import "./terminal-tab.scss"
|
||||
|
||||
import React from "react"
|
||||
import { observer } from "mobx-react";
|
||||
import { Trans } from "@lingui/macro";
|
||||
import { autobind, cssNames } from "../../utils";
|
||||
import { DockTab, DockTabProps } from "./dock-tab";
|
||||
import { Icon } from "../icon";
|
||||
import { terminalStore } from "./terminal.store";
|
||||
|
||||
interface Props extends DockTabProps {
|
||||
}
|
||||
|
||||
@observer
|
||||
export class TerminalTab extends React.Component<Props> {
|
||||
get tabId() {
|
||||
return this.props.value.id;
|
||||
}
|
||||
|
||||
get isDisconnected() {
|
||||
return terminalStore.isDisconnected(this.tabId);
|
||||
}
|
||||
|
||||
@autobind()
|
||||
reconnect() {
|
||||
terminalStore.reconnect(this.tabId);
|
||||
}
|
||||
|
||||
render() {
|
||||
const tabIcon = <Icon svg="terminal"/>;
|
||||
const className = cssNames("TerminalTab", this.props.className, {
|
||||
disconnected: this.isDisconnected,
|
||||
});
|
||||
return (
|
||||
<DockTab
|
||||
{...this.props}
|
||||
className={className}
|
||||
icon={tabIcon}
|
||||
moreActions={this.isDisconnected && (
|
||||
<Icon
|
||||
small
|
||||
material="refresh"
|
||||
className="restart-icon"
|
||||
tooltip={<Trans>Restart session</Trans>}
|
||||
onClick={this.reconnect}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user