{"action":"created","issue":{"url":"https://api.github.com/repos/digitalocean/netbox/issues/1529","repository_url":"https://api.github.com/repos/digitalocean/netbox","labels_url":"https://api.github.com/repos/digitalocean/netbox/issues/1529/labels{/name}","comments_url":"https://api.github.com/repos/digitalocean/netbox/issues/1529/comments","events_url":"https://api.github.com/repos/digitalocean/netbox/issues/1529/events","html_url":"https://github.com/digitalocean/netbox/issues/1529","id":259782880,"number":1529,"title":"Support images as front view image in rack","user":{"login":"taenzerme","id":3618912,"avatar_url":"https://avatars1.githubusercontent.com/u/3618912?v=4","gravatar_id":"","url":"https://api.github.com/users/taenzerme","html_url":"https://github.com/taenzerme","followers_url":"https://api.github.com/users/taenzerme/followers","following_url":"https://api.github.com/users/taenzerme/following{/other_user}","gists_url":"https://api.github.com/users/taenzerme/gists{/gist_id}","starred_url":"https://api.github.com/users/taenzerme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/taenzerme/subscriptions","organizations_url":"https://api.github.com/users/taenzerme/orgs","repos_url":"https://api.github.com/users/taenzerme/repos","events_url":"https://api.github.com/users/taenzerme/events{/privacy}","received_events_url":"https://api.github.com/users/taenzerme/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-22T11:16:38Z","updated_at":"2017-09-28T14:04:18Z","closed_at":null,"author_association":"NONE","body":"### Issue type\r\n[x] Feature request\r\n\r\n### Environment\r\n* Python version:  3.4.2\r\n* NetBox version: v2.1.5-dev\r\n\r\n### Description\r\nAs netbox did add support for images with devices it would be great to support choosing one of these as a front view image that is displayed in the rack view. \r\n\r\nI already tried to implement this:\r\n\r\n![screenshot 2017-09-22 13 11 31](https://user-images.githubusercontent.com/3618912/30742024-a215bcac-9f97-11e7-8e60-7a4b90ce9fcd.png)\r\n\r\n![screenshot 2017-09-22 13 15 55](https://user-images.githubusercontent.com/3618912/30742157-2e192d74-9f98-11e7-8fa6-3ea4b751a931.png)\r\n\r\nI did some quick code changes in my fork at https://github.com/taenzerme/netbox/tree/image-as-frontview. I guess doing it with a seperate <img/> element (and some z-index/position tweaking) inside the markup would be the cleaner way, but the inline style CSS works for me at the moment.\r\n\r\nMaybe this could be helpful for the rest, too?"},"comment":{"url":"https://api.github.com/repos/digitalocean/netbox/issues/comments/332846539","html_url":"https://github.com/digitalocean/netbox/issues/1529#issuecomment-332846539","issue_url":"https://api.github.com/repos/digitalocean/netbox/issues/1529","id":332846539,"user":{"login":"jeremystretch","id":13487278,"avatar_url":"https://avatars1.githubusercontent.com/u/13487278?v=4","gravatar_id":"","url":"https://api.github.com/users/jeremystretch","html_url":"https://github.com/jeremystretch","followers_url":"https://api.github.com/users/jeremystretch/followers","following_url":"https://api.github.com/users/jeremystretch/following{/other_user}","gists_url":"https://api.github.com/users/jeremystretch/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremystretch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremystretch/subscriptions","organizations_url":"https://api.github.com/users/jeremystretch/orgs","repos_url":"https://api.github.com/users/jeremystretch/repos","events_url":"https://api.github.com/users/jeremystretch/events{/privacy}","received_events_url":"https://api.github.com/users/jeremystretch/received_events","type":"User","site_admin":false},"created_at":"2017-09-28T14:04:18Z","updated_at":"2017-09-28T14:04:18Z","author_association":"CONTRIBUTOR","body":"We wouldn't want to use the ImageAttachment model here: we can just add `front_image` and `rear_image` file fields to the DeviceType model.\r\n\r\nThe hard part is manipulating the uploaded image to look halfway decent in the rack elevation. A 1U device in NetBox is rendered as a 226x19 pixel block, so there isn't a lot of space to work with. An uploaded image would need to be stripped of bordering whitespace and manipulated to ensure its height and width meet the specified dimensions. We _could_ allow for larger images, but that would require downsizing in the browser which probably wouldn't look great."}}
{"actor":{"display_login":"jeremystretch"}}