mirror of
https://github.com/weaveworks/scope.git
synced 2026-08-19 04:16:21 +00:00
More Terminal-UI and code post review fixes.
This commit is contained in:
@@ -35,7 +35,6 @@ function getStateFromStores() {
|
||||
topologiesLoaded: AppStore.isTopologiesLoaded(),
|
||||
version: AppStore.getVersion(),
|
||||
websocketClosed: AppStore.isWebsocketClosed()
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -4,10 +4,6 @@ import AppStore from '../stores/app-store';
|
||||
import Terminal from './terminal';
|
||||
import { receiveControlPipeFromParams } from '../actions/app-actions';
|
||||
|
||||
export function shouldLaunchTerminal() {
|
||||
return window.location.hash.indexOf('#!/terminal/') === 0;
|
||||
}
|
||||
|
||||
function getStateFromStores() {
|
||||
return {
|
||||
controlPipe: AppStore.getControlPipe()
|
||||
|
||||
@@ -198,7 +198,7 @@ export default class Terminal extends React.Component {
|
||||
ev.preventDefault();
|
||||
const paramString = JSON.stringify(this.props);
|
||||
clickCloseTerminal(this.getPipeId());
|
||||
openNewWindow(`/terminal.html#!/state/${paramString}`);
|
||||
openNewWindow(`terminal.html#!/state/${paramString}`);
|
||||
}
|
||||
|
||||
handleResize() {
|
||||
@@ -247,8 +247,8 @@ export default class Terminal extends React.Component {
|
||||
<div>
|
||||
<h3>Connection Closed</h3>
|
||||
<p>
|
||||
The connection to this container has been closed. <span
|
||||
className="link" onClick={this.handleCloseClick}>Close terminal.</span>
|
||||
The connection to this container has been closed.
|
||||
<div className="link" onClick={this.handleCloseClick}>Close terminal</div>
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
require('font-awesome-webpack');
|
||||
require('../styles/main.less');
|
||||
|
||||
import React from 'react';
|
||||
|
||||
@@ -3,16 +3,13 @@ import page from 'page';
|
||||
import { route } from '../actions/app-actions';
|
||||
import AppStore from '../stores/app-store';
|
||||
|
||||
//
|
||||
// TODO: move this logic somewhere else.
|
||||
//
|
||||
function shouldReplaceState(prevState, nextState) {
|
||||
return (
|
||||
// Opening a new terminal while an existing one is open.
|
||||
(prevState.controlPipe && nextState.controlPipe) ||
|
||||
// Closing a terminal.
|
||||
(prevState.controlPipe && !nextState.controlPipe)
|
||||
);
|
||||
// Opening a new terminal while an existing one is open.
|
||||
const terminalToTerminal = (prevState.controlPipe && nextState.controlPipe);
|
||||
// Closing a terminal.
|
||||
const closingTheTerminal = (prevState.controlPipe && !nextState.controlPipe);
|
||||
|
||||
return terminalToTerminal || closingTheTerminal;
|
||||
}
|
||||
|
||||
export function updateRoute() {
|
||||
|
||||
@@ -61,11 +61,6 @@
|
||||
transition-delay: .5s;
|
||||
}
|
||||
|
||||
.link {
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.hide {
|
||||
opacity: 0;
|
||||
}
|
||||
@@ -652,6 +647,12 @@ h2 {
|
||||
margin: 4px 0;
|
||||
color: @white;
|
||||
}
|
||||
.link {
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
cursor: pointer;
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
|
||||
&-cursor {
|
||||
|
||||
Reference in New Issue
Block a user