Spaces:
Runtime error
Runtime error
Update templates/index.html
Browse files- templates/index.html +14 -3
templates/index.html
CHANGED
|
@@ -93,14 +93,26 @@
|
|
| 93 |
background-color: #007bff;
|
| 94 |
color: white;
|
| 95 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
</style>
|
| 97 |
</head>
|
| 98 |
<body>
|
| 99 |
<div class="container">
|
| 100 |
<h1 class="text-center mb-4">AI SQL Assistant</h1>
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
<div class="mb-4">
|
| 103 |
<button type="button" class="btn btn-primary me-2" data-bs-toggle="modal" data-bs-target="#dbConfigModal">Configure MySQL Connection</button>
|
|
|
|
|
|
|
|
|
|
| 104 |
<form method="post" enctype="multipart/form-data" style="display: inline;">
|
| 105 |
<div class="mb-3 d-inline-block">
|
| 106 |
<label for="sql_file" class="form-label">Upload MySQL .sql File</label>
|
|
@@ -122,7 +134,7 @@
|
|
| 122 |
<form method="post" action="/configure_db">
|
| 123 |
<div class="mb-3">
|
| 124 |
<label for="host" class="form-label">Host</label>
|
| 125 |
-
<input type="text" class="form-control" id="host" name="host" placeholder="e.g.,
|
| 126 |
</div>
|
| 127 |
<div class="mb-3">
|
| 128 |
<label for="user" class="form-label">User</label>
|
|
@@ -134,7 +146,7 @@
|
|
| 134 |
</div>
|
| 135 |
<div class="mb-3">
|
| 136 |
<label for="port" class="form-label">Port</label>
|
| 137 |
-
<input type="number" class="form-control" id="port" name="port" placeholder="
|
| 138 |
</div>
|
| 139 |
<button type="submit" class="btn btn-primary">Save Connection</button>
|
| 140 |
</form>
|
|
@@ -209,7 +221,6 @@
|
|
| 209 |
</div>
|
| 210 |
{% endif %}
|
| 211 |
|
| 212 |
-
|
| 213 |
{% if results %}
|
| 214 |
<div class="result-table">
|
| 215 |
<h4>Query Results</h4>
|
|
|
|
| 93 |
background-color: #007bff;
|
| 94 |
color: white;
|
| 95 |
}
|
| 96 |
+
.welcome-note {
|
| 97 |
+
background-color: #e9ecef;
|
| 98 |
+
padding: 15px;
|
| 99 |
+
border-radius: 8px;
|
| 100 |
+
margin-bottom: 20px;
|
| 101 |
+
}
|
| 102 |
</style>
|
| 103 |
</head>
|
| 104 |
<body>
|
| 105 |
<div class="container">
|
| 106 |
<h1 class="text-center mb-4">AI SQL Assistant</h1>
|
| 107 |
+
<div class="welcome-note">
|
| 108 |
+
<p class="mb-0">This app uses a default TiDB Serverless database for instant access. Use the "Configure MySQL Connection" modal to connect to a custom database.</p>
|
| 109 |
+
</div>
|
| 110 |
|
| 111 |
<div class="mb-4">
|
| 112 |
<button type="button" class="btn btn-primary me-2" data-bs-toggle="modal" data-bs-target="#dbConfigModal">Configure MySQL Connection</button>
|
| 113 |
+
<form method="post" action="/reset_db" style="display: inline;">
|
| 114 |
+
<button type="submit" class="btn btn-primary me-2">Reset to Default Connection</button>
|
| 115 |
+
</form>
|
| 116 |
<form method="post" enctype="multipart/form-data" style="display: inline;">
|
| 117 |
<div class="mb-3 d-inline-block">
|
| 118 |
<label for="sql_file" class="form-label">Upload MySQL .sql File</label>
|
|
|
|
| 134 |
<form method="post" action="/configure_db">
|
| 135 |
<div class="mb-3">
|
| 136 |
<label for="host" class="form-label">Host</label>
|
| 137 |
+
<input type="text" class="form-control" id="host" name="host" placeholder="e.g., gateway01.ap-southeast-1.prod.aws.tidbcloud.com" required>
|
| 138 |
</div>
|
| 139 |
<div class="mb-3">
|
| 140 |
<label for="user" class="form-label">User</label>
|
|
|
|
| 146 |
</div>
|
| 147 |
<div class="mb-3">
|
| 148 |
<label for="port" class="form-label">Port</label>
|
| 149 |
+
<input type="number" class="form-control" id="port" name="port" placeholder="4000" value="4000">
|
| 150 |
</div>
|
| 151 |
<button type="submit" class="btn btn-primary">Save Connection</button>
|
| 152 |
</form>
|
|
|
|
| 221 |
</div>
|
| 222 |
{% endif %}
|
| 223 |
|
|
|
|
| 224 |
{% if results %}
|
| 225 |
<div class="result-table">
|
| 226 |
<h4>Query Results</h4>
|