yarn and composer updates
This commit is contained in:
parent
d167ef1f89
commit
e4fc0f5ac3
19 changed files with 3022 additions and 2342 deletions
|
@ -15,4 +15,4 @@ export default (uuid: string, initialData?: Response) => useSWR([ uuid, '/startu
|
|||
const variables = ((data as FractalResponseList).data || []).map(rawDataToServerEggVariable);
|
||||
|
||||
return { invocation: data.meta.startup_command, variables, dockerImages: data.meta.docker_images || [] };
|
||||
}, { initialData, errorRetryCount: 3 });
|
||||
}, { fallbackData: initialData, errorRetryCount: 3 });
|
||||
|
|
|
@ -33,8 +33,8 @@ export default () => {
|
|||
setSubmitting(true);
|
||||
|
||||
createLocation(short, long)
|
||||
.then(location => {
|
||||
mutate(data => ({ ...data!, items: data!.items.concat(location) }), false);
|
||||
.then(async (location) => {
|
||||
await mutate(data => ({ ...data!, items: data!.items.concat(location) }), false);
|
||||
setVisible(false);
|
||||
})
|
||||
.catch(error => {
|
||||
|
|
|
@ -33,8 +33,8 @@ export default () => {
|
|||
setSubmitting(true);
|
||||
|
||||
createNest(name, description)
|
||||
.then(nest => {
|
||||
mutate(data => ({ ...data!, items: data!.items.concat(nest) }), false);
|
||||
.then(async (nest) => {
|
||||
await mutate(data => ({ ...data!, items: data!.items.concat(nest) }), false);
|
||||
setVisible(false);
|
||||
})
|
||||
.catch(error => {
|
||||
|
|
|
@ -33,8 +33,8 @@ export default () => {
|
|||
setSubmitting(true);
|
||||
|
||||
createRole(name, description)
|
||||
.then(role => {
|
||||
mutate(data => ({ ...data!, items: data!.items.concat(role) }), false);
|
||||
.then(async (role) => {
|
||||
await mutate(data => ({ ...data!, items: data!.items.concat(role) }), false);
|
||||
setVisible(false);
|
||||
})
|
||||
.catch(error => {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { autocompletion, completionKeymap } from '@codemirror/autocomplete';
|
||||
import { closeBrackets, closeBracketsKeymap } from '@codemirror/closebrackets';
|
||||
import { defaultKeymap, defaultTabBinding } from '@codemirror/commands';
|
||||
import { defaultKeymap, indentWithTab } from '@codemirror/commands';
|
||||
import { commentKeymap } from '@codemirror/comment';
|
||||
import { foldGutter, foldKeymap } from '@codemirror/fold';
|
||||
import { lineNumbers, highlightActiveLineGutter } from '@codemirror/gutter';
|
||||
import { defaultHighlightStyle } from '@codemirror/highlight';
|
||||
import { history, historyKeymap } from '@codemirror/history';
|
||||
import { indentOnInput, LanguageSupport, LezerLanguage } from '@codemirror/language';
|
||||
import { indentOnInput, LanguageSupport, LRLanguage } from '@codemirror/language';
|
||||
import { lintKeymap } from '@codemirror/lint';
|
||||
import { bracketMatching } from '@codemirror/matchbrackets';
|
||||
import { rectangularSelection } from '@codemirror/rectangular-selection';
|
||||
|
@ -39,7 +39,7 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|||
import tw, { styled, TwStyle } from 'twin.macro';
|
||||
import { ayuMirage } from '@/components/elements/EditorTheme';
|
||||
|
||||
type EditorMode = LanguageSupport | LezerLanguage | StreamParser<any>;
|
||||
type EditorMode = LanguageSupport | LRLanguage | StreamParser<any>;
|
||||
|
||||
export interface Mode {
|
||||
name: string,
|
||||
|
@ -92,7 +92,7 @@ export const modeToExtension = (m: EditorMode): Extension => {
|
|||
return m;
|
||||
}
|
||||
|
||||
if (m instanceof LezerLanguage) {
|
||||
if (m instanceof LRLanguage) {
|
||||
return m;
|
||||
}
|
||||
|
||||
|
@ -165,7 +165,7 @@ const defaultExtensions: Extension = [
|
|||
...commentKeymap,
|
||||
...completionKeymap,
|
||||
...lintKeymap,
|
||||
defaultTabBinding,
|
||||
indentWithTab,
|
||||
]),
|
||||
|
||||
EditorState.tabSize.of(4),
|
||||
|
|
|
@ -9,8 +9,8 @@ const InstallListener = () => {
|
|||
const { mutate } = useFileManagerSwr();
|
||||
const setServerFromState = ServerContext.useStoreActions(actions => actions.server.setServerFromState);
|
||||
|
||||
useWebsocketEvent(SocketEvent.BACKUP_RESTORE_COMPLETED, () => {
|
||||
mutate(undefined);
|
||||
useWebsocketEvent(SocketEvent.BACKUP_RESTORE_COMPLETED, async () => {
|
||||
await mutate(undefined);
|
||||
setServerFromState(s => ({ ...s, status: null }));
|
||||
});
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ export default ({ backup }: Props) => {
|
|||
setLoading(true);
|
||||
clearFlashes('backups');
|
||||
deleteBackup(uuid, backup.uuid)
|
||||
.then(() => mutate(data => ({
|
||||
.then(async () => await mutate(data => ({
|
||||
...data!,
|
||||
items: data!.items.filter(b => b.uuid !== backup.uuid),
|
||||
backupCount: data!.backupCount - 1,
|
||||
|
@ -83,7 +83,7 @@ export default ({ backup }: Props) => {
|
|||
}
|
||||
|
||||
http.post(`/api/client/servers/${uuid}/backups/${backup.uuid}/lock`)
|
||||
.then(() => mutate(data => ({
|
||||
.then(async () => await mutate(data => ({
|
||||
...data!,
|
||||
items: data!.items.map(b => b.uuid !== backup.uuid ? b : {
|
||||
...b,
|
||||
|
|
|
@ -21,11 +21,11 @@ interface Props {
|
|||
export default ({ backup, className }: Props) => {
|
||||
const { mutate } = getServerBackups();
|
||||
|
||||
useWebsocketEvent(`${SocketEvent.BACKUP_COMPLETED}:${backup.uuid}` as SocketEvent, data => {
|
||||
useWebsocketEvent(`${SocketEvent.BACKUP_COMPLETED}:${backup.uuid}` as SocketEvent, async (data) => {
|
||||
try {
|
||||
const parsed = JSON.parse(data);
|
||||
|
||||
mutate(data => ({
|
||||
await mutate(data => ({
|
||||
...data!,
|
||||
items: data!.items.map(b => b.uuid !== backup.uuid ? b : ({
|
||||
...b,
|
||||
|
|
|
@ -80,8 +80,8 @@ export default () => {
|
|||
const submit = (values: Values, { setSubmitting }: FormikHelpers<Values>) => {
|
||||
clearFlashes('backups:create');
|
||||
createServerBackup(uuid, values)
|
||||
.then(backup => {
|
||||
mutate(data => ({ ...data!, items: data!.items.concat(backup), backupCount: data!.backupCount + 1 }), false);
|
||||
.then(async (backup) => {
|
||||
await mutate(data => ({ ...data!, items: data!.items.concat(backup), backupCount: data!.backupCount + 1 }), false);
|
||||
setVisible(false);
|
||||
})
|
||||
.catch(error => {
|
||||
|
|
|
@ -28,18 +28,18 @@ const ChmodFileModal = ({ files, ...props }: OwnProps) => {
|
|||
const directory = ServerContext.useStoreState(state => state.files.directory);
|
||||
const setSelectedFiles = ServerContext.useStoreActions(actions => actions.files.setSelectedFiles);
|
||||
|
||||
const submit = ({ mode }: FormikValues, { setSubmitting }: FormikHelpers<FormikValues>) => {
|
||||
const submit = async ({ mode }: FormikValues, { setSubmitting }: FormikHelpers<FormikValues>) => {
|
||||
clearFlashes('files');
|
||||
|
||||
mutate(data => data!.map(f => f.name === files[0].file ? { ...f, mode: fileBitsToString(mode, !f.isFile), modeBits: mode } : f), false);
|
||||
await mutate(data => data!.map(f => f.name === files[0].file ? { ...f, mode: fileBitsToString(mode, !f.isFile), modeBits: mode } : f), false);
|
||||
|
||||
const data = files.map(f => ({ file: f.file, mode: mode }));
|
||||
|
||||
chmodFiles(uuid, directory, data)
|
||||
.then((): Promise<any> => files.length > 0 ? mutate() : Promise.resolve())
|
||||
.then(async (): Promise<any> => files.length > 0 ? await mutate() : Promise.resolve())
|
||||
.then(() => setSelectedFiles([]))
|
||||
.catch(error => {
|
||||
mutate();
|
||||
.catch(async (error) => {
|
||||
await mutate();
|
||||
setSubmitting(false);
|
||||
clearAndAddHttpError({ key: 'files', error });
|
||||
})
|
||||
|
|
|
@ -58,15 +58,15 @@ const FileDropdownMenu = ({ file }: { file: FileObject }) => {
|
|||
}
|
||||
});
|
||||
|
||||
const doDeletion = () => {
|
||||
const doDeletion = async () => {
|
||||
clearFlashes('files');
|
||||
|
||||
// For UI speed, immediately remove the file from the listing before calling the deletion function.
|
||||
// If the delete actually fails, we'll fetch the current directory contents again automatically.
|
||||
mutate(files => files!.filter(f => f.key !== file.key), false);
|
||||
await mutate(files => files!.filter(f => f.key !== file.key), false);
|
||||
|
||||
deleteFiles(uuid, directory, [ file.name ]).catch(error => {
|
||||
mutate();
|
||||
deleteFiles(uuid, directory, [ file.name ]).catch(async (error) => {
|
||||
await mutate();
|
||||
clearAndAddHttpError({ key: 'files', error });
|
||||
});
|
||||
};
|
||||
|
@ -76,7 +76,7 @@ const FileDropdownMenu = ({ file }: { file: FileObject }) => {
|
|||
clearFlashes('files');
|
||||
|
||||
copyFile(uuid, join(directory, file.name))
|
||||
.then(() => mutate())
|
||||
.then(async () => await mutate())
|
||||
.catch(error => clearAndAddHttpError({ key: 'files', error }))
|
||||
.then(() => setShowSpinner(false));
|
||||
};
|
||||
|
@ -99,7 +99,7 @@ const FileDropdownMenu = ({ file }: { file: FileObject }) => {
|
|||
clearFlashes('files');
|
||||
|
||||
compressFiles(uuid, directory, [ file.name ])
|
||||
.then(() => mutate())
|
||||
.then(async () => await mutate())
|
||||
.catch(error => clearAndAddHttpError({ key: 'files', error }))
|
||||
.then(() => setShowSpinner(false));
|
||||
};
|
||||
|
@ -109,7 +109,7 @@ const FileDropdownMenu = ({ file }: { file: FileObject }) => {
|
|||
clearFlashes('files');
|
||||
|
||||
decompressFiles(uuid, directory, file.name)
|
||||
.then(() => mutate())
|
||||
.then(async () => await mutate())
|
||||
.catch(error => clearAndAddHttpError({ key: 'files', error }))
|
||||
.then(() => setShowSpinner(false));
|
||||
};
|
||||
|
|
|
@ -50,12 +50,12 @@ const MassActionsBar = () => {
|
|||
setLoadingMessage('Deleting files...');
|
||||
|
||||
deleteFiles(uuid, directory, selectedFiles)
|
||||
.then(() => {
|
||||
mutate(files => files!.filter(f => selectedFiles.indexOf(f.name) < 0), false);
|
||||
.then(async () => {
|
||||
await mutate(files => files!.filter(f => selectedFiles.indexOf(f.name) < 0), false);
|
||||
setSelectedFiles([]);
|
||||
})
|
||||
.catch(error => {
|
||||
mutate();
|
||||
.catch(async (error) => {
|
||||
await mutate();
|
||||
clearAndAddHttpError({ key: 'files', error });
|
||||
})
|
||||
.then(() => setLoading(false));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue