This commit is contained in:
Namhyeon Go 2020-11-27 16:11:59 +09:00
parent 952b48f245
commit ed84db843e
3 changed files with 37 additions and 27 deletions

View File

@ -82,7 +82,7 @@ var getLocalApplications = function() {
&& applications[k].uniqueId == localApplications[i].uniqueId
&& applications[k].createdBy == userId)
{
entry.find("select").data("application-id", applications[i].id);
entry.find("select").data("application-id", applications[k].id);
serverId = applications[k].server;
break;
}
@ -139,6 +139,7 @@ var getMyApplications = function() {
xmlStrings.push('<?xml version="1.0" encoding="UTF-8"?>');
xmlStrings.push("<StaticIP>");
for (var i = 0; i < res.data.length; i++) {
if (res.data[i].created_by == userId) {
xmlStrings.push("<Item>");
xmlStrings.push("<Name>" + res.data[i].name + "</Name>");
xmlStrings.push("<UniqueID>" + res.data[i].unique_id + "</UniqueID>");
@ -165,6 +166,7 @@ var getMyApplications = function() {
});
}
}
}
xmlStrings.push("</StaticIP>");
FILE.writeFile("staticip.xml", xmlStrings.join("\r\n"), "utf-8");
@ -176,6 +178,9 @@ var getMyApplications = function() {
.setContentType("application/x-www-form-urlencoded")
.setBearerAuth(token)
.setUseCache(false)
.setParameters({
"filter[created_by][eq]": userId
})
.get(apiUrl + "/netsolid/items/applications", onSuccess)
;
};
@ -190,7 +195,6 @@ var getMyServers = function(assignedServers) {
entry.find("a.title").text(res.data[i].ipaddress);
entry.find("div.description").text(res.data[i].name);
entry.appendTo("#listview_servers");
servers.push({
"data": res.data[i],
"entry": entry
@ -205,6 +209,9 @@ var getMyServers = function(assignedServers) {
.setContentType("application/x-www-form-urlencoded")
.setBearerAuth(token)
.setUseCache(false)
.setParameters({
"limit": "-1"
})
.get(apiUrl + "/netsolid/items/servers", onSuccess)
;
@ -230,6 +237,9 @@ var getAssignedServers = function() {
.setContentType("application/x-www-form-urlencoded")
.setBearerAuth(token)
.setUseCache(false)
.setParameters({
"filter[assigned_to][eq]": userId
})
.get(apiUrl + "/netsolid/items/assignedservers", onSuccess)
;
};

View File

@ -15,7 +15,7 @@ input, textarea {
#app {
width: 100%;
height: 100%;
overflow: hidden;
overflow: auto;
}
#loading {

View File

@ -292,7 +292,7 @@ var HTTPObject = function() {
return this.jqAjax({
type: "GET",
headers: this.headers,
url: url,
url: this.serializeParameters(url),
data: this.requestBody,
contentType: this.contentType,
success: callback,
@ -315,7 +315,7 @@ var HTTPObject = function() {
return this.jqAjax({
type: "PATCH",
headers: this.headers,
url: url,
url: this.serializeParameters(url),
data: this.requestBody,
contentType: this.contentType,
success: callback,