Skip to content

Commit 4459df0

Browse files
committed
xp, component server upload 기능 추가
1 parent 144acce commit 4459df0

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

zimmyrabbit/templates/jenkins/main.html

+38
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
<input type="button" class="btnBuild" value="BUILD" data-url="{% url 'zimmyrabbit:request_build'%}">
3636
<input type="text" class="id">
3737
<input type="text" class="token">
38+
39+
<br><br>
40+
<input type="button" class="btnUpload" value="BUILD_XP" id="upload_xp" data-url="{% url 'zimmyrabbit:request_build'%}">
41+
<input type="button" class="btnUpload" value="BUILD_EXEC" id="upload_exec" data-url="{% url 'zimmyrabbit:request_build'%}">
3842
</body>
3943
</html>
4044

@@ -117,4 +121,38 @@
117121
});
118122
});
119123

124+
document.addEventListener("DOMContentLoaded", function() {
125+
126+
var uploadButtons = document.querySelectorAll(".btnUpload");
127+
128+
uploadButtons.forEach(function(button) {
129+
button.addEventListener("click", function() {
130+
var cont = this.getAttribute("id");
131+
var url = this.getAttribute("data-url");
132+
let id = document.querySelector('.id').value;
133+
let token = document.querySelector('.token').value;
134+
135+
let param = {
136+
'buildJob' : cont,
137+
'id' : id,
138+
'token' : token,
139+
}
140+
141+
$.ajax({
142+
url : url,
143+
type : 'POST',
144+
data : JSON.stringify(param),
145+
headers: {
146+
'X-CSRFToken': csrftoken // CSRF 토큰 요청 헤더에 포함
147+
},
148+
success : function(data) {
149+
150+
},
151+
error: function() {
152+
console.log('error');
153+
}
154+
});
155+
});
156+
});
157+
});
120158
</script>

0 commit comments

Comments
 (0)