Update button label for instance editing to clarify action

This commit is contained in:
2025-07-23 17:18:37 +02:00
parent 57c0a1d1ef
commit f8469f1ed4
2 changed files with 1 additions and 7 deletions

View File

@@ -201,7 +201,7 @@ const InstanceModal: React.FC<InstanceModalProps> = ({
Cancel Cancel
</Button> </Button>
<Button onClick={handleSave} disabled={!instanceName.trim() || !!nameError}> <Button onClick={handleSave} disabled={!instanceName.trim() || !!nameError}>
{isEditing ? 'Save Changes' : 'Create Instance'} {isEditing ? 'Update & Restart Instance' : 'Create Instance'}
</Button> </Button>
</DialogFooter> </DialogFooter>
</DialogContent> </DialogContent>

View File

@@ -53,7 +53,6 @@ export const InstancesProvider = ({ children }: InstancesProviderProps) => {
try { try {
setError(null) setError(null)
await instancesApi.create(name, options) await instancesApi.create(name, options)
// Refresh the list to include the new instance
await fetchInstances() await fetchInstances()
} catch (err) { } catch (err) {
setError(err instanceof Error ? err.message : 'Failed to create instance') setError(err instanceof Error ? err.message : 'Failed to create instance')
@@ -64,7 +63,6 @@ export const InstancesProvider = ({ children }: InstancesProviderProps) => {
try { try {
setError(null) setError(null)
await instancesApi.update(name, options) await instancesApi.update(name, options)
// Refresh the list to get updated instance
await fetchInstances() await fetchInstances()
} catch (err) { } catch (err) {
setError(err instanceof Error ? err.message : 'Failed to update instance') setError(err instanceof Error ? err.message : 'Failed to update instance')
@@ -75,7 +73,6 @@ export const InstancesProvider = ({ children }: InstancesProviderProps) => {
try { try {
setError(null) setError(null)
await instancesApi.start(name) await instancesApi.start(name)
// Refresh the list to get updated status
await fetchInstances() await fetchInstances()
} catch (err) { } catch (err) {
setError(err instanceof Error ? err.message : 'Failed to start instance') setError(err instanceof Error ? err.message : 'Failed to start instance')
@@ -86,7 +83,6 @@ export const InstancesProvider = ({ children }: InstancesProviderProps) => {
try { try {
setError(null) setError(null)
await instancesApi.stop(name) await instancesApi.stop(name)
// Refresh the list to get updated status
await fetchInstances() await fetchInstances()
} catch (err) { } catch (err) {
setError(err instanceof Error ? err.message : 'Failed to stop instance') setError(err instanceof Error ? err.message : 'Failed to stop instance')
@@ -97,7 +93,6 @@ export const InstancesProvider = ({ children }: InstancesProviderProps) => {
try { try {
setError(null) setError(null)
await instancesApi.restart(name) await instancesApi.restart(name)
// Refresh the list to get updated status
await fetchInstances() await fetchInstances()
} catch (err) { } catch (err) {
setError(err instanceof Error ? err.message : 'Failed to restart instance') setError(err instanceof Error ? err.message : 'Failed to restart instance')
@@ -108,7 +103,6 @@ export const InstancesProvider = ({ children }: InstancesProviderProps) => {
try { try {
setError(null) setError(null)
await instancesApi.delete(name) await instancesApi.delete(name)
// Refresh the list to get updated status
await fetchInstances() await fetchInstances()
} catch (err) { } catch (err) {
setError(err instanceof Error ? err.message : 'Failed to delete instance') setError(err instanceof Error ? err.message : 'Failed to delete instance')