resoai / TileBoard

A simple yet highly configurable Dashboard for HomeAssistant
MIT License
1.63k stars 278 forks source link

History graph not working with network host url #789

Closed piltous closed 2 years ago

piltous commented 2 years ago

Hi,

I have a strange behavior here.

My dashboard is working great from HA ingress but not from the "network host url" for TYPES.HISTORY

I use this code that seems ok

  {
                  position: [3.1, 2.2],
                  type: TYPES.HISTORY,
                  id: 'sensor.XXX_pressure',
                  state: false, // hidding state
                  width: 2.1,
                  height: 1.4,
                  title: 'Pressure',
                  subtitle: function (item, entity) {
                     return 'Depuis ' + timeAgo(Date.now() - (item.offset || 7*24*3600*1000));
                     //return 'Since ' + timeAgo(Date.now() - (item.offset || 2*3600*1000));
                  },
                  //offset: 1*3600*1000,
                  offset: 7*24*3600*1000,
                  options: MINIMAL_CHART_OPTIONS,
                  },

In tileboard I have this error message Error in REST api Code -1 retrieved for http://192.168.178.39:8123/api/history/.......

In browser console I have this error message

192.168.178.39/:1 Access to XMLHttpRequest at 'http://192.168.178.39:8123/api/history/period/2021-11-04T16:46:12.661Z?end_time=2021-11-05T16:46:12.661Z&filter_entity_id=sensor.audun_le_tiche_pressure' from origin 'http://192.168.178.39:8999' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Thanks in advance

rchl commented 2 years ago

Duplicate of #386