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

Include image in the terminal output (log_panel) #370

Closed
poloh11 opened this issue Nov 17, 2020 · 7 comments
Closed

Include image in the terminal output (log_panel) #370

poloh11 opened this issue Nov 17, 2020 · 7 comments

Comments

@poloh11
Copy link

poloh11 commented Nov 17, 2020

Hi,
Thanks for this great tool !
For my use it would be even more incredible if I could include an image in the terminal output.
I mean, display an image in script execution and history from web url or sever location.
By looking around the code, I found

setInlineImage(output_path, download_url) {
        this.inlineImages[output_path] = download_url;
        this._notify_inline_image_change(output_path)
}

in file script-server/web-src/src/common/components/terminal/terminal_model.js
So I assume that you created the functionality. But how to use it from my script ? I there a specific syntax to use ?
Thank you so much
Paul

@bugy
Copy link
Owner

bugy commented Nov 17, 2020

Hi Paul, please check this comment:
#231 (comment)

@bugy bugy added the question label Nov 17, 2020
@poloh11
Copy link
Author

poloh11 commented Nov 17, 2020

Thanks bugy, I managed to make it work on live execution. But it do not display image in history right ?

@bugy
Copy link
Owner

bugy commented Nov 17, 2020 via email

@mueller-webservice
Copy link

Sry for asking this, but I can not determine where to put the config snippet to achieve this. Would you be so kind to tell me?

@bugy
Copy link
Owner

bugy commented Nov 30, 2020

@sir-Max you have to put it into script configuration:
my_script.json:

{
  "name": "My script",
  "script_path": "scripts/my_script.sh",
  "output_files": [
	{
             "type": "inline-image",
             "path": "##any_path/[0-9]{8}.png#"
        }
  ]
}

@mueller-webservice
Copy link

Thanks, that worked (at least with an absolute path in it). Is "##any_path/[0-9]{8}.png#" some kind of regex for matching a printed output? I can not get it to match any dynamically generated images.

But it is not urgent since I can just use a fixed path and name for my use case.

@bugy
Copy link
Owner

bugy commented Nov 30, 2020

@sir-Max exactly, this is a regex for printed output, you can read more here: https://github.com/bugy/script-server/wiki/Script-config#output_files

@bugy bugy added the resolved label Apr 5, 2021
@bugy bugy closed this as completed Apr 5, 2021
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

3 participants