Add Refresh menu item to Status page

This commit is contained in:
Lim Chee Aun 2023-03-19 20:12:45 +08:00
parent 458fb7bbbe
commit 47b51bdef8
2 changed files with 12 additions and 1 deletions

View file

@ -72,6 +72,7 @@ const ICONS = {
unblock: ['mingcute:forbid-circle-line', '180deg'], unblock: ['mingcute:forbid-circle-line', '180deg'],
flag: 'mingcute:flag-4-line', flag: 'mingcute:flag-4-line',
time: 'mingcute:time-line', time: 'mingcute:time-line',
refresh: 'mingcute:refresh-2-line',
}; };
const modules = import.meta.glob('/node_modules/@iconify-icons/mingcute/*.js'); const modules = import.meta.glob('/node_modules/@iconify-icons/mingcute/*.js');

View file

@ -1,6 +1,6 @@
import './status.css'; import './status.css';
import { Menu, MenuItem } from '@szhsin/react-menu'; import { Menu, MenuDivider, MenuItem } from '@szhsin/react-menu';
import debounce from 'just-debounce-it'; import debounce from 'just-debounce-it';
import pRetry from 'p-retry'; import pRetry from 'p-retry';
import { useEffect, useMemo, useRef, useState } from 'preact/hooks'; import { useEffect, useMemo, useRef, useState } from 'preact/hooks';
@ -562,6 +562,16 @@ function StatusPage() {
</button> </button>
} }
> >
<MenuItem
disabled={uiState === 'loading'}
onClick={() => {
states.reloadStatusPage++;
}}
>
<Icon icon="refresh" />
<span>Refresh</span>
</MenuItem>
<MenuDivider />
<MenuItem <MenuItem
onClick={() => { onClick={() => {
// Click all buttons with class .spoiler but not .spoiling // Click all buttons with class .spoiler but not .spoiling