no message
This commit is contained in:
@@ -25,6 +25,9 @@ public class Constants {
|
|||||||
public final static String time_file = "total_time";
|
public final static String time_file = "total_time";
|
||||||
//-служебные разделы проекта.
|
//-служебные разделы проекта.
|
||||||
public static final String data = "visualiser_data";
|
public static final String data = "visualiser_data";
|
||||||
|
public static final String MailAddress = "sapfor.tracker@internet.ru";
|
||||||
|
// public static final String MailPassword = "3s4w9e5fs3c1a89AA"; основной пароль.
|
||||||
|
public static final String MailPassword = "knKn2PpfrC348ZxHtMnT"; //пароль для сапфора как внешнего приложения.
|
||||||
//--
|
//--
|
||||||
//https://losst.ru/komandy-terminala-linux
|
//https://losst.ru/komandy-terminala-linux
|
||||||
public static String[] linux_system_commands = new String[]{
|
public static String[] linux_system_commands = new String[]{
|
||||||
|
|||||||
@@ -34,9 +34,6 @@ public class Global {
|
|||||||
//0 2 2,15 * * reboot &>/var/log/reboot.log
|
//0 2 2,15 * * reboot &>/var/log/reboot.log
|
||||||
//https://unix.stackexchange.com/questions/117148/how-can-i-run-reboot-as-a-normal-user-without-needing-to-enter-a-password
|
//https://unix.stackexchange.com/questions/117148/how-can-i-run-reboot-as-a-normal-user-without-needing-to-enter-a-password
|
||||||
public static final String ServerAddress = "alex-freenas.ddns.net";
|
public static final String ServerAddress = "alex-freenas.ddns.net";
|
||||||
public static final String MailAddress = "sapfor.tracker@internet.ru";
|
|
||||||
// public static final String MailPassword = "3s4w9e5fs3c1a89AA"; основной пароль.
|
|
||||||
public static final String MailPassword = "knKn2PpfrC348ZxHtMnT"; //пароль для сапфора как внешнего приложения.
|
|
||||||
public static final String dateNaN = "NaN";
|
public static final String dateNaN = "NaN";
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
//текущая папка системы. в отличие от шарпа никогда не должна меняться.
|
//текущая папка системы. в отличие от шарпа никогда не должна меняться.
|
||||||
|
|||||||
@@ -13,8 +13,23 @@ import java.awt.*;
|
|||||||
public class TestingBar extends VisualiserMenuBar {
|
public class TestingBar extends VisualiserMenuBar {
|
||||||
JButton autorefreshButton;
|
JButton autorefreshButton;
|
||||||
JSpinner sCheckTime;
|
JSpinner sCheckTime;
|
||||||
|
JSpinner sKernels;
|
||||||
public TestingBar() {
|
public TestingBar() {
|
||||||
addPasses(PassCode_2021.SynchronizeTestsTasks);
|
addPasses(PassCode_2021.SynchronizeTestsTasks);
|
||||||
|
//--
|
||||||
|
add(new JLabel(" ядер ") {
|
||||||
|
{
|
||||||
|
setFont(Current.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
add(sKernels = new JSpinner());
|
||||||
|
sKernels.setPreferredSize(new Dimension(60, 26));
|
||||||
|
sKernels.setMaximumSize(new Dimension(60, 26));
|
||||||
|
sKernels.setModel(new SpinnerNumberModel(TestingServer.kernels, 1, 16, 1));
|
||||||
|
UI.MakeSpinnerRapid(sKernels, e -> {
|
||||||
|
TestingServer.kernels = (int) sKernels.getValue();
|
||||||
|
});
|
||||||
|
//--
|
||||||
add(autorefreshButton = new MenuBarButton() {
|
add(autorefreshButton = new MenuBarButton() {
|
||||||
{
|
{
|
||||||
setText("проверка раз в");
|
setText("проверка раз в");
|
||||||
@@ -30,6 +45,7 @@ public class TestingBar extends VisualiserMenuBar {
|
|||||||
setIcon(Utils.getIcon(TestingServer.checkTasks ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
setIcon(Utils.getIcon(TestingServer.checkTasks ? "/icons/Pick.png" : "/icons/NotPick.png"));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//--
|
||||||
add(sCheckTime = new JSpinner());
|
add(sCheckTime = new JSpinner());
|
||||||
sCheckTime.setPreferredSize(new Dimension(60, 26));
|
sCheckTime.setPreferredSize(new Dimension(60, 26));
|
||||||
sCheckTime.setMaximumSize(new Dimension(60, 26));
|
sCheckTime.setMaximumSize(new Dimension(60, 26));
|
||||||
@@ -38,7 +54,7 @@ public class TestingBar extends VisualiserMenuBar {
|
|||||||
TestingServer.checkIntervalSecond = (int) sCheckTime.getValue();
|
TestingServer.checkIntervalSecond = (int) sCheckTime.getValue();
|
||||||
if (TestingServer.checkTasks) TestingServer.ResetTimer();
|
if (TestingServer.checkTasks) TestingServer.ResetTimer();
|
||||||
});
|
});
|
||||||
add(new JLabel(" сек") {
|
add(new JLabel(" сек ") {
|
||||||
{
|
{
|
||||||
setFont(Current.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
setFont(Current.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package Repository;
|
package Repository;
|
||||||
|
import Common.Constants;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.DBObject;
|
||||||
import Common.Database.Database;
|
import Common.Database.Database;
|
||||||
import Common.Database.rDBObject;
|
import Common.Database.rDBObject;
|
||||||
@@ -98,8 +99,11 @@ public abstract class RepositoryServer<D extends Database> {
|
|||||||
Utils.unpackFile(message_in.files.get(aName), f);
|
Utils.unpackFile(message_in.files.get(aName), f);
|
||||||
innerFiles.put(aName, f);
|
innerFiles.put(aName, f);
|
||||||
}
|
}
|
||||||
|
Vector<String> targets_ = new Vector<>();
|
||||||
|
targets_.add(Constants.MailAddress); //себе.
|
||||||
|
targets_.addAll(message_in.targets);
|
||||||
//------------------------------
|
//------------------------------
|
||||||
for (String target : message_in.targets) {
|
for (String target : targets_) {
|
||||||
System.out.println("target=" + target);
|
System.out.println("target=" + target);
|
||||||
if (needsEmail(target)) {
|
if (needsEmail(target)) {
|
||||||
System.out.println("needs email");
|
System.out.println("needs email");
|
||||||
@@ -109,12 +113,12 @@ public abstract class RepositoryServer<D extends Database> {
|
|||||||
@Override
|
@Override
|
||||||
protected PasswordAuthentication getPasswordAuthentication() {
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
return new PasswordAuthentication(
|
return new PasswordAuthentication(
|
||||||
Global.MailAddress,
|
Constants.MailAddress,
|
||||||
Global.MailPassword);
|
Constants.MailPassword);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
MimeMessage message = new MimeMessage(session);
|
MimeMessage message = new MimeMessage(session);
|
||||||
message.setFrom(new InternetAddress(Global.MailAddress));
|
message.setFrom(new InternetAddress(Constants.MailAddress));
|
||||||
message.setRecipients(Message.RecipientType.CC, InternetAddress.parse(target));
|
message.setRecipients(Message.RecipientType.CC, InternetAddress.parse(target));
|
||||||
message.setSubject(message_in.subject);
|
message.setSubject(message_in.subject);
|
||||||
Multipart multipart = new MimeMultipart();
|
Multipart multipart = new MimeMultipart();
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package Repository.Server;
|
package Repository.Server;
|
||||||
|
import Common.Constants;
|
||||||
import Common.Database.DBObject;
|
import Common.Database.DBObject;
|
||||||
import Common.Global;
|
import Common.Global;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
@@ -37,6 +38,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
public int getPort() {
|
public int getPort() {
|
||||||
return 7995;
|
return 7995;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
public boolean needsEmail(String email) {
|
public boolean needsEmail(String email) {
|
||||||
if (db.subscribers.containsKey(email)) {
|
if (db.subscribers.containsKey(email)) {
|
||||||
@@ -44,6 +46,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void DeleteAction(DBObject object) throws Exception {
|
public void DeleteAction(DBObject object) throws Exception {
|
||||||
if (object instanceof BugReport) {
|
if (object instanceof BugReport) {
|
||||||
@@ -409,7 +412,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
|||||||
//bonus backup
|
//bonus backup
|
||||||
if (rightNow.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) {
|
if (rightNow.get(Calendar.DAY_OF_WEEK) == Calendar.MONDAY) {
|
||||||
Vector<String> targets = new Vector<>();
|
Vector<String> targets = new Vector<>();
|
||||||
targets.add(Global.MailAddress);
|
targets.add(Constants.MailAddress);
|
||||||
targets.addAll(Arrays.asList(Global.admins_mails));
|
targets.addAll(Arrays.asList(Global.admins_mails));
|
||||||
EmailMessage message = new EmailMessage(
|
EmailMessage message = new EmailMessage(
|
||||||
"db backup",
|
"db backup",
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ public class SapforTasksPackage extends nDBObject {
|
|||||||
public long StartDate = 0; //дата начала выполнения
|
public long StartDate = 0; //дата начала выполнения
|
||||||
public long ChangeDate = 0;//дата окончания выполнения
|
public long ChangeDate = 0;//дата окончания выполнения
|
||||||
//-
|
//-
|
||||||
|
public int kernels=1; //количество потоков.д
|
||||||
@Description("DEFAULT 'Queued'")
|
@Description("DEFAULT 'Queued'")
|
||||||
public TasksPackageState state = TasksPackageState.Queued;
|
public TasksPackageState state = TasksPackageState.Queued;
|
||||||
// допустимые состояния
|
// допустимые состояния
|
||||||
|
|||||||
@@ -236,7 +236,10 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
else
|
else
|
||||||
TimerOff();
|
TimerOff();
|
||||||
}
|
}
|
||||||
|
//----
|
||||||
public static int checkIntervalSecond = 10;
|
public static int checkIntervalSecond = 10;
|
||||||
|
public static int kernels = 4;
|
||||||
|
//----
|
||||||
public static Timer checkTimer = null;
|
public static Timer checkTimer = null;
|
||||||
public static void TimerOn() {
|
public static void TimerOn() {
|
||||||
checkTasks = true;
|
checkTasks = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user