mirror of
https://github.com/lordmathis/llamactl.git
synced 2025-11-06 00:54:23 +00:00
Update button label for instance editing to clarify action
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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')
|
||||||
|
|||||||
Reference in New Issue
Block a user