cstate / cstate

๐Ÿ”ฅ Open source static (serverless) status page. Uses hyperfast Go & Hugo, minimal HTML/CSS/JS, customizable, outstanding browser support (IE8+), preloaded CMS, read-only API, badges & more.
https://cstate.mnts.lt
MIT License
2.47k stars 222 forks source link

External link button to link to a component #214

Closed aperullo closed 2 years ago

aperullo commented 2 years ago

Is your feature request related to a problem? Please describe. Some services/components have web frontends, It would be a nice-to-have to be able to link to them.

Describe the solution you'd like Add an optional link field to the config file under each component that will then show a button that will take one to the url.

Describe alternatives you've considered None in particular.

Additional context I have put together a branch with the change, but wasn't sure if it conforms to this projects' specific style. I haven't done frontend work (html/css) before so if there is a better way to do something please let me know. Otherwise I'll post a PR with the change.

External link image is from font awesome (license)

image

I'm not sure how the proper way to deal with dark-mode, and the icon is hard to see with it enabled.

mistermantas commented 2 years ago

cstate, because it has to support IE8, doesn't really use SVGs - most of the icon elements are actually from unicode

https://www.quora.com/Is-the-symbol-for-external-link-available-in-Unicode-If-so-how-do-I-get-in-on-my-Mac the closest thing is this nice-looking arrow

I think this is a kind of cool idea, actually, though - i think i might add it in a future update whenever i've got something else to couple with this

aperullo commented 2 years ago

Thanks! I see, using text immediately solves the dark mode issue. I also looked through part of unicode and found some other characters you might consider using as icons. I'm on linux so I can't check they all render on IE8 but here they are:

๐Ÿกญ U+1F86D
๐Ÿกต U+1F875
๐Ÿข… U+1F885
๐Ÿ”— U+1F517

image

For my eye, I like U+1F875. Though U+1F517 is the link emoji which might make it more immediately familiar, even if it looks kind of funky.

I'll update my branch as well.

image

mistermantas commented 2 years ago

Hi, you can make this into a PR so long as you:

I would also like to put this link on the pages for the systems themselves (when you click on the title) but I can do that myself since it's kind of outside of your feature request

aperullo commented 2 years ago

Yeah certainly not the prettiest. I wonder if it does any good to add the other unicode characters as options if we're looking to maintain that compatibility though. I would maybe just make note of "other options that were considered" in the PR?

Also updating wikis is strange since I can't directly submit PRs against them, so I've made a gist with my edit to the "Systems" section, describing the new link property. If there is a better way to go about it please let me know.

Please let me know I missed anything, thank you!

https://github.com/cstate/cstate/pull/223