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

fix disappearing scanned hosts #2357

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix disappearing scanned hosts
  • Loading branch information
sarahd93 committed Aug 3, 2020
commit b1fab5d8036f8565e30601f1d018cac2a75ab5df
13 changes: 8 additions & 5 deletions gsa/src/web/pages/reports/details/summary.js
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import React from 'react';
import React, {useState} from 'react';

import styled from 'styled-components';

@@ -100,8 +100,11 @@ const Summary = ({

const {id, name, comment, progress} = task;

const hosts_count =
isDefined(hosts) && isDefined(hosts.counts) ? hosts.counts.all : 0;
const [hostsCount, setHostsCount] = useState(0);

if (hosts?.counts?.all > hostsCount) {
setHostsCount(hosts.counts.all);
}

const filterString = isDefined(filter)
? filter.simple().toFilterString()
@@ -244,10 +247,10 @@ const Summary = ({
<TableData>{slave.name}</TableData>
</TableRow>
)}
{hosts_count > 0 && (
{hostsCount > 0 && (
<TableRow>
<TableData>{_('Hosts scanned')}</TableData>
<TableData>{hosts_count}</TableData>
<TableData>{hostsCount}</TableData>
</TableRow>
)}
<TableRow>