Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ repos:
- id: check-yaml
exclude: "(^mkdocs\\.yml$)"
- id: check-added-large-files
- repo: https://github.com/pre-commit/mirrors-prettier
rev: 'v3.0.3'
- repo: https://github.com/rbubley/mirrors-prettier
rev: 'v3.3.3'
hooks:
- id: prettier
types_or:
- javascript
- markdown
- jsx
additional_dependencies:
- prettier@3.3.3
- 'prettier-plugin-organize-imports@4.1.0'
1 change: 0 additions & 1 deletion .prettierrc

This file was deleted.

5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const config = {
plugins: [require("prettier-plugin-organize-imports")],
};

module.exports = config;
4 changes: 2 additions & 2 deletions next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ module.exports = {
? BIBIT_UNITS
: BIT_UNITS
: options.binary
? BIBYTE_UNITS
: BYTE_UNITS;
? BIBYTE_UNITS
: BYTE_UNITS;

if (value === 0) return `0 ${sizes[0]}/s`;

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"eslint-plugin-react-hooks": "^5.1.0",
"postcss": "^8.5.2",
"prettier": "^3.5.2",
"prettier-plugin-organize-imports": "^4.1.0",
"tailwind-scrollbar": "^4.0.1",
"tailwindcss": "^4.0.9",
"typescript": "^5.7.3"
Expand Down
26 changes: 22 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/components/bookmarks/group.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useRef, useEffect } from "react";
import classNames from "classnames";
import { Disclosure, Transition } from "@headlessui/react";
import { MdKeyboardArrowDown } from "react-icons/md";
import ErrorBoundary from "components/errorboundry";
import classNames from "classnames";
import List from "components/bookmarks/list";
import ErrorBoundary from "components/errorboundry";
import ResolvedIcon from "components/resolvedicon";
import { useEffect, useRef } from "react";
import { MdKeyboardArrowDown } from "react-icons/md";

export default function BookmarksGroup({
bookmarks,
Expand Down
4 changes: 2 additions & 2 deletions src/components/bookmarks/item.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useContext } from "react";
import classNames from "classnames";
import { SettingsContext } from "utils/contexts/settings";
import ResolvedIcon from "components/resolvedicon";
import { useContext } from "react";
import { SettingsContext } from "utils/contexts/settings";

export default function Item({ bookmark, iconOnly = false }) {
const description = bookmark.description ?? new URL(bookmark.href).hostname;
Expand Down
2 changes: 1 addition & 1 deletion src/components/favicon.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @next/next/no-img-element */
/* eslint-disable jsx-a11y/alt-text */
import { useRef, useEffect, useContext } from "react";
import { useContext, useEffect, useRef } from "react";
import { ColorContext } from "utils/contexts/color";

import themes from "utils/styles/themes";
Expand Down
6 changes: 3 additions & 3 deletions src/components/quicklaunch.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useTranslation } from "react-i18next";
import { useEffect, useState, useRef, useCallback, useContext } from "react";
import classNames from "classnames";
import { useCallback, useContext, useEffect, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import useSWR from "swr";
import { SettingsContext } from "utils/contexts/settings";

Expand Down Expand Up @@ -53,7 +53,7 @@ export default function QuickLaunch({ servicesAndBookmarks, searchString, setSea
const result = results[currentItemIndex];
window.open(
result.href,
newWindow ? "_blank" : result.target ?? searchProvider?.target ?? settings.target ?? "_blank",
newWindow ? "_blank" : (result.target ?? searchProvider?.target ?? settings.target ?? "_blank"),
"noreferrer",
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/resolvedicon.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useContext } from "react";
import Image from "next/image";
import { useContext } from "react";
import { SettingsContext } from "utils/contexts/settings";
import { ThemeContext } from "utils/contexts/theme";

Expand Down
4 changes: 2 additions & 2 deletions src/components/services/dropdown.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Fragment } from "react";
import { Menu, Transition } from "@headlessui/react";
import { BiCog } from "react-icons/bi";
import classNames from "classnames";
import { Fragment } from "react";
import { BiCog } from "react-icons/bi";

export default function Dropdown({ options, value, setValue }) {
return (
Expand Down
8 changes: 4 additions & 4 deletions src/components/services/group.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useRef, useEffect } from "react";
import classNames from "classnames";
import { Disclosure, Transition } from "@headlessui/react";
import { MdKeyboardArrowDown } from "react-icons/md";
import List from "components/services/list";
import classNames from "classnames";
import ResolvedIcon from "components/resolvedicon";
import List from "components/services/list";
import { useEffect, useRef } from "react";
import { MdKeyboardArrowDown } from "react-icons/md";

import { columnMap } from "../../utils/layout/columns";

Expand Down
10 changes: 5 additions & 5 deletions src/components/services/item.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import classNames from "classnames";
import ResolvedIcon from "components/resolvedicon";
import { useContext, useState } from "react";
import { SettingsContext } from "utils/contexts/settings";
import Docker from "widgets/docker/component";
import Kubernetes from "widgets/kubernetes/component";
import { SettingsContext } from "utils/contexts/settings";
import ResolvedIcon from "components/resolvedicon";

import Status from "./status";
import Widget from "./widget";
import KubernetesStatus from "./kubernetes-status";
import Ping from "./ping";
import SiteMonitor from "./site-monitor";
import KubernetesStatus from "./kubernetes-status";
import Status from "./status";
import Widget from "./widget";

export default function Item({ service, groupName, useEqualHeights }) {
const hasLink = service.href && service.href !== "#";
Expand Down
2 changes: 1 addition & 1 deletion src/components/services/kubernetes-status.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import useSWR from "swr";
import { t } from "i18next";
import useSWR from "swr";

export default function KubernetesStatus({ service, style }) {
const podSelectorString = service.podSelector !== undefined ? `podSelector=${service.podSelector}` : "";
Expand Down
2 changes: 1 addition & 1 deletion src/components/services/widget.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useTranslation } from "next-i18next";
import ErrorBoundary from "components/errorboundry";
import { useTranslation } from "next-i18next";

import components from "widgets/components";

Expand Down
2 changes: 1 addition & 1 deletion src/components/services/widget/block.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useTranslation } from "next-i18next";
import classNames from "classnames";
import { useTranslation } from "next-i18next";

export default function Block({ value, label }) {
const { t } = useTranslation();
Expand Down
2 changes: 1 addition & 1 deletion src/components/tab.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useContext } from "react";
import classNames from "classnames";
import { useContext } from "react";
import { TabContext } from "utils/contexts/tab";

function slugify(tabName) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/toggles/color.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useContext, Fragment } from "react";
import { IoColorPalette } from "react-icons/io5";
import { Popover, Transition } from "@headlessui/react";
import classNames from "classnames";
import { Fragment, useContext } from "react";
import { IoColorPalette } from "react-icons/io5";
import { ColorContext } from "utils/contexts/color";

const colors = [
Expand Down
4 changes: 2 additions & 2 deletions src/components/version.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { compareVersions, validate } from "compare-versions";
import cache from "memory-cache";
import { useTranslation } from "next-i18next";
import useSWR from "swr";
import { compareVersions, validate } from "compare-versions";
import { MdNewReleases } from "react-icons/md";
import useSWR from "swr";

const LATEST_RELEASE_CACHE_KEY = "latestRelease";

Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/datetime/datetime.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState, useEffect } from "react";
import { useTranslation } from "next-i18next";
import { useEffect, useState } from "react";

import Container from "../widget/container";
import Raw from "../widget/raw";
Expand Down
6 changes: 3 additions & 3 deletions src/components/widgets/glances/glances.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import useSWR from "swr";
import classNames from "classnames";
import { useTranslation } from "next-i18next";
import { useContext } from "react";
import { FaMemory, FaRegClock, FaThermometerHalf } from "react-icons/fa";
import { FiCpu, FiHardDrive } from "react-icons/fi";
import { useTranslation } from "next-i18next";
import classNames from "classnames";
import useSWR from "swr";
import { SettingsContext } from "utils/contexts/settings";

import Error from "../widget/error";
Expand Down
4 changes: 2 additions & 2 deletions src/components/widgets/kubernetes/kubernetes.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import useSWR from "swr";
import { useTranslation } from "next-i18next";
import useSWR from "swr";

import Error from "../widget/error";
import Container from "../widget/container";
import Error from "../widget/error";
import Raw from "../widget/raw";

import Node from "./node";
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/kubernetes/node.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useTranslation } from "next-i18next";
import { FaMemory } from "react-icons/fa";
import { FiAlertTriangle, FiCpu, FiServer } from "react-icons/fi";
import { SiKubernetes } from "react-icons/si";
import { useTranslation } from "next-i18next";

import UsageBar from "../resources/usage-bar";

Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/longhorn/longhorn.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import useSWR from "swr";

import Error from "../widget/error";
import Container from "../widget/container";
import Error from "../widget/error";
import Raw from "../widget/raw";

import Node from "./node";
Expand Down
12 changes: 6 additions & 6 deletions src/components/widgets/openmeteo/openmeteo.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import useSWR from "swr";
import { useTranslation } from "next-i18next";
import { useState } from "react";
import { WiCloudDown } from "react-icons/wi";
import { MdLocationDisabled, MdLocationSearching } from "react-icons/md";
import { useTranslation } from "next-i18next";
import { WiCloudDown } from "react-icons/wi";
import useSWR from "swr";

import Error from "../widget/error";
import mapIcon from "../../../utils/weather/openmeteo-condition-map";
import Container from "../widget/container";
import ContainerButton from "../widget/container_button";
import WidgetIcon from "../widget/widget_icon";
import Error from "../widget/error";
import PrimaryText from "../widget/primary_text";
import SecondaryText from "../widget/secondary_text";
import mapIcon from "../../../utils/weather/openmeteo-condition-map";
import WidgetIcon from "../widget/widget_icon";

function Widget({ options }) {
const { t } = useTranslation();
Expand Down
10 changes: 5 additions & 5 deletions src/components/widgets/openweathermap/weather.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import useSWR from "swr";
import { useTranslation } from "next-i18next";
import { useState } from "react";
import { WiCloudDown } from "react-icons/wi";
import { MdLocationDisabled, MdLocationSearching } from "react-icons/md";
import { useTranslation } from "next-i18next";
import { WiCloudDown } from "react-icons/wi";
import useSWR from "swr";

import Error from "../widget/error";
import mapIcon from "../../../utils/weather/owm-condition-map";
import Container from "../widget/container";
import ContainerButton from "../widget/container_button";
import Error from "../widget/error";
import PrimaryText from "../widget/primary_text";
import SecondaryText from "../widget/secondary_text";
import WidgetIcon from "../widget/widget_icon";
import mapIcon from "../../../utils/weather/owm-condition-map";

function Widget({ options }) {
const { t, i18n } = useTranslation();
Expand Down
6 changes: 3 additions & 3 deletions src/components/widgets/resources/cpu.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import useSWR from "swr";
import { FiCpu } from "react-icons/fi";
import { useTranslation } from "next-i18next";
import { FiCpu } from "react-icons/fi";
import useSWR from "swr";

import Resource from "../widget/resource";
import Error from "../widget/error";
import Resource from "../widget/resource";

export default function Cpu({ expanded, refresh = 1500 }) {
const { t } = useTranslation();
Expand Down
6 changes: 3 additions & 3 deletions src/components/widgets/resources/cputemp.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import useSWR from "swr";
import { FaThermometerHalf } from "react-icons/fa";
import { useTranslation } from "next-i18next";
import { FaThermometerHalf } from "react-icons/fa";
import useSWR from "swr";

import Resource from "../widget/resource";
import Error from "../widget/error";
import Resource from "../widget/resource";

function convertToFahrenheit(t) {
return (t * 9) / 5 + 32;
Expand Down
6 changes: 3 additions & 3 deletions src/components/widgets/resources/disk.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import useSWR from "swr";
import { FiHardDrive } from "react-icons/fi";
import { useTranslation } from "next-i18next";
import { FiHardDrive } from "react-icons/fi";
import useSWR from "swr";

import Resource from "../widget/resource";
import Error from "../widget/error";
import Resource from "../widget/resource";

export default function Disk({ options, expanded, diskUnits, refresh = 1500 }) {
const { t } = useTranslation();
Expand Down
Loading