реализация остановки сервера тестирования по кнопке

This commit is contained in:
2024-03-23 23:28:02 +03:00
parent 9f1777431c
commit 40feda7c5e
10 changed files with 105 additions and 55 deletions

View File

@@ -12,37 +12,11 @@ import Visual_DVM_2021.Passes.PassCode_2021;
import javax.swing.*;
import java.awt.*;
public class TestingBar extends VisualiserMenuBar {
// public MenuBarButton MachineButton;
// public MenuBarButton UserButton;
public JLabel KernelsLabel;
public JButton autorefreshButton;
JSpinner sCheckTime;
JSpinner sKernels;
public TestingBar() {
/*
add(MachineButton = new MenuBarButton() {
{
setIcon("/icons/Machine.png");
setFont(VisualiserFonts.TreePlain);
setToolTipText("Машина тестирования");
addActionListener(e -> {
UI.getMainWindow().FocusCredentials();
});
}
});
//--
add(UserButton = new MenuBarButton() {
{
setIcon("/icons/User.png");
setFont(VisualiserFonts.TreePlain);
setToolTipText("Учетная запись машины тестирования");
addActionListener(e -> {
UI.getMainWindow().FocusCredentials();
});
}
});
*/
//-
KernelsLabel = addLabel("", "/icons/Kernels.png");
KernelsLabel.setHorizontalTextPosition(JLabel.LEFT);
@@ -57,8 +31,6 @@ public class TestingBar extends VisualiserMenuBar {
UI.MakeSpinnerRapid(sKernels, e -> {
Global.properties.updateField("TestingKernels", sKernels.getValue());
});
addLabel(" ");
//--
add(new MenuBarButton() {
@@ -112,6 +84,8 @@ public class TestingBar extends VisualiserMenuBar {
setFont(Current.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
}
});
addSeparator();
addPasses(PassCode_2021.StopTestingServer);
}
public void ShowAutoCheckTesting() {
autorefreshButton.setIcon(Utils.getIcon(Global.properties.AutoCheckTesting ? "/icons/Pick.png" : "/icons/NotPick.png"));

View File

@@ -242,11 +242,9 @@ public class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
UnzipFolderPass unzipFolderPass = new UnzipFolderPass();
unzipFolderPass.Do(results_archive.getAbsolutePath(), packageLocalWorkspace.getAbsolutePath(), false);
}
//todo привязать это к настройкам, чтобы можно было включать/выключать удаление.
//получили результат. теперь уничтожаем папку пакета на целевой машине.
if (user.connection.Exists(packageRemoteWorkspace)) {
//---
if (Global.properties.eraseTestingWorkspaces && user.connection.Exists(packageRemoteWorkspace))
user.connection.RMDIR(packageRemoteWorkspace.full_name);
}
}
@Override
protected void AnalyseResults() throws Exception {