添加说明书
This commit is contained in:
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# http server模拟器
|
||||
## 说明书
|
||||
https://blog.csdn.net/qq_37855749/article/details/121030800
|
||||
@@ -1,23 +1,30 @@
|
||||
{
|
||||
"projectName": "HTTP SERVER 模拟器",
|
||||
"width": 1200,
|
||||
"height": 800,
|
||||
"stringLen": 0,
|
||||
"intLen": 0,
|
||||
"serverConfigs": [
|
||||
{
|
||||
"serverName": "WMS",
|
||||
"port": 8082,
|
||||
"serverUrls": [
|
||||
{
|
||||
"urlName": "登录",
|
||||
"url": "/login",
|
||||
"serverName": "WMS",
|
||||
"requestType": "POST",
|
||||
"responseBody": "{\n\t\"success\": \"ok\"\n}",
|
||||
"headerMap": null
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
"projectName" : "HTTP SERVER 模拟器",
|
||||
"width" : 1200,
|
||||
"height" : 800,
|
||||
"stringLen" : 8,
|
||||
"intLen" : 8,
|
||||
"serverConfigs" : [ {
|
||||
"serverName" : "WMS",
|
||||
"port" : 8080,
|
||||
"serverUrls" : [ {
|
||||
"urlName" : "登录",
|
||||
"url" : "/login",
|
||||
"serverName" : "WMS",
|
||||
"requestType" : "POST",
|
||||
"responseBody" : "{\n\t\"code\": 200,\n\t\"msg\": \"success\"\n}",
|
||||
"headerMap" : null
|
||||
}, {
|
||||
"urlName" : "派发任务",
|
||||
"url" : "/patch",
|
||||
"serverName" : "WMS",
|
||||
"requestType" : "POST",
|
||||
"responseBody" : "{\n\t\"taskNo\": \"$string$\"\n}",
|
||||
"headerMap" : null
|
||||
} ]
|
||||
}, {
|
||||
"serverName" : "WCS",
|
||||
"port" : 8081,
|
||||
"serverUrls" : [ ]
|
||||
} ]
|
||||
}
|
||||
@@ -29,13 +29,15 @@ public class UpdateRandomLenHandler implements EventHandler<ActionEvent> {
|
||||
Configuration configuration = ConfigHolder.get();
|
||||
Stage stage = new Stage();
|
||||
Label strName = LabelFactory.getLabel("随机字符长度:");
|
||||
strName.setPrefWidth(80);
|
||||
strName.setPrefWidth(150);
|
||||
TextField strField = new TextField(String.valueOf(configuration.getStringLen()));
|
||||
Label intName = LabelFactory.getLabel("随机整数长度:");
|
||||
TextField intField = new TextField(String.valueOf(configuration.getIntLen()));
|
||||
intField.setPrefWidth(80);
|
||||
intField.setPrefWidth(150);
|
||||
|
||||
HBox btnHBox = new HBox();
|
||||
Label saveTips1 = LabelFactory.getLabel("注: $string$代指随机字符串");
|
||||
Label saveTips2 = LabelFactory.getLabel("$int$代指随机整数");
|
||||
Button saveButton = ButtonFactory.getButton("保存");
|
||||
btnHBox.getChildren().addAll(saveButton);
|
||||
btnHBox.setAlignment(Pos.CENTER_RIGHT);
|
||||
@@ -46,8 +48,10 @@ public class UpdateRandomLenHandler implements EventHandler<ActionEvent> {
|
||||
gridPane.add(strField, 1, 0);
|
||||
gridPane.add(intName, 0, 1);
|
||||
gridPane.add(intField, 1, 1);
|
||||
gridPane.add(saveTips1, 0, 3);
|
||||
gridPane.add(saveTips2, 1, 3);
|
||||
|
||||
gridPane.add(btnHBox, 1, 3);
|
||||
gridPane.add(btnHBox, 1, 4);
|
||||
gridPane.setAlignment(Pos.CENTER);
|
||||
gridPane.setHgap(20d);
|
||||
gridPane.setVgap(10d);
|
||||
|
||||
@@ -22,11 +22,13 @@ import com.dayrain.style.LabelFactory;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.event.EventHandler;
|
||||
import javafx.geometry.Insets;
|
||||
import javafx.geometry.Pos;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Hyperlink;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.ListCell;
|
||||
import javafx.scene.control.ListView;
|
||||
@@ -48,6 +50,10 @@ import javafx.scene.text.Font;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.util.Callback;
|
||||
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -83,6 +89,23 @@ public class HomePage {
|
||||
MenuItem menuItem21 = new MenuItem("随机值长度");
|
||||
menu2.getItems().add(menuItem21);
|
||||
Menu menu3 = new Menu("帮助");
|
||||
MenuItem menuItem31 = new MenuItem("说明书");
|
||||
menuItem31.setOnAction(event -> {
|
||||
try {
|
||||
Desktop.getDesktop().browse(new URI("https://blog.csdn.net/qq_37855749/article/details/121030800"));
|
||||
} catch (IOException | URISyntaxException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
MenuItem menuItem32 = new MenuItem("源码地址");
|
||||
menuItem32.setOnAction(event -> {
|
||||
try {
|
||||
Desktop.getDesktop().browse(new URI("https://github.com/DayRain/http-server-simulator"));
|
||||
} catch (IOException | URISyntaxException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
menu3.getItems().addAll(menuItem31, menuItem32);
|
||||
menuBar.getMenus().addAll(menu1, menu2, menu3);
|
||||
borderPane.setTop(menuBar);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user