Skip to content

Commit 41c7b2c

Browse files
authored
Merge pull request #3554 from ControlSystemStudio/CSSTUDIO-2668
Login to all services
2 parents 0fe4737 + b40d471 commit 41c7b2c

File tree

43 files changed

+715
-455
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+715
-455
lines changed
3.55 KB
Loading
Binary file not shown.
30 KB
Loading
34.7 KB
Loading

app/credentials-management/doc/index.rst

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,25 @@ Further, Phoebus may be configured to store the credentials entered by the user
88
In order to also support an explicit logout capability, the Credentials Management application offers means to
99
remove stored credentials.
1010

11-
In some cases an explicit login procedure can be useful, e.g. login to service for the purpose of storing
12-
user credentials and thereby support automated creation of logbook entries.
13-
1411
The application is launched using the dedicated button in the (bottom) status bar.
1512

16-
The below screen shot shows an example where credentials have been stored for the "logbook" scope,
17-
plus an option to login to the "<remote service>" scope. User may also choose to "logout" from all scopes,
13+
The below screen shot shows an example where credentials have been stored for the "Logbook" scope,
14+
plus an option to login to the "<remote service>" scope. User may also choose to "Logout from all" services,
1815
i.e. to remove all stored credentials.
1916

2017
.. image:: images/CredentialsManagement.png
2118

22-
If no credentials are stored in the credentials store, and if no services supporting authentication have been configured,
19+
If no credentials are stored in the credentials store, and if no services supporting authentication are available,
2320
the Credentials Management UI will show a static message:
2421

25-
.. image:: images/CredentialsManagement_Empty.png
22+
.. image:: images/CredentialsManagement_empty.png
23+
24+
The "Login To All" button can be used to login to all services as a single action.
25+
In this case credentials entered in the text fields of toolbar at the top are used for all services, irrespective of
26+
the credentials (if any) entered in other input fields.
27+
28+
If login to a service fails (service off-line or invalid credentials), this is indicated in the "Login Result" column.
29+
30+
.. image:: images/CredentialsManagement_one_failed.png
31+
32+
If on the other hand login succeeds to a single or all services, the dialog is closed automatically.

app/credentials-management/src/main/java/org/phoebus/applications/credentialsmanagement/CredentialsManagementController.java

Lines changed: 281 additions & 123 deletions
Large diffs are not rendered by default.

app/credentials-management/src/main/java/org/phoebus/applications/credentialsmanagement/CredentialsManagementStage.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ public CredentialsManagementStage(List<ServiceAuthenticationProvider> authentica
6161
try {
6262
fxmlLoader.load();
6363
Scene scene = new Scene(fxmlLoader.getRoot());
64-
scene.getStylesheets().add(getClass().getResource("/css/credentials-management-style.css").toExternalForm());
6564
setTitle(Messages.Title);
6665
setScene(scene);
6766
} catch (Exception exception) {

app/credentials-management/src/main/java/org/phoebus/applications/credentialsmanagement/Messages.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public class Messages {
3030
public static String SecureStoreErrorTitle;
3131
public static String SecureStoreErrorBody;
3232
public static String Title;
33+
public static String ServiceConnectionFailure;
34+
public static String UnknownError;
35+
public static String UserNotAuthenticated;
3336

3437
static
3538
{
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
.text-field-styling{
22
-fx-padding: 5px 3px 3px 3px;
3-
-fx-border-insets: 5px 3px 3px 3px;
3+
-fx-border-insets: 5px 3px 3px 2px;
44
-fx-background-insets: 5px 3px 3px 3px;
55
-fx-border-color: #cdcdcd;
66
-fx-border-radius: 3px;
77
}
88

99
.table-view .table-column{
10-
-fx-alignment:center;
10+
-fx-alignment:CENTER;
1111
}
1212

13-
.table-view .table-cell{
14-
-fx-font-weight: bold;
13+
.table-view .column-header > .label{
14+
-fx-alignment: CENTER-LEFT;
1515
-fx-font-size: 14px;
16+
-fx-padding: 5px 3px 3px 3px;
1617
}
1718

1819
.button-style{
1920
-fx-pref-width: 100px;
2021
}
22+
23+
.error{
24+
-fx-text-fill: red;
25+
}
26+
27+

app/credentials-management/src/main/resources/org/phoebus/applications/credentialsmanagement/CredentialsManagement.fxml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
<?import javafx.scene.control.cell.*?>
2323
<?import javafx.scene.layout.*?>
2424

25-
<BorderPane id="parent" fx:id="parent" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/11.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.phoebus.applications.credentialsmanagement.CredentialsManagementController">
25+
<BorderPane id="parent" fx:id="parent" prefHeight="400.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/17.0.12" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.phoebus.applications.credentialsmanagement.CredentialsManagementController">
2626
<top>
27-
<ToolBar prefHeight="40.0" prefWidth="200.0" BorderPane.alignment="CENTER">
27+
<ToolBar prefHeight="40.0" BorderPane.alignment="CENTER">
2828
<items>
29-
<Button fx:id="clearAllCredentialsButton" mnemonicParsing="false" onAction="#logOutFromAll" text="%LogOutFromAll">
30-
<tooltip>
31-
<Tooltip text="%ClearAllCredentials" />
32-
</tooltip>
33-
</Button>
29+
<TextField fx:id="loginToAllUsernameTextField" promptText="%Username" />
30+
<PasswordField fx:id="loginToAllPasswordTextField" promptText="%Password" />
31+
<Button fx:id="loginToAllButton" mnemonicParsing="false" onAction="#loginToAll" prefWidth="120.0" text="%LoginToAll" />
32+
<Label maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS" />
33+
<Button fx:id="logoutFromAllButton" mnemonicParsing="false" onAction="#logoutFromAll" prefWidth="120.0" text="%LogoutFromAll" />
3434
</items>
3535
</ToolBar>
3636
</top>
@@ -40,23 +40,31 @@
4040
<Label text="%NoCredentialsFound" />
4141
</placeholder>
4242
<columns>
43-
<TableColumn fx:id="scopeColumn" prefWidth="${parent.width * 0.2}" text="%Scope">
43+
<TableColumn fx:id="scopeColumn" style="-fx-alignment: CENTER-LEFT;" text="%Scope">
4444
<cellValueFactory>
45-
<PropertyValueFactory property="scope" />
45+
<PropertyValueFactory property="displayName" />
4646
</cellValueFactory>
4747
</TableColumn>
48-
<TableColumn fx:id="usernameColumn" editable="true" prefWidth="${parent.width * 0.3}" text="%UserName">
48+
<TableColumn fx:id="usernameColumn" editable="true" prefWidth="110.0" text="%Username">
4949
<cellValueFactory>
5050
<PropertyValueFactory property="username" />
5151
</cellValueFactory>
5252
</TableColumn>
53-
<TableColumn fx:id="passwordColumn" editable="true" prefWidth="${parent.width * 0.3}" text="%Password">
53+
<TableColumn fx:id="passwordColumn" editable="true" prefWidth="110.0" text="%Password">
5454
<cellValueFactory>
5555
<PropertyValueFactory property="password" />
5656
</cellValueFactory>
5757
</TableColumn>
58-
<TableColumn fx:id="actionButtonColumn" prefWidth="${parent.width * 0.2}" />
58+
<TableColumn fx:id="actionButtonColumn" prefWidth="70.0" />
59+
<TableColumn fx:id="loginResultColumn" editable="false" prefWidth="150.0" style="-fx-alignment: CENTER-LEFT;" text="%LoginResult">
60+
<cellValueFactory>
61+
<PropertyValueFactory property="loginResultMessage" />
62+
</cellValueFactory>
63+
</TableColumn>
5964
</columns>
65+
<columnResizePolicy>
66+
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
67+
</columnResizePolicy>
6068
</TableView>
6169
</center>
6270
</BorderPane>

0 commit comments

Comments
 (0)