Add local routing rules to Harbor
All checks were successful
Build and Deploy Gateway / build-and-push (push) Successful in 17s
Build and Deploy Gateway / deploy (push) Successful in 6s

This commit is contained in:
2026-07-11 21:52:03 +03:00
parent 306a9b8ced
commit a0c66edb02
17 changed files with 823 additions and 26 deletions

View File

@@ -88,10 +88,14 @@ function App() {
: new HarborApiError({ code: err?.code }, err?.status);
setError({
context,
message: safeError.message,
message: context === 'routing' && safeError.code === 'STATE_CONFLICT'
? 'Правила изменились. Закройте панель и откройте её снова.'
: safeError.message,
code: safeError.code,
correlationId: safeError.correlationId,
retry: safeError.retryable ? () => run(key, action, context) : null,
retry: safeError.retryable && safeError.code !== 'STATE_CONFLICT'
? () => run(key, action, context)
: null,
});
return false;
}
@@ -156,6 +160,11 @@ function App() {
onRestart={() => run('connection', api.singbox.restart, 'connection')}
onStop={() => run('connection', api.singbox.stop, 'connection')}
onSetGatewayAuto={(enabled) => run('gatewayAuto', () => api.gatewayAuto.setEnabled(enabled), 'connection')}
onSaveRouteRules={(rules, expectedRevision) => run(
'routeRules',
() => api.routeRules.update(rules, expectedRevision),
'routing',
)}
/>
</main>
</div>