Add container registry pull, image source settings, and global AWS config
All checks were successful
Build Container / build-container (push) Successful in 1m59s
All checks were successful
Build Container / build-container (push) Successful in 1m59s
Support pulling images from registry (default: repo.anhonesthost.net/cybercovellc/triple-c/triple-c-sandbox:latest), local builds, or custom images via a new settings UI. Add global AWS configuration (config path auto-detect, profile picker, region) that serves as defaults overridable per-project for Bedrock auth. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -51,11 +51,30 @@ export function useDocker() {
|
||||
[setImageExists],
|
||||
);
|
||||
|
||||
const pullImage = useCallback(
|
||||
async (imageName: string, onProgress?: (msg: string) => void) => {
|
||||
const unlisten = onProgress
|
||||
? await listen<string>("image-pull-progress", (event) => {
|
||||
onProgress(event.payload);
|
||||
})
|
||||
: null;
|
||||
|
||||
try {
|
||||
await commands.pullImage(imageName);
|
||||
setImageExists(true);
|
||||
} finally {
|
||||
unlisten?.();
|
||||
}
|
||||
},
|
||||
[setImageExists],
|
||||
);
|
||||
|
||||
return {
|
||||
dockerAvailable,
|
||||
imageExists,
|
||||
checkDocker,
|
||||
checkImage,
|
||||
buildImage,
|
||||
pullImage,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { useCallback } from "react";
|
||||
import { useAppState } from "../store/appState";
|
||||
import * as commands from "../lib/tauri-commands";
|
||||
import type { AppSettings } from "../lib/types";
|
||||
|
||||
export function useSettings() {
|
||||
const { hasKey, setHasKey } = useAppState();
|
||||
const { hasKey, setHasKey, appSettings, setAppSettings } = useAppState();
|
||||
|
||||
const checkApiKey = useCallback(async () => {
|
||||
try {
|
||||
@@ -29,10 +30,33 @@ export function useSettings() {
|
||||
setHasKey(false);
|
||||
}, [setHasKey]);
|
||||
|
||||
const loadSettings = useCallback(async () => {
|
||||
try {
|
||||
const settings = await commands.getSettings();
|
||||
setAppSettings(settings);
|
||||
return settings;
|
||||
} catch (e) {
|
||||
console.error("Failed to load settings:", e);
|
||||
return null;
|
||||
}
|
||||
}, [setAppSettings]);
|
||||
|
||||
const saveSettings = useCallback(
|
||||
async (settings: AppSettings) => {
|
||||
const updated = await commands.updateSettings(settings);
|
||||
setAppSettings(updated);
|
||||
return updated;
|
||||
},
|
||||
[setAppSettings],
|
||||
);
|
||||
|
||||
return {
|
||||
hasKey,
|
||||
checkApiKey,
|
||||
saveApiKey,
|
||||
removeApiKey,
|
||||
appSettings,
|
||||
loadSettings,
|
||||
saveSettings,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user