mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Link to help page for double prompt
This commit is contained in:
parent
97d7f4f30f
commit
106132ef88
2 changed files with 16 additions and 0 deletions
|
@ -8,6 +8,10 @@ import javafx.animation.AnimationTimer;
|
|||
import javafx.application.Platform;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.scene.control.Alert;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.ButtonBar;
|
||||
import javafx.scene.control.ButtonType;
|
||||
import javafx.scene.input.MouseEvent;
|
||||
import javafx.scene.layout.StackPane;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
|
@ -20,6 +24,17 @@ public class AskpassAlert {
|
|||
alert.setHeaderText(prompt);
|
||||
alert.setAlertType(Alert.AlertType.CONFIRMATION);
|
||||
|
||||
// Link to help page for double prompt
|
||||
if (!SecretManager.shouldCacheForPrompt(prompt)) {
|
||||
var type = new ButtonType("Help", ButtonBar.ButtonData.HELP);
|
||||
alert.getButtonTypes().add(type);
|
||||
var button = (Button)alert.getDialogPane().lookupButton(type);
|
||||
button.addEventFilter(MouseEvent.MOUSE_PRESSED, event -> {
|
||||
Hyperlinks.open(Hyperlinks.DOUBLE_PROMPT);
|
||||
event.consume();
|
||||
});
|
||||
}
|
||||
|
||||
var text = new SecretFieldComp(prop).createStructure().get();
|
||||
alert.getDialogPane().setContent(new StackPane(text));
|
||||
var stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
||||
|
|
|
@ -4,6 +4,7 @@ import io.xpipe.app.issue.ErrorEvent;
|
|||
|
||||
public class Hyperlinks {
|
||||
|
||||
public static final String DOUBLE_PROMPT = "https://docs.xpipe.io/two-step-connections";
|
||||
public static final String GITHUB = "https://github.com/xpipe-io/xpipe";
|
||||
public static final String PRIVACY = "https://docs.xpipe.io/privacy-policy";
|
||||
public static final String EULA = "https://docs.xpipe.io/end-user-license-agreement";
|
||||
|
|
Loading…
Reference in a new issue