set-sshkey.xhtml 5.1 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:bw="http://www.scc.kit.edu/bwfacelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:of="http://omnifaces.org/functions">
<head>
<title></title>
</head>
<body>
<f:view>
	<f:metadata>
		<f:viewParam name="registryId" value="#{setServiceSshPubKeyBean.id}"/>
		<f:viewParam name="ssn" value="#{setServiceSshPubKeyBean.serviceShortName}"/>
		<f:event type="javax.faces.event.PreRenderViewEvent"
            listener="#{setServiceSshPubKeyBean.preRenderView}" />
	</f:metadata>

<ui:composition template="/template/default.xhtml">
	<ui:param name="title" value="#{messages.title}"/>

	<ui:define name="content">
	<h:form id="form">

		<div id="panelInline">
			<p:panel header="#{messages.set_ssh_pub_key_for} #{setServiceSshPubKeyBean.serviceEntity.name}">
				
				<div class="panel">
					<h:outputText value="#{messages.service_ssh_pub_key_help}" escape="false" />
				</div>

				<p:messages id="messageBox" for="key_error" showDetail="true" />
					<p:panelGrid id="baseData" columns="2">
				</p:panelGrid>			

      			<p:dataTable var="regKey" value="#{setServiceSshPubKeyBean.sshPubKeyRegistryList.toArray()}">
	      			<p:column>
	       				<f:facet name="header"><h:outputText value="#{messages.ssh_key_name}:"/></f:facet>
	        			<h:outputText value="#{regKey.sshPubKey.name}"/>
	        		</p:column>
      			</p:dataTable>
			</p:panel>
	
			<p:panel header="#{messages.set_ssh_pub_key}">
      			<p:dataTable var="key" value="#{setServiceSshPubKeyBean.sshPubKeyList.toArray()}">
	      			<p:column>
	       				<f:facet name="header"><h:outputText value="#{messages.ssh_key_name}:"/></f:facet>
	        			<h:outputText value="#{key.name}"/>
	        		</p:column>
					<p:column>
	       				<f:facet name="header"><h:outputText value="#{messages.expires}:"/></f:facet>
	        			<h:outputText value="#{of:formatDate(key.expiresAt, 'dd.MM.yyyy HH:mm')}"/>
	        		</p:column>
					<p:column>
	        			<p:commandLink oncomplete="PF('addKeyDlg').show();" update=":form:addKeyDlgId">
	        				<h:panelGroup styleClass="ui-icon ui-icon-plus" />
	        				<f:setPropertyActionListener value="#{key}" target="#{setServiceSshPubKeyBean.selectedKey}" />
	        			</p:commandLink>
	        		</p:column>
      			</p:dataTable>
				
				<p:dialog header="#{messages.set_ssh_pub_key_for} #{setServiceSshPubKeyBean.serviceEntity.name}" 
					widgetVar="addKeyDlg" id="addKeyDlgId" modal="true">
				    
				    <div class="panel">
					    <h:outputText value="#{messages.service_ssh_pub_key_help_modal}" />
				    </div>
			        <p:panelGrid columns="2">

						<p:outputLabel for ="@next" value="#{messages.ssh_pub_key_selected}" />
						<h:outputText value="#{setServiceSshPubKeyBean.selectedKey.name}" />

					    <p:outputLabel for="@next" value="#{messages.ssh_pub_key_usage_type}" />
				        <p:selectOneMenu value="#{setServiceSshPubKeyBean.selectedUsageType}">
				        	<p:ajax update="sshUsageTypeId" />
			            	<f:selectItems value="#{setServiceSshPubKeyBean.usageTypes}" 
			            		var="ut" itemLabel="#{ut}" itemValue="#{ut}" />
			            </p:selectOneMenu>
			        
			        </p:panelGrid>
					<p:panel id="sshUsageTypeId">
						<h:panelGroup rendered="#{setServiceSshPubKeyBean.selectedUsageType == 'Interactive'}">
							<div class="panel">
								<h:outputText value="#{messages.ssh_pub_key_usage_interactive_help}" />
							</div>
						</h:panelGroup>
	
						<h:panelGroup rendered="#{setServiceSshPubKeyBean.selectedUsageType == 'Command'}">
							<div class="panel">
								<h:outputText value="#{messages.ssh_pub_key_usage_command_help}" />
							</div>
							<p:panelGrid columns="2">
								<p:outputLabel for="@next" value="#{messages.ssh_pub_key_command}" />
								<p:inputText value="#{setServiceSshPubKeyBean.newCommand}" />
							
								<p:outputLabel for="@next" value="#{messages.ssh_pub_key_from}" />
								<p:inputText value="#{setServiceSshPubKeyBean.newFrom}" />
							</p:panelGrid>
						</h:panelGroup>
					</p:panel>

					<p:panelGrid columns="2">
						<p:outputLabel for="@next" value="#{messages.ssh_pub_key_comment}" />
						<p:inputTextarea rows="4" cols="30" value="#{setServiceSshPubKeyBean.newComment}" />
					</p:panelGrid>

			        <h:panelGroup layout="block" style="text-align: right">
			            <p:commandButton value="#{messages.add}" action="#{setServiceSshPubKeyBean.save()}" 
			            	update="@form" oncomplete="PF('addKeyDlg').hide();" />
			            <p:commandButton value="#{messages.cancel}" oncomplete="PF('addKeyDlg').hide();" />
			        </h:panelGroup>				    
				</p:dialog>   				

			</p:panel>
		</div>
		
	</h:form>
	</ui:define>
</ui:composition>
</f:view>
</body>
</html>