mirror of
https://github.com/grafana/grafana.git
synced 2024-11-22 08:56:43 -06:00
Plugins: Add sync update all plugins in cloud (#92742)
This commit is contained in:
parent
82fe497b9d
commit
c6fb9884a0
@ -218,14 +218,24 @@ export const UpdateAllModal = ({ isOpen, onDismiss, plugins }: Props) => {
|
||||
}
|
||||
}, [error, errorMap, inProgress, selectedPlugins]);
|
||||
|
||||
const onConfirm = () => {
|
||||
const onConfirm = async () => {
|
||||
if (!inProgress) {
|
||||
setInProgress(true);
|
||||
plugins.forEach((plugin) => {
|
||||
if (selectedPlugins?.has(plugin.id)) {
|
||||
install(plugin.id, plugin.latestVersion, true);
|
||||
|
||||
// in cloud the requests need to be sync
|
||||
if (config.pluginAdminExternalManageEnabled && config.featureToggles.managedPluginsInstall) {
|
||||
for (let plugin of plugins) {
|
||||
if (selectedPlugins?.has(plugin.id)) {
|
||||
await install(plugin.id, plugin.latestVersion, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
plugins.forEach((plugin) => {
|
||||
if (selectedPlugins?.has(plugin.id)) {
|
||||
install(plugin.id, plugin.latestVersion, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -3,7 +3,7 @@ import { ReactElement, useState } from 'react';
|
||||
import { useLocation } from 'react-router-dom-v5-compat';
|
||||
|
||||
import { SelectableValue, GrafanaTheme2, PluginType } from '@grafana/data';
|
||||
import { config, locationSearchToObject } from '@grafana/runtime';
|
||||
import { locationSearchToObject } from '@grafana/runtime';
|
||||
import { Select, RadioButtonGroup, useStyles2, Tooltip, Field, Button } from '@grafana/ui';
|
||||
import { Page } from 'app/core/components/Page/Page';
|
||||
import { Trans } from 'app/core/internationalization';
|
||||
@ -94,10 +94,8 @@ export default function Browse({ route }: GrafanaRouteComponentProps): ReactElem
|
||||
</Button>
|
||||
);
|
||||
|
||||
const hideUpdateAllButton = config.pluginAdminExternalManageEnabled && config.featureToggles.managedPluginsInstall;
|
||||
|
||||
return (
|
||||
<Page navModel={navModel} actions={hideUpdateAllButton ? undefined : updateAll} subTitle={subTitle}>
|
||||
<Page navModel={navModel} actions={updateAll} subTitle={subTitle}>
|
||||
<Page.Contents>
|
||||
<HorizontalGroup wrap>
|
||||
<Field label="Search">
|
||||
|
Loading…
Reference in New Issue
Block a user