From 3ba1b22cdcd8289005761b02d39b78ed21c7f32e Mon Sep 17 00:00:00 2001 From: Zaki-1052 Date: Mon, 1 Jul 2024 12:19:59 -0700 Subject: [PATCH] setup form restyle --- public/setup.css | 97 +++++++++++++++++++++++++++++++++++++++++++++++ public/setup.html | 92 ++++++++++++++++++++++++++++---------------- server.js | 19 +++++++--- 3 files changed, 170 insertions(+), 38 deletions(-) create mode 100644 public/setup.css diff --git a/public/setup.css b/public/setup.css new file mode 100644 index 0000000..293322b --- /dev/null +++ b/public/setup.css @@ -0,0 +1,97 @@ +/* styles.css */ + +/* General Styles */ +body { + font-family: Arial, sans-serif; + background-color: #121212; + color: #e0e0e0; + margin: 0; + padding: 0; + display: flex; + justify-content: center; + align-items: center; + overflow: auto; /* Prevents overflow */ +} + +/* Container */ +.container { + background-color: #1e1e1e; + padding: 20px 40px; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); + max-width: 400px; + width: 100%; + text-align: center; + overflow-y: auto; /* Enables vertical scroll if needed */ +} + +/* Form */ +form { + display: flex; + flex-direction: column; +} + +/* Form Group */ +.form-group { + margin-bottom: 15px; + text-align: left; +} + +.form-group label { + display: block; + margin-bottom: 5px; + color: #bbbbbb; +} + +.form-group input { + width: 100%; + padding: 8px; + box-sizing: border-box; + border: 1px solid #333; + border-radius: 4px; + background-color: #2c2c2c; + color: #e0e0e0; + transition: border-color 0.3s; +} + +.form-group input:focus { + border-color: #007bff; +} + +/* Button */ +button { + padding: 10px 15px; + border: none; + border-radius: 4px; + background-color: #007bff; + color: #fff; + font-size: 16px; + cursor: pointer; + transition: background-color 0.3s; +} + +button:hover { + background-color: #0056b3; +} + +/* Link */ +a { + color: #007bff; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +/* Completion Message */ +.completion-message { + margin: 20px auto; + max-width: 600px; + padding: 10px; + background-color: #1e1e1e; + border-radius: 8px; + box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); + text-align: center; + color: #e0e0e0; +} \ No newline at end of file diff --git a/public/setup.html b/public/setup.html index a37dca0..39be7c1 100644 --- a/public/setup.html +++ b/public/setup.html @@ -3,31 +3,54 @@ - Setup + Welcome to GPTPortal Setup + -

Setup

-
- -
- - -
- - -
- - -
- - -
- - -
- - -
+
+

Welcome to GPTPortal

+

Please fill in the form below to set up your account. Refer to the GPT Portal Documentation for information on how to obtain the required API keys.

+

This information is purely stored locally to your computer, and cannot be transmitted over the internet!

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
- + \ No newline at end of file diff --git a/server.js b/server.js index b828014..550694e 100644 --- a/server.js +++ b/server.js @@ -97,21 +97,30 @@ app.get('/setup', (req, res) => { }); app.post('/setup', (req, res) => { - const { username, password, openaiApiKey, googleApiKey, mistralApiKey, claudeApiKey } = req.body; + const { username, password, openaiApiKey, claudeApiKey, googleApiKey, mistralApiKey, qroqApiKey, openrouterApiKey, codestralApiKey } = req.body; let envContent = `USER_USERNAME=${username}\nUSER_PASSWORD=${password}\n`; if (openaiApiKey) { envContent += `OPENAI_API_KEY=${openaiApiKey}\n`; } + if (claudeApiKey) { + envContent += `CLAUDE_API_KEY=${claudeApiKey}\n`; + } if (googleApiKey) { - envContent += `GOOGLE_API_KEY=${googleApiKey}\n`; + envContent += `GOOGLE_API_KEY=${googleApiKey}\n`; } if (mistralApiKey) { - envContent += `MISTRAL_API_KEY=${mistralApiKey}\n`; + envContent += `MISTRAL_API_KEY=${mistralApiKey}\n`; } - if (claudeApiKey) { - envContent += `CLAUDE_API_KEY=${claudeApiKey}\n`; + if (qroqApiKey) { + envContent += `QROQ_API_KEY=${qroqApiKey}\n`; + } + if (openrouterApiKey) { + envContent += `OPENROUTER_API_KEY=${openrouterApiKey}\n`; + } + if (codestralApiKey) { + envContent += `CODESTRAL_API_KEY=${codestralApiKey}\n`; } fs.writeFileSync('.env', envContent);