edit: 다운로드 개수 입력 기능 추가

This commit is contained in:
sykweon
2025-01-17 17:50:50 +09:00
parent d9f9cdd39b
commit ca67c06c52
4 changed files with 21 additions and 2 deletions

View File

@@ -62,4 +62,8 @@ body {
font-size: 15px;
border-radius: 5px;
cursor: pointer;
}
#input_txt_box_3, #input_txt_box_4 {
width: 45px;
}

View File

@@ -9,4 +9,6 @@
*/
const inputTxtBox1 = $('#input_txt_box_1')
const inputTxtBox2 = $('#input_txt_box_2')
const inputTxtBox2 = $('#input_txt_box_2')
const inputTxtBox3 = $('#input_txt_box_3')
const inputTxtBox4 = $('#input_txt_box_4')

View File

@@ -8,13 +8,17 @@
- 2025-01-16/ksy : base
*/
let apiRequestBody = { "prompt": "" }
let apiRequestBody = {
"prompt": "",
"downloadCount": 1
}
function generatorBtn1() {
try {
const apiUrl = `http://${REST_SERVER.IP}:${REST_SERVER.PORT}${DALLE3_REQUEST_URL}`
apiRequestBody.prompt = inputTxtBox1.val()
apiRequestBody.downloadCount = inputTxtBox3.val()
postData(apiUrl, apiRequestBody)
}
catch (error) {
@@ -27,6 +31,7 @@ function generatorBtn2() {
const apiUrl = `http://${REST_SERVER.IP}:${REST_SERVER.PORT}${IMAGEN_REQUEST_URL}`
apiRequestBody.prompt = inputTxtBox2.val()
apiRequestBody.downloadCount = inputTxtBox4.val()
postData(apiUrl, apiRequestBody)
}
catch (error) {

View File

@@ -28,6 +28,10 @@
<div>
<input type="text" id="input_txt_box_1" class="input_txt_box" placeholder="입력하세요.">
</div>
<div>
<span class="download_count">Download Count:</span>
<input type="text" id="input_txt_box_3" class="input_txt_box" value="1">
</div>
<div class="generator_btn_zone">
<button onclick="generatorBtn1()" id="generator_1_btn" class="generator_btn">Create</button>
</div>
@@ -37,6 +41,10 @@
<div>
<input type="text" id="input_txt_box_2" class="input_txt_box" placeholder="입력하세요.">
</div>
<div>
<span class="download_count">Download Count:</span>
<input type="text" id="input_txt_box_4" class="input_txt_box" value="1">
</div>
<div class="generator_btn_zone">
<button onclick="generatorBtn2()" id="generator_1_btn" class="generator_btn">Create</button>
</div>