mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-30 03:19:11 +08:00
GitHost SSH Key: Make the message more informative
This way, the user will have more feedback about what step in the process are they.
This commit is contained in:
@ -25,7 +25,9 @@ class GitHostSetupAutoConfigure extends StatefulWidget {
|
|||||||
class GitHostSetupAutoConfigureState extends State<GitHostSetupAutoConfigure> {
|
class GitHostSetupAutoConfigureState extends State<GitHostSetupAutoConfigure> {
|
||||||
GitHost gitHost;
|
GitHost gitHost;
|
||||||
String errorMessage = "";
|
String errorMessage = "";
|
||||||
|
|
||||||
bool _configuringStarted = false;
|
bool _configuringStarted = false;
|
||||||
|
String _message = "Waiting for Permissions ...";
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -48,10 +50,21 @@ class GitHostSetupAutoConfigureState extends State<GitHostSetupAutoConfigure> {
|
|||||||
|
|
||||||
GitRepo repo;
|
GitRepo repo;
|
||||||
try {
|
try {
|
||||||
|
this.setState(() {
|
||||||
|
_message = "Creating private repo";
|
||||||
|
});
|
||||||
|
|
||||||
// FIXME: What if repo already exists?
|
// FIXME: What if repo already exists?
|
||||||
repo = await gitHost.createRepo("journal");
|
repo = await gitHost.createRepo("journal");
|
||||||
|
|
||||||
|
this.setState(() {
|
||||||
|
_message = "Generating SSH Key";
|
||||||
|
});
|
||||||
var publicKey = await generateSSHKeys(comment: "GitJournal");
|
var publicKey = await generateSSHKeys(comment: "GitJournal");
|
||||||
|
|
||||||
|
this.setState(() {
|
||||||
|
_message = "Adding as a Deploy Key";
|
||||||
|
});
|
||||||
await gitHost.addDeployKey(publicKey, repo.fullName);
|
await gitHost.addDeployKey(publicKey, repo.fullName);
|
||||||
|
|
||||||
var userInfo = await gitHost.getUserInfo();
|
var userInfo = await gitHost.getUserInfo();
|
||||||
@ -83,7 +96,7 @@ class GitHostSetupAutoConfigureState extends State<GitHostSetupAutoConfigure> {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (_configuringStarted) {
|
if (_configuringStarted) {
|
||||||
if (this.errorMessage == null || this.errorMessage.isEmpty) {
|
if (this.errorMessage == null || this.errorMessage.isEmpty) {
|
||||||
return GitHostSetupLoadingPage("Configuring ...");
|
return GitHostSetupLoadingPage(_message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return GitHostSetupErrorPage(errorMessage);
|
return GitHostSetupErrorPage(errorMessage);
|
||||||
|
Reference in New Issue
Block a user