Skip to content

Commit 2cbe66d

Browse files
Long day centering the Div
1 parent 0b26d16 commit 2cbe66d

File tree

4 files changed

+522
-180
lines changed

4 files changed

+522
-180
lines changed

config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
// Configuration file for SQL Test Cases Generator
22
const CONFIG = {
3-
API_BASE_URL: 'https://sql-test-generator.onrender.com/api/groq', // Use the backend proxy
3+
// IMPORTANT: Replace 'YOUR_DEPLOYED_BACKEND_URL_HERE' with the actual URL of your deployed backend proxy.
4+
// Example: 'https://your-app-name.onrender.com/api/groq' or 'https://your-custom-domain.com/api/groq'
5+
API_BASE_URL: 'YOUR_DEPLOYED_BACKEND_URL_HERE/api/groq',
46
MODEL: 'qwen/qwen3-32b',
57
MAX_TOKENS: 4096,
68
TEMPERATURE: 0.6,
79
TOP_P: 0.95,
810
REASONING_EFFORT: 'default'
911
};
1012

11-
window.getApiKey = () => null; // Not needed, backend handles the key
13+
window.getApiKey = () => null; // Not needed, backend handles the key

index.html

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ <h1><i class="fas fa-database"></i> SQL Query Test Cases Generator</h1>
2626
<h3><i class="fas fa-info-circle"></i> Instructions</h3>
2727
<ol>
2828
<li>Select your desired difficulty level</li>
29+
<li>(Optional) Upload a CSV/JSON file to provide schema context</li>
2930
<li>Choose the number of test cases (1-10)</li>
3031
<li>Click Generate to create questions</li>
3132
<li>Copy questions and provide feedback</li>
@@ -47,6 +48,22 @@ <h3><i class="fas fa-layer-group"></i> Difficulty Level</h3>
4748
</div>
4849
</div>
4950

51+
<!-- New section for file upload -->
52+
<div class="file-upload-section">
53+
<h3><i class="fas fa-upload"></i> Upload Schema/Data (Optional)</h3>
54+
<p class="upload-tip">Upload a CSV or JSON file to provide context for question generation. This helps generate more relevant questions based on your data structure.</p>
55+
<input type="file" id="schemaUpload" accept=".csv,.json" class="file-input">
56+
<div id="fileStatus" class="file-status">No file chosen</div>
57+
<button id="clearFileBtn" class="clear-file-btn" style="display: none;">
58+
<i class="fas fa-times-circle"></i> Clear Uploaded Data
59+
</button>
60+
<div class="uploaded-content-preview" id="uploadedContentPreview" style="display: none;">
61+
<h4>Preview:</h4>
62+
<pre id="uploadedSchemaDisplay"></pre>
63+
</div>
64+
</div>
65+
<!-- End new section -->
66+
5067
<div class="quantity-selection">
5168
<h3><i class="fas fa-hashtag"></i> Number of Test Cases</h3>
5269
<div class="quantity-input">
@@ -103,16 +120,18 @@ <h3><i class="fas fa-thumbs-up"></i> Feedback</h3>
103120
<i class="fas fa-exclamation-triangle"></i>
104121
</button>
105122
<div class="stats stats-centered">
106-
<span><i class="fas fa-user"></i> User Number: <span id="userCount">1</span></span>
107-
<span><i class="fas fa-clipboard-list"></i> Total Test Cases Generated Until Now: <span id="totalGenerated">0</span></span>
123+
<span><i class="fas fa-user"></i> Your User ID: <span id="userIdDisplay">Loading...</span></span>
124+
<span><i class="fas fa-clipboard-list"></i> Total Generated (Global): <span id="totalGenerated">0</span></span>
125+
<span><i class="fas fa-thumbs-up"></i> Good Feedback (Global): <span id="globalGoodCount">0</span></span>
126+
<span><i class="fas fa-thumbs-down"></i> Bad Feedback (Global): <span id="globalBadCount">0</span></span>
108127
</div>
109128
<div style="width:32px;"></div>
110129
</div>
111130
</footer>
112131

113132
<div class="passcode-modal" id="passcodeModal" style="display:none;">
114133
<div class="passcode-modal-content">
115-
<h4>Enter Passcode to Clear Stats</h4>
134+
<h4>Enter Passcode to Clear Global Stats</h4>
116135
<input type="password" id="passcodeInput" placeholder="Passcode" />
117136
<button id="submitPasscodeBtn">Submit</button>
118137
</div>
@@ -125,7 +144,29 @@ <h4>Enter Passcode to Clear Stats</h4>
125144
</div>
126145
</div>
127146

147+
<!-- Firebase SDKs -->
148+
<script type="module">
149+
import { initializeApp } from "https://www.gstatic.com/firebasejs/11.6.1/firebase-app.js";
150+
import { getAuth, signInAnonymously, signInWithCustomToken, onAuthStateChanged } from "https://www.gstatic.com/firebasejs/11.6.1/firebase-auth.js";
151+
import { getFirestore, doc, getDoc, setDoc, onSnapshot, updateDoc } from "https://www.gstatic.com/firebasejs/11.6.1/firebase-firestore.js";
152+
153+
// Expose Firebase objects globally for script.js
154+
window.firebase = {
155+
initializeApp,
156+
getAuth,
157+
signInAnonymously,
158+
signInWithCustomToken,
159+
onAuthStateChanged,
160+
getFirestore,
161+
doc,
162+
getDoc,
163+
setDoc,
164+
onSnapshot,
165+
updateDoc
166+
};
167+
</script>
168+
128169
<script src="config.js"></script>
129170
<script src="script.js"></script>
130171
</body>
131-
</html>
172+
</html>

0 commit comments

Comments
 (0)