2024年4月12日18:17:37
parent
41109980e0
commit
d91801cbe6
|
|
@ -95,6 +95,9 @@ public class MinioUploadController {
|
||||||
@FXML
|
@FXML
|
||||||
public TextField create_bucket_name;
|
public TextField create_bucket_name;
|
||||||
|
|
||||||
|
@FXML
|
||||||
|
public Button load_init_config;
|
||||||
|
|
||||||
public void reload(String bucketName){
|
public void reload(String bucketName){
|
||||||
if (bucketName == null){
|
if (bucketName == null){
|
||||||
return;
|
return;
|
||||||
|
|
@ -123,10 +126,7 @@ public class MinioUploadController {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void init_minio_config(){
|
public void init_minio_config(){
|
||||||
//默认值
|
|
||||||
endpoint.setText("http://192.168.1.254:9000");
|
|
||||||
accessKey.setText("minioadmin");
|
|
||||||
secretKey.setText("minioadmin");
|
|
||||||
MinioUtils.objectMap.put("endpoint",endpoint.getText());
|
MinioUtils.objectMap.put("endpoint",endpoint.getText());
|
||||||
MinioUtils.objectMap.put("accessKey",accessKey.getText());
|
MinioUtils.objectMap.put("accessKey",accessKey.getText());
|
||||||
MinioUtils.objectMap.put("secretKey",secretKey.getText());
|
MinioUtils.objectMap.put("secretKey",secretKey.getText());
|
||||||
|
|
@ -140,11 +140,14 @@ public class MinioUploadController {
|
||||||
AlertUtils.alert_msg("重新加载成功!");
|
AlertUtils.alert_msg("重新加载成功!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void load_init(){
|
||||||
|
init_minio_config();
|
||||||
|
init_bucket_list();
|
||||||
|
}
|
||||||
|
|
||||||
@FXML
|
@FXML
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
|
||||||
init_minio_config();
|
|
||||||
|
|
||||||
this.backet_list.setItems(backet_item_list);
|
this.backet_list.setItems(backet_item_list);
|
||||||
backet_list.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {
|
backet_list.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<String>() {
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -154,8 +157,15 @@ public class MinioUploadController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
init_bucket_list();
|
|
||||||
|
|
||||||
|
//默认值
|
||||||
|
endpoint.setText("http://192.168.1.254:9000");
|
||||||
|
accessKey.setText("minioadmin");
|
||||||
|
secretKey.setText("minioadmin");
|
||||||
|
|
||||||
|
load_init_config.setOnAction(event -> {
|
||||||
|
load_init();
|
||||||
|
});
|
||||||
tableview.setItems(list);
|
tableview.setItems(list);
|
||||||
file_name.setCellValueFactory(new PropertyValueFactory<BucketFile,String>("fileName"));
|
file_name.setCellValueFactory(new PropertyValueFactory<BucketFile,String>("fileName"));
|
||||||
file_size.setCellValueFactory(new PropertyValueFactory<BucketFile,Number>("size"));
|
file_size.setCellValueFactory(new PropertyValueFactory<BucketFile,Number>("size"));
|
||||||
|
|
@ -210,7 +220,6 @@ public class MinioUploadController {
|
||||||
file_choose.setGraphic(iv);
|
file_choose.setGraphic(iv);
|
||||||
file_choose.setOnAction(event -> choose_file());
|
file_choose.setOnAction(event -> choose_file());
|
||||||
|
|
||||||
|
|
||||||
upload.setOnAction(event -> {
|
upload.setOnAction(event -> {
|
||||||
|
|
||||||
if (endpoint.getText().length() == 0) {
|
if (endpoint.getText().length() == 0) {
|
||||||
|
|
|
||||||
|
|
@ -412,6 +412,7 @@ public class MinioUtils {
|
||||||
return getDefault().listBuckets();
|
return getDefault().listBuckets();
|
||||||
} catch (ErrorResponseException | InsufficientDataException | InternalException | InvalidKeyException | InvalidResponseException | IOException | NoSuchAlgorithmException | ServerException | XmlParserException e) {
|
} catch (ErrorResponseException | InsufficientDataException | InternalException | InvalidKeyException | InvalidResponseException | IOException | NoSuchAlgorithmException | ServerException | XmlParserException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
AlertUtils.alert_msg(objectMap.get("endpoint").toString() + "链接错误!");
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,10 +36,11 @@
|
||||||
</columns>
|
</columns>
|
||||||
</TableView>
|
</TableView>
|
||||||
<ComboBox fx:id="backet_list" layoutX="905.0" layoutY="35.0" prefWidth="150.0" />
|
<ComboBox fx:id="backet_list" layoutX="905.0" layoutY="35.0" prefWidth="150.0" />
|
||||||
<Button fx:id="reload_config" layoutX="886.0" layoutY="101.0" mnemonicParsing="false" text="重新加载配置文件" />
|
<Button fx:id="reload_config" layoutX="1042.0" layoutY="101.0" mnemonicParsing="false" text="重新加载配置文件" />
|
||||||
<Button fx:id="create_bucket" layoutX="725.0" layoutY="163.0" mnemonicParsing="false" text="创建bucket" />
|
<Button fx:id="create_bucket" layoutX="725.0" layoutY="163.0" mnemonicParsing="false" text="创建bucket" />
|
||||||
<TextField fx:id="create_bucket_name" layoutX="512.0" layoutY="163.0" prefHeight="23.0" prefWidth="191.0" />
|
<TextField fx:id="create_bucket_name" layoutX="512.0" layoutY="163.0" prefHeight="23.0" prefWidth="191.0" />
|
||||||
<Label layoutX="376.0" layoutY="167.0" text="将要创建的bucket名称" />
|
<Label layoutX="376.0" layoutY="167.0" text="将要创建的bucket名称" />
|
||||||
<Button fx:id="delete_bucket" layoutX="1073.0" layoutY="35.0" mnemonicParsing="false" text="删除所选bucket" />
|
<Button fx:id="delete_bucket" layoutX="1073.0" layoutY="35.0" mnemonicParsing="false" text="删除所选bucket" />
|
||||||
|
<Button fx:id="load_init_config" layoutX="896.0" layoutY="101.0" mnemonicParsing="false" text="加载默认配置" />
|
||||||
</children>
|
</children>
|
||||||
</AnchorPane>
|
</AnchorPane>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue