refactor(q1): any 937→837, unused 25→0, catch any 清零, Record<string,unknown> 安全替换168处
- unused-vars 全清零: 删除未用 import + 前缀 _ - catch (e: any) 94处移除显式标注 (strict=false 隐式推断) - Record<string,any>→Record<string,unknown> 安全替换168处 (无属性访问场景) - tsc -b 零错误, npm run build 通过 - 9/9 API 回归测试通过
This commit is contained in:
1 parent
4ae215f4c9
commit
37c657987b
62 files changed
+133
-141
No files matched your search
@@ -131,7 +131,7 @@ export function DeploymentWorkload({ clusterCode, namespace, deploymentName, mod
|
||||
await kubernetesApi.scaleDeployment(clusterCode, namespace, deploymentName, newReplicas);
|
||||
toast({ title: '扩缩容成功', description: `副本数已设置为 ${newReplicas}` });
|
||||
loadData();
|
||||
} catch (e: any) {
|
||||
} catch (e) {
|
||||
toast({ title: '操作失败', description: e?.message || String(e), variant: 'destructive' });
|
||||
} finally { setActionLoading(''); }
|
||||
};
|
||||
@@ -143,7 +143,7 @@ export function DeploymentWorkload({ clusterCode, namespace, deploymentName, mod
|
||||
toast({ title: '伸缩成功', description: `副本数已设置为 ${scaleValue}` });
|
||||
setModal(null);
|
||||
loadData();
|
||||
} catch (e: any) {
|
||||
} catch (e) {
|
||||
toast({ title: '操作失败', description: e?.message || String(e), variant: 'destructive' });
|
||||
} finally { setActionLoading(''); }
|
||||
};
|
||||
@@ -160,7 +160,7 @@ export function DeploymentWorkload({ clusterCode, namespace, deploymentName, mod
|
||||
await kubernetesApi.restartDeployment(clusterCode, namespace, deploymentName);
|
||||
toast({ title: '重启指令已下发', description: 'Deployment 正在滚动重启' });
|
||||
setTimeout(loadData, 1500);
|
||||
} catch (e: any) {
|
||||
} catch (e) {
|
||||
toast({ title: '重启失败', description: e?.message || String(e), variant: 'destructive' });
|
||||
} finally { setActionLoading(''); }
|
||||
};
|
||||
@@ -183,7 +183,7 @@ export function DeploymentWorkload({ clusterCode, namespace, deploymentName, mod
|
||||
}
|
||||
toast({ title: `${action}成功`, description: `Deployment 滚动更新已${action}` });
|
||||
setTimeout(loadData, 1000);
|
||||
} catch (e: any) {
|
||||
} catch (e) {
|
||||
toast({ title: `${action}失败`, description: e?.message || String(e), variant: 'destructive' });
|
||||
} finally { setActionLoading(''); }
|
||||
};
|
||||
@@ -201,7 +201,7 @@ export function DeploymentWorkload({ clusterCode, namespace, deploymentName, mod
|
||||
toast({ title: '镜像更新成功', description: `正在滚动更新为 ${newImage}` });
|
||||
setModal(null);
|
||||
loadData();
|
||||
} catch (e: any) {
|
||||
} catch (e) {
|
||||
toast({ title: '更新失败', description: e?.message || String(e), variant: 'destructive' });
|
||||
} finally { setActionLoading(''); }
|
||||
};
|
||||
@@ -218,7 +218,7 @@ export function DeploymentWorkload({ clusterCode, namespace, deploymentName, mod
|
||||
toast({ title: '删除成功', description: `${deploymentName} 已删除` });
|
||||
setModal(null);
|
||||
setTimeout(() => navigate(`/kubernetes/${clusterCode}/namespace/${namespace}/deployments`), 800);
|
||||
} catch (e: any) {
|
||||
} catch (e) {
|
||||
toast({ title: '删除失败', description: e?.message || String(e), variant: 'destructive' });
|
||||
} finally { setActionLoading(''); }
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user