mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 09:17:42 +00:00
3610 Priority column now displays yes or no for prioritized
This commit is contained in:
parent
85dff9aee4
commit
eb898c5fce
@ -106,32 +106,14 @@ public final class AutoIngestDashboardTopComponent extends TopComponent {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the AutoIngestMonitor from the current AutoIngestDashboard if there
|
||||
* is one.
|
||||
* Get the current AutoIngestDashboard if there is one.
|
||||
*
|
||||
* @return the current AutoIngestMonitor or null if there is no
|
||||
* AutoIngestDashboard
|
||||
* @return the current AutoIngestDashboard or null if there is not one
|
||||
*/
|
||||
AutoIngestMonitor getAutoIngestMonitor() {
|
||||
AutoIngestDashboard getAutoIngestDashboard() {
|
||||
for (Component comp : getComponents()) {
|
||||
if (comp instanceof AutoIngestDashboard) {
|
||||
return ((AutoIngestDashboard) comp).getMonitor();
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the pending jobs panel from the current AutoIngestDashboard if there
|
||||
* is one.
|
||||
*
|
||||
* @return the AutoIngestJobsPanel which contains the pending AutoIngestJobs
|
||||
* or null if there is no AutoIngestDashboard
|
||||
*/
|
||||
AutoIngestJobsPanel getPendingJobsPanel() {
|
||||
for (Component comp : getComponents()) {
|
||||
if (comp instanceof AutoIngestDashboard) {
|
||||
return ((AutoIngestDashboard) comp).getPendingJobsPanel();
|
||||
return (AutoIngestDashboard) comp;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -41,15 +41,15 @@ import org.sleuthkit.autopsy.guiutils.StatusIconCellRenderer;
|
||||
final class AutoIngestJobsNode extends AbstractNode {
|
||||
|
||||
@Messages({
|
||||
"AutoIngestNode.caseName.text=Case Name",
|
||||
"AutoIngestNode.dataSource.text=Data Source",
|
||||
"AutoIngestNode.hostName.text=Host Name",
|
||||
"AutoIngestNode.stage.text=Stage",
|
||||
"AutoIngestNode.stageTime.text=Time in Stage",
|
||||
"AutoIngestNode.jobCreated.text=Job Created",
|
||||
"AutoIngestNode.jobCompleted.text=Job Completed",
|
||||
"AutoIngestNode.priority.text=Priority",
|
||||
"AutoIngestNode.status.text=Status"
|
||||
"AutoIngestJobsNode.caseName.text=Case Name",
|
||||
"AutoIngestJobsNode.dataSource.text=Data Source",
|
||||
"AutoIngestJobsNode.hostName.text=Host Name",
|
||||
"AutoIngestJobsNode.stage.text=Stage",
|
||||
"AutoIngestJobsNode.stageTime.text=Time in Stage",
|
||||
"AutoIngestJobsNode.jobCreated.text=Job Created",
|
||||
"AutoIngestJobsNode.jobCompleted.text=Job Completed",
|
||||
"AutoIngestJobsNode.priority.text=Prioritized",
|
||||
"AutoIngestJobsNode.status.text=Status"
|
||||
})
|
||||
|
||||
/**
|
||||
@ -85,6 +85,7 @@ final class AutoIngestJobsNode extends AbstractNode {
|
||||
switch (autoIngestJobStatus) {
|
||||
case PENDING_JOB:
|
||||
jobs = jobsSnapshot.getPendingJobs();
|
||||
jobs.sort(new AutoIngestJob.PriorityComparator());
|
||||
break;
|
||||
case RUNNING_JOB:
|
||||
jobs = jobsSnapshot.getRunningJobs();
|
||||
@ -142,6 +143,9 @@ final class AutoIngestJobsNode extends AbstractNode {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Messages({"AutoIngestJobsNode.prioritized.true=Yes",
|
||||
"AutoIngestJobsNode.prioritized.false=No"
|
||||
})
|
||||
protected Sheet createSheet() {
|
||||
Sheet s = super.createSheet();
|
||||
Sheet.Set ss = s.get(Sheet.PROPERTIES);
|
||||
@ -149,32 +153,32 @@ final class AutoIngestJobsNode extends AbstractNode {
|
||||
ss = Sheet.createPropertiesSet();
|
||||
s.put(ss);
|
||||
}
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestNode_caseName_text(), Bundle.AutoIngestNode_caseName_text(), Bundle.AutoIngestNode_caseName_text(),
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestJobsNode_caseName_text(), Bundle.AutoIngestJobsNode_caseName_text(), Bundle.AutoIngestJobsNode_caseName_text(),
|
||||
autoIngestJob.getManifest().getCaseName()));
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestNode_dataSource_text(), Bundle.AutoIngestNode_dataSource_text(), Bundle.AutoIngestNode_dataSource_text(),
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestJobsNode_dataSource_text(), Bundle.AutoIngestJobsNode_dataSource_text(), Bundle.AutoIngestJobsNode_dataSource_text(),
|
||||
autoIngestJob.getManifest().getDataSourcePath().getFileName().toString()));
|
||||
switch (jobStatus) {
|
||||
case PENDING_JOB:
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestNode_jobCreated_text(), Bundle.AutoIngestNode_jobCreated_text(), Bundle.AutoIngestNode_jobCreated_text(),
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestJobsNode_jobCreated_text(), Bundle.AutoIngestJobsNode_jobCreated_text(), Bundle.AutoIngestJobsNode_jobCreated_text(),
|
||||
autoIngestJob.getManifest().getDateFileCreated()));
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestNode_priority_text(), Bundle.AutoIngestNode_priority_text(), Bundle.AutoIngestNode_priority_text(),
|
||||
autoIngestJob.getPriority()));
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestJobsNode_priority_text(), Bundle.AutoIngestJobsNode_priority_text(), Bundle.AutoIngestJobsNode_priority_text(),
|
||||
autoIngestJob.getPriority() > 0 ? Bundle.AutoIngestJobsNode_prioritized_true() : Bundle.AutoIngestJobsNode_prioritized_false()));
|
||||
break;
|
||||
case RUNNING_JOB:
|
||||
AutoIngestJob.StageDetails status = autoIngestJob.getProcessingStageDetails();
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestNode_hostName_text(), Bundle.AutoIngestNode_hostName_text(), Bundle.AutoIngestNode_hostName_text(),
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestJobsNode_hostName_text(), Bundle.AutoIngestJobsNode_hostName_text(), Bundle.AutoIngestJobsNode_hostName_text(),
|
||||
autoIngestJob.getProcessingHostName()));
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestNode_stage_text(), Bundle.AutoIngestNode_stage_text(), Bundle.AutoIngestNode_stage_text(),
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestJobsNode_stage_text(), Bundle.AutoIngestJobsNode_stage_text(), Bundle.AutoIngestJobsNode_stage_text(),
|
||||
status.getDescription()));
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestNode_stageTime_text(), Bundle.AutoIngestNode_stageTime_text(), Bundle.AutoIngestNode_stageTime_text(),
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestJobsNode_stageTime_text(), Bundle.AutoIngestJobsNode_stageTime_text(), Bundle.AutoIngestJobsNode_stageTime_text(),
|
||||
DurationCellRenderer.longToDurationString((Date.from(Instant.now()).getTime()) - (status.getStartDate().getTime()))));
|
||||
break;
|
||||
case COMPLETED_JOB:
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestNode_jobCreated_text(), Bundle.AutoIngestNode_jobCreated_text(), Bundle.AutoIngestNode_jobCreated_text(),
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestJobsNode_jobCreated_text(), Bundle.AutoIngestJobsNode_jobCreated_text(), Bundle.AutoIngestJobsNode_jobCreated_text(),
|
||||
autoIngestJob.getManifest().getDateFileCreated()));
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestNode_jobCompleted_text(), Bundle.AutoIngestNode_jobCompleted_text(), Bundle.AutoIngestNode_jobCompleted_text(),
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestJobsNode_jobCompleted_text(), Bundle.AutoIngestJobsNode_jobCompleted_text(), Bundle.AutoIngestJobsNode_jobCompleted_text(),
|
||||
autoIngestJob.getCompletedDate()));
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestNode_status_text(), Bundle.AutoIngestNode_status_text(), Bundle.AutoIngestNode_status_text(),
|
||||
ss.put(new NodeProperty<>(Bundle.AutoIngestJobsNode_status_text(), Bundle.AutoIngestJobsNode_status_text(), Bundle.AutoIngestJobsNode_status_text(),
|
||||
autoIngestJob.getErrorsOccurred() ? StatusIconCellRenderer.Status.WARNING : StatusIconCellRenderer.Status.OK));
|
||||
break;
|
||||
default:
|
||||
|
@ -63,29 +63,27 @@ final class AutoIngestJobsPanel extends javax.swing.JPanel implements ExplorerMa
|
||||
|
||||
switch (status) {
|
||||
case PENDING_JOB:
|
||||
outlineView.setPropertyColumns(Bundle.AutoIngestNode_dataSource_text(), Bundle.AutoIngestNode_dataSource_text(),
|
||||
Bundle.AutoIngestNode_jobCreated_text(), Bundle.AutoIngestNode_jobCreated_text(),
|
||||
Bundle.AutoIngestNode_priority_text(), Bundle.AutoIngestNode_priority_text());
|
||||
outline.setColumnSorted(3, false, 1);
|
||||
outline.setColumnSorted(0, true, 2);
|
||||
outlineView.setPropertyColumns(Bundle.AutoIngestJobsNode_dataSource_text(), Bundle.AutoIngestJobsNode_dataSource_text(),
|
||||
Bundle.AutoIngestJobsNode_jobCreated_text(), Bundle.AutoIngestJobsNode_jobCreated_text(),
|
||||
Bundle.AutoIngestJobsNode_priority_text(), Bundle.AutoIngestJobsNode_priority_text());
|
||||
break;
|
||||
case RUNNING_JOB:
|
||||
outlineView.setPropertyColumns(Bundle.AutoIngestNode_dataSource_text(), Bundle.AutoIngestNode_dataSource_text(),
|
||||
Bundle.AutoIngestNode_hostName_text(), Bundle.AutoIngestNode_hostName_text(),
|
||||
Bundle.AutoIngestNode_stage_text(), Bundle.AutoIngestNode_stage_text(),
|
||||
Bundle.AutoIngestNode_stageTime_text(), Bundle.AutoIngestNode_stageTime_text());
|
||||
outlineView.setPropertyColumns(Bundle.AutoIngestJobsNode_dataSource_text(), Bundle.AutoIngestJobsNode_dataSource_text(),
|
||||
Bundle.AutoIngestJobsNode_hostName_text(), Bundle.AutoIngestJobsNode_hostName_text(),
|
||||
Bundle.AutoIngestJobsNode_stage_text(), Bundle.AutoIngestJobsNode_stage_text(),
|
||||
Bundle.AutoIngestJobsNode_stageTime_text(), Bundle.AutoIngestJobsNode_stageTime_text());
|
||||
outline.setColumnSorted(0, true, 1);
|
||||
break;
|
||||
case COMPLETED_JOB:
|
||||
outlineView.setPropertyColumns(Bundle.AutoIngestNode_dataSource_text(), Bundle.AutoIngestNode_dataSource_text(),
|
||||
Bundle.AutoIngestNode_jobCreated_text(), Bundle.AutoIngestNode_jobCreated_text(),
|
||||
Bundle.AutoIngestNode_jobCompleted_text(), Bundle.AutoIngestNode_jobCompleted_text(),
|
||||
Bundle.AutoIngestNode_status_text(), Bundle.AutoIngestNode_status_text());
|
||||
outlineView.setPropertyColumns(Bundle.AutoIngestJobsNode_dataSource_text(), Bundle.AutoIngestJobsNode_dataSource_text(),
|
||||
Bundle.AutoIngestJobsNode_jobCreated_text(), Bundle.AutoIngestJobsNode_jobCreated_text(),
|
||||
Bundle.AutoIngestJobsNode_jobCompleted_text(), Bundle.AutoIngestJobsNode_jobCompleted_text(),
|
||||
Bundle.AutoIngestJobsNode_status_text(), Bundle.AutoIngestJobsNode_status_text());
|
||||
outline.setColumnSorted(3, false, 1);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(Bundle.AutoIngestNode_caseName_text());
|
||||
((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(Bundle.AutoIngestJobsNode_caseName_text());
|
||||
outline.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
outline.setRootVisible(false);
|
||||
|
||||
|
@ -55,13 +55,11 @@ abstract class PrioritizationAction extends AbstractAction {
|
||||
*
|
||||
* @param monitor - the AutoIngestMonitor which can be accessed to change
|
||||
* the job or case priority
|
||||
* @param panel - the AutoIngestJobsPanel which will need to be updated
|
||||
* after the priority is modified
|
||||
*
|
||||
* @throws
|
||||
* org.sleuthkit.autopsy.experimental.autoingest.AutoIngestMonitor.AutoIngestMonitorException
|
||||
*/
|
||||
protected abstract void modifyPriority(AutoIngestMonitor monitor, AutoIngestJobsPanel panel) throws AutoIngestMonitor.AutoIngestMonitorException;
|
||||
protected abstract void modifyPriority(AutoIngestMonitor monitor) throws AutoIngestMonitor.AutoIngestMonitorException;
|
||||
|
||||
/**
|
||||
* Get the implementation specific error message for if modifyPriority fails
|
||||
@ -84,23 +82,22 @@ abstract class PrioritizationAction extends AbstractAction {
|
||||
if (job != null) {
|
||||
final AutoIngestDashboardTopComponent tc = (AutoIngestDashboardTopComponent) WindowManager.getDefault().findTopComponent(AutoIngestDashboardTopComponent.PREFERRED_ID);
|
||||
if (tc != null) {
|
||||
tc.getPendingJobsPanel().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||
EventQueue.invokeLater(() -> {
|
||||
try {
|
||||
AutoIngestMonitor monitor = tc.getAutoIngestMonitor();
|
||||
AutoIngestJobsPanel pendingPanel = tc.getPendingJobsPanel();
|
||||
if (monitor != null && pendingPanel != null) {
|
||||
modifyPriority(monitor, pendingPanel);
|
||||
pendingPanel.refresh(monitor.getJobsSnapshot());
|
||||
AutoIngestDashboard dashboard = tc.getAutoIngestDashboard();
|
||||
if (dashboard != null) {
|
||||
dashboard.getPendingJobsPanel().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||
EventQueue.invokeLater(() -> {
|
||||
try {
|
||||
modifyPriority(dashboard.getMonitor());
|
||||
dashboard.getPendingJobsPanel().refresh(dashboard.getMonitor().getJobsSnapshot());
|
||||
} catch (AutoIngestMonitor.AutoIngestMonitorException ex) {
|
||||
String errorMessage = getErrorMessage();
|
||||
logger.log(Level.SEVERE, errorMessage, ex);
|
||||
MessageNotifyUtil.Message.error(errorMessage);
|
||||
} finally {
|
||||
dashboard.getPendingJobsPanel().setCursor(Cursor.getDefaultCursor());
|
||||
}
|
||||
} catch (AutoIngestMonitor.AutoIngestMonitorException ex) {
|
||||
String errorMessage = getErrorMessage();
|
||||
logger.log(Level.SEVERE, errorMessage, ex);
|
||||
MessageNotifyUtil.Message.error(errorMessage);
|
||||
} finally {
|
||||
tc.getPendingJobsPanel().setCursor(Cursor.getDefaultCursor());
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -129,7 +126,7 @@ abstract class PrioritizationAction extends AbstractAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void modifyPriority(AutoIngestMonitor monitor, AutoIngestJobsPanel panel) throws AutoIngestMonitor.AutoIngestMonitorException {
|
||||
protected void modifyPriority(AutoIngestMonitor monitor) throws AutoIngestMonitor.AutoIngestMonitorException {
|
||||
monitor.prioritizeJob(getJob());
|
||||
}
|
||||
|
||||
@ -163,7 +160,7 @@ abstract class PrioritizationAction extends AbstractAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void modifyPriority(AutoIngestMonitor monitor, AutoIngestJobsPanel panel) throws AutoIngestMonitor.AutoIngestMonitorException {
|
||||
protected void modifyPriority(AutoIngestMonitor monitor) throws AutoIngestMonitor.AutoIngestMonitorException {
|
||||
monitor.deprioritizeJob(getJob());
|
||||
}
|
||||
|
||||
@ -199,7 +196,7 @@ abstract class PrioritizationAction extends AbstractAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void modifyPriority(AutoIngestMonitor monitor, AutoIngestJobsPanel panel) throws AutoIngestMonitor.AutoIngestMonitorException {
|
||||
protected void modifyPriority(AutoIngestMonitor monitor) throws AutoIngestMonitor.AutoIngestMonitorException {
|
||||
monitor.prioritizeCase(getJob().getManifest().getCaseName());
|
||||
}
|
||||
|
||||
@ -235,7 +232,7 @@ abstract class PrioritizationAction extends AbstractAction {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void modifyPriority(AutoIngestMonitor monitor, AutoIngestJobsPanel panel) throws AutoIngestMonitor.AutoIngestMonitorException {
|
||||
protected void modifyPriority(AutoIngestMonitor monitor) throws AutoIngestMonitor.AutoIngestMonitorException {
|
||||
monitor.deprioritizeCase(getJob().getManifest().getCaseName());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user