Skip to content

Commit 59a09dd

Browse files
committed
UI/UX: Add 'No Properties File' UI when there is no properties file in AlertLogMonitoringMenu
1 parent 700f457 commit 59a09dd

File tree

2 files changed

+294
-193
lines changed

2 files changed

+294
-193
lines changed

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

Lines changed: 51 additions & 2 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.time.LocalDate;
56
import java.util.HashMap;
@@ -20,6 +21,7 @@
2021
import javafx.fxml.Initializable;
2122
import javafx.geometry.Insets;
2223
import javafx.scene.control.Alert.AlertType;
24+
import javafx.scene.control.Button;
2325
import javafx.scene.control.DatePicker;
2426
import javafx.scene.control.ScrollPane;
2527
import javafx.scene.control.ScrollPane.ScrollBarPolicy;
@@ -45,7 +47,9 @@
4547
import root.javafx.CustomView.NumberTextFormatter;
4648
import root.javafx.CustomView.TagBar;
4749
import root.javafx.CustomView.dateCell.DisableAfterTodayDateCell;
50+
import root.javafx.DI.DependencyInjection;
4851
import root.javafx.utils.AlertUtils;
52+
import root.javafx.utils.SceneUtils;
4953
import root.repository.implement.LinuxServerMonitoringRepository;
5054
import root.repository.implement.PropertyRepositoryImpl;
5155
import root.repository.implement.ReportFileRepo;
@@ -91,6 +95,15 @@ public class AlertLogMonitoringMenuController implements Initializable {
9195

9296
@FXML
9397
AnchorPane summaryNodataAP;
98+
99+
@FXML
100+
AnchorPane topMenuBar;
101+
102+
@FXML
103+
AnchorPane noPropertyFileAP;
104+
105+
@FXML
106+
Button fileOpenBtn;
94107

95108
TagBar tagBar = new TagBar();
96109

@@ -121,13 +134,21 @@ public void initialize(URL location, ResourceBundle resources) {
121134
if (lastUseConnInfoFilePath != null) {
122135
runConnInfoFileComboBox.getSelectionModel().select(lastUseConnInfoFilePath);
123136
}
137+
138+
System.out.println(propService.getMonitoringServerNameList());
139+
if(propService.getMonitoringServerNameList().size() == 0) {
140+
setNoPropertyUIVisible(true);
141+
} else {
142+
setNoPropertyUIVisible(false);
143+
}
144+
124145
} else {
125-
AlertUtils.showAlert(AlertType.INFORMATION, "접속정보 설정", "설정된 접속정보가 없습니다.\n[설정]메뉴로 이동합니다.");
146+
setNoPropertyUIVisible(true);
126147
return;
127148
}
128149
} catch (PropertyNotFoundException e) {
129150
log.error(e.getMessage());
130-
AlertUtils.showAlert(AlertType.INFORMATION, "접속정보 설정", "설정된 접속정보가 없습니다.\n[설정]메뉴로 이동합니다.");
151+
setNoPropertyUIVisible(true);
131152
return;
132153
}
133154

@@ -395,4 +416,32 @@ private void updateStatusMessage(String message) {
395416
statusTextUpdateThread.setDaemon(true);
396417
statusTextUpdateThread.start();
397418
}
419+
420+
/**
421+
* 설정 메뉴로 이동
422+
*
423+
* @param e
424+
* @throws IOException
425+
*/
426+
public void goSettingMenu(ActionEvent e) throws IOException {
427+
SceneUtils.movePage(DependencyInjection.load("/fxml/SettingMenu.fxml"));
428+
}
429+
430+
/**
431+
* 접속정보 설정파일 열기
432+
*
433+
* @param e
434+
*/
435+
public void openPropertiesFile(ActionEvent e) {
436+
}
437+
438+
/**
439+
* 접속정보 설정 파일이 없을 때 UI Visible 변경
440+
*
441+
* @param isVisible
442+
*/
443+
private void setNoPropertyUIVisible(boolean isVisible) {
444+
noPropertyFileAP.setVisible(true);
445+
topMenuBar.setVisible(false);
446+
}
398447
}

0 commit comments

Comments
 (0)