|
1 | 1 | package root.javafx.Controller; |
2 | 2 |
|
| 3 | +import java.io.IOException; |
3 | 4 | import java.net.URL; |
4 | 5 | import java.time.LocalDate; |
5 | 6 | import java.util.HashMap; |
|
20 | 21 | import javafx.fxml.Initializable; |
21 | 22 | import javafx.geometry.Insets; |
22 | 23 | import javafx.scene.control.Alert.AlertType; |
| 24 | +import javafx.scene.control.Button; |
23 | 25 | import javafx.scene.control.DatePicker; |
24 | 26 | import javafx.scene.control.ScrollPane; |
25 | 27 | import javafx.scene.control.ScrollPane.ScrollBarPolicy; |
|
45 | 47 | import root.javafx.CustomView.NumberTextFormatter; |
46 | 48 | import root.javafx.CustomView.TagBar; |
47 | 49 | import root.javafx.CustomView.dateCell.DisableAfterTodayDateCell; |
| 50 | +import root.javafx.DI.DependencyInjection; |
48 | 51 | import root.javafx.utils.AlertUtils; |
| 52 | +import root.javafx.utils.SceneUtils; |
49 | 53 | import root.repository.implement.LinuxServerMonitoringRepository; |
50 | 54 | import root.repository.implement.PropertyRepositoryImpl; |
51 | 55 | import root.repository.implement.ReportFileRepo; |
@@ -91,6 +95,15 @@ public class AlertLogMonitoringMenuController implements Initializable { |
91 | 95 |
|
92 | 96 | @FXML |
93 | 97 | AnchorPane summaryNodataAP; |
| 98 | + |
| 99 | + @FXML |
| 100 | + AnchorPane topMenuBar; |
| 101 | + |
| 102 | + @FXML |
| 103 | + AnchorPane noPropertyFileAP; |
| 104 | + |
| 105 | + @FXML |
| 106 | + Button fileOpenBtn; |
94 | 107 |
|
95 | 108 | TagBar tagBar = new TagBar(); |
96 | 109 |
|
@@ -121,13 +134,21 @@ public void initialize(URL location, ResourceBundle resources) { |
121 | 134 | if (lastUseConnInfoFilePath != null) { |
122 | 135 | runConnInfoFileComboBox.getSelectionModel().select(lastUseConnInfoFilePath); |
123 | 136 | } |
| 137 | + |
| 138 | + System.out.println(propService.getMonitoringServerNameList()); |
| 139 | + if(propService.getMonitoringServerNameList().size() == 0) { |
| 140 | + setNoPropertyUIVisible(true); |
| 141 | + } else { |
| 142 | + setNoPropertyUIVisible(false); |
| 143 | + } |
| 144 | + |
124 | 145 | } else { |
125 | | - AlertUtils.showAlert(AlertType.INFORMATION, "접속정보 설정", "설정된 접속정보가 없습니다.\n[설정]메뉴로 이동합니다."); |
| 146 | + setNoPropertyUIVisible(true); |
126 | 147 | return; |
127 | 148 | } |
128 | 149 | } catch (PropertyNotFoundException e) { |
129 | 150 | log.error(e.getMessage()); |
130 | | - AlertUtils.showAlert(AlertType.INFORMATION, "접속정보 설정", "설정된 접속정보가 없습니다.\n[설정]메뉴로 이동합니다."); |
| 151 | + setNoPropertyUIVisible(true); |
131 | 152 | return; |
132 | 153 | } |
133 | 154 |
|
@@ -395,4 +416,32 @@ private void updateStatusMessage(String message) { |
395 | 416 | statusTextUpdateThread.setDaemon(true); |
396 | 417 | statusTextUpdateThread.start(); |
397 | 418 | } |
| 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 | + } |
398 | 447 | } |
0 commit comments