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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a Dashboard #26

Draft
wants to merge 1 commit into
base: v3
Choose a base branch
from
Draft

Conversation

tooolbox
Copy link
Contributor

@tooolbox tooolbox commented Oct 3, 2020

Web dashboard for Dalga. Closes #22

Screen Shot 2020-10-02 at 11 30 25 PM

  • When you run Dalga locally, you can visit the dashboard at http://localhost:34006
  • Simple HTML, CSS and JS.
  • Embedded into the binary for easy deployment.
  • Development mode for fast iteration (go build -tags=dev).
  • Shows realtime graphs based on the /status data (5 second update window).
  • Modal form for creating a new job.
  • Lookup an existing job.
  • Pause, resume, cancel, etc. an existing job.
  • Add logo? 馃槈

One thing that I realize is missing is any kind of "listing" command for the jobs in Dalga. The dashboard can exist without it, but would be more useful if you can search through jobs and so on.


Another note is that I had a version of this working with Typescript and React and Material UI, with esbuild for bundling, but I decided it was entirely too complicated for the use case 馃槃

@cenkalti
Copy link
Owner

cenkalti commented Oct 3, 2020

@tooolbox this looks really nice. I am excited!

If it's going to be easier for you, you can continue with Typescript and React and Material UI version.

For "Lookup an existing job." task, I think we also have to implement pagination for listing endpoint because the jobs table may contain many records that a client can handle. Therefore, an auto-incrementing ID field needs to be added to the jobs table if we are going to implement that feature. Or, maybe a created_at field could do the same job.

And, for the logo. "Dalga" means wave in Turkish language. We can pick up a loyalty free logo. I have found some:

@tooolbox
Copy link
Contributor Author

tooolbox commented Oct 3, 2020

@tooolbox this looks really nice. I am excited!

馃帀 馃帀

If it's going to be easier for you, you can continue with Typescript and React and Material UI version.

Nah, it's fine, this one's farther along, and easier to iterate on anyway.

For "Lookup an existing job." task, I think we also have to implement pagination for listing endpoint because the jobs table may contain many records that a client can handle. Therefore, an auto-incrementing ID field needs to be added to the jobs table if we are going to implement that feature. Or, maybe a created_at field could do the same job.

You're totally right on the pagination! Heh, imagine if you had 10,000 jobs in there? I think the ID field/created_at is a good idea, and I am having a hard time deciding which is better:

  • Created_at has more useful data within itself natively.
  • If you upgraded your database by doing ALTER TABLE jobs ADD COLUMN created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP() or whatever, all the existing jobs in your database would then have the same created_at, which makes it not very useful for pagination.

Maybe the 2nd point there is silly? Let me know what you think.

And, for the logo. "Dalga" means wave in Turkish language. We can pick up a loyalty free logo. I have found some:

Awesome, I'll look through and give some feedback :)

@cenkalti
Copy link
Owner

cenkalti commented Oct 4, 2020

If you upgraded your database by doing ALTER TABLE jobs ADD COLUMN created_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP() or whatever, all the existing jobs in your database would then have the same created_at, which makes it not very useful for pagination.

Good point. Timestamp is not unique. I think it is better to use auto-incrementing integer id. If I remember correctly, MySQL generate a valid sequence of integers when adding the new column with ALTER TABLE statement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dashboard
2 participants