Add support for storing SSH keys on user accounts
This commit is contained in:
parent
5705d7dbdd
commit
97280a62a2
20 changed files with 678 additions and 6 deletions
|
@ -6,7 +6,7 @@ export interface FlashStore {
|
|||
items: FlashMessage[];
|
||||
addFlash: Action<FlashStore, FlashMessage>;
|
||||
addError: Action<FlashStore, { message: string; key?: string }>;
|
||||
clearAndAddHttpError: Action<FlashStore, { error: any, key?: string }>;
|
||||
clearAndAddHttpError: Action<FlashStore, { error?: Error | any | null; key?: string }>;
|
||||
clearFlashes: Action<FlashStore, string | void>;
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,19 @@ const flashes: FlashStore = {
|
|||
state.items.push({ type: 'error', title: 'Error', ...payload });
|
||||
}),
|
||||
|
||||
clearAndAddHttpError: action((state, { key, error }) => {
|
||||
state.items = [ { type: 'error', title: 'Error', key, message: httpErrorToHuman(error) } ];
|
||||
clearAndAddHttpError: action((state, payload) => {
|
||||
if (!payload.error) {
|
||||
state.items = [];
|
||||
} else {
|
||||
console.error(payload.error);
|
||||
|
||||
state.items = [ {
|
||||
type: 'error',
|
||||
title: 'Error',
|
||||
key: payload.key,
|
||||
message: httpErrorToHuman(payload.error),
|
||||
} ];
|
||||
}
|
||||
}),
|
||||
|
||||
clearFlashes: action((state, payload) => {
|
||||
|
|
Reference in a new issue