Skip to content

Commit 51f5d6f

Browse files
authored
Merge pull request #250 from Dokyeongyun/ft-220517-noDataUI
Ft 220517 no data UI
2 parents 1dd3c30 + 93c9b72 commit 51f5d6f

File tree

6 files changed

+490
-264
lines changed

6 files changed

+490
-264
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(isVisible);
445+
topMenuBar.setVisible(!isVisible);
446+
}
398447
}

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

Lines changed: 42 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,15 @@ public void initialize(URL location, ResourceBundle resources) {
9299
if (lastUseConnInfoFilePath != null) {
93100
runConnInfoFileComboBox.getSelectionModel().select(lastUseConnInfoFilePath);
94101
}
102+
103+
setNoPropertyUIVisible(false);
95104
} else {
96-
AlertUtils.showAlert(AlertType.INFORMATION, "접속정보 설정", "설정된 DB/Server 접속정보가 없습니다.\n[설정]메뉴로 이동합니다.");
105+
setNoPropertyUIVisible(true);
97106
return;
98107
}
99108
} catch (PropertyNotFoundException e) {
100109
log.error(e.getMessage());
101-
AlertUtils.showAlert(AlertType.INFORMATION, "접속정보 설정", "설정된 DB/Server 접속정보가 없습니다.\n[설정]메뉴로 이동합니다.");
110+
setNoPropertyUIVisible(true);
102111
return;
103112
}
104113

@@ -172,4 +181,33 @@ public void runMonitoring(ActionEvent e) {
172181
asmDiskUsageMAP.syncTableData(asmDiskUsageMAP.getSelectedAliasComboBoxItem(), 0);
173182
osDiskUsageMAP.syncTableData(osDiskUsageMAP.getSelectedAliasComboBoxItem(), 0);
174183
}
184+
185+
/**
186+
* 설정 메뉴로 이동
187+
*
188+
* @param e
189+
* @throws IOException
190+
*/
191+
public void goSettingMenu(ActionEvent e) throws IOException {
192+
SceneUtils.movePage(DependencyInjection.load("/fxml/SettingMenu.fxml"));
193+
}
194+
195+
/**
196+
* 접속정보 설정파일 열기
197+
*
198+
* @param e
199+
*/
200+
public void openPropertiesFile(ActionEvent e) {
201+
202+
}
203+
204+
/**
205+
* 접속정보 설정 파일이 없을 때 UI Visible 변경
206+
*
207+
* @param isVisible
208+
*/
209+
private void setNoPropertyUIVisible(boolean isVisible) {
210+
noPropertyFileAP.setVisible(isVisible);
211+
topMenuBar.setVisible(!isVisible);
212+
}
175213
}

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

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import javafx.fxml.FXML;
2020
import javafx.fxml.Initializable;
2121
import javafx.scene.Node;
22+
import javafx.scene.control.Button;
2223
import javafx.scene.control.Control;
2324
import javafx.scene.control.Label;
2425
import javafx.scene.control.ScrollPane;
@@ -118,6 +119,9 @@ public class RunMenuController implements Initializable {
118119

119120
@FXML
120121
AnchorPane noPropertyFileAP;
122+
123+
@FXML
124+
Button fileOpenBtn;
121125

122126
private MonitoringTableViewPagingBox dbResults;
123127
private MonitoringTableViewPagingBox serverResults;
@@ -135,10 +139,10 @@ public void initialize(URL location, ResourceBundle resources) {
135139
/* 4. 실행결과 */
136140
// initRunStep4();
137141

138-
noPropertyFileAP.setVisible(false);
142+
setNoPropertyUIVisible(false);
139143
} catch (PropertyNotFoundException e) {
140144
log.error(e.getMessage());
141-
noPropertyFileAP.setVisible(true);
145+
setNoPropertyUIVisible(true);
142146
}
143147
}
144148

@@ -315,8 +319,8 @@ private void initRunStep1() throws PropertyNotFoundException {
315319
// 1-1. 모니터링 접속정보 설정파일 콤보박스 아이템 설정
316320
List<String> connInfoFileList = propService.getConnectionInfoList();
317321
if (connInfoFileList == null || ArrayUtils.isEmpty(connInfoFileList.toArray())) {
318-
// TODO 접속정보 설정파일이 없는 경우
319-
addMonitoringConnInfoPreview(new ArrayList<>(), new ArrayList<>());
322+
setNoPropertyUIVisible(true);
323+
// addMonitoringConnInfoPreview(new ArrayList<>(), new ArrayList<>());
320324
} else {
321325
connInfoFileListComboBox.getItems().addAll(connInfoFileList);
322326
}
@@ -457,4 +461,21 @@ private void initRunStep4() {
457461
public void goSettingMenu(ActionEvent e) throws IOException {
458462
SceneUtils.movePage(DependencyInjection.load("/fxml/SettingMenu.fxml"));
459463
}
464+
465+
/**
466+
* 접속정보 설정파일 열기
467+
*
468+
* @param e
469+
*/
470+
public void openPropertiesFile(ActionEvent e) {
471+
}
472+
473+
/**
474+
* 접속정보 설정 파일이 없을 때 UI Visible 변경
475+
*
476+
* @param isVisible
477+
*/
478+
private void setNoPropertyUIVisible(boolean isVisible) {
479+
noPropertyFileAP.setVisible(isVisible);
480+
}
460481
}

0 commit comments

Comments
 (0)