Giter Site home page Giter Site logo

galloween / custom-sidebar-v2 Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 15.0 41 KB

Home Assistant (HACS) plugin that allows you to rearrange, hide, and add sidebar menu items. Refactor of https://github.com/Villhellm/custom-sidebar

home-assistant custom-sidebar custom-sidebars homeassistant hacs hacs-integration plugin js lovelace lovelace-ui

custom-sidebar-v2's People

Contributors

galloween avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

custom-sidebar-v2's Issues

Exceptions do not hide items

Adding user specific exceptions and having them hidden does not hide them for that user??

........
],
    "exceptions": [
    {
        "user": [
            "Su"
        ],
        "base_order": false,
        "order": [
            {
                "item": "overview",
                "order": 1
            },
            {
                "item": "energy",
                "hide": true
            },
            {
                "item": "map",
                "hide": true
            },
            {
                "item": "logbook",
                "hide": true
            },
            {
                "item": "history",
                "hide": true
            },
            {
                "item": "media browser",
                "hide": true
            }
        ]
    }
    ]
}

Sidebar never updates

This component seems to be causing me nothing but trouble...

The only way I can get the sidebar to update when I make changes in sidebar-order.json is in Incognito Mode (I use Chrome). I've tried clearing data for that site, force refreshing, etc... And it seems that if I'm ever able to get it to update, it's only in Incognito.

My sidebar-order.json here: https://pastebin.com/fcqXhmgD

Is there any particular reason why this one doesn't seem to want to update for me?

App Configuration on iOS device

I want to change the order for the App Configuration panel on iOS devices, but "app configuration" is not enough. Do you know what the title for the App Configuration is?

Icons not showing for new_item

I have this configured in my sidebar-order.json

{ "new_item": true, "item": "OpenEVSE", "href": "http://192.168.0.77", "icon:": "mdi:car-electric", "order": 8 }

And it is not showing the icon, I have tried clearing the browser cache, reboot HA, etc and the same.
image

Also is there a way to have the new_item objects open up in a new browser window?

Plugin not working for non-admin users

Hi, first of all thanks for refactoring this plugin and make it working with the latest version of HA :-)
I noticed everything works fine for admin users but not for non administrators. The issue seems related to getSidebarItem() when called upon startup returning undefined since looking for "data-panel" equals to "config" which is not there for a non admin user (https://github.com/galloween/custom-sidebar-v2/blob/main/dist/custom-sidebar-v2.js#L145).
As a workaround a tried picking up the latest element (e.g. .at(-1)) of window.$customSidebarV2.SideBarElement which works but I'm sure it breaks out other things.
Thanks!

Admin Exception

Could you add an exception for admins, so that administrator items can be customized independently?

My default customizations hide some sidebar items, but I would like to make an exception to show all sidebar items for administrators.

Thanks!

Configuration badge (notification) are repeated on all new items

The badge from the Settings-menu are repeated to all new_item's in sidebar-order.json.
image

In my case Settings is the place where the badge displaying 3 shall be.
This is how it looks if I remove everything in sidebar-order.json:
image

my sidebar-order.json:

  "order": [
    {
      "new_item": true,
      "item": "Automations",
      "href": "/config/automation",
      "icon": "mdi:home-automation",
      "order": 1,
      "bottom" : true
    },
    {
      "new_item": true,
      "item": "Integrations",
      "href": "/config/integrations",
      "icon": "mdi:puzzle",
      "order": 2,
      "bottom" : true
    },
    {
      "item": "HACS",
      "order": 3,
      "bottom" : true
    },
    {
      "new_item": true,
      "item": "Z-Wave JS UI",
      "href": "http://example.com:8091/",
      "icon": "mdi:z-wave",
      "target": "_blank",
      "order": 4,
      "bottom" : true
    },
    {
      "item": "Developer Tools",
      "order": 5,
      "bottom" : true
    },
    {
      "item": "Settings",
      "order": 6,
      "bottom" : true
    }
  ]
}```

Update Badges repeat on all custom entries

2022.4.0b0 introduces updates this is also introducing a badge with the number of updates for configuration.

Like below
image

but with custom sidebar, those updates are showing up on all custom entries and the badge is also offset a little, which is not showing the complete number.

like below

image

Tooltips

When this plugin is used (and it's amazing, as I have some external links I want added that are not iframe-friendly), I've noticed that new items don't have tooltips, while HASS-default items do.

Suggestion would be to add a tooltip property to allow for custom tooltips, or use the name / id somehow

Not working on latest HassOS

Hi, just stumbled across your project and installed it using HACS.

This is my config/configuration.yml

frontend:
  themes: !include_dir_merge_named themes
  extra_module_url:
    - /hacsfiles/custom-sidebar-v2/custom-sidebar-v2.js

and this my config/www/sidebar-order.json

{
    "order": [
    {
      "new_item": true,
      "item": "Google",
      "href": "https://mrdoob.com/projects/chromeexperiments/google-gravity/",
      "icon": "mdi:earth",
      "target": "_blank",
      "order": 4
    },
    {
        "item": "media-browser"
        "hide": true
    }
    ],
    "exceptions": [
    {
        "user": ["eltern"],
        "order": [
        {
            "item": "history",
            "hide": true
        }
        ]
    }
    ]
 }

Restarting the server and hard reloading with cache cleaning does not show any results, neither on the main account nor on the user account.
Am I missing some step here or is there any way I could troubleshoot this?

Fast loading

Hi is it possible to have it load a little faster? Maybe first load the config and after that check for any errors?

I want to remove certain tabs for some users but because this is hiding the tabs and not removing it when the default tabs show for just a second I would go and check the code and find the hidden items.

Schermopname.2022-01-31.om.17.38.38.mov

iframe support?

Hi, is it possible to show this is an iframe, in the same way as the iframe panel support from Home Assistant?

{
  "new_item": true,
  "item": "Google",
  "href": "https://mrdoob.com/projects/chromeexperiments/google-gravity/",
  "icon": "mdi:earth",
  "target": "_blank"
},

Add "defaultPanel" configuration setting

Wonder if would be possible/sensible adding a defaultPanel configuration setting which will automatically browse to a defined panel/page upon loading of the plugin. In this way when accessing HA from a new device or with a new user, he is moved away ASAP from the default Overview dashboard which is displacing for new/guest users.
Thanks!

Order not respected in mobile app

This config works perfectly in my desktop browser:

{
  "order": [
    {
      "item": "lovelace",
      "order": 0
    },
    {
      "item": "lovelace-administration",
      "order": 1
    },
    {
      "item": "mobile-view",
      "order": 2
    },
    {
      "item": "shopping-list",
      "order": 3
    },
    {
      "item": "a0d7b954_grafana",
      "order": 4
    },
    {
      "item": "energy",
      "order": 5
    },
    {
      "item": "logbook",
      "order": 6
    },
    {
      "item": "history",
      "order": 7
    },
    {
      "item": "map",
      "order": 8
    },
    {
      "item": "redirect-logs",
      "bottom": true,
      "order": 9
    },
    {
      "item": "redirect-server-controls",
      "bottom": true,
      "order": 10
    },
    {
      "item": "redirect-devices",
      "bottom": true,
      "order": 11
    },
    {
      "item": "hacs",
      "bottom": true,
      "order": 12
    },
    {
      "item": "redirect-addons",
      "bottom": true,
      "order": 13
    },
    {
      "item": "alarmo",
      "bottom": true,
      "order": 14
    },
    {
      "item": "developer-tools",
      "bottom": true,
      "order": 14
    },
    {
      "item": "settings",
      "bottom": true,
      "order": 14
    },
    {
      "item": "media",
      "hide": true
    }
  ]
}

Screenshot 2022-08-24 at 19-35-28 Overview โ€“ Home Assistant

However it is all over the place in the iOS Home Assistant companion app:

9345

I have reset the frontend cache and reloaded but it made no difference.

Ctrl + f5 makes this custom sidebar not work?

After pressing Ctrl + f5 it removes my custom setting for the side bar and shows the overview, electric, map etc again. Clearing cache and cookies fixes this? I guess this only hides the options but can't be applied again after the clearing of Ctrl + f5?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.