set-sshkey.xhtml 8.65 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
<?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">
27
	<h:form id="form" prependId="false" class="full form">
28

29
30
31
	<h3><h:outputText value="#{messages.set_ssh_pub_key_for} #{setServiceSshPubKeyBean.serviceEntity.name}" /></h3>
	
			<p:panel>
32
33
34
35
36
37
38
39
40
41
				
				<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()}">
ls1947's avatar
ls1947 committed
42
	      			<p:column width="12%">
43
	       				<f:facet name="header"><h:outputText value="#{messages.status}"/></f:facet>
44
        				<h:panelGroup id="deniedKey" rendered="#{regKey.keyStatus == 'DENIED'}">
ls1947's avatar
ls1947 committed
45
        					<i class="fa fa-fw fa-close"></i><span><h:outputText value="#{messages.ssh_pub_key_denied}" /></span>
46
47
        				</h:panelGroup>
        				<p:tooltip id="toolTipDeniedKey" for="deniedKey" value="#{messages.ssh_pub_key_denied}" position="top"/>
48
        				<h:panelGroup id="pendingKey" rendered="#{regKey.keyStatus == 'PENDING'}">
ls1947's avatar
ls1947 committed
49
        					<i class="fa fa-fw fa-exclamation-triangle"></i><span><h:outputText value="#{messages.ssh_pub_key_pending}" /></span>
50
51
52
        				</h:panelGroup>
        				<p:tooltip id="toolTipPendingKey" for="pendingKey" value="#{messages.ssh_pub_key_pending}" position="top"/>
        				<h:panelGroup id="activeKey" rendered="#{regKey.keyStatus == 'ACTIVE'}">
ls1947's avatar
ls1947 committed
53
        					<i class="fa fa-fw fa-check"></i><span><h:outputText value="#{messages.ssh_pub_key_active}" /></span>
54
55
       					</h:panelGroup>
        				<p:tooltip id="toolTipActiveKey" for="activeKey" value="#{messages.ssh_pub_key_active}" position="top"/>
56
	        		</p:column>
ls1947's avatar
ls1947 committed
57
					<p:column width="12%">
michael.simon's avatar
michael.simon committed
58
	       				<f:facet name="header"><h:outputText value="#{messages.ssh_pub_key_usage_type}"/></f:facet>
ls1947's avatar
ls1947 committed
59
60
61
62
63
64
65
66
	        			<h:panelGroup id="interactiveId" rendered="#{regKey.usageType == 'INTERACTIVE'}">
	        				<i class="fa fa-fw fa-user"></i><span><h:outputText value="#{messages.interactive}" /></span>
	        			</h:panelGroup>
	        			<p:tooltip for="interactiveId" value="#{messages.interactive}" position="top"/>
	        			<h:panelGroup id="commandId" rendered="#{regKey.usageType == 'COMMAND'}">
	        				<i class="fa fa-fw fa-database"></i><span><h:outputText value="#{messages.command}" /></span>
	        			</h:panelGroup>
	        			<p:tooltip for="commandId" value="#{messages.command}" position="top"/>
67
	        		</p:column>
68
69
	      			<p:column>
	       				<f:facet name="header"><h:outputText value="#{messages.ssh_key_name}:"/></f:facet>
ls1947's avatar
ls1947 committed
70
71
72
73
74
75
76
77
78
79
	        			<p:panelGrid columns="2" style="margin-bottom: 0px;">
		        			<h:outputText value="#{regKey.sshPubKey.name}"/>
		        			<p:outputPanel>
			        			<h:outputText value="#{messages.comment}: #{regKey.comment}" rendered="#{not empty regKey.comment}" />
			        			<p:outputPanel rendered="#{regKey.usageType == 'COMMAND'}">
			        				<div><h:outputText value="#{messages.command}: #{regKey.command}" /></div>
			        				<div><h:outputText value="#{messages.from}: #{regKey.from}" /></div>
			        			</p:outputPanel>
		        			</p:outputPanel> 
	        			</p:panelGrid>
80
	        		</p:column>
ls1947's avatar
ls1947 committed
81
82
83
84
85
86
					<p:column width="12%">
	        			<p:commandButton action="#{setServiceSshPubKeyBean.delete(regKey)}" immediate="true" update="@form"
	        				value="#{messages.delete}">
	        				<p:confirm header="#{messages.confirm_header}" escape="false"
	        					message="#{messages.ssh_pub_key_registry_confirm}" />
	        			</p:commandButton>
87
	        		</p:column>
88
89
90
      			</p:dataTable>
			</p:panel>
	
91
92
93
	<h3><h:outputText value="#{messages.set_ssh_pub_key}" /></h3>
	
			<p:panel>
94
95
96
97
98
99
100
101
102
103
      			<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>
ls1947's avatar
ls1947 committed
104
105
	        			<p:commandButton oncomplete="PF('addKeyDlg').show();" update=":form:addKeyDlgId"
	        				value="#{messages.add}">
106
	        				<f:setPropertyActionListener value="#{key}" target="#{setServiceSshPubKeyBean.selectedKey}" />
ls1947's avatar
ls1947 committed
107
	        			</p:commandButton>
108
109
110
111
	        		</p:column>
      			</p:dataTable>
				
				<p:dialog header="#{messages.set_ssh_pub_key_for} #{setServiceSshPubKeyBean.serviceEntity.name}" 
112
113
					widgetVar="addKeyDlg" id="addKeyDlgId" modal="true" closable="false" closeOnEscape="true"
					showEffect="fade" hideEffect="fade">
114
				    
michael.simon's avatar
michael.simon committed
115
				    <div class="panel" style="width:360px;">
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
					    <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'}">
michael.simon's avatar
michael.simon committed
133
							<div class="panel" style="width:360px;">
134
135
136
137
138
								<h:outputText value="#{messages.ssh_pub_key_usage_interactive_help}" />
							</div>
						</h:panelGroup>
	
						<h:panelGroup rendered="#{setServiceSshPubKeyBean.selectedUsageType == 'Command'}">
michael.simon's avatar
michael.simon committed
139
							<div class="panel" style="width:360px;">
140
141
142
								<h:outputText value="#{messages.ssh_pub_key_usage_command_help}" />
							</div>
							<p:panelGrid columns="2">
ls1947's avatar
ls1947 committed
143
								<p:outputLabel for="@next" value="#{messages.command}" />
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
								<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>   				

ls1947's avatar
ls1947 committed
164
165
166
167
			    <p:confirmDialog global="true" showEffect="fade" hideEffect="fade" closable="false" 
			    	closeOnEscape="true" width="250">
			        <p:commandButton value="#{messages.yes}" type="button" styleClass="ui-confirmdialog-yes"/>
			        <p:commandButton value="#{messages.no}" type="button" styleClass="ui-confirmdialog-no"/>
168
169
			    </p:confirmDialog>    
	    
170
			</p:panel>
michael.simon's avatar
michael.simon committed
171
172
173
174
175

		<div class="text full" style="margin-top: 2em;">
			<a href="../index.xhtml"><h:outputText value="#{messages.back}"/></a>
		</div>			

176
	</h:form>
michael.simon's avatar
michael.simon committed
177

178
179
180
181
182
	</ui:define>
</ui:composition>
</f:view>
</body>
</html>