Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GUI miscellaneous #991

Merged
merged 10 commits into from
Oct 4, 2018
8 changes: 5 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Michael Wiegand (wiegandm) and asmaack.

Main changes compared to 8.0+beta1

* Put NVT preferences into own tab on detailspage #991
* Change report summary table appearance #991
* Changed visual appearance of Tables #983
* Changed Donut Chart to a Pie Chart #982
* Improved visual appearance of Donut Charts while resizing #979
Expand Down Expand Up @@ -47,7 +49,7 @@ Main changes compared to 8.0+beta1
* Improved login page layout #859
* Removed sticky menu in header #857
* Update locales if they are changed at the User Settings #856
* Refined the menu appappearance #852, #869
* Refined the menu appearance #852, #869
* Reduced default max height for dialogs to 400px #843
* Show Report page header before report is loaded #825
* Clear/Flush redux store on logout #797
Expand Down Expand Up @@ -269,7 +271,7 @@ Main changes since 6.1+beta1:
* Add subject and message input for email alerts and allow the use of
various variables in the message text.
* Various extensions to support OSP 1.0 and first 1.1 features.
* Add charts to reports section.
* Add charts to reports section.
* Split any dual form pages into separate ones for using the popup
dialogs (for example new/upload combinations).
* Add an upload icon to the Reports page header.
Expand Down Expand Up @@ -1040,7 +1042,7 @@ Security Assistant (GSA). It is the web client that makes the full feature set
of OpenVAS Manager available in a web browser.

This release -- in combination with the OpenVAS Manager 4.0+beta1 release --
introduces the renaming of "Escalator" to "Alert" and an improved handling
introduces the renaming of "Escalator" to "Alert" and an improved handling
of the Targets list.

Many thanks to everyone who has contributed to this release:
Expand Down
12 changes: 6 additions & 6 deletions gsa/src/web/entity/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ import styled from 'styled-components';

import {isDefined} from 'gmp/utils/identity';

import PropTypes from '../utils/proptypes.js';
import PropTypes from 'web/utils/proptypes';

import Toolbar from '../components/bar/toolbar.js';
import Toolbar from 'web/components/bar/toolbar';

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

import Loading from '../components/loading/loading.js';
import Loading from 'web/components/loading/loading';

import Section from '../components/section/section.js';
import Section from 'web/components/section/section';

import EntityInfo from './info.js';
import EntityInfo from './info';

export const Col = styled.col`
width: ${props => props.width};
Expand Down
28 changes: 14 additions & 14 deletions gsa/src/web/pages/nvts/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ import {isDefined} from 'gmp/utils/identity';

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

import PropTypes from '../../utils/proptypes.js';
import PropTypes from 'web/utils/proptypes';

import DetailsBlock from '../../entity/block.js';
import DetailsBlock from 'web/entity/block';

import Severitybar from '../../components/bar/severitybar.js';
import Severitybar from 'web/components/bar/severitybar';

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

import Link from '../../components/link/link.js';
import Link from 'web/components/link/link';

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 './references.js';
import Solution from './solution.js';
import References from './references';
import Solution from './solution';
import Pre from './preformatted';

const NvtDetails = ({
Expand Down Expand Up @@ -79,7 +79,7 @@ const NvtDetails = ({
}

<DetailsBlock
title={_('Vulnerability Scoring')}
title={_('Scoring')}
>
<InfoTable>
<TableBody>
Expand Down Expand Up @@ -114,7 +114,7 @@ const NvtDetails = ({

{isDefined(tags.insight) && tags.insight !== TAG_NA &&
<DetailsBlock
title={_('Vulnerability Insight')}
title={_('Insight')}
>
<Pre>
{tags.insight}
Expand All @@ -125,7 +125,7 @@ const NvtDetails = ({
{(isDefined(qod) ||
(isDefined(tags.vuldetect) && tags.vuldetect !== TAG_NA)) &&
<DetailsBlock
title={_('Vulnerability Detection Method')}
title={_('Detection Method')}
>
{isDefined(tags.vuldetect) && tags.vuldetect !== TAG_NA &&
<Pre>
Expand Down
177 changes: 93 additions & 84 deletions gsa/src/web/pages/nvts/detailspage.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,14 @@ const Details = ({
}) => {
overrides = overrides.filter(override => override.isActive());
notes = notes.filter(note => note.isActive());
const {preferences, default_timeout} = entity;

return (
<Layout flex="column">

<NvtDetails
entity={entity}
/>

<DetailsBlock
title={_('Preferences')}
>
<Preferences
preferences={preferences}
default_timeout={default_timeout}
/>
</DetailsBlock>

{overrides.length > 0 &&
<DetailsBlock
id="overrides"
Expand Down Expand Up @@ -245,88 +236,106 @@ const open_dialog = (nvt, func) => {
};

const Page = ({
entity,
entity = {},
notes,
overrides,
onChanged,
onDownloaded,
onError,
onInteraction,
...props
}) => (
<NvtComponent
onChanged={onChanged}
onDownloaded={onDownloaded}
onDownloadError={onError}
onInteraction={onInteraction}
>
{({
notecreate,
overridecreate,
download,
}) => (
<EntityPage
{...props}
entity={entity}
toolBarIcons={ToolBarIcons}
title={_('NVT')}
sectionIcon="nvt.svg"
onChanged={onChanged}
onInteraction={onInteraction}
onNoteCreateClick={nvt => open_dialog(nvt, notecreate)}
onNvtDownloadClick={download}
onOverrideCreateClick={nvt => open_dialog(nvt, overridecreate)}
>
{({
activeTab = 0,
onActivateTab,
}) => {
return (
<Layout grow="1" flex="column">
<TabLayout
grow="1"
align={['start', 'end']}
>
<TabList
active={activeTab}
align={['start', 'stretch']}
onActivateTab={onActivateTab}
}) => {
const {
default_timeout,
preferences = [],
userTags,
} = entity;
const numPreferences = preferences.length;

return (
<NvtComponent
onChanged={onChanged}
onDownloaded={onDownloaded}
onDownloadError={onError}
onInteraction={onInteraction}
>
{({
notecreate,
overridecreate,
download,
}) => (
<EntityPage
{...props}
entity={entity}
toolBarIcons={ToolBarIcons}
title={_('NVT')}
sectionIcon="nvt.svg"
onChanged={onChanged}
onInteraction={onInteraction}
onNoteCreateClick={nvt => open_dialog(nvt, notecreate)}
onNvtDownloadClick={download}
onOverrideCreateClick={nvt => open_dialog(nvt, overridecreate)}
>
{({
activeTab = 0,
onActivateTab,
}) => {
return (
<Layout grow="1" flex="column">
<TabLayout
grow="1"
align={['start', 'end']}
>
<Tab>
{_('Information')}
</Tab>
<EntitiesTab entities={entity.userTags}>
{_('User Tags')}
</EntitiesTab>
</TabList>
</TabLayout>

<Tabs active={activeTab}>
<TabPanels>
<TabPanel>
<Details
notes={notes}
overrides={overrides}
entity={entity}
/>
</TabPanel>
<TabPanel>
<EntityTags
entity={entity}
onChanged={onChanged}
onError={onError}
onInteraction={onInteraction}
/>
</TabPanel>
</TabPanels>
</Tabs>
</Layout>
);
}}
</EntityPage>
)}
</NvtComponent>
);
<TabList
active={activeTab}
align={['start', 'stretch']}
onActivateTab={onActivateTab}
>
<Tab>
{_('Information')}
</Tab>
<EntitiesTab count={numPreferences}>
{_('Preferences')}
</EntitiesTab>
<EntitiesTab entities={userTags}>
{_('User Tags')}
</EntitiesTab>
</TabList>
</TabLayout>

<Tabs active={activeTab}>
<TabPanels>
<TabPanel>
<Details
notes={notes}
overrides={overrides}
entity={entity}
/>
</TabPanel>
<TabPanel>
<Preferences
preferences={preferences}
default_timeout={default_timeout}
/>
</TabPanel>
<TabPanel>
<EntityTags
entity={entity}
onChanged={onChanged}
onError={onError}
onInteraction={onInteraction}
/>
</TabPanel>
</TabPanels>
</Tabs>
</Layout>
);
}}
</EntityPage>
)}
</NvtComponent>
);
};

Page.propTypes = {
entity: PropTypes.model,
Expand Down
9 changes: 5 additions & 4 deletions gsa/src/web/pages/nvts/nvtpreference.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import Radio from 'web/components/form/radio';
import TextField from 'web/components/form/textfield';
import YesNoRadio from 'web/components/form/yesnoradio';

import Divider from 'web/components/layout/divider';
import Layout from 'web/components/layout/layout';

import TableData from 'web/components/table/data';
Expand Down Expand Up @@ -96,7 +97,7 @@ class NvtPreference extends React.Component {
}
else if (type === 'password') {
input = (
<Layout>
<Divider>
<Checkbox
title={_('Replace existing password with')}
checked={checked}
Expand All @@ -107,12 +108,12 @@ class NvtPreference extends React.Component {
value={value}
onChange={this.onPreferenceChange}
/>
</Layout>
</Divider>
);
}
else if (type === 'file') {
input = (
<Layout>
<Divider>
<Checkbox
title={
isEmpty(preference.value) ?
Expand All @@ -126,7 +127,7 @@ class NvtPreference extends React.Component {
disabled={!checked}
onChange={this.onPreferenceChange}
/>
</Layout>
</Divider>
);
}
else if (type === 'radio') {
Expand Down
14 changes: 7 additions & 7 deletions gsa/src/web/pages/nvts/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import _ from 'gmp/locale';

import {isDefined} from 'gmp/utils/identity';

import PropTypes from '../../utils/proptypes.js';
import PropTypes from 'web/utils/proptypes';

import Table from '../../components/table/stripedtable.js';
import TableBody from '../../components/table/body.js';
import TableData from '../../components/table/data.js';
import TableHeader from '../../components/table/header.js';
import TableHead from '../../components/table/head.js';
import TableRow from '../../components/table/row.js';
import Table from 'web/components/table/stripedtable';
import TableBody from 'web/components/table/body';
import TableData from 'web/components/table/data';
import TableHeader from 'web/components/table/header';
import TableHead from 'web/components/table/head';
import TableRow from 'web/components/table/row';

const Preferences = ({
preferences = [],
Expand Down
Loading