Skip to content

Conversation

@JamesNK
Copy link
Member

@JamesNK JamesNK commented Nov 27, 2024

Description

Fixes #6626

Demo:

consolelogs-commands

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
Microsoft Reviewers: Open in CodeFlow

@JamesNK
Copy link
Member Author

JamesNK commented Nov 27, 2024

Feels good to use. cc @davidfowl @DamianEdwards @leslierichardson95 in case you have any UI feedback.

@davidfowl
Copy link
Member

This looks really good to me

@drewnoakes
Copy link
Member

I wonder if some users will expect this to stop the logs, rather than the resource, which could be annoying or even dangerous (in ACA for example).

Some ideas that might help with this:

  • Use a button with icon and text
  • Move the start/stop button into the ... menu, so it always appears with text
  • Move buttons next to resource combo box

@JamesNK
Copy link
Member Author

JamesNK commented Nov 28, 2024

The button icons and text come from the resource commands. Right now they just say Stop, Start, Restart. The text doesn't make it any clearer what the button does.

The buttons on the page could be removed and commands are only in a nested Resource commands menu.

e.g. to stop a resource, you would go ... -> Resource commands -> Stop

@davidfowl
Copy link
Member

If we add log specific commands where would they go?

@JamesNK
Copy link
Member Author

JamesNK commented Nov 28, 2024

In the example above? Resource commands

@JamesNK
Copy link
Member Author

JamesNK commented Nov 28, 2024

The tooltip can say what the button does:

image

Is that enough to remove confusion?

@drewnoakes
Copy link
Member

drewnoakes commented Nov 28, 2024

Only if the user reads the tool tip. Having a button that stops a resource without any confirmation that might be mistaken to do something else seems like it could cause some undue problems.

I'm thinking of the scenario where something is logging rapidly and the user wants to pause the logs to make it easier to read them, so they click the "stop" button thinking that's what it does.

What about splitting that "toolbar" area such that all resource related stuff is on one side (combo box, commands) and all log related stuff is on the other side (status, download, future pause/resume/clear buttons).

@JamesNK
Copy link
Member Author

JamesNK commented Nov 28, 2024

I don't see a good place to put command buttons on the left. If they were placed between the dropdown and status message it wouldn't look good because there can be a variable number of commands for a resource, and the status message location would jump around.

Edit: Maybe if the status was moved to the right then it could work.

@JamesNK
Copy link
Member Author

JamesNK commented Nov 28, 2024

How about this:

image

Comment on lines -37 to -41
AdditionalAttributes = new Dictionary<string, object>
{
{ "data-action", "download" },
{ "data-resource", PageViewModel.SelectedResource?.Name ?? string.Empty }
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adamint I believe these were left over from earlier iterations of logs download. I removed them and everything still seems to work

@drewnoakes
Copy link
Member

How about this:

image

This is what I had in mind. Seeing it, I think it's much clearer.

}
},
displayDescription: null,
displayDescription: "Start resource",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any ideas on how we could localize these? Options including having the server send all translated values, or sending a known key value that's then looked up in the dashboard.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is any plan for this kind of text to be localizable. Like state text, the API for adding commands just takes one string. That would need to change, and then I guess the server would need to send the frontend lang in a cookie or query string.

@JamesNK JamesNK merged commit f7a006b into main Nov 29, 2024
9 checks passed
@JamesNK JamesNK deleted the jamesnk/consolelogs-commands branch November 29, 2024 00:21
@github-actions github-actions bot locked and limited conversation to collaborators Dec 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run Resource Commands from Console Logs Page

3 participants