mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
fix(kube): improve dashboard load speed [EE-4941] (#8572)
* apply changes from EE * clear query cache when logging out * Text transitions in smoother
This commit is contained in:
parent
5f0af62521
commit
89194405ee
36 changed files with 569 additions and 210 deletions
50
app/react/kubernetes/DashboardView/EnvironmentInfo.tsx
Normal file
50
app/react/kubernetes/DashboardView/EnvironmentInfo.tsx
Normal file
|
@ -0,0 +1,50 @@
|
|||
import { Gauge } from 'lucide-react';
|
||||
|
||||
import { stripProtocol } from '@/portainer/filters/filters';
|
||||
import { useTagsForEnvironment } from '@/portainer/tags/queries';
|
||||
import { useEnvironmentId } from '@/react/hooks/useEnvironmentId';
|
||||
import { useEnvironment } from '@/react/portainer/environments/queries';
|
||||
|
||||
import { Widget, WidgetTitle, WidgetBody } from '@@/Widget';
|
||||
|
||||
export function EnvironmentInfo() {
|
||||
const environmentId = useEnvironmentId();
|
||||
const { data: environmentData, ...environmentQuery } =
|
||||
useEnvironment(environmentId);
|
||||
const tagsQuery = useTagsForEnvironment(environmentId);
|
||||
const tagNames = tagsQuery.tags?.map((tag) => tag.Name).join(', ') || '-';
|
||||
|
||||
return (
|
||||
<Widget>
|
||||
<WidgetTitle icon={Gauge} title="Environment info" />
|
||||
<WidgetBody loading={environmentQuery.isLoading}>
|
||||
{environmentQuery.isError && <div>Failed to load environment</div>}
|
||||
{environmentData && (
|
||||
<table className="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td className="!border-none !pl-0">Environment</td>
|
||||
<td
|
||||
className="!border-none"
|
||||
data-cy="dashboard-environmentName"
|
||||
>
|
||||
{environmentData.Name}
|
||||
</td>
|
||||
</tr>
|
||||
<tr ng-if="ctrl.showEnvUrl">
|
||||
<td className="!border-t !pl-0">URL</td>
|
||||
<td className="!border-t" data-cy="dashboard-environmenturl">
|
||||
{stripProtocol(environmentData.URL) || '-'}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td className="!pl-0">Tags</td>
|
||||
<td data-cy="dashboard-environmentTags">{tagNames}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
)}
|
||||
</WidgetBody>
|
||||
</Widget>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue