2024-10-09 22:21:57 +03:00
|
|
|
|
package _VisualDVM.TestingSystem.Common;
|
2024-10-14 18:41:02 +03:00
|
|
|
|
import Common.MainModule_;
|
2024-10-11 00:00:30 +03:00
|
|
|
|
import Common.Utils.Utils_;
|
2024-10-09 22:01:19 +03:00
|
|
|
|
import Common.Visual.Controls.MenuBarButton;
|
2024-10-08 22:33:49 +03:00
|
|
|
|
import Common.Visual.Fonts.VisualiserFonts;
|
2024-10-14 20:57:18 +03:00
|
|
|
|
import Common.Visual.Menus.VisualiserMenuBar;
|
2024-10-15 15:13:57 +03:00
|
|
|
|
import Common.Visual.UI;
|
2024-10-14 15:19:13 +03:00
|
|
|
|
import _VisualDVM.Global;
|
2024-10-14 12:14:01 +03:00
|
|
|
|
import _VisualDVM.Passes.PassCode;
|
2023-10-12 00:31:58 +03:00
|
|
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
|
import java.awt.*;
|
2024-10-14 21:55:58 +03:00
|
|
|
|
public class TestingMenuBar extends VisualiserMenuBar {
|
2024-10-14 15:19:13 +03:00
|
|
|
|
// public JLabel KernelsLabel;
|
2023-12-10 02:26:28 +03:00
|
|
|
|
public JButton autorefreshButton;
|
2023-10-12 00:31:58 +03:00
|
|
|
|
JSpinner sCheckTime;
|
2024-10-14 15:19:13 +03:00
|
|
|
|
// JSpinner sKernels;
|
2024-03-24 02:49:32 +03:00
|
|
|
|
JLabel serverAdminLabel;
|
2024-10-14 21:55:58 +03:00
|
|
|
|
public TestingMenuBar() {
|
2023-12-11 18:29:15 +03:00
|
|
|
|
//-
|
2024-10-14 15:19:13 +03:00
|
|
|
|
// KernelsLabel = addLabel("", "/icons/Kernels.png");
|
|
|
|
|
|
// KernelsLabel.setHorizontalTextPosition(JLabel.LEFT);
|
|
|
|
|
|
// KernelsLabel.setToolTipText("количество ядер, задействованное при тестировании");
|
2024-09-20 01:52:39 +03:00
|
|
|
|
/*
|
2023-10-14 00:43:39 +03:00
|
|
|
|
add(sKernels = new JSpinner());
|
|
|
|
|
|
sKernels.setPreferredSize(new Dimension(60, 26));
|
|
|
|
|
|
sKernels.setMaximumSize(new Dimension(60, 26));
|
2023-11-14 22:37:33 +03:00
|
|
|
|
sKernels.setModel(new SpinnerNumberModel(Global.properties.TestingKernels, 1,
|
2024-03-24 02:49:32 +03:00
|
|
|
|
Utils.getTestingMaxKernels(),
|
2023-11-30 01:25:26 +03:00
|
|
|
|
1));
|
2023-11-13 21:07:44 +03:00
|
|
|
|
sKernels.setValue(Global.properties.TestingKernels);
|
2023-10-14 00:43:39 +03:00
|
|
|
|
UI.MakeSpinnerRapid(sKernels, e -> {
|
2023-11-13 21:07:44 +03:00
|
|
|
|
Global.properties.updateField("TestingKernels", sKernels.getValue());
|
2023-10-14 00:43:39 +03:00
|
|
|
|
});
|
2024-09-20 01:52:39 +03:00
|
|
|
|
*/
|
2023-12-11 18:29:15 +03:00
|
|
|
|
addLabel(" ");
|
2023-10-14 00:43:39 +03:00
|
|
|
|
//--
|
2023-10-17 22:25:10 +03:00
|
|
|
|
add(new MenuBarButton() {
|
|
|
|
|
|
{
|
2023-10-18 14:05:51 +03:00
|
|
|
|
setText("оповещение по email");
|
2023-10-17 22:25:10 +03:00
|
|
|
|
setToolTipText("Оповещение о прогрессе выполнения пакета тестов");
|
|
|
|
|
|
Mark();
|
|
|
|
|
|
addActionListener(e -> {
|
2025-01-13 22:41:11 +03:00
|
|
|
|
Global.mainModule.getPass(PassCode.UpdateProperty).Do("EmailOnTestingProgress");
|
2023-10-17 22:25:10 +03:00
|
|
|
|
Mark();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
public void Mark() {
|
2025-01-18 01:36:02 +03:00
|
|
|
|
setIcon(Utils_.getIcon(Global.normalProperties.EmailOnTestingProgress ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
|
2023-10-17 22:25:10 +03:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
//--
|
2023-10-12 00:31:58 +03:00
|
|
|
|
add(autorefreshButton = new MenuBarButton() {
|
|
|
|
|
|
{
|
|
|
|
|
|
setText("проверка раз в");
|
|
|
|
|
|
setToolTipText("автоматическое обновление состояния пакета задач");
|
|
|
|
|
|
Mark();
|
|
|
|
|
|
addActionListener(e -> {
|
2025-01-13 22:41:11 +03:00
|
|
|
|
Global.mainModule.getPass(PassCode.UpdateProperty).Do("AutoCheckTesting");
|
2025-01-18 01:36:02 +03:00
|
|
|
|
if (Global.normalProperties.AutoCheckTesting)
|
2023-11-13 21:07:44 +03:00
|
|
|
|
TestingServer.TimerOn();
|
|
|
|
|
|
else
|
|
|
|
|
|
TestingServer.TimerOff();
|
|
|
|
|
|
//-
|
2023-10-12 00:31:58 +03:00
|
|
|
|
Mark();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
public void Mark() {
|
2025-01-18 01:36:02 +03:00
|
|
|
|
setIcon(Utils_.getIcon(Global.normalProperties.AutoCheckTesting ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
|
2023-10-12 00:31:58 +03:00
|
|
|
|
}
|
|
|
|
|
|
});
|
2023-10-14 00:43:39 +03:00
|
|
|
|
//--
|
2023-10-12 00:31:58 +03:00
|
|
|
|
add(sCheckTime = new JSpinner());
|
|
|
|
|
|
sCheckTime.setPreferredSize(new Dimension(60, 26));
|
|
|
|
|
|
sCheckTime.setMaximumSize(new Dimension(60, 26));
|
2025-01-18 01:36:02 +03:00
|
|
|
|
sCheckTime.setModel(new SpinnerNumberModel(Global.normalProperties.CheckTestingIntervalSeconds, 10, 3600, 1));
|
|
|
|
|
|
sCheckTime.setValue(Global.normalProperties.CheckTestingIntervalSeconds);
|
2024-10-15 15:13:57 +03:00
|
|
|
|
UI.MakeSpinnerRapid(sCheckTime, e -> {
|
2025-01-18 01:36:02 +03:00
|
|
|
|
Global.normalProperties.updateField("CheckTestingIntervalSeconds", sCheckTime.getValue());
|
|
|
|
|
|
if (Global.normalProperties.AutoCheckTesting) TestingServer.ResetTimer();
|
2023-10-12 00:31:58 +03:00
|
|
|
|
});
|
2023-10-14 00:43:39 +03:00
|
|
|
|
add(new JLabel(" сек ") {
|
2023-10-12 00:31:58 +03:00
|
|
|
|
{
|
2024-10-14 18:41:02 +03:00
|
|
|
|
setFont(MainModule_.instance.getUI().getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
2023-10-12 00:31:58 +03:00
|
|
|
|
}
|
|
|
|
|
|
});
|
2024-03-23 23:28:02 +03:00
|
|
|
|
addSeparator();
|
2024-03-24 02:49:32 +03:00
|
|
|
|
serverAdminLabel = addLabel(" управление сервером ");
|
2024-10-09 23:37:58 +03:00
|
|
|
|
addPasses(PassCode.StartTestingServer, PassCode.ShutdownTestingServer, PassCode.PublishTestingServer);
|
2023-10-12 00:31:58 +03:00
|
|
|
|
}
|
2023-11-13 21:07:44 +03:00
|
|
|
|
public void ShowAutoCheckTesting() {
|
2025-01-18 01:36:02 +03:00
|
|
|
|
autorefreshButton.setIcon(Utils_.getIcon(Global.normalProperties.AutoCheckTesting ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
|
2023-10-12 00:31:58 +03:00
|
|
|
|
}
|
2024-03-24 02:49:32 +03:00
|
|
|
|
public void showServerAdminLabel(boolean flag) {
|
|
|
|
|
|
serverAdminLabel.setVisible(flag);
|
2023-12-11 18:29:15 +03:00
|
|
|
|
}
|
2023-10-12 00:31:58 +03:00
|
|
|
|
}
|