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

Adding "splash" screen [feature] #218

Open
giliredbaron opened this issue May 21, 2019 · 20 comments
Open

Adding "splash" screen [feature] #218

giliredbaron opened this issue May 21, 2019 · 20 comments

Comments

@giliredbaron
Copy link

Can be nice to have the ability to put some text in the empty output place before running the actual script.
This can be like a splash screen for every task.
I find it useful because it can show the current state of service/task before running the script server.

Screen Shot 2019-05-21 at 16 13 34

@giliredbaron giliredbaron changed the title [feature] Adding "splash" screen Adding "splash" screen [feature] May 21, 2019
@bugy
Copy link
Owner

bugy commented May 21, 2019

Hi @giliredbaron, thanks for the idea! Do you have a proposal what image/text could be there?

@bugy bugy added the feature label May 21, 2019
@giliredbaron
Copy link
Author

One option is a script output.
Second is to read it from a file.

The purpose of this was born when we run some script that makes some change.
Before we run this script (from our script server) we have a look at some other screen (web page, monitoring stuff) and take action according to it.
My thought was, to use the same tool, script server, to both, create a change, and watch the state.

Gili

@bugy
Copy link
Owner

bugy commented May 21, 2019

Hi Gili, thanks for the explanation. So you mean it could be some pre-script, which is executed each time, when a user opens a page. Is it correct?

@giliredbaron
Copy link
Author

Correct...! :)

@lokeshkh92
Copy link

hi @bugy / @giliredbaron , how can we implement this pre-script ?
can you please point me to the documentation if it's documented, or else can you please let me know here?

@bugy
Copy link
Owner

bugy commented Jun 9, 2021 via email

@bugy bugy added this to the 1.18.0 milestone Sep 3, 2021
@bugy
Copy link
Owner

bugy commented Oct 20, 2022

@lokeshkh92 @giliredbaron @MNeill73
Do you think that for your use cases, generating dynamic description (above parameters section) would be enough?
Or do you need almost the full screen?

@MNeill73
Copy link

In theory this would work.

In my head, I'm pondering having one of my report scripts tee the output into a defined static file whenever it runs, so that current status report would be shown as the first thing when a user logs in to "do things" with the environment management system running inside this instance of script-server.

The script isn't super intensive, so either one of "running a script", or "rendering a file contents", would work for my use case. Said contents would be HTML, though, so I'd either need the main window contents to accept HTML, or I'd need to preprocess the HTML table through lynx when I save it.

@bugy
Copy link
Owner

bugy commented Mar 10, 2023

Done, now it's possible to configure preload script (only via json, as this is a preview feature).
Example:

  "preload_script": {
    "script": "echo 'This is a <b>preload</b> script showing some info.</br>'",
    "output_format": "html"
  }

output_format is optional, it's the same as output format in normal configuration

bugy added a commit that referenced this issue Mar 10, 2023
@MNeill73
Copy link

MNeill73 commented Mar 10, 2023 via email

@bugy
Copy link
Owner

bugy commented Mar 10, 2023 via email

@MNeill73
Copy link

MNeill73 commented Mar 14, 2023 via email

@bugy
Copy link
Owner

bugy commented Mar 14, 2023

Do you see anything in logs/server.log?
Also, you might need to reload UI cache, smth like ctrl+R in browser

@MNeill73
Copy link

MNeill73 commented Mar 14, 2023 via email

@bugy
Copy link
Owner

bugy commented Mar 15, 2023

Oh, @MNeill73 I just noticed it, this preload script should be specified per script (see the first comment in this ticket)

@MNeill73
Copy link

MNeill73 commented Mar 15, 2023 via email

@bugy
Copy link
Owner

bugy commented Mar 16, 2023

Hi, @MNeill73 unfortunately this is a completely separate feature. And with a quite big backlog, I won't give priority to it (since noone else requested to it).
I'll move it to a separate ticket.

@chellige
Copy link

chellige commented Apr 30, 2023

This looks like the perfect solution for what I'm after however it's not working for me.
I'm running script-server v1.17.1

I created the following script:
$ cat Hello_World.json

{
"name": "Hello World",
"script_path": "/bin/echo",
"group": "TEST",
"requires_terminal": false,
"output_format": "text",
"preload_script": {
"script": "echo 'This is a preload script showing some info.
'",
"output_format": "html"
},
"parameters": [
{
"name": "Who do you want to say hello to?",
"param": "Hello ",
"same_arg_param": true,
"type": "text",
"default": "World"
}
]
}

I restarted the script-server and cleared all browser history. Only log entry was
2023-04-30 14:25:56,067 [tornado.access.INFO] 101 GET /scripts/Hello%20World?initWithValues=false (127.0.0.1) 0.92ms

Can you tell me where I went wrong.

Thank you

@bugy
Copy link
Owner

bugy commented Apr 30, 2023

You have to use dev version for it.

@chellige
Copy link

That worked. Thanks for all you do!

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

5 participants