mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-27 09:06:43 +08:00
Remote Setup: Add a button to regenerate the key
This commit is contained in:
@ -177,6 +177,12 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
|
|||||||
_startGitClone(context);
|
_startGitClone(context);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
regenerateFunction: () {
|
||||||
|
setState(() {
|
||||||
|
publicKey = "";
|
||||||
|
});
|
||||||
|
_generateSshKey(context);
|
||||||
|
},
|
||||||
publicKey: publicKey,
|
publicKey: publicKey,
|
||||||
copyKeyFunction: _copyKeyToClipboard,
|
copyKeyFunction: _copyKeyToClipboard,
|
||||||
openDeployKeyPage: _launchDeployKeyPage,
|
openDeployKeyPage: _launchDeployKeyPage,
|
||||||
|
@ -6,6 +6,7 @@ import 'githostsetup_loading.dart';
|
|||||||
|
|
||||||
class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
|
class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
|
||||||
final Func0<void> doneFunction;
|
final Func0<void> doneFunction;
|
||||||
|
final Func0<void> regenerateFunction;
|
||||||
final Func1<BuildContext, void> copyKeyFunction;
|
final Func1<BuildContext, void> copyKeyFunction;
|
||||||
final String publicKey;
|
final String publicKey;
|
||||||
|
|
||||||
@ -13,6 +14,7 @@ class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
|
|||||||
|
|
||||||
GitHostSetupSshKeyKnownProvider({
|
GitHostSetupSshKeyKnownProvider({
|
||||||
@required this.doneFunction,
|
@required this.doneFunction,
|
||||||
|
@required this.regenerateFunction,
|
||||||
@required this.copyKeyFunction,
|
@required this.copyKeyFunction,
|
||||||
@required this.openDeployKeyPage,
|
@required this.openDeployKeyPage,
|
||||||
@required this.publicKey,
|
@required this.publicKey,
|
||||||
@ -42,10 +44,15 @@ class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
|
|||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
PublicKeyWidget(publicKey),
|
PublicKeyWidget(publicKey),
|
||||||
const SizedBox(height: 8.0),
|
const SizedBox(height: 8.0),
|
||||||
|
|
||||||
GitHostSetupButton(
|
GitHostSetupButton(
|
||||||
text: "Copy Key",
|
text: "Copy Key",
|
||||||
onPressed: () => copyKeyFunction(context),
|
onPressed: () => copyKeyFunction(context),
|
||||||
),
|
),
|
||||||
|
GitHostSetupButton(
|
||||||
|
text: "Regenerate Key",
|
||||||
|
onPressed: regenerateFunction,
|
||||||
|
),
|
||||||
const SizedBox(height: 16.0),
|
const SizedBox(height: 16.0),
|
||||||
|
|
||||||
// Step 2
|
// Step 2
|
||||||
|
Reference in New Issue
Block a user