Merge "Display description how to generate SSH Key in SshPanel"

This commit is contained in:
Shawn Pearce
2013-01-01 09:35:54 -08:00
committed by Gerrit Code Review
4 changed files with 37 additions and 2 deletions

View File

@@ -69,6 +69,7 @@ public interface AccountConstants extends Constants {
String sshKeyStatus();
String addSshKeyPanelHeader();
String addSshKeyHelpTitle();
String addSshKeyHelp();
String sshJavaAppletNotAvailable();
String invalidSshKeyError();

View File

@@ -60,7 +60,27 @@ buttonDeleteIdentity = Delete
buttonLinkIdentity = Link Another Identity
addSshKeyPanelHeader = Add SSH Public Key
addSshKeyHelp = (<a href="http://help.github.com/key-setup-redirect" target="_blank">GitHub's Guide to SSH Keys</a>)
addSshKeyHelpTitle = How to Generate an SSH Key
addSshKeyHelp = \
<ol>\
<li>\
From the Terminal or Git Bash, run <em>ssh-keygen</em>\
</li>\
<li>\
Confirm the default path <em>.ssh/id_rsa</em>\
</li>\
<li>\
Enter a passphrase (recommended) or leave it blank.<br>\
Remember this passphrase, as you will need it to unlock the<br>\
key whenever you use it.\
</li>\
<li>\
Open <em>~/.ssh/id_rsa.pub</em> and copy & paste the contents into<br>\
the box below, then click on "Add".<br>\
Note that <em>id_rsa.pub</em> is your public key and can be shared,<br>\
while <em>id_rsa</em> is your private key and should be kept secret.\
</li>\
<\ol>
invalidSshKeyError = Invalid SSH Key
sshJavaAppletNotAvailable = Open Key Unavailable: Java not enabled

View File

@@ -17,6 +17,7 @@ package com.google.gerrit.client.account;
import com.google.gerrit.client.ErrorDialog;
import com.google.gerrit.client.Gerrit;
import com.google.gerrit.client.rpc.GerritCallback;
import com.google.gerrit.client.ui.ComplexDisclosurePanel;
import com.google.gerrit.client.ui.FancyFlexTable;
import com.google.gerrit.client.ui.SmallHeading;
import com.google.gerrit.common.data.SshHostKey;
@@ -92,7 +93,11 @@ class SshPanel extends Composite {
addKeyBlock.setVisible(false);
addKeyBlock.setStyleName(Gerrit.RESOURCES.css().addSshKeyPanel());
addKeyBlock.add(new SmallHeading(Util.C.addSshKeyPanelHeader()));
addKeyBlock.add(new HTML(Util.C.addSshKeyHelp()));
final ComplexDisclosurePanel addSshKeyHelp =
new ComplexDisclosurePanel(Util.C.addSshKeyHelpTitle(), false);
addSshKeyHelp.setContent(new HTML(Util.C.addSshKeyHelp()));
addKeyBlock.add(addSshKeyHelp);
addTxt = new NpTextArea();
addTxt.setVisibleLines(12);

View File

@@ -1237,6 +1237,15 @@ a:hover.downloadLink {
padding: 5px 5px 5px 5px;
}
.addSshKeyPanel ol {
margin-top: 0px;
margin-bottom: 5px;
}
.addSshKeyPanel td {
width: 100%;
}
.createGroupLink {
margin-bottom: 10px;
}