(web) css fixes and cleanup

This commit is contained in:
Alexey Kontsevoy 2017-09-04 13:31:46 -04:00
parent 4dad2d9336
commit dd35f5c762
9 changed files with 22 additions and 22 deletions

View file

@ -10,7 +10,7 @@ type access struct {
Read bool `json:"read"`
Edit bool `json:"edit"`
Create bool `json:"create"`
Delete bool `json:"delete"`
Delete bool `json:"remove"`
}
type userACL struct {

View file

@ -189,7 +189,7 @@ const ErrorIndicator = ({ text }) => (
<i className="fa fa-exclamation-triangle fa-3x text-warning"></i>
<div className="m-l">
<strong>Error</strong>
<div className="text-center"><small>{text}</small></div>
<div><small>{text}</small></div>
</div>
</div>
)

View file

@ -136,7 +136,7 @@ const ErrorIndicator = ({ text }) => (
<i className="fa fa-exclamation-triangle fa-3x text-warning"></i>
<div className="m-l">
<strong>Connection error</strong>
<div className="text-center"><small>{text}</small></div>
<div><small>{text}</small></div>
</div>
</div>
)

View file

@ -5,7 +5,7 @@ import Sessions from '../components/sessions/main.jsx';
import PlayerHost from '../components/player/playerHost.jsx';
import reactor from 'app/reactor';
import { fetchSiteEventsWithinTimeRange } from 'app/flux/storedSessionsFilter/actions';
import { getStore } from '../flux/userAcl/store';
import { getAcl } from '../flux/userAcl/store';
const auditNavItem = {
icon: 'fa fa-group',
@ -50,7 +50,7 @@ class AuditFeature extends FeatureBase {
}
onload() {
const sessAccess = getStore().getSessions();
const sessAccess = getAcl().getSessionAccess();
if (sessAccess.read) {
addNavItem(auditNavItem);
this.init();

View file

@ -2,7 +2,6 @@ import reactor from 'app/reactor';
import { TLPT_NODES_RECEIVE } from './actionTypes';
import api from 'app/services/api';
import cfg from 'app/config';
import { showError } from 'app/flux/notifications/actions';
import appGetters from 'app/flux/app/getters';
import Logger from 'app/lib/logger';
@ -17,7 +16,6 @@ export default {
reactor.dispatch(TLPT_NODES_RECEIVE, { siteId, jsonItems: items });
})
.fail(err => {
showError('Unable to retrieve list of nodes');
logger.error('fetchNodes', err);
})
}

View file

@ -19,7 +19,7 @@ import api from 'app/services/api';
import cfg from 'app/config';
import { fetchStoredSession } from './../sessions/actions';
import sessionGetters from './../sessions/getters';
import { getStore } from './../userAcl/store';
import { getAcl } from './../userAcl/store';
const logger = require('app/lib/logger').create('app/flux/player');
@ -68,7 +68,7 @@ const actions = {
close() {
reactor.dispatch(TLPT_PLAYER_CLOSE);
const canListSessions = getStore().getSessions().read;
const canListSessions = getAcl().getSessionAccess().read;
const redirect = canListSessions ? cfg.routes.sessions : cfg.routes.app;
history.push(redirect);
}

View file

@ -17,7 +17,6 @@ limitations under the License.
import reactor from 'app/reactor';
import api from 'app/services/api';
import cfg from 'app/config';
import {showError} from 'app/flux/notifications/actions';
import moment from 'moment';
import appGetters from 'app/flux/app/getters';
import Logger from 'app/lib/logger';
@ -63,12 +62,11 @@ const actions = {
fetchActiveSessions() {
const siteId = reactor.evaluate(appGetters.siteId);
return api.get(cfg.api.getFetchSessionsUrl(siteId))
.done( json => {
.done(json => {
let sessions = json.sessions || [];
reactor.dispatch(RECEIVE_ACTIVE_SESSIONS, { siteId, json: sessions });
})
.fail( err => {
showError('Unable to retrieve list of sessions');
.fail(err => {
logger.error('fetchActiveSessions', err);
});
},

View file

@ -34,7 +34,7 @@ const Access = new Record({
read: false,
edit: false,
create: false,
delete: false
remove: false
})
class AccessListRec extends Record({
@ -42,11 +42,11 @@ class AccessListRec extends Record({
trustedClusters: new Access(),
roles: new Access(),
sessions: new Access(),
sshLogins: []
sshLogins: new List()
}){
constructor(json = {}) {
let map = toImmutable(json);
let sshLogins = new List(map.get('sshLogins'));
const map = toImmutable(json);
const sshLogins = new List(map.get('sshLogins'));
const params = {
sshLogins: sortLogins(sshLogins),
authConnectors: new Access(map.get('authConnectors')),
@ -58,19 +58,19 @@ class AccessListRec extends Record({
super(params);
}
getSessions() {
getSessionAccess() {
return this.get('sessions');
}
getRoles() {
getRoleAccess() {
return this.get('roles');
}
getConnectors() {
getConnectorAccess() {
return this.get('authConnectors');
}
getTrustedClusters() {
getClusterAccess() {
return this.get('trustedClusters');
}
@ -79,7 +79,7 @@ class AccessListRec extends Record({
}
}
export function getStore() {
export function getAcl() {
return reactor.evaluate(['tlpt_user_acl']);
}

View file

@ -68,6 +68,10 @@ const api = {
return err.responseJSON.error.message || msg;
}
if (err.responseText) {
return err.responseText;
}
return msg;
}
}