BackupPC-users

Re: [BackupPC-users] Smarter CGI

2011-05-17 12:32:37
Subject: Re: [BackupPC-users] Smarter CGI
From: Bowie Bailey <Bowie_Bailey AT BUC DOT com>
To: backuppc-users AT lists.sourceforge DOT net
Date: Tue, 17 May 2011 12:30:31 -0400
On 5/17/2011 12:11 PM, Timothy J Massey wrote:
> 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.

Only the CGI code would need to change in this case.  You are not
storing anything different in the config file, you are just changing how
the information is displayed in the CGI interface.

> 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.

It would be nice for readability to have readable labels in the config
file rather than just the numerical codes, but it is not really
necessary.  And this *would* need modifications in all of the code.

> 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.

Agreed, but since this is not available to the general public yet, the
OP will need to work with the current version if he wants the changes to
take effect now.

-- 
Bowie

------------------------------------------------------------------------------
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>