mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
* CB-2912 refactor: use websocket * CB-2912 chore: disable websocket by default * CB-2912 feat: websocket events * CB-2912 feat: websocket protocol * CB-2912 fix: gql schema * CB-2912 feat: update sdk * CB-2912 chore: remove deprecated code * CB-2912 feat: dynamic events subscription * CB-2912 fix: container resource api * CB-2923 test websocket * CB-2923 refactor event model * CB-2923 dynamic ws event deserializer * CB-2912 chore: update schema * CB-2923 separate events for create/delete/update action * CB-2923 manifest fix * CB-2923 update qql schema * CB-2923 update eclipse configuration * CB-2912 feat: update websocket api * CB-2923 update client event model * CB-2912 feat: resource connection * CB-2923 support new event types * CB-2912 chore: update schema * CB-2923 websocket ping pong * CB-2912 fix: rename topic to topicId in WebSocketClientEvent * CB-2923 send event if datasource description was changed * CB-2923 split WebSession * CB-2912 fix: resources connection * CB-2912 websocket client (#1370) * CB-2989 create ws client * CB-2912 refactor: rename useResource * CB-2912 resolve conflicts * CB-2912 fix: use wss with https protocol Co-authored-by: Aleksandr Skoblikov <aleksandr.skoblikov@dbeaver.com>
53 lines
1.7 KiB
TypeScript
53 lines
1.7 KiB
TypeScript
/*
|
|
* CloudBeaver - Cloud Database Manager
|
|
* Copyright (C) 2020-2022 DBeaver Corp and others
|
|
*
|
|
* Licensed under the Apache License, Version 2.0.
|
|
* you may not use this file except in compliance with the License.
|
|
*/
|
|
|
|
import { observer } from 'mobx-react-lite';
|
|
import styled, { css } from 'reshadow';
|
|
import { gte } from 'semver';
|
|
|
|
import type { AdministrationItemContentComponent } from '@cloudbeaver/core-administration';
|
|
import { BASE_CONTAINERS_STYLES, ColoredContainer, useResource, useStyles } from '@cloudbeaver/core-blocks';
|
|
import { useService } from '@cloudbeaver/core-di';
|
|
import { CachedMapAllKey } from '@cloudbeaver/core-sdk';
|
|
import { VersionResource, VersionService } from '@cloudbeaver/core-version';
|
|
|
|
import { Instructions } from './Instructions';
|
|
import { Recommendations } from './Recommendations';
|
|
import { VersionChecker } from './VersionChecker';
|
|
import { VersionSelector } from './VersionSelector';
|
|
|
|
const styles = css`
|
|
ColoredContainer {
|
|
composes: theme-typography--body2 from global;
|
|
list-style-position: inside;
|
|
}
|
|
`;
|
|
|
|
export const VersionUpdate: AdministrationItemContentComponent = observer(function VersionUpdate() {
|
|
const style = useStyles(BASE_CONTAINERS_STYLES, styles);
|
|
const versionService = useService(VersionService);
|
|
const versionResource = useResource(VersionUpdate, VersionResource, CachedMapAllKey, {
|
|
silent: true,
|
|
});
|
|
|
|
const versions = versionResource.resource.values.filter(v => gte(v.number, versionService.current));
|
|
|
|
return styled(style)(
|
|
<ColoredContainer wrap gap overflow parent>
|
|
<VersionChecker />
|
|
{versions.length > 0 && (
|
|
<>
|
|
<Instructions />
|
|
<VersionSelector versions={versions} />
|
|
</>
|
|
)}
|
|
<Recommendations />
|
|
</ColoredContainer>
|
|
);
|
|
});
|