mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-03 13:42:12 +08:00
Chore: add organize imports to pre-commit (#5104)
This commit is contained in:
@@ -4,13 +4,13 @@ import path from "path";
|
||||
|
||||
import yaml from "js-yaml";
|
||||
|
||||
import checkAndCopyConfig, { getSettings, substituteEnvironmentVars, CONF_DIR } from "utils/config/config";
|
||||
import checkAndCopyConfig, { CONF_DIR, getSettings, substituteEnvironmentVars } from "utils/config/config";
|
||||
import {
|
||||
cleanServiceGroups,
|
||||
findGroupByName,
|
||||
servicesFromConfig,
|
||||
servicesFromDocker,
|
||||
cleanServiceGroups,
|
||||
servicesFromKubernetes,
|
||||
findGroupByName,
|
||||
} from "utils/config/service-helpers";
|
||||
import { cleanWidgetGroups, widgetsFromConfig } from "utils/config/widget-helpers";
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/* eslint-disable no-console */
|
||||
import { join } from "path";
|
||||
import { copyFileSync, existsSync, mkdirSync, readFileSync } from "fs";
|
||||
import { join } from "path";
|
||||
|
||||
import cache from "memory-cache";
|
||||
import yaml from "js-yaml";
|
||||
import cache from "memory-cache";
|
||||
|
||||
const cacheKey = "homepageEnvironmentVariables";
|
||||
const homepageVarPrefix = "HOMEPAGE_VAR_";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import path from "path";
|
||||
import { readFileSync } from "fs";
|
||||
import path from "path";
|
||||
|
||||
import yaml from "js-yaml";
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import path from "path";
|
||||
import { readFileSync } from "fs";
|
||||
import path from "path";
|
||||
|
||||
import { ApiextensionsV1Api, KubeConfig } from "@kubernetes/client-node";
|
||||
import yaml from "js-yaml";
|
||||
import { KubeConfig, ApiextensionsV1Api } from "@kubernetes/client-node";
|
||||
|
||||
import checkAndCopyConfig, { CONF_DIR, substituteEnvironmentVars } from "utils/config/config";
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { promises as fs } from "fs";
|
||||
import path from "path";
|
||||
|
||||
import yaml from "js-yaml";
|
||||
import Docker from "dockerode";
|
||||
import yaml from "js-yaml";
|
||||
|
||||
import createLogger from "utils/logger";
|
||||
import checkAndCopyConfig, { CONF_DIR, getSettings, substituteEnvironmentVars } from "utils/config/config";
|
||||
import getDockerArguments from "utils/config/docker";
|
||||
import kubernetes from "utils/kubernetes/export";
|
||||
import { getKubeConfig } from "utils/config/kubernetes";
|
||||
import * as shvl from "utils/config/shvl";
|
||||
import kubernetes from "utils/kubernetes/export";
|
||||
import createLogger from "utils/logger";
|
||||
|
||||
const logger = createLogger("service-helpers");
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createContext, useState, useEffect, useMemo } from "react";
|
||||
import { createContext, useEffect, useMemo, useState } from "react";
|
||||
|
||||
let lastColor = false;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createContext, useState, useMemo } from "react";
|
||||
import { createContext, useMemo, useState } from "react";
|
||||
|
||||
export const SettingsContext = createContext();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createContext, useState, useMemo } from "react";
|
||||
import { createContext, useMemo, useState } from "react";
|
||||
|
||||
export const TabContext = createContext();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createContext, useState, useEffect, useMemo } from "react";
|
||||
import { createContext, useEffect, useMemo, useState } from "react";
|
||||
|
||||
const getInitialTheme = () => {
|
||||
if (typeof window !== "undefined" && window.localStorage) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
const hasFocus = () => typeof document !== "undefined" && document.hasFocus();
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import listIngress from "utils/kubernetes/ingress-list";
|
||||
import listTraefikIngress from "utils/kubernetes/traefik-list";
|
||||
import listHttpRoute from "utils/kubernetes/httproute-list";
|
||||
import { isDiscoverable, constructedServiceFromResource } from "utils/kubernetes/resource-helpers";
|
||||
import listIngress from "utils/kubernetes/ingress-list";
|
||||
import { constructedServiceFromResource, isDiscoverable } from "utils/kubernetes/resource-helpers";
|
||||
import listTraefikIngress from "utils/kubernetes/traefik-list";
|
||||
|
||||
const kubernetes = {
|
||||
listIngress,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NetworkingV1Api } from "@kubernetes/client-node";
|
||||
|
||||
import { getKubernetes, getKubeConfig } from "utils/config/kubernetes";
|
||||
import { getKubeConfig, getKubernetes } from "utils/config/kubernetes";
|
||||
import createLogger from "utils/logger";
|
||||
|
||||
const logger = createLogger("ingress-list");
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { CustomObjectsApi } from "@kubernetes/client-node";
|
||||
|
||||
import { substituteEnvironmentVars } from "utils/config/config";
|
||||
import {
|
||||
getKubeConfig,
|
||||
ANNOTATION_BASE,
|
||||
ANNOTATION_WIDGET_BASE,
|
||||
getKubeConfig,
|
||||
HTTPROUTE_API_GROUP,
|
||||
HTTPROUTE_API_VERSION,
|
||||
} from "utils/config/kubernetes";
|
||||
import { substituteEnvironmentVars } from "utils/config/config";
|
||||
import createLogger from "utils/logger";
|
||||
import * as shvl from "utils/config/shvl";
|
||||
import createLogger from "utils/logger";
|
||||
|
||||
const logger = createLogger("resource-helpers");
|
||||
const kc = getKubeConfig();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CustomObjectsApi } from "@kubernetes/client-node";
|
||||
|
||||
import { getKubernetes, getKubeConfig, checkCRD, ANNOTATION_BASE } from "utils/config/kubernetes";
|
||||
import { ANNOTATION_BASE, checkCRD, getKubeConfig, getKubernetes } from "utils/config/kubernetes";
|
||||
import createLogger from "utils/logger";
|
||||
|
||||
const logger = createLogger("traefik-list");
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import getServiceWidget from "utils/config/service-helpers";
|
||||
import { formatApiCall, sanitizeErrorURL } from "utils/proxy/api-helpers";
|
||||
import validateWidgetData from "utils/proxy/validate-widget-data";
|
||||
import { httpProxy } from "utils/proxy/http";
|
||||
import createLogger from "utils/logger";
|
||||
import { getSettings } from "utils/config/config";
|
||||
import getServiceWidget from "utils/config/service-helpers";
|
||||
import createLogger from "utils/logger";
|
||||
import { formatApiCall, sanitizeErrorURL } from "utils/proxy/api-helpers";
|
||||
import { httpProxy } from "utils/proxy/http";
|
||||
import validateWidgetData from "utils/proxy/validate-widget-data";
|
||||
import widgets from "widgets/widgets";
|
||||
|
||||
const logger = createLogger("credentialedProxyHandler");
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import getServiceWidget from "utils/config/service-helpers";
|
||||
import { formatApiCall, sanitizeErrorURL } from "utils/proxy/api-helpers";
|
||||
import validateWidgetData from "utils/proxy/validate-widget-data";
|
||||
import { httpProxy } from "utils/proxy/http";
|
||||
import createLogger from "utils/logger";
|
||||
import { formatApiCall, sanitizeErrorURL } from "utils/proxy/api-helpers";
|
||||
import { httpProxy } from "utils/proxy/http";
|
||||
import validateWidgetData from "utils/proxy/validate-widget-data";
|
||||
import widgets from "widgets/widgets";
|
||||
|
||||
const logger = createLogger("genericProxyHandler");
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { JSONRPCClient, JSONRPCErrorException } from "json-rpc-2.0";
|
||||
|
||||
import { formatApiCall } from "utils/proxy/api-helpers";
|
||||
import { httpProxy } from "utils/proxy/http";
|
||||
import getServiceWidget from "utils/config/service-helpers";
|
||||
import createLogger from "utils/logger";
|
||||
import { formatApiCall } from "utils/proxy/api-helpers";
|
||||
import { httpProxy } from "utils/proxy/http";
|
||||
import widgets from "widgets/widgets";
|
||||
|
||||
const logger = createLogger("jsonrpcProxyHandler");
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import cache from "memory-cache";
|
||||
|
||||
import getServiceWidget from "utils/config/service-helpers";
|
||||
import createLogger from "utils/logger";
|
||||
import { asJson, formatApiCall } from "utils/proxy/api-helpers";
|
||||
import { httpProxy } from "utils/proxy/http";
|
||||
import createLogger from "utils/logger";
|
||||
import widgets from "widgets/widgets";
|
||||
|
||||
const INFO_ENDPOINT = "{url}/webapi/query.cgi?api=SYNO.API.Info&version=1&method=query";
|
||||
|
||||
@@ -5,8 +5,8 @@ import { createUnzip, constants as zlibConstants } from "node:zlib";
|
||||
import { http, https } from "follow-redirects";
|
||||
import cache from "memory-cache";
|
||||
|
||||
import { addCookieToJar, setCookieHeader } from "./cookie-jar";
|
||||
import { sanitizeErrorURL } from "./api-helpers";
|
||||
import { addCookieToJar, setCookieHeader } from "./cookie-jar";
|
||||
|
||||
import createLogger from "utils/logger";
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* eslint-disable no-console */
|
||||
import widgets from "widgets/widgets";
|
||||
import createLogger from "utils/logger";
|
||||
import widgets from "widgets/widgets";
|
||||
|
||||
const logger = createLogger("validateWidgetData");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user