mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
4653 add Ingest History to Data Source Summary
This commit is contained in:
parent
465bba9b43
commit
0726f3407b
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Autopsy Forensic Browser
|
* Autopsy Forensic Browser
|
||||||
*
|
*
|
||||||
* Copyright 2011-2018 Basis Technology Corp.
|
* Copyright 2011-2019 Basis Technology Corp.
|
||||||
* Contact: carrier <at> sleuthkit <dot> org
|
* Contact: carrier <at> sleuthkit <dot> org
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@ -35,6 +35,7 @@ import org.sleuthkit.datamodel.IngestJobInfo;
|
|||||||
import org.sleuthkit.datamodel.IngestModuleInfo;
|
import org.sleuthkit.datamodel.IngestModuleInfo;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
import org.sleuthkit.datamodel.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Panel for displaying ingest job history.
|
* Panel for displaying ingest job history.
|
||||||
@ -44,9 +45,11 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(IngestJobInfoPanel.class.getName());
|
private static final Logger logger = Logger.getLogger(IngestJobInfoPanel.class.getName());
|
||||||
private List<IngestJobInfo> ingestJobs;
|
private List<IngestJobInfo> ingestJobs;
|
||||||
|
private List<IngestJobInfo> ingestJobsForSelectedDataSource = new ArrayList<>();
|
||||||
private IngestJobTableModel ingestJobTableModel = new IngestJobTableModel();
|
private IngestJobTableModel ingestJobTableModel = new IngestJobTableModel();
|
||||||
private IngestModuleTableModel ingestModuleTableModel = new IngestModuleTableModel(null);
|
private IngestModuleTableModel ingestModuleTableModel = new IngestModuleTableModel(null);
|
||||||
private final DateFormat datetimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
private final DateFormat datetimeFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
|
||||||
|
private DataSource selectedDataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form IngestJobInfoPanel
|
* Creates new form IngestJobInfoPanel
|
||||||
@ -61,7 +64,7 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel {
|
|||||||
private void customizeComponents() {
|
private void customizeComponents() {
|
||||||
refresh();
|
refresh();
|
||||||
this.ingestJobTable.getSelectionModel().addListSelectionListener((ListSelectionEvent e) -> {
|
this.ingestJobTable.getSelectionModel().addListSelectionListener((ListSelectionEvent e) -> {
|
||||||
IngestJobInfo currJob = (ingestJobTable.getSelectedRow() < 0 ? null : this.ingestJobs.get(ingestJobTable.getSelectedRow()));
|
IngestJobInfo currJob = (ingestJobTable.getSelectedRow() < 0 ? null : this.ingestJobsForSelectedDataSource.get(ingestJobTable.getSelectedRow()));
|
||||||
this.ingestModuleTableModel = new IngestModuleTableModel(currJob);
|
this.ingestModuleTableModel = new IngestModuleTableModel(currJob);
|
||||||
this.ingestModuleTable.setModel(this.ingestModuleTableModel);
|
this.ingestModuleTable.setModel(this.ingestModuleTableModel);
|
||||||
});
|
});
|
||||||
@ -75,12 +78,21 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateIngestHistoryData(DataSource selectedDataSource){
|
||||||
|
this.selectedDataSource = selectedDataSource;
|
||||||
|
ingestJobsForSelectedDataSource.clear();
|
||||||
|
for (IngestJobInfo jobInfo : ingestJobs){
|
||||||
|
ingestJobsForSelectedDataSource.add(jobInfo);
|
||||||
|
}
|
||||||
|
this.repaint();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void refresh() {
|
private void refresh() {
|
||||||
try {
|
try {
|
||||||
SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase();
|
SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase();
|
||||||
List<IngestJobInfo> ingestJobs = skCase.getIngestJobs();
|
this.ingestJobs = skCase.getIngestJobs();
|
||||||
this.ingestJobs = ingestJobs;
|
updateIngestHistoryData(selectedDataSource);
|
||||||
this.repaint();
|
|
||||||
} catch (TskCoreException | NoCurrentCaseException ex) {
|
} catch (TskCoreException | NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Failed to load ingest jobs.", ex);
|
logger.log(Level.SEVERE, "Failed to load ingest jobs.", ex);
|
||||||
JOptionPane.showMessageDialog(this, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE);
|
JOptionPane.showMessageDialog(this, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE);
|
||||||
@ -104,7 +116,7 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRowCount() {
|
public int getRowCount() {
|
||||||
return ingestJobs.size();
|
return ingestJobsForSelectedDataSource.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -114,7 +126,7 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getValueAt(int rowIndex, int columnIndex) {
|
public Object getValueAt(int rowIndex, int columnIndex) {
|
||||||
IngestJobInfo currIngestJob = ingestJobs.get(rowIndex);
|
IngestJobInfo currIngestJob = ingestJobsForSelectedDataSource.get(rowIndex);
|
||||||
if (columnIndex == 0) {
|
if (columnIndex == 0) {
|
||||||
try {
|
try {
|
||||||
SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase();
|
SleuthkitCase skCase = Case.getCurrentCaseThrows().getSleuthkitCase();
|
||||||
|
@ -25,6 +25,7 @@ import java.util.Observer;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javax.swing.event.ListSelectionEvent;
|
import javax.swing.event.ListSelectionEvent;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.IngestJobInfoPanel;
|
||||||
import org.sleuthkit.datamodel.DataSource;
|
import org.sleuthkit.datamodel.DataSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -36,6 +37,7 @@ final class DataSourceSummaryDialog extends javax.swing.JDialog implements Obser
|
|||||||
private DataSourceSummaryCountsPanel countsPanel;
|
private DataSourceSummaryCountsPanel countsPanel;
|
||||||
private DataSourceSummaryDetailsPanel detailsPanel;
|
private DataSourceSummaryDetailsPanel detailsPanel;
|
||||||
private DataSourceBrowser dataSourcesPanel;
|
private DataSourceBrowser dataSourcesPanel;
|
||||||
|
private IngestJobInfoPanel ingestHistoryPanel;
|
||||||
private static final Logger logger = Logger.getLogger(DataSourceSummaryDialog.class.getName());
|
private static final Logger logger = Logger.getLogger(DataSourceSummaryDialog.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -44,26 +46,30 @@ final class DataSourceSummaryDialog extends javax.swing.JDialog implements Obser
|
|||||||
* datasource.
|
* datasource.
|
||||||
*/
|
*/
|
||||||
@Messages({
|
@Messages({
|
||||||
"DataSourceSummaryPanel.window.title=Data Sources Summary",
|
"DataSourceSummaryDialog.window.title=Data Sources Summary",
|
||||||
"DataSourceSummaryPanel.countsTab.title=Counts",
|
"DataSourceSummaryDialog.countsTab.title=Counts",
|
||||||
"DataSourceSummaryPanel.detailsTab.title=Details"
|
"DataSourceSummaryDialog.detailsTab.title=Details",
|
||||||
|
"DataSourceSummaryDialog.ingestHistoryTab.title=Ingest History"
|
||||||
})
|
})
|
||||||
DataSourceSummaryDialog(Frame owner) {
|
DataSourceSummaryDialog(Frame owner) {
|
||||||
super(owner, Bundle.DataSourceSummaryPanel_window_title(), true);
|
super(owner, Bundle.DataSourceSummaryDialog_window_title(), true);
|
||||||
Map<Long, String> usageMap = DataSourceInfoUtilities.getDataSourceTypes();
|
Map<Long, String> usageMap = DataSourceInfoUtilities.getDataSourceTypes();
|
||||||
Map<Long, Long> fileCountsMap = DataSourceInfoUtilities.getCountsOfFiles();
|
Map<Long, Long> fileCountsMap = DataSourceInfoUtilities.getCountsOfFiles();
|
||||||
countsPanel = new DataSourceSummaryCountsPanel(fileCountsMap);
|
countsPanel = new DataSourceSummaryCountsPanel(fileCountsMap);
|
||||||
detailsPanel = new DataSourceSummaryDetailsPanel(usageMap);
|
detailsPanel = new DataSourceSummaryDetailsPanel(usageMap);
|
||||||
dataSourcesPanel = new DataSourceBrowser(usageMap, fileCountsMap);
|
dataSourcesPanel = new DataSourceBrowser(usageMap, fileCountsMap);
|
||||||
|
ingestHistoryPanel = new IngestJobInfoPanel();
|
||||||
initComponents();
|
initComponents();
|
||||||
dataSourceSummarySplitPane.setLeftComponent(dataSourcesPanel);
|
dataSourceSummarySplitPane.setLeftComponent(dataSourcesPanel);
|
||||||
dataSourceTabbedPane.addTab(Bundle.DataSourceSummaryPanel_detailsTab_title(), detailsPanel);
|
dataSourceTabbedPane.addTab(Bundle.DataSourceSummaryDialog_detailsTab_title(), detailsPanel);
|
||||||
dataSourceTabbedPane.addTab(Bundle.DataSourceSummaryPanel_countsTab_title(), countsPanel);
|
dataSourceTabbedPane.addTab(Bundle.DataSourceSummaryDialog_countsTab_title(), countsPanel);
|
||||||
|
dataSourceTabbedPane.addTab(Bundle.DataSourceSummaryDialog_ingestHistoryTab_title(), ingestHistoryPanel);
|
||||||
dataSourcesPanel.addListSelectionListener((ListSelectionEvent e) -> {
|
dataSourcesPanel.addListSelectionListener((ListSelectionEvent e) -> {
|
||||||
if (!e.getValueIsAdjusting()) {
|
if (!e.getValueIsAdjusting()) {
|
||||||
DataSource selectedDataSource = dataSourcesPanel.getSelectedDataSource();
|
DataSource selectedDataSource = dataSourcesPanel.getSelectedDataSource();
|
||||||
countsPanel.updateCountsTableData(selectedDataSource);
|
countsPanel.updateCountsTableData(selectedDataSource);
|
||||||
detailsPanel.updateDetailsPanelData(selectedDataSource);
|
detailsPanel.updateDetailsPanelData(selectedDataSource);
|
||||||
|
ingestHistoryPanel.updateIngestHistoryData(selectedDataSource);
|
||||||
this.repaint();
|
this.repaint();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user