mirror of https://github.com/jetkvm/kvm.git
PR feedback
This commit is contained in:
parent
7f3f8694b9
commit
474cb70e80
|
|
@ -42,6 +42,7 @@
|
||||||
"dc_power_control_restore_power_state": "Restore Power Loss",
|
"dc_power_control_restore_power_state": "Restore Power Loss",
|
||||||
"dc_power_control_power_on_state": "Power ON",
|
"dc_power_control_power_on_state": "Power ON",
|
||||||
"dc_power_control_power_off_state": "Power OFF",
|
"dc_power_control_power_off_state": "Power OFF",
|
||||||
|
"dc_power_control_restore_last_state": "Last State",
|
||||||
"dc_power_control_voltage": "Voltage",
|
"dc_power_control_voltage": "Voltage",
|
||||||
"dc_power_control_voltage_unit": "V",
|
"dc_power_control_voltage_unit": "V",
|
||||||
"dc_power_control_current": "Current",
|
"dc_power_control_current": "Current",
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ export function DCPowerControl() {
|
||||||
options={[
|
options={[
|
||||||
{ value: '0', label: m.dc_power_control_power_off_state()},
|
{ value: '0', label: m.dc_power_control_power_off_state()},
|
||||||
{ value: '1', label: m.dc_power_control_power_on_state()},
|
{ value: '1', label: m.dc_power_control_power_on_state()},
|
||||||
{ value: '2', label: m.dc_power_control_restore_power_state() },
|
{ value: '2', label: m.dc_power_control_restore_last_state()},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import { CheckCircleIcon, XCircleIcon } from "@heroicons/react/20/solid";
|
||||||
|
|
||||||
import Card from "@/components/Card";
|
import Card from "@/components/Card";
|
||||||
|
|
||||||
|
|
||||||
interface NotificationOptions {
|
interface NotificationOptions {
|
||||||
duration?: number;
|
duration?: number;
|
||||||
// Add other options as needed
|
// Add other options as needed
|
||||||
|
|
@ -34,7 +33,7 @@ const ToastContent = ({
|
||||||
const notifications = {
|
const notifications = {
|
||||||
success: (message: string, options?: NotificationOptions) => {
|
success: (message: string, options?: NotificationOptions) => {
|
||||||
return toast.custom(
|
return toast.custom(
|
||||||
t => (
|
(t: Toast) => (
|
||||||
<ToastContent
|
<ToastContent
|
||||||
icon={<CheckCircleIcon className="w-5 h-5 text-green-500 dark:text-green-400" />}
|
icon={<CheckCircleIcon className="w-5 h-5 text-green-500 dark:text-green-400" />}
|
||||||
message={message}
|
message={message}
|
||||||
|
|
@ -47,7 +46,7 @@ const notifications = {
|
||||||
|
|
||||||
error: (message: string, options?: NotificationOptions) => {
|
error: (message: string, options?: NotificationOptions) => {
|
||||||
return toast.custom(
|
return toast.custom(
|
||||||
t => (
|
(t: Toast) => (
|
||||||
<ToastContent
|
<ToastContent
|
||||||
icon={<XCircleIcon className="w-5 h-5 text-red-500 dark:text-red-400" />}
|
icon={<XCircleIcon className="w-5 h-5 text-red-500 dark:text-red-400" />}
|
||||||
message={message}
|
message={message}
|
||||||
|
|
@ -64,9 +63,9 @@ function useMaxToasts(max: number) {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
toasts
|
toasts
|
||||||
.filter(t => t.visible) // Only consider visible toasts
|
.filter((t: Toast) => t.visible) // Only consider visible toasts
|
||||||
.filter((_, i) => i >= max) // Is toast index over limit?
|
.filter((_: Toast, i: number) => i >= max) // Is toast index over limit?
|
||||||
.forEach(t => toast.dismiss(t.id)); // Dismiss – Use toast.remove(t.id) for no exit animation
|
.forEach((t: Toast) => toast.dismiss(t.id)); // Dismiss – Use toast.remove(t.id) for no exit animation
|
||||||
}, [toasts, max]);
|
}, [toasts, max]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue