update setting UI, showing current instance in a separate line
This commit is contained in:
parent
5cc6834532
commit
918269f42e
@ -104,25 +104,28 @@ function Settings({ onConfigSaved }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-full h-full overflow-y-auto overflow-x-auto flex flex-col p-4">
|
<div className="w-full h-full overflow-y-auto overflow-x-auto flex flex-col p-4">
|
||||||
|
{storedUrl && (
|
||||||
|
<p className="text-gray-300 mb-2">
|
||||||
|
Current instance: <span className="text-white font-semibold">{storedUrl}</span>
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<p className="mt-3 text-white">New instance URL:</p>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
value={instanceUrl}
|
value={instanceUrl}
|
||||||
onChange={(e) => setInstanceUrl(e.target.value)}
|
onChange={(e) => setInstanceUrl(e.target.value)}
|
||||||
placeholder={
|
placeholder="https://cdrm-project.com/, http://127.0.0.1:5000/"
|
||||||
storedUrl
|
className="w-full p-4 text-lg bg-gray-800 text-white border border-gray-700 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 mt-4 font-mono"
|
||||||
? `Current CDRM Instance: ${storedUrl}`
|
|
||||||
: "CDRM Instance URL (e.g., https://cdrm-project.com/, http://127.0.0.1:5000/)"
|
|
||||||
}
|
|
||||||
className="w-full p-4 text-lg bg-gray-800 text-white border border-gray-700 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 mt-4"
|
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
className={`mt-4 p-2 ${
|
className={`mt-4 p-2 font-bold ${
|
||||||
loading ? "bg-blue-400" : "bg-blue-600 hover:bg-blue-700"
|
loading ? "bg-blue-400" : "bg-blue-600 hover:bg-blue-700"
|
||||||
} text-white rounded-md transition duration-300`}
|
} text-white rounded-md transition duration-300`}
|
||||||
>
|
>
|
||||||
{loading ? "Connecting..." : "Save Settings"}
|
{loading ? "Connecting..." : "Save settings"}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{message && (
|
{message && (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user