Skip to content

Commit

Permalink
Merge pull request #1004 from swaterkamp/GUImisc
Browse files Browse the repository at this point in the history
GUI miscellaneous #4
  • Loading branch information
swaterkamp authored Oct 8, 2018
2 parents dbeeac3 + bfad9e7 commit b6aca30
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 38 deletions.
2 changes: 1 addition & 1 deletion gsa/src/gmp/commands/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class UserCommand extends EntityCommand {
forEach(group.auth_conf_setting, setting => {
values[setting.key] = setting.value;
if (isDefined(setting.certificate_info)) {
values.certificate_info = setting.certificate_info;
values.certificateInfo = setting.certificate_info;
}
});

Expand Down
3 changes: 2 additions & 1 deletion gsa/src/web/pages/help/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ const TextBlock = styled.div`
max-width: 600px;
min-width: 400px;
margin-right: 30px;
text-align: left;
@media screen and (max-width: 800px) {
margin-right: 0px;
};
Expand All @@ -67,7 +68,7 @@ const About = () => (
>
<TextBlock>
<h1>Greenbone Security Assistant</h1>
<h3>Version 7.1+beta1</h3>
<h3>Version 8.0+beta2</h3>
<DivP>The Greenbone Security Assistant (GSA) is the web-based
user interface of the Greenbone Vulnerability Manager (GVM).
</DivP>
Expand Down
35 changes: 18 additions & 17 deletions gsa/src/web/pages/ldap/ldappage.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class LdapAuthentication extends React.Component {
authdn: '',
ldaphost: '',
enable: '',
certificate_info: {},
certificateInfo: {},
loading: 'true',
};

Expand All @@ -83,19 +83,19 @@ class LdapAuthentication extends React.Component {

getLdapAuth() {
const {gmp} = this.props;
const auth_data = gmp.user.currentAuthSettings().then(response => {
const authData = gmp.user.currentAuthSettings().then(response => {
const data = response.data.get('method:ldap_connect');
let {authdn, certificate_info, enable, ldaphost} = data;
let {authdn, certificateInfo, enable, ldaphost} = data;
// handle getting enable as "true" but posting it as 1
enable = enable === 'true' ? YES_VALUE : NO_VALUE;
this.setState({
authdn,
certificate_info,
certificateInfo,
enable,
ldaphost,
});
});
return auth_data;
return authData;
}

handleInteraction() {
Expand All @@ -108,13 +108,14 @@ class LdapAuthentication extends React.Component {
handleSaveSettings() {
const {
authdn,
certificate_info,
certificateInfo,
enable,
ldaphost,
} = this.state;

const data = {
authdn,
certificate_info,
certificateInfo,
enable,
ldaphost,
};
Expand All @@ -129,8 +130,8 @@ class LdapAuthentication extends React.Component {
this.setState({[name]: value});
}

showCertfificateInfo(certificate_info) {
if (isDefined(certificate_info)) {
showCertfificateInfo(certificateInfo) {
if (isDefined(certificateInfo)) {
return (
<Table>
<TableBody>
Expand All @@ -139,31 +140,31 @@ class LdapAuthentication extends React.Component {
{_('Activation')}
</TableData>
<TableData>
{certificate_info.activationTime}
{certificateInfo.activationTime}
</TableData>
</TableRow>
<TableRow>
<TableData>
{_('Expiration')}
</TableData>
<TableData>
{certificate_info.expirationTime}
{certificateInfo.expirationTime}
</TableData>
</TableRow>
<TableRow>
<TableData>
{_('MD5 Fingerprint')}
</TableData>
<TableData>
{certificate_info.md5_fingerprint}
{certificateInfo.md5_fingerprint}
</TableData>
</TableRow>
<TableRow>
<TableData>
{_('Issued by')}
</TableData>
<TableData>
{certificate_info.issuer}
{certificateInfo.issuer}
</TableData>
</TableRow>
</TableBody>
Expand All @@ -181,7 +182,7 @@ class LdapAuthentication extends React.Component {

const {
authdn,
certificate_info,
certificateInfo,
enable,
ldaphost,
} = this.state;
Expand Down Expand Up @@ -226,21 +227,21 @@ class LdapAuthentication extends React.Component {
</FormGroup>
<FormGroup title={_('CA Certificate')} titlesize="5">
<Layout flex="column">
{this.showCertfificateInfo(certificate_info)}
{this.showCertfificateInfo(certificateInfo)}
<FileField
name="certificate"
onChange={this.handleValueChange}
/>
</Layout>
</FormGroup>
<Layout align="center">
<FormGroup title=" ">
<Button
width="auto"
onClick={this.handleSaveSettings}
>
{_('Save')}
</Button>
</Layout>
</FormGroup>
</Layout>
</Layout>
);
Expand Down
10 changes: 6 additions & 4 deletions gsa/src/web/pages/radius/radiuspage.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class RadiusAuthentication extends React.Component {

getRadiusAuth() {
const {gmp} = this.props;
const auth_data = gmp.user.currentAuthSettings().then(response => {
const authData = gmp.user.currentAuthSettings().then(response => {
const data = response.data.get('method:radius_connect');
let {enable, radiushost, radiuskey} = data;
// handle getting enable as "true" but posting it as 1
Expand All @@ -88,7 +88,7 @@ class RadiusAuthentication extends React.Component {
radiuskey,
});
});
return auth_data;
return authData;
}

handleInteraction() {
Expand All @@ -104,11 +104,13 @@ class RadiusAuthentication extends React.Component {
radiushost,
radiuskey,
} = this.state;

const data = {
enable,
radiushost,
radiuskey,
};

const {gmp} = this.props;

this.handleInteraction();
Expand Down Expand Up @@ -171,14 +173,14 @@ class RadiusAuthentication extends React.Component {
/>
</FormGroup>
</Layout>
<Layout align="center">
<FormGroup title=" ">
<Button
width="auto"
onClick={this.handleSaveSettings}
>
{_('Save')}
</Button>
</Layout>
</FormGroup>
</Layout>
);
}
Expand Down
4 changes: 2 additions & 2 deletions gsa/src/web/pages/reports/scaninfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const ReportScanInfoTable = ({
{is_ended &&
<TableRow>
<TableData>
{delta ? _('Scan Duration Report 1') : _('Scan Duration')}
{delta ? _('Scan Duration Report 1') : _('Scan Duration')}
</TableData>
<TableData>
{scanDuration(scan_start, scan_end)}
Expand Down Expand Up @@ -216,7 +216,7 @@ const ReportScanInfoTable = ({
{delta && delta_report.scan_end.isValid() &&
<TableRow>
<TableData>
{_('Scan Duration Report 2')}
{_('Scan Duration Report 2')}
</TableData>
<TableData>
{scanDuration(delta_report.scan_start, delta_report.scan_end)}
Expand Down
27 changes: 16 additions & 11 deletions gsa/src/web/pages/results/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,23 @@ import {isEmpty} from 'gmp/utils/string';

import {TAG_NA} from 'gmp/models/nvt';

import Layout from '../../components/layout/layout.js';
import Layout from 'web/components/layout/layout';

import PropTypes from '../../utils/proptypes.js';
import {renderNvtName} from '../../utils/render.js';
import PropTypes from 'web/utils/proptypes';
import {renderNvtName} from 'web/utils/render';

import DetailsBlock from '../../entity/block.js';
import DetailsBlock from 'web/entity/block';
import {Col} from 'web/entity/page';

import DetailsLink from '../../components/link/detailslink.js';
import DetailsLink from 'web/components/link/detailslink';

import InfoTable from '../../components/table/infotable.js';
import TableBody from '../../components/table/body.js';
import TableData from '../../components/table/data.js';
import TableRow from '../../components/table/row.js';
import InfoTable from 'web/components/table/infotable';
import TableBody from 'web/components/table/body';
import TableData from 'web/components/table/data';
import TableRow from 'web/components/table/row';

import References from '../nvts/references.js';
import Solution from '../nvts/solution.js';
import References from '../nvts/references';
import Solution from '../nvts/solution';
import P from '../nvts/preformatted';

/*
Expand Down Expand Up @@ -149,6 +150,10 @@ const ResultDetails = ({
{tags.vuldetect}
</Layout>
<InfoTable>
<colgroup>
<Col width="10%"/>
<Col width="90%"/>
</colgroup>
<TableBody>
<TableRow>
<TableData>
Expand Down
4 changes: 2 additions & 2 deletions gsa/src/web/pages/schedules/timeunitselect.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ import {_l} from 'gmp/locale/lang';

import {ReccurenceFrequency} from 'gmp/models/event';

import Select from 'web/components/form/select.js';
import Select from 'web/components/form/select';

const TIME_UNIT_ITEMS = [
{value: ReccurenceFrequency.HOURLY, label: _l('hour(s)')},
{value: ReccurenceFrequency.DAILY, label: _l('day(s)')},
{value: ReccurenceFrequency.WEEKLY, label: _l('week(s)')},
{value: ReccurenceFrequency.MONTHLY, label: _l('month(s)')},
{value: ReccurenceFrequency.YEARLY, label: _l('years(s)')},
{value: ReccurenceFrequency.YEARLY, label: _l('year(s)')},
];

const TimeUnitSelect = props => (
Expand Down

0 comments on commit b6aca30

Please sign in to comment.