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

Allow arbitrary actions for menu items #140

Open
bdw429s opened this issue Aug 8, 2018 · 3 comments
Open

Allow arbitrary actions for menu items #140

bdw429s opened this issue Aug 8, 2018 · 3 comments

Comments

@bdw429s
Copy link
Member

bdw429s commented Aug 8, 2018

It would be cool to provide a command line to execute for a menu item. Either a box command option (I'd likely need to provide the full path to the binary to runwar) or any OS command that a user wanted to configure. This could be anything ranging from a git pull on the web root to a grunt build or a cmd box server log --follow (open a console) or calc.exe (why not, right? :) ).

I think the main question would be how to handle the output of that process, Do we

  • Ignore any output and simply tell the user when it completes
  • Find a method of showing the user the output which could be tricky given the underlying Java UI libs in use
  • Open the command in a terminal window native to that machine. Obviously, the command may not be a terminal command like if you wanted a button that opened calc.exe

Even if we just do a simple implementation of this at the moment, we could tie it up to a process builder and let people get funky with custom menu items to see what they build. I asked for feedback in CFML Slack and I got a lot of interesting ideas people wanted to be able to do such as starting a server with another CF engine and importing CFConfig files. Most of the ideas would require some arbitrary command execution.

@denuno
Copy link
Member

denuno commented Aug 14, 2018

I've got a rough implementation of this that uses a process builder and a dialog window with scroll bars for results. It'd be easy enough to let the user control what happens with the output. Maybe have a output="dialog" or output="/file/path" or output="/dev/null" type of deal? We'll let them set the working directory as well. I think that'd be pretty good and cover most uses.

Looks like this now:
{"label":"Run ls", "action":"run", "image":"resources/dialog-information.png","command":"ls -altr"}

@bdw429s
Copy link
Member Author

bdw429s commented Aug 14, 2018

I'll likely default the working directory to the web root, but we can allow the user to set it if they need. Regarding output, the two most common uses are probably none and dialog. What if a user opens something like calc.exe. Will that process stay tied to the Java server so if they stopped the server, calc would close? Just curious what the relationship would be for launching an unrelated program. A better example would be something like VSCode. I could see people wanting to launch their web root in their IDE/editor like VSCode and then later restarting the server but they wouldn't expect VSCode to die. Maybe we need to have a background option for just launch and forget kind of stuff.

I think I might also support a mode to run a box command of their choice in the directory of the server, but I can take care of determining the location of the box binary on my own and just passing it all to you combined with the commands they want.

@bdw429s
Copy link
Member Author

bdw429s commented Aug 31, 2018

@denuno Did you see my question about whether the process will be tied to the server or in the background? I've already had people ask about doing the VSCode sort of scenario where they want to fire up an IDE from their tray menu and they want it to be totally detached from the server so if the server gets stopped, the IDE doesn't close.

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

No branches or pull requests

2 participants