You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/sidebar/Footer/UpdateNotifications.tsx

34 lines
857 B

import { useQuery } from 'react-query';
import { getVersionStatus } from '@/portainer/services/api/status.service';
import styles from './UpdateNotifications.module.css';
export function UpdateNotification() {
const query = useUpdateNotification();
if (!query.data || !query.data.UpdateAvailable) {
return null;
}
const { LatestVersion } = query.data;
return (
<div className={styles.updateNotification}>
<a
target="_blank"
href={`https://github.com/portainer/portainer/releases/tag/${LatestVersion}`}
style={{ color: '#091e5d' }}
rel="noreferrer"
>
<i className="fa-lg fas fa-cloud-download-alt space-right" />A new
version is available
</a>
</div>
);
}
function useUpdateNotification() {
return useQuery(['status', 'version'], () => getVersionStatus());
}