mirror of
				https://github.com/karl0ss/homepage.git
				synced 2025-11-04 00:10:57 +00:00 
			
		
		
		
	Rename unifi_console info widget to unifi
This commit is contained in:
		
							parent
							
								
									42da3eca28
								
							
						
					
					
						commit
						fe1064b173
					
				@ -9,7 +9,7 @@ export default function Widget({ options }) {
 | 
			
		||||
  const { t } = useTranslation();
 | 
			
		||||
 | 
			
		||||
  // eslint-disable-next-line no-param-reassign
 | 
			
		||||
  options.type = "unifi_console";
 | 
			
		||||
  options.type = "unifi";
 | 
			
		||||
  const { data: statsData, error: statsError } = useWidgetAPI(options, "stat/sites");
 | 
			
		||||
 | 
			
		||||
  if (statsError || statsData?.error) {
 | 
			
		||||
@ -10,7 +10,7 @@ const widgetMappings = {
 | 
			
		||||
  greeting: dynamic(() => import("components/widgets/greeting/greeting")),
 | 
			
		||||
  datetime: dynamic(() => import("components/widgets/datetime/datetime")),
 | 
			
		||||
  logo: dynamic(() => import("components/widgets/logo/logo"), { ssr: false }),
 | 
			
		||||
  unifi_console: dynamic(() => import("components/widgets/unifi_console/unifi_console")),
 | 
			
		||||
  unifi: dynamic(() => import("components/widgets/unifi/unifi")),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export default function Widget({ widget }) {
 | 
			
		||||
 | 
			
		||||
@ -17,11 +17,11 @@ async function getWidget(req) {
 | 
			
		||||
  const { group, service, type } = req.query;
 | 
			
		||||
 | 
			
		||||
  let widget = null;
 | 
			
		||||
  if (type === "unifi_console") {
 | 
			
		||||
  if (type === "unifi") {
 | 
			
		||||
    const settings = getSettings();
 | 
			
		||||
    widget = settings.unifi_console;
 | 
			
		||||
    widget = settings.unifi;
 | 
			
		||||
    if (!widget) {
 | 
			
		||||
      logger.debug("There is no unifi_console section in settings.yaml");
 | 
			
		||||
      logger.debug("There is no unifi section in settings.yaml");
 | 
			
		||||
      return null;
 | 
			
		||||
    }
 | 
			
		||||
    widget.type = "unifi";
 | 
			
		||||
 | 
			
		||||
@ -61,7 +61,6 @@ const widgets = {
 | 
			
		||||
  traefik,
 | 
			
		||||
  transmission,
 | 
			
		||||
  unifi,
 | 
			
		||||
  unifi_console: unifi
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export default widgets;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user