This commit is contained in:
Tomofumi Tanaka
2014-04-07 22:26:27 +09:00
parent b357d52ec5
commit 3a2ecf6896
2 changed files with 6 additions and 3 deletions

View File

@@ -28,6 +28,9 @@ object SshUtil {
} }
} }
def fingerPrint(key: String): String = KeyUtils.getFingerPrint(str2PublicKey(key).get) def fingerPrint(key: String): Option[String] = str2PublicKey(key) match {
case Some(publicKey) => Some(KeyUtils.getFingerPrint(publicKey))
case None => None
}
} }

View File

@@ -17,7 +17,7 @@
@if(i != 0){ @if(i != 0){
<hr> <hr>
} }
<strong>@key.title</strong> (@_root_.ssh.SshUtil.fingerPrint(key.publicKey)) <strong>@key.title</strong> (@_root_.ssh.SshUtil.fingerPrint(key.publicKey).getOrElse("Key is invalid."))
<a href="@path/@account.userName/_ssh/delete/@key.sshKeyId" class="btn btn-mini btn-danger pull-right">Delete</a> <a href="@path/@account.userName/_ssh/delete/@key.sshKeyId" class="btn btn-mini btn-danger pull-right">Delete</a>
} }
</div> </div>