промежуточный.заложил вкладку для админа
This commit is contained in:
30
.idea/workspace.xml
generated
30
.idea/workspace.xml
generated
@@ -7,34 +7,14 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/AdministrationForm.form" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/AdministrationForm.java" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/AdministrationWindow.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReport.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/Subscriber.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/Subscriber.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberDialog.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberDialog.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberFields.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberFields.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubsribersForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubsribersForm.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountDialog.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountDialog.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountFields.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountFields.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UserAccount.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UserAccount.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/Account/Account.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/Account/AccountRole.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/AccountRole.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/Account/AccountsDBTable.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/GlobalDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/GlobalDatabase.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/MainModule.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/MainModule.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/NormalProperties.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/NormalProperties.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AddBugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AddBugReport.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/CheckAccount.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/CheckAccount.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/CheckRegistrationOnServer.java" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishComponent.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishComponent.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerCode.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestingServer.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMPackage/DVMPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMPackage/DVMPackage.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforPackage/SapforPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/SAPFOR/SapforPackage/SapforPackage.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/CallbackForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/CallbackForm.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/MainForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/MainForm.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/MainWindow.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/MainWindow.java" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
||||
@@ -33,8 +33,8 @@ public class CheckAccount extends ComponentsServerPass {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
Global.mainModule.getAccount().role = AccountRole.Undefined;
|
||||
keyFile = new File(Global.KeyDirectory, "key");
|
||||
Global.normalProperties.Update();
|
||||
keyFile = new File(Global.KeyDirectory, "key");
|
||||
//--
|
||||
//1. Ищем ключ.
|
||||
if (keyFile.exists()) {
|
||||
|
||||
11
src/_VisualDVM/Visual/Windows/AdministrationForm.form
Normal file
11
src/_VisualDVM/Visual/Windows/AdministrationForm.form
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.Visual.Windows.AdministrationForm">
|
||||
<grid id="27dc6" binding="content" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<xy x="20" y="20" width="500" height="400"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children/>
|
||||
</grid>
|
||||
</form>
|
||||
14
src/_VisualDVM/Visual/Windows/AdministrationForm.java
Normal file
14
src/_VisualDVM/Visual/Windows/AdministrationForm.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package _VisualDVM.Visual.Windows;
|
||||
import Common.Visual.FormWithSplitters;
|
||||
|
||||
import javax.swing.*;
|
||||
public class AdministrationForm implements FormWithSplitters,AdministrationWindow {
|
||||
private JPanel content;
|
||||
@Override
|
||||
public JPanel getContent() {
|
||||
return content;
|
||||
}
|
||||
@Override
|
||||
public void ShowAll() {
|
||||
}
|
||||
}
|
||||
5
src/_VisualDVM/Visual/Windows/AdministrationWindow.java
Normal file
5
src/_VisualDVM/Visual/Windows/AdministrationWindow.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package _VisualDVM.Visual.Windows;
|
||||
import Common.Visual.VisualizerForm;
|
||||
public interface AdministrationWindow extends VisualizerForm {
|
||||
void ShowAll();
|
||||
}
|
||||
@@ -363,7 +363,6 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
public void EnableBugreports() {
|
||||
UI.Clear(accountPanel);
|
||||
accountPanel.add(SC10);
|
||||
Global.mainModule.getUI().getMainWindow().SwitchTestingTabs(true);
|
||||
}
|
||||
@Override
|
||||
public void setUdefinedRights(){
|
||||
@@ -371,28 +370,37 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
UI.Clear(accountPanel);
|
||||
accountPanel.add(new CallbackWelcomeForm().content);
|
||||
Global.mainModule.getUI().getMainWindow().SwitchTestingTabs(false);
|
||||
Global.mainModule.getUI().getMainWindow().SwitchAdministrationTab(false);
|
||||
Global.mainModule.getUI().getTestingMenuBar().showServerAdminLabel(false);
|
||||
adminLabel.setVisible(false);
|
||||
}
|
||||
@Override
|
||||
public void setUserRights() {
|
||||
EnableBugreports();
|
||||
LockMyOnly();
|
||||
Global.mainModule.SetUserPassesAccess();
|
||||
Global.mainModule.getUI().getMainWindow().SwitchTestingTabs(false);
|
||||
Global.mainModule.getUI().getMainWindow().SwitchAdministrationTab(false);
|
||||
Global.mainModule.getUI().getTestingMenuBar().showServerAdminLabel(false);
|
||||
adminLabel.setVisible(false);
|
||||
}
|
||||
private void setDeveloperRights() {
|
||||
EnableBugreports();
|
||||
UnlockMyOnly();
|
||||
Global.mainModule.SetDeveloperPassesAccess();
|
||||
Global.mainModule.getUI().getMainWindow().SwitchTestingTabs(true);
|
||||
Global.mainModule.getUI().getMainWindow().SwitchAdministrationTab(false);
|
||||
Global.mainModule.getUI().getTestingMenuBar().showServerAdminLabel(false);
|
||||
adminLabel.setVisible(false);
|
||||
}
|
||||
@Override
|
||||
public void setAdminRights() {
|
||||
EnableBugreports();
|
||||
UnlockMyOnly();
|
||||
Global.mainModule.SetAdminPassesAccess();
|
||||
//--
|
||||
Global.mainModule.getUI().getMainWindow().SwitchTestingTabs(true);
|
||||
Global.mainModule.getUI().getMainWindow().SwitchAdministrationTab(true);
|
||||
Global.mainModule.getUI().getTestingMenuBar().showServerAdminLabel(true);
|
||||
adminLabel.setVisible(true);
|
||||
}
|
||||
@@ -435,19 +443,15 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
|
||||
break;
|
||||
case User:
|
||||
//видит только свои баги.
|
||||
EnableBugreports();
|
||||
setUserRights();
|
||||
break;
|
||||
case Developer:
|
||||
EnableBugreports();
|
||||
setDeveloperRights();
|
||||
break;
|
||||
case Admin:
|
||||
EnableBugreports();
|
||||
setAdminRights();
|
||||
break;
|
||||
default:
|
||||
EnableBugreports();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ public class MainForm extends Form implements MainWindow {
|
||||
private TestsForm testsForm;
|
||||
//---
|
||||
private TestingForm testingForm;
|
||||
private AdministrationForm administrationForm;
|
||||
//-----------------
|
||||
private JPanel Content;
|
||||
private JTabbedPane globalTabs;
|
||||
@@ -35,6 +36,7 @@ public class MainForm extends Form implements MainWindow {
|
||||
InstallCredentialsPanel();
|
||||
InstallTestsPanel();
|
||||
InstallTestingPanel();
|
||||
InstallAdministrationPanel();
|
||||
ShowUpdatesIcon();
|
||||
//----------------------
|
||||
}
|
||||
@@ -67,6 +69,7 @@ public class MainForm extends Form implements MainWindow {
|
||||
SaveCredentialsPanel();
|
||||
SaveTestsPanel();
|
||||
SaveTestingPanel();
|
||||
SaveAdministrationPanel();
|
||||
//--
|
||||
if (Global.mainModule.getUI().getDebugWindow() != null)
|
||||
((FormWithSplitters) Global.mainModule.getUI().getDebugWindow()).SaveSplitters();
|
||||
@@ -220,10 +223,18 @@ public class MainForm extends Form implements MainWindow {
|
||||
globalTabs.setEnabledAt(4, flag);
|
||||
}
|
||||
@Override
|
||||
public void SwitchAdministrationTab(boolean flag) {
|
||||
globalTabs.setEnabledAt(5, flag);
|
||||
}
|
||||
@Override
|
||||
public TestingWindow getTestingWindow() {
|
||||
return testingForm;
|
||||
}
|
||||
@Override
|
||||
public AdministrationWindow getAdministrationWindow() {
|
||||
return administrationForm;
|
||||
}
|
||||
@Override
|
||||
public void Show() {
|
||||
//приходится идти на это только ПОСЛЕ создания главного окна.
|
||||
// иначе ссылка на главное окно в методах пустая.
|
||||
@@ -258,4 +269,16 @@ public class MainForm extends Form implements MainWindow {
|
||||
restoreGlobalTab();
|
||||
Global.mainModule.getUI().mainMenuBar.ShowProject(false);
|
||||
}
|
||||
private void InstallAdministrationPanel() {
|
||||
globalTabs.insertTab("Администрирование",
|
||||
Utils_.getIcon("/icons/Subscribe.png"),
|
||||
(administrationForm = new AdministrationForm()).getContent(),
|
||||
"Подписчики", 5);
|
||||
}
|
||||
private void SaveAdministrationPanel() {
|
||||
if (administrationForm != null) {
|
||||
administrationForm.SaveSplitters();
|
||||
administrationForm = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ public interface MainWindow {
|
||||
CredentialsWindow getCredentialsWindow();
|
||||
TestsWindow getTestsWindow();
|
||||
TestingWindow getTestingWindow();
|
||||
AdministrationWindow getAdministrationWindow();
|
||||
//-
|
||||
void ShowUpdatesIcon();
|
||||
void FocusProject();
|
||||
@@ -17,6 +18,7 @@ public interface MainWindow {
|
||||
void FocusTests();
|
||||
void FocusTesting();
|
||||
void SwitchTestingTabs(boolean flag);
|
||||
void SwitchAdministrationTab(boolean flag);
|
||||
//-
|
||||
void ShowCheckedTestsCount();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user