set-sshkey.xhtml 6.57 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
<?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()}">
41
42
43
44
45
46
47
48
49
50
51
	      			<p:column width="5%">
	       				<f:facet name="header"><h:outputText value="#{messages.status}"/></f:facet>
        				<h:panelGroup id="pendingKey" rendered="#{regKey.keyStatus == 'PENDING'}">
        					<i class="fa fa-fw fa-exclamation-triangle"></i>
        				</h:panelGroup>
        				<p:tooltip id="toolTipPendingKey" for="pendingKey" value="#{messages.ssh_pub_key_pending}" position="top"/>
        				<h:panelGroup id="activeKey" rendered="#{regKey.keyStatus == 'ACTIVE'}">
        					<i class="fa fa-fw fa-check"></i>
       					</h:panelGroup>
        				<p:tooltip id="toolTipActiveKey" for="activeKey" value="#{messages.ssh_pub_key_active}" position="top"/>
	        		</p:column>
52
53
54
55
	      			<p:column>
	       				<f:facet name="header"><h:outputText value="#{messages.ssh_key_name}:"/></f:facet>
	        			<h:outputText value="#{regKey.sshPubKey.name}"/>
	        		</p:column>
56
					<p:column>
57
	        			<p:commandLink action="#{setServiceSshPubKeyBean.delete(regKey)}" immediate="true" update="@form">
58
	        				<h:panelGroup styleClass="ui-icon ui-icon-trash" />
59
	        				<p:confirm header="#{messages.confirm_header}" message="#{messages.confirm}" />
60
61
	        			</p:commandLink>
	        		</p:column>
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
      			</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}" 
84
85
					widgetVar="addKeyDlg" id="addKeyDlgId" modal="true" closable="false" closeOnEscape="true"
					showEffect="fade" hideEffect="fade">
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
127
128
129
130
131
132
133
134
135
				    
				    <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>   				

136
137
138
139
140
			    <p:confirmDialog global="true" showEffect="fade" hideEffect="fade" closable="false" closeOnEscape="true">
			        <p:commandButton value="#{messages.yes}" type="button" styleClass="ui-confirmdialog-yes" />
			        <p:commandButton value="#{messages.no}" type="button" styleClass="ui-confirmdialog-no" />
			    </p:confirmDialog>    
	    
141
142
143
144
145
146
147
148
149
			</p:panel>
		</div>
		
	</h:form>
	</ui:define>
</ui:composition>
</f:view>
</body>
</html>