Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: plain-text configuration #11

Closed
slezica opened this issue Mar 27, 2015 · 11 comments
Closed

Suggestion: plain-text configuration #11

slezica opened this issue Mar 27, 2015 · 11 comments

Comments

@slezica
Copy link

slezica commented Mar 27, 2015

This is a surprising and awesome tool, but you need to write Go to use it.

Reading widgets from a configuration file, in any popular format, would make the tool easier to configure and available to a much larger range of developers.

@Matt3o12
Copy link
Contributor

Good point, although you are going to need to write Go code eventually (unless you want to have a completely static app of course). If you only use the available widgets, you won't be able to get dynamic content.
I currently write widgets for termui that are kind of "higher level widgets" and only fulfill one task. The first widget is going to be a Hacker News newsfeed (that includes the top stories as well as the most recent ones). Later I will write widget that pulls my server's load (and CPU usage, memory, etc) using new relic. They have a pretty straightforward API and connecting your server to their service is free and super easy (it only took me a minute)*.

Right now, implementing that is kind of pointless, though. The only advantage is cleaner code but that's it.

* just make sure you add the server to their Server monitoring Service and not the application service (because the usage is very limited if you don't pay).

@gizak
Copy link
Owner

gizak commented Mar 27, 2015

Hi @slezica, it's a good idea! Reminds me of graphite-web. I think this can be done by wrapping it up as a command line tool which continuously fetches data from an URI (*.json maybe). But as @Matt3o12 said, you may need some go codes if you want adding in custom logic.

Actually I've came across a similiar idea when implementing grid layout, thought a html-like tamplate would be helpful to define layout. Now this seems doable!

@RangerMauve
Copy link

Yeah, what you're describing sounds more like a project that someone should make using this as a rendering background, rather than having the library itself focus on making "html-like" directly.

@Matt3o12
Copy link
Contributor

👍

@andyl
Copy link

andyl commented Apr 1, 2015

+1 for plain text configuration, and for polling JSON files or URL to ingest data. Termui is great but we can't write custom go code.

Another idea for data sources: add an adapter to InfluxDB. All of our stats are stored in InfluxDB, but we don't have any way to display on the terminal.

To display InfluxDB stats on the browser we use Grafana - might be an interesting comparable for termui.

I agree with the OP - termui is a surprising and awesome tool. I think you are very close to having a tool that will attract a huge audience.

@fgrehm
Copy link

fgrehm commented Apr 1, 2015

Another idea that would make things a bit more dynamic would be to expose a JS api through something like otto, but I'm relatively new to termui to know if that would be doable or not 😁

@RangerMauve
Copy link

@fgrehm If you want a JS API, why not just go with blessed-contrib which is node-based?

@gizak
Copy link
Owner

gizak commented Apr 2, 2015

Just open a new repo termuid in response;)

@alphapapa
Copy link

Yes, this looks really neat, but all I want to do is pipe some data to a widget and have it displayed. It seems like a widget should be able to accept a plain number, CSV, JSON, etc.

And to be sure this isn't already possible and I wasn't missing something, I had to come find this issue... :)

@fgrehm
Copy link

fgrehm commented Jul 21, 2015

I just came across https://github.com/yaronn/wopr which might be used as an inspiration

@cjbassi
Copy link
Contributor

cjbassi commented Jan 24, 2019

A plain text configuration is a cool idea, but it's somewhat out of the scope of termui (I think). As was mentioned, you can create a higher level widget that reads its data from a file. But the widget design itself has to be in Go.

I realize this is an older issue, but just doing some housekeeping. 😺

@cjbassi cjbassi closed this as completed Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants