mirror of
https://github.com/portainer/portainer.git
synced 2025-08-07 14:55:27 +02:00
feat(config): separate configmaps and secrets [EE-5078] (#9029)
This commit is contained in:
parent
4a331b71e1
commit
d7fc2046d7
102 changed files with 2845 additions and 665 deletions
|
@ -16,6 +16,12 @@ export function isFulfilled<T>(
|
|||
return result.status === 'fulfilled';
|
||||
}
|
||||
|
||||
export function isRejected<T>(
|
||||
result: PromiseSettledResult<T>
|
||||
): result is PromiseRejectedResult {
|
||||
return result.status === 'rejected';
|
||||
}
|
||||
|
||||
export function getFulfilledResults<T>(
|
||||
results: Array<PromiseSettledResult<T>>
|
||||
) {
|
||||
|
|
|
@ -127,6 +127,7 @@ export const ngModule = angular
|
|||
'type',
|
||||
'value',
|
||||
'to',
|
||||
'params',
|
||||
'children',
|
||||
'pluralType',
|
||||
'isLoading',
|
||||
|
|
|
@ -49,6 +49,13 @@ export function agentInterceptor(config: AxiosRequestConfig) {
|
|||
|
||||
axios.interceptors.request.use(agentInterceptor);
|
||||
|
||||
/**
|
||||
* Parses an Axios error and returns a PortainerError.
|
||||
* @param err The original error.
|
||||
* @param msg An optional error message to prepend.
|
||||
* @param parseError A function to parse AxiosErrors. Defaults to defaultErrorParser.
|
||||
* @returns A PortainerError with the parsed error message and details.
|
||||
*/
|
||||
export function parseAxiosError(
|
||||
err: Error,
|
||||
msg = '',
|
||||
|
@ -70,7 +77,7 @@ export function parseAxiosError(
|
|||
return new PortainerError(resultMsg, resultErr);
|
||||
}
|
||||
|
||||
function defaultErrorParser(axiosError: AxiosError) {
|
||||
export function defaultErrorParser(axiosError: AxiosError) {
|
||||
const message = axiosError.response?.data.message || '';
|
||||
const details = axiosError.response?.data.details || message;
|
||||
const error = new Error(message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue