BackupPC-users

Re: [BackupPC-users] Smarter CGI

2011-05-17 12:17:27
Subject: Re: [BackupPC-users] Smarter CGI
From: Timothy J Massey <tmassey AT obscorp DOT com>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Tue, 17 May 2011 12:11:58 -0400
Bowie Bailey <Bowie_Bailey AT BUC DOT com> wrote on 05/17/2011 12:05:15 PM:

> > Lastly, for various fields throughout the CGI, I would like to
> make them drop down menu's with pre-populated options. For instance,
> BackupsDisable, i would like the menu to show the "Disabled, Manual
> Only and Never Backup" but to carry the corresponding values (0, 1 ,
> 2) Any guidance would be very much appreciated as i am new to perl
> and BackupPC. Thanks.
>
> This should be simply a matter of changing the type of html field being
> used to collect the data.  Theoretically, all you would have to do is
> find the spot in the code where it generates the config screen and
> change it there.  Of course, I'm not familiar with the code, so it is
> possible there is something else involved.

That would be a very nice addition.  And it's true that 'all you'd have to do' is change the HTML used for those fields from a text box to a drop-down box with the proper cosmetic and functional labels.

HOWEVER, you have also just created a rather larger maintenance burden.  You will now have to change the handling of this in multiple places throughout the code:  in the actual code and in the CGI code.

So, a straightforward "hack the CGI code to show the right labels" is just that:  a straightforward hack.  Better might be to restructure the code such that the labels are stored in the configuration file (or some other common location) and the CGI pulls them from there.

Given that Craig is working on a significant rewrite for BackupPC 4.0, this may be something that would be best worked on there, while major things are changing anyway.  Also, the new system will use (require?) a database, so there's an even more logical place to stick the information.  Craig, is this something you have any thoughts on?

For the record, I'm with the original poster:  it'd be *very* nice to have.  I have to click on the documentation link every time I wan to use BackupsDisable myself!  :)  But I also understand the maintenance side, too...

Timothy J. Massey
 
Out of the Box Solutions, Inc.
Creative IT Solutions Made Simple!

http://www.OutOfTheBoxSolutions.com
tmassey AT obscorp DOT com
      22108 Harper Ave.
St. Clair Shores, MI 48080
Office: (800)750-4OBS (4627)
Cell: (586)945-8796

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/
<Prev in Thread] Current Thread [Next in Thread>