Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit aa25d12

Browse files
committed
update
1 parent eace839 commit aa25d12

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

src/main/java/com/zhazhapan/vspider/controller/CustomCrawlingController.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
package com.zhazhapan.vspider.controller;
22

3+
import com.zhazhapan.util.Checker;
34
import com.zhazhapan.vspider.SpiderApplication;
5+
import com.zhazhapan.vspider.models.MysqlConfig;
46
import javafx.fxml.FXML;
57
import javafx.scene.control.CheckBox;
68
import javafx.scene.control.TextArea;
79
import javafx.scene.control.TextField;
10+
import javafx.util.Pair;
811

912
/**
1013
* @author pantao
@@ -45,5 +48,21 @@ public class CustomCrawlingController {
4548
@FXML
4649
private void initialize() {
4750
SpiderApplication.customCrawlingController = this;
51+
mappings.setWrapText(true);
52+
dbHost.setText(MysqlConfig.getDbHost());
53+
dbPort.setText(MysqlConfig.getDbPort());
54+
dbCondition.setText(MysqlConfig.getDbCondition());
55+
dbName.setText(MysqlConfig.getDbName());
56+
dbPassword.setText(MysqlConfig.getDbPassword());
57+
dbTable.setText(MysqlConfig.getTableName());
58+
dbUsername.setText(MysqlConfig.getDbUsername());
59+
if (Checker.isNotEmpty(MysqlConfig.getFields())) {
60+
StringBuilder sb = new StringBuilder();
61+
for (Pair<String, String> pair : MysqlConfig.getFields()) {
62+
sb.append(pair.getKey()).append(" -> ").append(pair.getValue()).append(", ");
63+
}
64+
String mapping = sb.toString();
65+
mappings.setText(mapping.substring(0, mapping.length() - 2));
66+
}
4867
}
4968
}

src/main/java/com/zhazhapan/vspider/models/MysqlConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class MysqlConfig {
1818

1919
private static String dbPort = "3306";
2020

21-
private static String dbName = "test";
21+
private static String dbName = "spider";
2222

2323
private static String dbCondition = "useUnicode=true&characterEncoding=utf-8&useSSL=true";
2424

src/main/resources/view/MainWindow.fxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
<bottom>
1818
<HBox alignment="CENTER_LEFT" prefHeight="20.0" prefWidth="700.0" BorderPane.alignment="CENTER_RIGHT">
1919
<Label fx:id="statusLabel" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308"
20-
prefHeight="20.0" prefWidth="630.0" HBox.hgrow="ALWAYS">
20+
prefHeight="20.0" prefWidth="680.0" HBox.hgrow="ALWAYS">
2121
<HBox.margin>
2222
<Insets left="10.0"/>
2323
</HBox.margin>
2424
</Label>
25-
<Label prefHeight="17.0" prefWidth="157.0" text="2017 (c) 潘滔 v1.1" HBox.hgrow="NEVER">
25+
<Label prefHeight="17.0" prefWidth="150.0" text="2017 (c) 潘滔 v1.1" HBox.hgrow="NEVER">
2626
<HBox.margin>
2727
<Insets/>
2828
</HBox.margin>

0 commit comments

Comments
 (0)