Commit 8c6daca0 authored by michael.simon's avatar michael.simon
Browse files

optics for ssh key deployment

parent bbdc6662
......@@ -61,6 +61,7 @@ public class UserSshKeyManagementBean implements Serializable {
private List<OpenSshPublicKey> keyList;
private String newKey;
private String newName;
private OpenSshPublicKey selectedKey;
public void preRenderView(ComponentSystemEvent ev) {
if (user == null) {
......@@ -162,4 +163,12 @@ public class UserSshKeyManagementBean implements Serializable {
public void setNewName(String newName) {
this.newName = newName;
}
public OpenSshPublicKey getSelectedKey() {
return selectedKey;
}
public void setSelectedKey(OpenSshPublicKey selectedKey) {
this.selectedKey = selectedKey;
}
}
......@@ -23,26 +23,33 @@
<ui:param name="title" value="#{messages.title}"/>
<ui:define name="content">
<h:form id="form" prependId="false">
<p:panel header="#{messages.ssh_key_management}">
<h:form id="form">
<p:panel id="panel" header="#{messages.ssh_key_management}">
<div><p:messages showDetail="true" /></div>
<p:panelGrid id="baseData" columns="2">
<h:outputText value="#{messages.ssh_key}:"/>
<h:panelGroup>
<ul>
<ui:repeat var="key" value="#{userSshKeyManagementBean.keyList.toArray()}">
<li><h:outputText value="#{key.name}"/> - <p:commandLink id="delete" action="#{userSshKeyManagementBean.deleteKey(key.name)}" value="#{messages.delete}" immediate="true" update="@form" /></li>
</ui:repeat>
</ul>
</h:panelGroup>
<p:dataTable var="key" value="#{userSshKeyManagementBean.keyList.toArray()}">
<p:column>
<f:facet name="header"><h:outputText value="#{messages.ssh_key}:"/></f:facet>
<h:outputText value="#{key.name}"/>
</p:column>
<p:column>
<h:outputText value="#{key.publicKey}" rendered="#{not empty key.publicKey}" />
<h:outputText value="#{messages.unknown_ssh_key_type}" rendered="#{empty key.publicKey}" />
</p:column>
<p:column>
<p:commandLink id="delete" action="#{userSshKeyManagementBean.deleteKey(key.name)}" value="#{messages.delete}" immediate="true" update="@form">
<p:confirm header="#{messages.confirm_header}" message="#{messages.confirm}" />
</p:commandLink>
</p:column>
</p:dataTable>
<p:panelGrid id="baseData" columns="2">
<bw:inputText id="sshKeyName" label="#{messages.add_ssh_key_name}:"
value="#{userSshKeyManagementBean.newName}" required="true"/>
<h:outputText value="#{messages.add_ssh_key}:"/>
<p:inputTextarea value="#{userSshKeyManagementBean.newKey}" style="width: 600px; height: 100px;"
<p:inputTextarea value="#{userSshKeyManagementBean.newKey}" style="width: 400px; height: 100px;"
autoResize="false" />
</p:panelGrid>
<p:commandButton id="add" action="#{userSshKeyManagementBean.deployKey()}" value="#{messages.add}" update="@form" />
......@@ -55,6 +62,11 @@
</f:facet>
</p:ajaxStatus>
</p:panel>
<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
<p:commandButton value="#{messages.yes}" type="button" styleClass="ui-confirmdialog-yes" />
<p:commandButton value="#{messages.no}" type="button" styleClass="ui-confirmdialog-no" />
</p:confirmDialog>
</h:form>
</ui:define>
</ui:composition>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment