fix: scale replicas in response, K8s metrics client, quota precheck, auth tests
- Add GetMetrics method to MetricsClient interface and implement cluster metrics API - Add QuotaPrecheck service for validating resource quotas before deployment - Add auth DTO with role/permission models and auth handler tests - Add instance diagnostics: mounted NFS volumes, labels, annotations in pod diagnostics - Update workspace handler with GetWorkspace endpoint and shared-user list - Fix monitoring handler to use correct service method name - Add tail_lines fallback in instance handler for snake_case query params - Update nginx config for SSE log streaming support (no buffering) - Add comprehensive test coverage: auth_service_test, auth_handler_test, auth_dto_test, metrics_client_test, quota_precheck_test - Update error messages for quota validation and instance operations - ModifyModal: fix YAML lineWidth:0, modified keys summary, delta-only submit - InstanceCard: correctly disable scale-minus when replicas <= 0 - SidebarLayout: add hover transition for sidebar items - Update todo.md and lessons.md with latest fixes
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
* Export configured API client, generated functions, and friendly aliases.
|
||||
*/
|
||||
|
||||
type AxiosOptions<T extends (...args: any) => any> = Parameters<T>[2];
|
||||
type AxiosOptions<T extends (...args: never[]) => unknown> = Parameters<T>[2];
|
||||
|
||||
import {
|
||||
deleteClustersClusterId,
|
||||
@ -143,7 +143,10 @@ export type CreateRegistryRequest = GeneratedCreateRegistryRequest;
|
||||
export type UpdateRegistryRequest = GeneratedUpdateRegistryRequest;
|
||||
export type RegistryHealthResponse = GeneratedRegistryHealthResponse;
|
||||
|
||||
export type InstanceResponse = GeneratedInstanceResponse;
|
||||
export type InstanceResponse = GeneratedInstanceResponse & {
|
||||
ownerId?: string;
|
||||
ownerUsername?: string;
|
||||
};
|
||||
export type CreateInstanceRequest = GeneratedCreateInstanceRequest;
|
||||
export type UpdateInstanceRequest = GeneratedUpdateInstanceRequest;
|
||||
export type InstanceEntry = GeneratedInstanceEntry;
|
||||
@ -242,7 +245,7 @@ export const scaleInstance = (
|
||||
instanceId: string,
|
||||
body: { replicas: number; workload?: string },
|
||||
) => {
|
||||
return customAxiosInstance<{ instance: any; replicas: number; message: string }>({
|
||||
return customAxiosInstance<{ instance: InstanceResponse; replicas: number; message: string }>({
|
||||
url: `/clusters/${encodeURIComponent(clusterId)}/instances/${encodeURIComponent(instanceId)}/scale`,
|
||||
method: "POST",
|
||||
data: body,
|
||||
@ -252,7 +255,7 @@ export const getInstanceValuesDiff = (
|
||||
clusterId: string,
|
||||
instanceId: string,
|
||||
) => {
|
||||
return customAxiosInstance<{ current: Record<string, any>; defaults: Record<string, any> }>({
|
||||
return customAxiosInstance<{ current: Record<string, unknown>; defaults: Record<string, unknown> }>({
|
||||
url: `/clusters/${encodeURIComponent(clusterId)}/instances/${encodeURIComponent(instanceId)}/values-diff`,
|
||||
method: "GET",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user