feat: move Apps from admin to main tab bar with container config
- Apps tab visible to OPERATOR+ (hidden for VIEWER), scoped by sidebar app selection and environment filter - List view: DataTable with name, environment, updated, created columns - Detail view: deployments across all envs, version upload with per-env deploy target, container config form (resources, ports, custom env vars) with explicit Save - Memory reserve field disabled for non-production environments with info hint - Admin sidebar sorted alphabetically, Applications entry removed - Old admin AppsPage deleted Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,9 @@ export interface App {
|
||||
environmentId: string;
|
||||
slug: string;
|
||||
displayName: string;
|
||||
containerConfig: Record<string, unknown>;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface AppVersion {
|
||||
@@ -59,6 +61,13 @@ async function appFetch<T>(path: string, options?: RequestInit): Promise<T> {
|
||||
|
||||
// --- Apps ---
|
||||
|
||||
export function useAllApps() {
|
||||
return useQuery({
|
||||
queryKey: ['apps', 'all'],
|
||||
queryFn: () => appFetch<App[]>(''),
|
||||
});
|
||||
}
|
||||
|
||||
export function useApps(environmentId: string | undefined) {
|
||||
return useQuery({
|
||||
queryKey: ['apps', environmentId],
|
||||
@@ -85,6 +94,15 @@ export function useDeleteApp() {
|
||||
});
|
||||
}
|
||||
|
||||
export function useUpdateContainerConfig() {
|
||||
const qc = useQueryClient();
|
||||
return useMutation({
|
||||
mutationFn: ({ appId, config }: { appId: string; config: Record<string, unknown> }) =>
|
||||
appFetch<App>(`/${appId}/container-config`, { method: 'PUT', body: JSON.stringify(config) }),
|
||||
onSuccess: () => qc.invalidateQueries({ queryKey: ['apps'] }),
|
||||
});
|
||||
}
|
||||
|
||||
// --- Versions ---
|
||||
|
||||
export function useAppVersions(appId: string | undefined) {
|
||||
|
||||
Reference in New Issue
Block a user