Commit
·
0c73a71
1
Parent(s):
de69ec9
Update public/index.html
Browse files- public/index.html +53 -15
public/index.html
CHANGED
|
@@ -3,23 +3,61 @@
|
|
| 3 |
<html lang="en">
|
| 4 |
|
| 5 |
<head>
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
</head>
|
| 12 |
|
| 13 |
<body>
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
</body>
|
| 24 |
|
| 25 |
-
</html>
|
|
|
|
| 3 |
<html lang="en">
|
| 4 |
|
| 5 |
<head>
|
| 6 |
+
<meta charset="UTF-8">
|
| 7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 8 |
+
<title>OPENAI Reverse Proxy</title>
|
| 9 |
+
|
| 10 |
+
<style>
|
| 11 |
+
/* CSS styles for the container, headings, and lead paragraph */
|
| 12 |
+
.container {
|
| 13 |
+
max-width: 800px;
|
| 14 |
+
margin: 0 auto;
|
| 15 |
+
padding: 20px;
|
| 16 |
+
background-color: #fff;
|
| 17 |
+
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
| 18 |
+
border-radius: 5px;
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
.text-center {
|
| 22 |
+
text-align: center;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.lead {
|
| 26 |
+
font-size: 18px;
|
| 27 |
+
color: #555;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
.url {
|
| 31 |
+
color: #007bff;
|
| 32 |
+
font-weight: bold;
|
| 33 |
+
}
|
| 34 |
+
</style>
|
| 35 |
</head>
|
| 36 |
|
| 37 |
<body>
|
| 38 |
+
<div class="container">
|
| 39 |
+
<h1 class="text-center">Welcome to OPENAI Reverse Proxy</h1>
|
| 40 |
+
<p class="lead">This is your OpenAI Reverse Proxy URL:</p>
|
| 41 |
+
<p class="url" id="reverseProxyUrl"></p>
|
| 42 |
+
</div>
|
| 43 |
+
|
| 44 |
+
<!-- JavaScript code -->
|
| 45 |
+
<script>
|
| 46 |
+
// Function to generate the Reverse Proxy URL
|
| 47 |
+
function getExternalUrl(spaceId) {
|
| 48 |
+
try {
|
| 49 |
+
const [username, spacename] = spaceId.split("/");
|
| 50 |
+
return `https://${username}-${spacename.replace(/_/g, "-")}.hf.space/api/v1`;
|
| 51 |
+
} catch (e) {
|
| 52 |
+
return "";
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
// Get the Reverse Proxy URL and update the HTML element with id="reverseProxyUrl"
|
| 57 |
+
const spaceId = "ngoctuanai/openaiproxy";
|
| 58 |
+
const reverseProxyUrl = getExternalUrl(spaceId);
|
| 59 |
+
document.getElementById("reverseProxyUrl").textContent = reverseProxyUrl;
|
| 60 |
+
</script>
|
| 61 |
</body>
|
| 62 |
|
| 63 |
+
</html>
|