Re: Cross-platform GUI for UNIX based scripts
by RichardK (Parson) on May 23, 2013 at 13:46 UTC
|
What about turning it into a web app using one of the many frameworks? Then you don't have to care what platform the users are on, as long as they've got a browser.
I'd use Mojolicious, Mojolicious::Lite is a really nice, simple and quick way to get started, but there are lots of other frameworks you could try.
| [reply] |
|
So the app would be on a user specified server to which the webpage would connect to? Seems like something very easy to do if I understand correctly.
| [reply] |
|
| [reply] |
|
|
Re: Cross-platform GUI for UNIX based scripts
by LanX (Saint) on May 23, 2013 at 13:35 UTC
|
Depends... Tk (or a web-app) are the usual suspect...
... but if I understand your requirements right, you should consider using curses to have quick and efficient results.
It's a TUI¹ not a GUI, which should be sufficient for you. (see Curses::UI)
Like this you only need a terminal emulation on Win or Mac.
And you can reconnect to long running sessions thru Putty and even automate the connection.
Just spares yourself of the headaches of ...
- portability and
- access control,
- HTML templates,
- Ajax protocol
- synchronizing client and server updates
- user complaining about ugly Tk design...
my 2¢...
Cheers Rolf
( addicted to the Perl Programming Language)
¹) Text User Interface which approaches the features of a GUI | [reply] |
|
Hm might be the easiest way, thanks. People really love fancy GUIs though and few share my love to command lines.
| [reply] |
|
> People really love fancy GUIs though and few share my love to command lines.
You didn't give us much information about the context.
TUIs are semantically not much different from GUIs, it's just the optics and Tk is nowadays far from common taste, especially when confronted with Win/Mac folks.
Anyway the other client/server approaches will produce overhead, if you need to duplicate features which are already provided by ssh/putty.
For instance "user authentication":
- Does security matter?
- Who's allowed to use/connect to your web-app?
- Who's account is used to start your process?
- Who is in charge for necessary port forwardings?
- and so on ...
Maybe your use case is plain vanilla and security doesn't matter!
But better be sure of the features needed when replacing ssh/putty as a tool and the amount of time you are able to invest.
I've seen too many badly maintained GUI's/ web-apps because the amount of work to keep everything up to date was underestimated.
Cheers Rolf
( addicted to the Perl Programming Language)
| [reply] |
|
Re: Cross-platform GUI for UNIX based scripts
by taint (Chaplain) on May 23, 2013 at 13:16 UTC
|
Greetings,
No disrespect intended, but generally speaking, the *NIX crowd tend to be pretty savvy
when it comes to "tech stuff". That said, if you have any experience in Perl, you might
want to look into the tk, or gtk Perl bindings/toolkits. Basically put; they allow you
to incorporate buttons, and other widgets into your Perl applications, that will run
on other platforms easily. It would also be worth looking into using CGI. There a massive
collection of freely available modules that provide the "progress-bars" you noted, as well as Jason.
Simply running a search on CPAN for
http://search.cpan.org/search?query=tk&mode=all tk. Provided a few hundred possibilies.
http://search.cpan.org/search?query=gtk&mode=all gtk, gave much the same.
HTH
--chris
#!/usr/bin/perl -Tw
use perl::always;
my perl_version = "5.12.4";
print $perl_version;
| [reply] |
|
Thanks Chris I will have a look. The majority of the people who will use it are windows based with no experience of UNIX. They haven't even used putty before which makes it a bit of a headache for me.
| [reply] |
Re: Cross-platform GUI for UNIX based scripts
by Zzenmonk (Sexton) on May 24, 2013 at 07:15 UTC
|
Hi,
All the above are pertinent for your problem. The solution you choose depend on the user population you address. I am realizing tailor made application for companies and chose the web-application solution.
Depending on the user population I use JavaScript to improve the user experience. If the user population is made of professionals I validate the data only on the server and do not use JavaScript for this purpose. This lowers the development costs.
My solutions base on:
- Apache web server (available also for windows)
- Apache mod_perl if I need performance is required (probably not your case)
- HTTPS for security if required
- PERL or Strawberry PERL for windows
- CGI::Session module for user authentication
- CGI.pm to support the development of the application.
- CSS for the page layout.
- JavaScript for a high conviviality
A good part of my web-app page set up is listed here http://www.perlmonks.org/?node_id=1029920.
The back end of you application can be provided either by the PERL native functions, various PERL modules (i.e. File::Copy) or by the PERL system() instruction (watch your steps with this!).
Hope it helps
K
The best medicine against depression is a cold beer!
| [reply] |
|
After reading all the comments I am straying towards your solution as I have experience in web design.
The server I am currently working on is a secure, proxied one. In your approach do you create a webpage on the server that users connect to through their desktop browser (providing the password etc. if needed)?
I was thinking about a website that initiates the software after which the user can log off. When logging back the user can see the progress or if the process is done, the results. I don't think it would be difficult to set up?
Thanks for your advice, it's really helpful.
| [reply] |
|
Hi
First notice that my solution need a higher development effort than some other listed here. I would recommend to create the web app on an other server for security reasons. You should have a look at the SSL modules on CPAN to pass the UNIX command to the target server.
I would authenticate the user to the web app with CGI::session and use an PK system to authenticate the web-app to the target server. Eventually jail the account you are using on the target server. Keep the validity time of the cookies of CGI::session short to avoid session theft as far as possible.
Once the user is authenticated I would prepare the UNIX command on the web-app server and pass it to the UNIX server with SSH. If you build a good system (i.e. PERL best practice!) you will be able to reuse the web-app for several UNIX servers.
PS: Never assume a user will log out. Keep the validity of the session short. I use for example 10 minutes for a login screen.
K
The best medicine against depression is a cold beer!
| [reply] |
|
Re: Cross-platform GUI for UNIX based scripts
by karlgoethebier (Abbot) on May 24, 2013 at 14:11 UTC
|
«Any ideas are welcome»
OK, if so - and you want that your GUI looks really cool, please take a look at Flex as well as ActionScript.
IMHO this stuff has some benefits:
- Very easy handling of that asynchronous HTTP stuff
- Nice data binding concept
- ActionScript is how JavaScript should be: typification, class keyword, no need to use prototype. It is a nice language.
- Each class you create can have two incarnations: (M)XML and ActionScript code. This goes far beyond that "MarkUp for the Visual Things/Code For The Logic" approach. You can very easily do something similar to Code-Behind.
- If you do this and then think about doing some "micro MVC" stuff, things become interesting. Do the basic layout in MXML. Write your classes in ActionScript, based on <s:Group>. E.g. one containing a button, another a data grid for displaying your data and one with some of the XML list objects of Flex for the data and a http service for the fetch as a kind of delegate. A group doesn't listen for any events by default. edit: Bullshit, forgot my own cheated stuff ;-(
So overwrite the built-in event dispatcher class see example below, define your custom events , build the listeners and the corresponding handlers, instantiate your AS classes as MXML and the fun begins...
(Simplified, i know...)
edit: Example:
The price you have to pay for this: it's Shockwave/Flash :-(
OK, nobody is perfect.
You can do this stuff using vi or emacs or better use FlashBuilder, a tool based on Eclipse. Some free GUIs are around - i didn' use them yet.
Best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
| [reply] [d/l] [select] |
|
Hm nice idea. I was once developing within a group that created all the visual side in Flex. It does not seem to dfficult to learn. Thanks for the idea
| [reply] |
|
| [reply] |
Re: Cross-platform GUI for UNIX based scripts
by sam_bakki (Pilgrim) on May 27, 2013 at 11:55 UTC
|
Hi
If you AIM for perl based cross platform GUI, Go for GTK. You can develop GUI in GTK Glade GUI builder and only write call backs in perl (Kind of VB approach). I develop many perl based GUI in Perl GTK+, The great http://www.sisyphusion.tk/ repo has perl GTK PPMs for Windows too.
For code examples and screen shots have a look at http://code.google.com/p/saaral-soft-search-spider/
| [reply] [d/l] |
|
Thanks, will have a look as well. Great ideas guys.
| [reply] |