no message
This commit is contained in:
@@ -111,7 +111,6 @@ public class Constants {
|
||||
//testuser ALL=NOPASSWD:/sbin/reboot
|
||||
//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
|
||||
public static final String ServerAddress = "alex-freenas.ddns.net";
|
||||
//--
|
||||
//https://losst.ru/komandy-terminala-linux
|
||||
public static String[] linux_system_commands = new String[]{
|
||||
@@ -467,6 +466,4 @@ public class Constants {
|
||||
};
|
||||
//все запретные символы через пробел.
|
||||
public static String all_forbidden_characters_string = "";
|
||||
public static final Machine repository_machine = new Machine("Ubuntu", "alex-freenas.ddns.net", 23, MachineType.Server);
|
||||
public static final User repository_user = new User("testuser", "mprit_2011", "");
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ public class Global {
|
||||
//---
|
||||
ActivateDB(); //тут current getAccount; роль по умолчанию всегда неизвестна.
|
||||
///--------------
|
||||
|
||||
/*
|
||||
Current.set(Current.Account, new Account(){
|
||||
{
|
||||
name = "M";
|
||||
@@ -329,6 +329,7 @@ public class Global {
|
||||
role = AccountRole.Admin;
|
||||
}
|
||||
});
|
||||
*/
|
||||
Pass_2021.passes.get(PassCode_2021.CheckAccount).Do();
|
||||
//---------------
|
||||
componentsServer.ActivateDB();
|
||||
|
||||
@@ -20,9 +20,13 @@ public class GlobalProperties extends Properties {
|
||||
@Expose
|
||||
public Current.Mode Mode = Current.Mode.Normal;
|
||||
@Expose
|
||||
public int ComponentsServerPort = 7995; //пока не используется
|
||||
public String ServerAddress="alex-freenas.ddns.net";
|
||||
@Expose
|
||||
public int TestingServerPort = 7998; //пока не используется
|
||||
public String ServerUserName ="testuser";
|
||||
@Expose
|
||||
public int ComponentsServerPort = 7995;
|
||||
@Expose
|
||||
public int TestingServerPort = 7998;
|
||||
//---
|
||||
@Expose
|
||||
public int SocketTimeout = 5000;
|
||||
|
||||
@@ -24,7 +24,8 @@ public class Machine extends iDBObject {
|
||||
return type.equals(MachineType.Local) ? name : (address + ":" + port);
|
||||
}
|
||||
public String getFullDescription() {
|
||||
return this.equals(Constants.repository_machine) ? "Репозиторий визуализатора" : "Машина по адресу " + Utils.Brackets(getURL());
|
||||
return //this.equals(Constants.repository_machine) ? "Репозиторий визуализатора" :
|
||||
"Машина по адресу " + Utils.Brackets(getURL());
|
||||
}
|
||||
public LinkedHashMap<Integer, Compiler> getCompilers() {
|
||||
return Global.db.getMapByFKi(this, Compiler.class);
|
||||
|
||||
@@ -62,7 +62,7 @@ public class Visualiser extends Component {
|
||||
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
||||
@Override
|
||||
public void GetVersionInfo() {
|
||||
version = 1064;
|
||||
version = 1066;
|
||||
String pattern = "MMM dd yyyy HH:mm:ss";
|
||||
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
||||
date_text = df.format(getClassBuildTime());
|
||||
|
||||
@@ -35,7 +35,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
||||
}
|
||||
@Override
|
||||
public int getPort() {
|
||||
return 7995;
|
||||
return Global.properties.ComponentsServerPort;
|
||||
}
|
||||
@Override
|
||||
protected void checkTargets(EmailMessage message_in) {
|
||||
|
||||
@@ -131,7 +131,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
//основа
|
||||
@Override
|
||||
public int getPort() {
|
||||
return 7998;
|
||||
return Global.properties.TestingServerPort;
|
||||
}
|
||||
//---
|
||||
@Override
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
package TestingSystem.SAPFOR.Json;
|
||||
import Common.UI.UI;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
import TestingSystem.SAPFOR.SapforPackage.SapforPackage;
|
||||
import TestingSystem.SAPFOR.SapforTask.MatchState;
|
||||
@@ -40,6 +41,7 @@ public class SapforPackage_json implements Serializable {
|
||||
//----
|
||||
//---------
|
||||
public void DropComparison() {
|
||||
// UI.Info("DROP COMPARISON");
|
||||
comparison_root = null;
|
||||
comparisonSortedTasks.clear();
|
||||
for (SapforTask task : allTasks.values())
|
||||
@@ -89,6 +91,7 @@ public class SapforPackage_json implements Serializable {
|
||||
comparisonSortedTasks.clear();
|
||||
//раскидать задачи по состояниям, конфигам, группам
|
||||
for (MatchState matchState : MatchState.values()) {
|
||||
System.out.println("match_state="+matchState.toString());
|
||||
LinkedHashMap<TaskState, LinkedHashMap<Integer, LinkedHashMap<String, Vector<SapforTask>>>> state_tasks = new LinkedHashMap<>();
|
||||
comparisonSortedTasks.put(matchState, state_tasks);
|
||||
//--
|
||||
@@ -97,23 +100,25 @@ public class SapforPackage_json implements Serializable {
|
||||
state_tasks.put(state, configuration_tasks);
|
||||
//--
|
||||
for (SapforTask task : tasks) {
|
||||
if (task.match.equals(matchState) && task.state.equals(state)) {
|
||||
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = null;
|
||||
if (configuration_tasks.containsKey(task.sapfor_configuration_id)) {
|
||||
groups_tasks = configuration_tasks.get(task.sapfor_configuration_id);
|
||||
} else {
|
||||
groups_tasks = new LinkedHashMap<>();
|
||||
configuration_tasks.put(task.sapfor_configuration_id, groups_tasks);
|
||||
// if (matchState.equals(MatchState.Unknown)) {
|
||||
if (task.match.equals(matchState) && task.state.equals(state)) {
|
||||
LinkedHashMap<String, Vector<SapforTask>> groups_tasks = null;
|
||||
if (configuration_tasks.containsKey(task.sapfor_configuration_id)) {
|
||||
groups_tasks = configuration_tasks.get(task.sapfor_configuration_id);
|
||||
} else {
|
||||
groups_tasks = new LinkedHashMap<>();
|
||||
configuration_tasks.put(task.sapfor_configuration_id, groups_tasks);
|
||||
}
|
||||
Vector<SapforTask> tasks = null;
|
||||
if (groups_tasks.containsKey(task.group_description)) {
|
||||
tasks = groups_tasks.get(task.group_description);
|
||||
} else {
|
||||
tasks = new Vector<>();
|
||||
groups_tasks.put(task.group_description, tasks);
|
||||
}
|
||||
tasks.add(task);
|
||||
}
|
||||
Vector<SapforTask> tasks = null;
|
||||
if (groups_tasks.containsKey(task.group_description)) {
|
||||
tasks = groups_tasks.get(task.group_description);
|
||||
} else {
|
||||
tasks = new Vector<>();
|
||||
groups_tasks.put(task.group_description, tasks);
|
||||
}
|
||||
tasks.add(task);
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
//--
|
||||
|
||||
@@ -54,7 +54,8 @@ public class SapforTask extends DBObject {
|
||||
public Vector<SapforVersion_json> variants = new Vector<>();
|
||||
//----------
|
||||
@Description("IGNORE")
|
||||
public MatchState match = MatchState.Unknown;
|
||||
public MatchState match = MatchState.NotMatch;
|
||||
// MatchState.Unknown;
|
||||
//-----------
|
||||
public String getUniqueKey() {
|
||||
return sapfor_configuration_id + "_" + group_description + "_" + test_description;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class MatchesSummary extends SapforPackageTreeNode {
|
||||
case NotMatch:
|
||||
return "NotMatch";
|
||||
default:
|
||||
return "TestVersion";
|
||||
return "Unknown";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package TestingSystem.SAPFOR.SapforTasksPackage.UI;
|
||||
import Common.UI.UI;
|
||||
public class PackageSummary extends SapforPackageTreeNode {
|
||||
public int count = 0;
|
||||
@Override
|
||||
public String getImageKey() {
|
||||
return null;
|
||||
// System.out.println("PACKAGE_SUMMARY "+ this.count);
|
||||
return "UnknownStateSummary";
|
||||
// return null;
|
||||
}
|
||||
public PackageSummary() {
|
||||
}
|
||||
|
||||
@@ -4,9 +4,11 @@ import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import java.util.Objects;
|
||||
public abstract class SapforPackageTreeNode extends DefaultMutableTreeNode {
|
||||
public ImageIcon getIcon() {
|
||||
return (getImageKey() != null) ?
|
||||
new ImageIcon(Objects.requireNonNull(getClass().getResource("/icons/versions/" + getImageKey() + ".png")))
|
||||
: null;
|
||||
// System.out.println(getImageKey());
|
||||
ImageIcon res = new ImageIcon(Objects.requireNonNull(getClass().getResource("/icons/versions/" + getImageKey() + ".png")));
|
||||
// System.out.println(res);
|
||||
return (getImageKey() != null) ? res : null;
|
||||
}
|
||||
public abstract String getImageKey();
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Common.UI.UI;
|
||||
import GlobalData.Account.AccountRole;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Pass_2021;
|
||||
public class CheckAccount extends Pass_2021<Boolean> {
|
||||
@@ -19,10 +20,36 @@ public class CheckAccount extends Pass_2021<Boolean> {
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
switch (Current.getAccount().email){
|
||||
case "vmk-post@yandex.ru":
|
||||
case "79854210702@ya.ru":
|
||||
Current.getAccount().role = AccountRole.Admin;
|
||||
target = true;
|
||||
break;
|
||||
case "npodderyugina@gmail.com":
|
||||
case "savol@keldysh.ru":
|
||||
case "mkocharmin@yandex.ru":
|
||||
case "juk.06@list.ru":
|
||||
Current.getAccount().role = AccountRole.Developer;
|
||||
target = true;
|
||||
break;
|
||||
case "?":
|
||||
Current.getAccount().role = AccountRole.Undefined;
|
||||
target = false;
|
||||
break;
|
||||
default:
|
||||
Current.getAccount().role =AccountRole.User;
|
||||
target = true;
|
||||
break;
|
||||
}
|
||||
|
||||
//временно. оффлайн проверка по почте
|
||||
/*
|
||||
target = Current.getAccount().email.equals("?") ?
|
||||
(Pass_2021.passes.get(PassCode_2021.EditAccount).Do() &&
|
||||
Pass_2021.passes.get(PassCode_2021.CheckRegistrationOnServer).Do()) :
|
||||
(Pass_2021.passes.get(PassCode_2021.CheckRegistrationOnServer).Do());
|
||||
*/
|
||||
}
|
||||
@Override
|
||||
protected boolean validate() {
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.Utils.Utils;
|
||||
import GlobalData.Machine.Machine;
|
||||
import GlobalData.Machine.MachineType;
|
||||
import GlobalData.RemoteFile.RemoteFile;
|
||||
import GlobalData.User.User;
|
||||
import ProjectData.LanguageName;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
@@ -27,8 +31,8 @@ public class InstallServerSapfor extends ConnectionPass<Object> {
|
||||
}
|
||||
@Override
|
||||
public void Connect() throws Exception {
|
||||
machine = Constants.repository_machine;
|
||||
user = Constants.repository_user;
|
||||
machine = new Machine("Ubuntu", Global.properties.ServerAddress, 23, MachineType.Server);
|
||||
user = new User(Global.properties.ServerUserName, "mprit_2011", "");
|
||||
super.Connect();
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -37,7 +37,7 @@ public abstract class RepositoryPass<S extends RepositoryServer, T> extends Pass
|
||||
}
|
||||
//-
|
||||
protected void connect() throws Exception {
|
||||
clientSocket = Utils.createClientSocket(InetAddress.getByName(Constants.ServerAddress),
|
||||
clientSocket = Utils.createClientSocket(InetAddress.getByName(Global.properties.ServerAddress),
|
||||
server.getPort(),
|
||||
getTimeout()
|
||||
);
|
||||
|
||||
@@ -403,15 +403,15 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
lAccountRole.setText(Utils.Brackets(Current.getAccount().role.getDescription()));
|
||||
switch (Current.getAccount().role) {
|
||||
case Undefined:
|
||||
UI.Clear(accountPanel);
|
||||
accountPanel.add(new CallbackWelcomeForm().content);
|
||||
UI.getMainWindow().SwitchTestingTabs(false);
|
||||
break;
|
||||
/// UI.Clear(accountPanel);
|
||||
// accountPanel.add(new CallbackWelcomeForm().content);
|
||||
// UI.getMainWindow().SwitchTestingTabs(false);
|
||||
// break;
|
||||
case User:
|
||||
//видит только свои баги.
|
||||
EnableBugreports();
|
||||
setUserRights();
|
||||
break;
|
||||
// EnableBugreports();
|
||||
// setUserRights();
|
||||
// break;
|
||||
case Developer:
|
||||
EnableBugreports();
|
||||
setDeveloperRights();
|
||||
|
||||
BIN
src/icons/versions/Unknown.png
Normal file
BIN
src/icons/versions/Unknown.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Reference in New Issue
Block a user