Skip to content

Commit

Permalink
fixing column width
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-kovoy committed Oct 25, 2016
1 parent 4230761 commit 8b5d60d
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ webpackJsonp([0],{

var openSession = _require4.openSession;

var auth = __webpack_require__(345);
var session = __webpack_require__(237);
var cfg = __webpack_require__(221);

Expand All @@ -73,8 +72,8 @@ webpackJsonp([0],{
{ history: session.getHistory() },
React.createElement(Route, { path: cfg.routes.msgs, component: MessagePage }),
React.createElement(Route, { path: cfg.routes.login, component: Login }),
React.createElement(Route, { path: cfg.routes.logout, onEnter: auth.logout }),
React.createElement(Route, { path: cfg.routes.newUser, component: NewUser }),
React.createElement(Redirect, { from: cfg.routes.logout, to: cfg.routes.login }),
React.createElement(Redirect, { from: cfg.routes.app, to: cfg.routes.nodes }),
React.createElement(
Route,
Expand Down Expand Up @@ -4129,15 +4128,21 @@ webpackJsonp([0],{
displayName: 'GrvTableCell',

render: function render() {
var props = this.props;
return props.isHeader ? React.createElement(
var _props2 = this.props;
var isHeader = _props2.isHeader;
var children = _props2.children;
var _props2$className = _props2.className;
var className = _props2$className === undefined ? '' : _props2$className;

className = 'grv-table-cell ' + className;
return isHeader ? React.createElement(
'th',
{ key: props.key, className: 'grv-table-cell' },
props.children
{ className: className },
children
) : React.createElement(
'td',
{ key: props.key },
props.children
null,
children
);
}
});
Expand Down Expand Up @@ -5069,7 +5074,8 @@ webpackJsonp([0],{
header: React.createElement(SortHeaderCell, {
sortDir: this.state.colSortDirs.nodeIp,
onSortChange: this.onSortChange,
title: 'Node IP'
title: 'Node IP',
className: 'grv-sessions-stored-col-ip'
}),
cell: React.createElement(TextCell, { data: data })
}),
Expand All @@ -5078,6 +5084,7 @@ webpackJsonp([0],{
header: React.createElement(SortHeaderCell, {
sortDir: this.state.colSortDirs.clientIp,
onSortChange: this.onSortChange,
className: 'grv-sessions-stored-col-ip',
title: 'Client IP'
}),
cell: React.createElement(TextCell, { data: data })
Expand Down Expand Up @@ -7684,6 +7691,9 @@ webpackJsonp([0],{
var TLPT_SESSIONS_RECEIVE = _require2.TLPT_SESSIONS_RECEIVE;
var TLPT_SESSIONS_UPDATE = _require2.TLPT_SESSIONS_UPDATE;
var TLPT_SESSIONS_UPDATE_WITH_EVENTS = _require2.TLPT_SESSIONS_UPDATE_WITH_EVENTS;

var PORT_REGEX = /:\d+$/;

exports['default'] = Store({
getInitialState: function getInitialState() {
return toImmutable({});
Expand All @@ -7696,9 +7706,9 @@ webpackJsonp([0],{
}
});

function parseIp(ip) {
ip = ip || '';
return ip.split(':')[0];
function getIp(addr) {
addr = addr || '';
return addr.replace(PORT_REGEX, '');
}

function updateSessionWithEvents(state, events) {
Expand All @@ -7721,8 +7731,8 @@ webpackJsonp([0],{

if (item.event === 'session.start') {
session.created = item.time;
session.nodeIp = parseIp(item['addr.local']);
session.clientIp = parseIp(item['addr.remote']);
session.nodeIp = getIp(item['addr.local']);
session.clientIp = getIp(item['addr.remote']);
}

if (item.event === 'session.end') {
Expand Down
File renamed without changes.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions web/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Teleport by Gravitational</title>
<script src="/web/config.js"></script>
<link rel="shortcut icon" href="/web/app/favicon.ico"><link href="/web/app/vendor.57fc9ee505ddd8fe1c81bdaeec9397a4.css" rel="stylesheet"></head>
<link rel="shortcut icon" href="/web/app/favicon.ico"><link href="/web/app/vendor.ae6b0637750532aa0f1055eb4ab2e37a.css" rel="stylesheet"></head>
<body class="grv">
<div id="app"></div>
<div id="bearer_token" style="display: none;">{{.Session}}</div>
<script type="text/javascript" src="/web/app/vendor.4494c1cffa26639e79aa.js"></script><script type="text/javascript" src="/web/app/styles.4494c1cffa26639e79aa.js"></script><script type="text/javascript" src="/web/app/app.4494c1cffa26639e79aa.js"></script></body>
<script type="text/javascript" src="/web/app/vendor.e2381b56479715f84da4.js"></script><script type="text/javascript" src="/web/app/styles.e2381b56479715f84da4.js"></script><script type="text/javascript" src="/web/app/app.e2381b56479715f84da4.js"></script></body>
</html>
2 changes: 2 additions & 0 deletions web/src/app/components/sessions/storedSessionList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ var StoredSessions = React.createClass({
sortDir={this.state.colSortDirs.nodeIp}
onSortChange={this.onSortChange}
title="Node IP"
className="grv-sessions-stored-col-ip"
/>
}
cell={<TextCell data={data} /> }
Expand All @@ -138,6 +139,7 @@ var StoredSessions = React.createClass({
<SortHeaderCell
sortDir={this.state.colSortDirs.clientIp}
onSortChange={this.onSortChange}
className="grv-sessions-stored-col-ip"
title="Client IP"
/>
}
Expand Down
5 changes: 3 additions & 2 deletions web/src/app/components/table.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ var SortHeaderCell = React.createClass({
*/
var GrvTableCell = React.createClass({
render(){
var props = this.props;
return props.isHeader ? <th key={props.key} className="grv-table-cell">{props.children}</th> : <td key={props.key}>{props.children}</td>;
let { isHeader, children, className='' } = this.props;
className = 'grv-table-cell ' + className;
return isHeader ? <th className={className}>{children}</th> : <td>{children}</td>;
}
});

Expand Down
3 changes: 1 addition & 2 deletions web/src/app/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ var { Router, Route, Redirect } = require('react-router');
var { App, Login, Nodes, Sessions, NewUser, CurrentSessionHost, MessagePage, NotFound } = require('./components');
var { ensureUser } = require('./modules/user/actions');
var { openSession } = require('./modules/currentSession/actions');
var auth = require('./services/auth');
var session = require('./services/session');
var cfg = require('./config');

Expand All @@ -35,8 +34,8 @@ render((
<Router history={session.getHistory()}>
<Route path={cfg.routes.msgs} component={MessagePage}/>
<Route path={cfg.routes.login} component={Login}/>
<Route path={cfg.routes.logout} onEnter={auth.logout}/>
<Route path={cfg.routes.newUser} component={NewUser}/>
<Redirect from={cfg.routes.logout} to={cfg.routes.login}/>
<Redirect from={cfg.routes.app} to={cfg.routes.nodes}/>
<Route path={cfg.routes.app} component={App} onEnter={ensureUser} >
<Route path={cfg.routes.sessions} component={Sessions}/>
Expand Down
12 changes: 7 additions & 5 deletions web/src/app/modules/sessions/sessionStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ var {
TLPT_SESSIONS_UPDATE,
TLPT_SESSIONS_UPDATE_WITH_EVENTS } = require('./actionTypes');

var PORT_REGEX = /:\d+$/;

export default Store({
getInitialState() {
return toImmutable({});
Expand All @@ -32,9 +34,9 @@ export default Store({
}
})

function parseIp(ip){
ip = ip || '';
return ip.split(':')[0];
function getIp(addr){
addr = addr || '';
return addr.replace(PORT_REGEX, '');
}

function updateSessionWithEvents(state, events){
Expand All @@ -57,8 +59,8 @@ function updateSessionWithEvents(state, events){

if(item.event === 'session.start'){
session.created = item.time;
session.nodeIp = parseIp(item['addr.local']);
session.clientIp = parseIp(item['addr.remote']);
session.nodeIp = getIp(item['addr.local']);
session.clientIp = getIp(item['addr.remote']);
}

if(item.event === 'session.end'){
Expand Down
4 changes: 4 additions & 0 deletions web/src/styles/grv-sessions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ limitations under the License.
margin-left: 5px;
}


.grv-sessions-stored-col-ip{
min-width: 90px;
}
}

0 comments on commit 8b5d60d

Please sign in to comment.