Files
siliconflow-BizyAir/set_api_key.html
T
0153b2c8a8 Add listmodel request (#88)
* update ci method & fix key page bug

* add list model method

* refine

* Update workflow-ci.yml

* Support the use of uploaded Lora (#85)

* Support the use of uploaded Lora

* refine

* refine

* refine

* refine

* refine

* reformat

* add test workflow

* fix error

* fix error

* fix vaild error

* refine

* refine

* remove Redundant warning

* skip flux lora

* use ini file instead of cookies in daily use (#91)

* debug ci

* refine

* refine

* get key from cookies

* set key to ini file

* print error msg when set api key failed

* revert menu json file

* revert code, becuase of the error reoccur

* remove raise error, instead of using warning

* rever workflow ci yaml

* refine test output

* add workflow dspatch event

* refine

* fix encode_comfy_image & decode_comfy_image

* [feat]set api key  home page refresh

* update dev_config.yaml

* add FluxGuidance node

* fix error

* black

---------

Co-authored-by: Yao Chi <later@usopp.net>
Co-authored-by: of-HaiQin <5372604@qq.com>
2024-08-16 20:40:06 +08:00

89 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BizyAir - Set API Key</title>
<style>
body {
background-color: #121212;
color: #ffffff;
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.container {
text-align: center;
}
input[type="password"] {
padding: 10px;
margin: 10px;
border: 2px solid rgb(130, 88, 245);
border-radius: 5px;
background-color: #1e1e1e;
color: #ffffff;
width: 200px;
}
button {
padding: 10px 20px;
border: none;
border-radius: 5px;
background-color: rgb(130, 88, 245);
color: #ffffff;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
</style>
<script>
async function setApiKey () {
const apiKey = document.getElementById('apiKey').value;
let endpoint = location.href;
if (endpoint.includes('/bizyair/set-api-key'))
endpoint = endpoint.replace('/bizyair/set-api-key', '/bizyair/set_api_key');
else
endpoint = `${endpoint}/bizyair/set_api_key`;
const response = await fetch(endpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: `api_key=${encodeURIComponent(apiKey)}`
});
if (response.ok) {
alert('API Key set successfully!');
if (window.opener) {
window.opener.location.reload();
window.close();
}
} else {
alert('Failed to set API Key: ' + await response.text());
}
}
</script>
</head>
<body>
<div class="container">
<h1>Set API Key</h1>
<input type="password" id="apiKey" placeholder="Enter API Key">
<button onclick="setApiKey()">Set API Key</button>
<p>To get your key, visit <a href="https://cloud.siliconflow.cn"
target="_blank">https://cloud.siliconflow.cn</a></p>
</div>
</body>
</html>
</div>
</body>
</html>