Skip to content

Commit f7fe403

Browse files
committed
UI/UX: Add 'No Properties File' UI when there is no properties file
1 parent 1dd3c30 commit f7fe403

File tree

2 files changed

+93
-33
lines changed

2 files changed

+93
-33
lines changed

DBMonitoringWindowApp/src/main/java/root/javafx/Controller/HistoryMenuController.java

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package root.javafx.Controller;
22

3+
import java.io.IOException;
34
import java.net.URL;
45
import java.util.List;
56
import java.util.ResourceBundle;
@@ -9,7 +10,6 @@
910
import javafx.event.ActionEvent;
1011
import javafx.fxml.FXML;
1112
import javafx.fxml.Initializable;
12-
import javafx.scene.control.Alert.AlertType;
1313
import javafx.scene.layout.AnchorPane;
1414
import lombok.extern.slf4j.Slf4j;
1515
import root.common.database.implement.JdbcConnectionInfo;
@@ -29,7 +29,8 @@
2929
import root.core.usecase.constracts.ServerMonitoringUsecase;
3030
import root.core.usecase.implement.DBCheckUsecaseImpl;
3131
import root.core.usecase.implement.ServerMonitoringUsecaseImpl;
32-
import root.javafx.utils.AlertUtils;
32+
import root.javafx.DI.DependencyInjection;
33+
import root.javafx.utils.SceneUtils;
3334
import root.repository.implement.DBCheckRepositoryImpl;
3435
import root.repository.implement.LinuxServerMonitoringRepository;
3536
import root.repository.implement.PropertyRepositoryImpl;
@@ -57,6 +58,12 @@ public class HistoryMenuController implements Initializable {
5758

5859
@FXML
5960
AnchorPane osDiskUsageTabAP;
61+
62+
@FXML
63+
AnchorPane topMenuBar;
64+
65+
@FXML
66+
AnchorPane noPropertyFileAP;
6067

6168
/* Custom View */
6269
MonitoringAPController<ArchiveUsage> archiveUsageMAP;
@@ -92,13 +99,18 @@ public void initialize(URL location, ResourceBundle resources) {
9299
if (lastUseConnInfoFilePath != null) {
93100
runConnInfoFileComboBox.getSelectionModel().select(lastUseConnInfoFilePath);
94101
}
102+
103+
noPropertyFileAP.setVisible(false);
104+
topMenuBar.setVisible(true);
95105
} else {
96-
AlertUtils.showAlert(AlertType.INFORMATION, "접속정보 설정", "설정된 DB/Server 접속정보가 없습니다.\n[설정]메뉴로 이동합니다.");
106+
noPropertyFileAP.setVisible(true);
107+
topMenuBar.setVisible(false);
97108
return;
98109
}
99110
} catch (PropertyNotFoundException e) {
100111
log.error(e.getMessage());
101-
AlertUtils.showAlert(AlertType.INFORMATION, "접속정보 설정", "설정된 DB/Server 접속정보가 없습니다.\n[설정]메뉴로 이동합니다.");
112+
noPropertyFileAP.setVisible(true);
113+
topMenuBar.setVisible(false);
102114
return;
103115
}
104116

@@ -172,4 +184,15 @@ public void runMonitoring(ActionEvent e) {
172184
asmDiskUsageMAP.syncTableData(asmDiskUsageMAP.getSelectedAliasComboBoxItem(), 0);
173185
osDiskUsageMAP.syncTableData(osDiskUsageMAP.getSelectedAliasComboBoxItem(), 0);
174186
}
187+
188+
/**
189+
* 설정 메뉴로 이동
190+
*
191+
* @param e
192+
* @throws IOException
193+
*/
194+
public void goSettingMenu(ActionEvent e) throws IOException {
195+
SceneUtils.movePage(DependencyInjection.load("/fxml/SettingMenu.fxml"));
196+
}
197+
175198
}

DBMonitoringWindowApp/src/main/resources/fxml/HistoryMenu.fxml

Lines changed: 66 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3+
<?import com.jfoenix.controls.JFXButton?>
34
<?import com.jfoenix.controls.JFXComboBox?>
45
<?import de.jensd.fx.glyphs.fontawesome.FontAwesomeIconView?>
6+
<?import java.lang.String?>
7+
<?import javafx.geometry.Insets?>
58
<?import javafx.scene.Cursor?>
69
<?import javafx.scene.control.Button?>
710
<?import javafx.scene.control.Label?>
@@ -10,9 +13,11 @@
1013
<?import javafx.scene.control.TabPane?>
1114
<?import javafx.scene.layout.AnchorPane?>
1215
<?import javafx.scene.layout.BorderPane?>
16+
<?import javafx.scene.layout.HBox?>
17+
<?import javafx.scene.layout.StackPane?>
1318
<?import javafx.scene.text.Font?>
1419

15-
<SplitPane dividerPositions="0.15" minHeight="650.0" minWidth="1200.0" stylesheets="@../css/javaFx.css" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="root.javafx.Controller.HistoryMenuController">
20+
<SplitPane dividerPositions="0.15" minHeight="650.0" minWidth="1200.0" stylesheets="@../../../../../../../DBMonitoring/DBMonitoring/src/main/resources/css/javaFx.css" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="root.javafx.Controller.HistoryMenuController">
1621
<items>
1722
<AnchorPane maxWidth="200.0" minWidth="150.0" style="-fx-background-color: white;">
1823
<fx:include source="LeftMenu.fxml" />
@@ -39,9 +44,9 @@
3944
<Font name="Noto Sans Korean Medium" size="13.0" />
4045
</font>
4146
</Label>
42-
<AnchorPane layoutX="217.0" layoutY="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="250.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
47+
<AnchorPane fx:id="topMenuBar" layoutX="217.0" layoutY="5.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="250.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
4348
<children>
44-
<JFXComboBox fx:id="runConnInfoFileComboBox" minWidth="300.0" styleClass="basic-font" stylesheets="@../css/javaFx.css" unFocusColor="#ececec" AnchorPane.bottomAnchor="5.0" AnchorPane.rightAnchor="60.0" AnchorPane.topAnchor="5.0" />
49+
<JFXComboBox fx:id="runConnInfoFileComboBox" minWidth="300.0" styleClass="basic-font" stylesheets="@../../../../../../../DBMonitoring/DBMonitoring/src/main/resources/css/javaFx.css" unFocusColor="#ececec" AnchorPane.bottomAnchor="5.0" AnchorPane.rightAnchor="60.0" AnchorPane.topAnchor="5.0" />
4550
<Button fx:id="monitoringRunBtn" layoutX="540.6000061035156" mnemonicParsing="false" onAction="#runMonitoring" style="-fx-background-color: transparent;" AnchorPane.bottomAnchor="5.0" AnchorPane.rightAnchor="15.0" AnchorPane.topAnchor="5.0">
4651
<cursor>
4752
<Cursor fx:constant="HAND" />
@@ -56,34 +61,66 @@
5661
</AnchorPane>
5762
</top>
5863
<center>
59-
<AnchorPane minWidth="550.0" style="-fx-background-color: white;">
64+
<StackPane>
6065
<children>
61-
<TabPane tabClosingPolicy="UNAVAILABLE" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="4.0">
62-
<tabs>
63-
<Tab text="Archive Usage">
64-
<content>
65-
<AnchorPane fx:id="archiveUsageTabAP" />
66-
</content>
67-
</Tab>
68-
<Tab text="TableSpace Usage">
69-
<content>
70-
<AnchorPane fx:id="tableSpaceUsageTabAP" />
71-
</content>
72-
</Tab>
73-
<Tab text="ASM Disk Usage">
74-
<content>
75-
<AnchorPane fx:id="asmDiskUsageTabAP" />
76-
</content>
77-
</Tab>
78-
<Tab text="OS Disk Usage">
79-
<content>
80-
<AnchorPane fx:id="osDiskUsageTabAP" />
81-
</content>
82-
</Tab>
83-
</tabs>
84-
</TabPane>
66+
<AnchorPane minWidth="550.0" style="-fx-background-color: white;">
67+
<children>
68+
<TabPane tabClosingPolicy="UNAVAILABLE" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="4.0">
69+
<tabs>
70+
<Tab text="Archive Usage">
71+
<content>
72+
<AnchorPane fx:id="archiveUsageTabAP" />
73+
</content>
74+
</Tab>
75+
<Tab text="TableSpace Usage">
76+
<content>
77+
<AnchorPane fx:id="tableSpaceUsageTabAP" />
78+
</content>
79+
</Tab>
80+
<Tab text="ASM Disk Usage">
81+
<content>
82+
<AnchorPane fx:id="asmDiskUsageTabAP" />
83+
</content>
84+
</Tab>
85+
<Tab text="OS Disk Usage">
86+
<content>
87+
<AnchorPane fx:id="osDiskUsageTabAP" />
88+
</content>
89+
</Tab>
90+
</tabs>
91+
</TabPane>
92+
</children>
93+
</AnchorPane>
94+
<AnchorPane fx:id="noPropertyFileAP" style="-fx-background-color: white;">
95+
<children>
96+
<HBox alignment="CENTER" layoutY="269.6000061035156" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
97+
<children>
98+
<Label graphicTextGap="13.0" style="-fx-alignment: center;" text="접속정보 설정파일이 없습니다.">
99+
<graphic>
100+
<FontAwesomeIconView fill="#1f6cc4" glyphName="ARCHIVE" size="40" text="" />
101+
</graphic>
102+
<styleClass>
103+
<String fx:value="basic-font" />
104+
<String fx:value="bold" />
105+
</styleClass>
106+
</Label>
107+
<JFXButton fx:id="goSettingMenuBtn" alignment="CENTER" contentDisplay="RIGHT" ellipsisString="" graphicTextGap="5.0" minWidth="70.0" onAction="#goSettingMenu" ripplerFill="BLACK" style="-fx-border-color: #ddd; -fx-font-size: 12px; -fx-border-radius: 30px; -fx-text-fill: black;" styleClass="basic-font" text="설정하기">
108+
<cursor>
109+
<Cursor fx:constant="HAND" />
110+
</cursor>
111+
<graphic>
112+
<FontAwesomeIconView fill="#1f6cc4" glyphName="ARROW_CIRCLE_RIGHT" selectionEnd="0" selectionStart="0" size="13" />
113+
</graphic>
114+
<HBox.margin>
115+
<Insets left="15.0" />
116+
</HBox.margin>
117+
</JFXButton>
118+
</children>
119+
</HBox>
120+
</children>
121+
</AnchorPane>
85122
</children>
86-
</AnchorPane>
123+
</StackPane>
87124
</center>
88125
<bottom>
89126
<AnchorPane maxHeight="30.0" minHeight="30.0" style="-fx-background-color: #f7f7f7; -fx-border-width: 0.2px; -fx-border-color: gray;" BorderPane.alignment="CENTER" />

0 commit comments

Comments
 (0)