Improve icon buttons
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Pierre HUBERT 2024-12-06 18:39:25 +01:00
parent 49d77cd379
commit 7d7d9c5437
3 changed files with 16 additions and 15 deletions

View File

@ -20,7 +20,7 @@ type ThemeContext = { theme: Theme; set: (theme: Theme) => void };
const ThemeContextK = React.createContext<ThemeContext | null>(null); const ThemeContextK = React.createContext<ThemeContext | null>(null);
export function ThemeProvider(p: React.PropsWithChildren): React.ReactElement { export function ThemeProvider(p: React.PropsWithChildren): React.ReactElement {
const [theme, setTheme] = React.useState<Theme>("highcontrast"); const [theme, setTheme] = React.useState<Theme>("teamsdark");
let fluentTheme = teamsHighContrastTheme; let fluentTheme = teamsHighContrastTheme;
switch (theme) { switch (theme) {

View File

@ -2,7 +2,8 @@ import { Button, Spinner, Toolbar, Tooltip } from "@fluentui/react-components";
import { import {
ArrowResetRegular, ArrowResetRegular,
PauseRegular, PauseRegular,
PlayRegular, PlayCircleRegular,
PlayFilled,
PowerRegular, PowerRegular,
StopRegular, StopRegular,
} from "@fluentui/react-icons"; } from "@fluentui/react-icons";
@ -23,7 +24,7 @@ export function GroupVMAction(p: {
<Toolbar> <Toolbar>
<GroupVMButton <GroupVMButton
enabled={p.group.can_start} enabled={p.group.can_start}
icon={<PlayRegular />} icon={<PlayFilled />}
tooltip="Start" tooltip="Start"
group={p.group} group={p.group}
vm={p.vm} vm={p.vm}
@ -32,17 +33,6 @@ export function GroupVMAction(p: {
needConfirm={false} needConfirm={false}
action={GroupApi.StartVM} action={GroupApi.StartVM}
/> />
<GroupVMButton
enabled={p.group.can_resume}
icon={<PlayRegular />}
tooltip="Resume"
group={p.group}
vm={p.vm}
allowedStates={["Paused", "PowerManagementSuspended"]}
currState={p.state}
needConfirm={false}
action={GroupApi.ResumeVM}
/>
<GroupVMButton <GroupVMButton
enabled={p.group.can_suspend} enabled={p.group.can_suspend}
icon={<PauseRegular />} icon={<PauseRegular />}
@ -54,6 +44,17 @@ export function GroupVMAction(p: {
needConfirm={true} needConfirm={true}
action={GroupApi.SuspendVM} action={GroupApi.SuspendVM}
/> />
<GroupVMButton
enabled={p.group.can_resume}
icon={<PlayCircleRegular />}
tooltip="Resume"
group={p.group}
vm={p.vm}
allowedStates={["Paused", "PowerManagementSuspended"]}
currState={p.state}
needConfirm={false}
action={GroupApi.ResumeVM}
/>
<GroupVMButton <GroupVMButton
enabled={p.group.can_shutdown} enabled={p.group.can_shutdown}
icon={<PowerRegular />} icon={<PowerRegular />}

View File

@ -25,8 +25,8 @@ import { Rights } from "../api/ServerApi";
import { VMApi, VMInfo, VMInfoAndCaps, VMState } from "../api/VMApi"; import { VMApi, VMInfo, VMInfoAndCaps, VMState } from "../api/VMApi";
import { useConfirm } from "../hooks/providers/ConfirmDialogProvider"; import { useConfirm } from "../hooks/providers/ConfirmDialogProvider";
import { useToast } from "../hooks/providers/ToastProvider"; import { useToast } from "../hooks/providers/ToastProvider";
import { VMLiveScreenshot } from "./VMLiveScreenshot";
import { SectionContainer } from "./SectionContainer"; import { SectionContainer } from "./SectionContainer";
import { VMLiveScreenshot } from "./VMLiveScreenshot";
const useStyles = makeStyles({ const useStyles = makeStyles({
body1Stronger: typographyStyles.body1Stronger, body1Stronger: typographyStyles.body1Stronger,