Add local routing rules to Harbor
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user