librenms-plugins / Weathermap

MIT License
64 stars 51 forks source link

Plugin should display maps #7

Closed supertylerc closed 9 years ago

supertylerc commented 9 years ago

This plugin should display the maps it generates on the plugin page (or provide navigation to reach the maps).

supertylerc commented 9 years ago

I have a PR for this, but it's on a Linux box because #8 is wreaking havoc on my ability to test locally. I'll have to setup the Linux box later to be able to push its changes.

laf commented 9 years ago

Is it done by listing files in a directory? It's possible for users to output the html files to anywhere but I could update the docs to say, if you put them in X it will be in the Webui.

supertylerc commented 9 years ago

It looks in the output/ directory and loops through to create an <li> tag for each file ending in *.png.

supertylerc commented 9 years ago

Example of the HTML output (cleaned up for legibility):

<div class="row">
  <div class="col-md-12">
    Click <a href="plugins/Weathermap/editor.php">here to access the editor</a> where you can create and manage maps.
    <div class="container">
      <ul class="list-inline">
        <li>
          <img class="img-responsive" src="plugins/Weathermap/output/core.png"/>
        </li>
        <li>
          <img class="img-responsive" src="plugins/Weathermap/output/routers.png"/>
        </li>
      </ul>
    </div>
  </div>
</div>
supertylerc commented 9 years ago

And an example in mobile proportions.

screen shot 2015-04-07 at 2 53 21 pm

laf commented 9 years ago

Looks good :)

supertylerc commented 9 years ago

See PR #9 for the implementation of the feature.

supertylerc commented 9 years ago

Ultimately, I think that steps should be taken to generate the overlib HTML for the plugin page. This is probably a good first step to something useful, though.

supertylerc commented 9 years ago

I just added a new commit to #9 that will turns the image into a link to the overlib. Definitely not the greatest UX, but hopefully better than fumbling around for the correct paths.

laf commented 9 years ago

Thanks @supertylerc :)

Just merged it in now.

supertylerc commented 9 years ago

Awesome. Thanks for merging. :)