97 lines
2.5 KiB
Plaintext
97 lines
2.5 KiB
Plaintext
<%@include file="init.jsp"%>
|
|
<%--
|
|
<%@ page import="org.gcube.vomanagement.usermanagement.model.GCubeGroup"%>
|
|
<%
|
|
List<GCubeGroup> userGroups = (List<GCubeGroup>) request.getAttribute("userGroups");
|
|
pageContext.setAttribute("userGroups", userGroups);
|
|
|
|
List<String> userContexts = (List<String>) request.getAttribute("userContexts");
|
|
pageContext.setAttribute("userContexts", userContexts);
|
|
%>
|
|
--%>
|
|
|
|
|
|
<portlet:actionURL name="createDefinition" var="createDefinitionURL" />
|
|
|
|
<%--
|
|
<%=ParamUtil.getString(renderRequest,"message")%>
|
|
--%>
|
|
|
|
<div>
|
|
<p>Create:</p>
|
|
<div>
|
|
<label for="ssd_clientId">Client Id:</label>
|
|
<input id="ssd_clientId" name="ssd_clientId" value="" />
|
|
<label for="ssd_description">Description:</label>
|
|
<input id="ssd_description" name="ssd_description" value="" />
|
|
<%--
|
|
<select style="width: 100%;" name="contexts" id="myselect">
|
|
<c:forEach var="context" items="${userContexts}">
|
|
<option value="${context}">${context}</option>
|
|
</c:forEach>
|
|
</select> --%>
|
|
</div>
|
|
<div style="margin-bottom: 15px;">
|
|
<button name="createSSDButton" id="createSSDButton" type="button"
|
|
class="btn btn-primary" onClick="createSysyemServiceDefinition()">Create</button>
|
|
</div>
|
|
<%--
|
|
<div>
|
|
<button id="buttonCopy" class="btn btn-mini" onclick="copyFunction()">
|
|
<i class="icon-copy"></i> Copy
|
|
</button>
|
|
<!-- 300px; margin: 10px;" -->
|
|
<textarea style="width: 90%;" id="tokenResult"></textarea>
|
|
</div>
|
|
--%>
|
|
</div>
|
|
|
|
<script>
|
|
function createSysyemServiceDefinition() {
|
|
console.log("createSysyemServiceDefinition: ");
|
|
var selectedClientId = $("#ssd_clientId").val();
|
|
console.log("name: "+selectedName);
|
|
var selectedDescription = $("#ssd_description").val();
|
|
console.log("description: "+selectedDescription);
|
|
|
|
$.ajax({
|
|
url : '<%=createDefinitionURL%>',
|
|
type : 'POST',
|
|
datatype : 'json',
|
|
data : {
|
|
name : selectedName,
|
|
description : selectedDescription
|
|
},
|
|
success : function(data) {
|
|
console.log("Success!");
|
|
}
|
|
});
|
|
}
|
|
|
|
<%--
|
|
var resultObject = JSON.parse(JSON.stringify(data));
|
|
if (resultObject.success) {
|
|
$('#tokenResult').text(resultObject.comment);
|
|
$('#buttonCopy').show();
|
|
} else {
|
|
$('#tokenResult').text(resultObject.comment);
|
|
$('#tokenResult').css('color', 'red');
|
|
}
|
|
$('#createSSDButton').attr("disabled", false);
|
|
|
|
function copyFunction() {
|
|
/* Get the text field */
|
|
var copyText = document.getElementById("tokenResult");
|
|
|
|
/* Select the text field */
|
|
copyText.select();
|
|
copyText.setSelectionRange(0, 99999); /* For mobile devices */
|
|
|
|
/* Copy the text inside the text field */
|
|
document.execCommand("copy");
|
|
}
|
|
|
|
|
|
$('#buttonCopy').hide();
|
|
--%>
|
|
</script> |