From: Nick J. <ni...@na...> - 2001-06-09 18:56:27
|
Hello everyone, I have been looking at the webmin code for several days trying to grok it. There is no documentation on it that I can find, the comments in the code are sparse (to say the least), and even the variable and function names are not at all "self-documenting". In a short amount of time I need to change, significantly, some core things in webmin. Even so much as changing the way the HTML is printed is a task that requires extensive code manipulation, and all of the HTML is embedded in the code, rather thoroughly, and there are several function calls to other pieces of code, from other files,that make up certain parts of the HTML. None of this is documented and I can't figure out what these functions are doing, why they are needed etc. Has anyone else attempted something like this and ran into these problems? It seems like it is extremely difficult to reuse any code. Even within themes entire cgi's have to be rewritten to behave differently and print HTML out differently. Are there any plans for an HTML Templating system? More flexible framework? Is there any technical Documentation? Anyone have any words of wisdom? Any comments apprectiated. -- Nick Jennings |
From: Joe C. <jo...@sw...> - 2001-06-09 19:19:25
|
Read the fine manual, Nick. (Not the one I wrote...the developer docs written by Jamie. They're linked right from the main Webmin page, and while they tend to lag one or two releases behind, they are a great source of information about general Webmin development and the routines you have at your disposal.) I've found Webmin to be /very/ easy to customize...and I'm perl sub-literate (I can't read it and I can barely write it). I'll conced that Webmin could be more modular (at the code level...not referring to allowing third party modules). I have found that sometimes, rather than calling a routine from Jamies modules, I have to just rip it out and paste it into my own modules... Having been involved with Webmin since the early .7x versions, I can say that it does seem to be getting more modular...more function oriented, rather than put all the code in the order that it happens. But, all that being said, I have to say something about looking a gift horse in the mouth. Webmin is the best thing going, by a long shot...ever tried writing a module for LinuxConf? Anyway, I think the number of third party modules (and the number of proprietary products based on it) will attest to the fact that you are not in the majority in thinking it's hard to understand or modify. Maybe you just don't like Perl? (And understandable position...I find it rather confusing, myself, but as Perl goes, Webmin is a great example of readable code.) Nick Jennings wrote: > Hello everyone, > > I have been looking at the webmin code for several days trying to grok > it. There is no documentation on it that I can find, the comments in the > code are sparse (to say the least), and even the variable and function > names are not at all "self-documenting". > > In a short amount of time I need to change, significantly, some core > things in webmin. Even so much as changing the way the HTML is printed > is a task that requires extensive code manipulation, and all of the HTML > is embedded in the code, rather thoroughly, and there are several function > calls to other pieces of code, from other files,that make up certain > parts of the HTML. None of this is documented and I can't figure out > what these functions are doing, why they are needed etc. > > Has anyone else attempted something like this and ran into these problems? > It seems like it is extremely difficult to reuse any code. Even within > themes entire cgi's have to be rewritten to behave differently and print > HTML out differently. > > Are there any plans for an HTML Templating system? More flexible framework? > Is there any technical Documentation? Anyone have any words of wisdom? > > Any comments apprectiated. > > -- -- Joe Cooper <jo...@sw...> Affordable Web Caching Proxy Appliances http://www.swelltech.com |
From: Nick J. <ni...@na...> - 2001-06-09 19:38:19
|
Joe, I believe the fine manual you are referring to is in regards to writing a webmin module. This documentation is great, if all I wanted to do was write a webmin module. That's not all I need to do, and that isn't what I am having trouble with. I have several years of perl experience and have developed and contributed to several open source projects using my perl skills, so I don't think that is the issue either. Those docs don't cover "webmin development" as you say, they convert developing webmin modules, there is a very drastic difference. What I am trying to do is change the webmin framework. (i.e. the stuff before the modules are called). There is no documentation on the layout of webmin (e.g. filenames & their functions, the full process from webmin being started (via. miniserv.pl) to webmin display and managing its modules. the "themes" in webmin are pretty much a complete hack in my opinion, your basically copying the webmin code into a different directory and then recoding it to do what you want. Theres no code reuse at all, if the main webmin index.cgi is updated in a future release, those changes have to be interpreted into however the "theme" was modified, and it's just a mess. The directory structure contains modules, themes, and core level directories all together.. the category tabs are hard coded etc. I realize allot of the in-flexibility is due to the attempt at a cohesive internationalization method, but I think things could be design in a way that still allows flexibility and code re-use. I am not trying to just gripe out webmin's shortcomings, that isn't why I subscribed to this list. I would like help, direction, advice, documentation anything to help me do what I need to do, which is modify the core workings of webmin to allow me to do things that currently you just can't do. I think this is a key reason why there aren't hardly any webmin themes at all. You basically have to sit a recode the core handling of webmin's index.cgi in order to make a theme, and all of the HTML is embedded in the code instead of in templates. On Sat, Jun 09, 2001 at 02:29:00PM -0500, Joe Cooper wrote: > Read the fine manual, Nick. (Not the one I wrote...the developer docs > written by Jamie. They're linked right from the main Webmin page, and > while they tend to lag one or two releases behind, they are a great > source of information about general Webmin development and the routines > you have at your disposal.) > > I've found Webmin to be /very/ easy to customize...and I'm perl > sub-literate (I can't read it and I can barely write it). > > I'll conced that Webmin could be more modular (at the code level...not > referring to allowing third party modules). I have found that > sometimes, rather than calling a routine from Jamies modules, I have to > just rip it out and paste it into my own modules... > > Having been involved with Webmin since the early .7x versions, I can say > that it does seem to be getting more modular...more function oriented, > rather than put all the code in the order that it happens. > > But, all that being said, I have to say something about looking a gift > horse in the mouth. Webmin is the best thing going, by a long > shot...ever tried writing a module for LinuxConf? > > Anyway, I think the number of third party modules (and the number of > proprietary products based on it) will attest to the fact that you are > not in the majority in thinking it's hard to understand or modify. > Maybe you just don't like Perl? (And understandable position...I find > it rather confusing, myself, but as Perl goes, Webmin is a great example > of readable code.) > > Nick Jennings wrote: > > > Hello everyone, > > > > I have been looking at the webmin code for several days trying to grok > > it. There is no documentation on it that I can find, the comments in the > > code are sparse (to say the least), and even the variable and function > > names are not at all "self-documenting". > > > > In a short amount of time I need to change, significantly, some core > > things in webmin. Even so much as changing the way the HTML is printed > > is a task that requires extensive code manipulation, and all of the HTML > > is embedded in the code, rather thoroughly, and there are several function > > calls to other pieces of code, from other files,that make up certain > > parts of the HTML. None of this is documented and I can't figure out > > what these functions are doing, why they are needed etc. > > > > Has anyone else attempted something like this and ran into these problems? > > It seems like it is extremely difficult to reuse any code. Even within > > themes entire cgi's have to be rewritten to behave differently and print > > HTML out differently. > > > > Are there any plans for an HTML Templating system? More flexible framework? > > Is there any technical Documentation? Anyone have any words of wisdom? > > > > Any comments apprectiated. > > > > > > > > -- > > -- > Joe Cooper <jo...@sw...> > Affordable Web Caching Proxy Appliances > http://www.swelltech.com > > > - > Forwarded by the Webmin development list at web...@we... > To remove yourself from this list, go to > http://lists.sourceforge.net/lists/listinfo/webadmin-devel > -- Nick Jennings |
From: Joe C. <jo...@sw...> - 2001-06-09 20:13:35
|
I get your gist now, and you're right. Themes in Webmin are new (they just arrived three releases back) and pretty rough around the edges. I have made a theme myself, but it is primarily the default with all new icons (absolutely gorgeous icons--it makes all the difference in the world ;-). I'm guessing Jamie is sympathetic, and would be willing to listen to reason in this area...He's done at least one theme for a proprietary company in the past, so I reckon he knows the difficulties of it. I must admit there are some things I'd like to see made easier about theming. Interestingly, one of the first projects in Webmin I embarked on, was making Webmin themable--luckily, Jamie came out with a themable version less than a week after I started hacking on it. It's a bigger task than it seems...especially since Webmin wasn't designed to be themable from the beginning. That being said, perhaps all of the folks who are doing Webmin themes (and there are at least a few), should get together and help Jamie bring Webmin page templating, or something similar, to life. I'd like to see it, and would be happy to help make it happen. (We just have to be careful not to volunteer Jamie into doing more work than he already does! ;-) We could at least get the HTML out of the code, and into UI modules where it belongs. But I still contend that even in the area of themes, Webmin isn't all that bad. Nick Jennings wrote: > Joe, I believe the fine manual you are referring to is in regards to > writing a webmin module. This documentation is great, if all I wanted > to do was write a webmin module. That's not all I need to do, and that > isn't what I am having trouble with. I have several years of perl experience > and have developed and contributed to several open source projects using > my perl skills, so I don't think that is the issue either. > > Those docs don't cover "webmin development" as you say, they convert > developing webmin modules, there is a very drastic difference. > > What I am trying to do is change the webmin framework. (i.e. the stuff > before the modules are called). There is no documentation on the layout > of webmin (e.g. filenames & their functions, the full process from > webmin being started (via. miniserv.pl) to webmin display and managing > its modules. > > the "themes" in webmin are pretty much a complete hack in my opinion, your > basically copying the webmin code into a different directory and then > recoding it to do what you want. Theres no code reuse at all, if the main > webmin index.cgi is updated in a future release, those changes have to be > interpreted into however the "theme" was modified, and it's just a mess. > > The directory structure contains modules, themes, and core level directories > all together.. the category tabs are hard coded etc. > > I realize allot of the in-flexibility is due to the attempt at a cohesive > internationalization method, but I think things could be design in a > way that still allows flexibility and code re-use. > > I am not trying to just gripe out webmin's shortcomings, that isn't why > I subscribed to this list. I would like help, direction, advice, documentation > anything to help me do what I need to do, which is modify the core workings > of webmin to allow me to do things that currently you just can't do. > > I think this is a key reason why there aren't hardly any webmin themes at > all. You basically have to sit a recode the core handling of webmin's > index.cgi in order to make a theme, and all of the HTML is embedded in > the code instead of in templates. -- Joe Cooper <jo...@sw...> Affordable Web Caching Proxy Appliances http://www.swelltech.com |
From: Jamie C. <jca...@we...> - 2001-06-11 02:23:51
|
Nick Jennings wrote: > > Hello everyone, > > I have been looking at the webmin code for several days trying to grok > it. There is no documentation on it that I can find, the comments in the > code are sparse (to say the least), and even the variable and function > names are not at all "self-documenting". > > In a short amount of time I need to change, significantly, some core > things in webmin. Even so much as changing the way the HTML is printed > is a task that requires extensive code manipulation, and all of the HTML > is embedded in the code, rather thoroughly, and there are several function > calls to other pieces of code, from other files,that make up certain > parts of the HTML. None of this is documented and I can't figure out > what these functions are doing, why they are needed etc. > > Has anyone else attempted something like this and ran into these problems? > It seems like it is extremely difficult to reuse any code. Even within > themes entire cgi's have to be rewritten to behave differently and print > HTML out differently. > > Are there any plans for an HTML Templating system? More flexible framework? > Is there any technical Documentation? Anyone have any words of wisdom? > > Any comments apprectiated. You're right, changing the format of the HTML output by webmin is quite difficult - basically, you have to change the CGI programs themselves. The themes support was mainly designed for changing images and colours, not so much for the replacement of the actual programs. The only solution to this would be to move all the HTML from the CGI programs into separate template HTML files, which could then be modified by themes. However, this would be a massive task as every single CGI would need to be modified .. unless someone can suggest a clever shortcut or automated way of doing it? - Jamie |
From: Bryan D. <br...@bc...> - 2001-06-11 04:38:29
|
> However, this would be a massive task as every single CGI would > need to be modified .. unless someone can suggest a clever shortcut or > automated way of doing it? what about a webmin2XML gateway of sorts??? Sure would be nicer than just HTML templates... Bryan |
From: Nick J. <ni...@na...> - 2001-06-11 20:21:37
|
On Mon, Jun 11, 2001 at 12:45:43AM +0000, Bryan Dumm wrote: > > However, this would be a massive task as every single CGI would > > need to be modified .. unless someone can suggest a clever shortcut or > > automated way of doing it? > > what about a webmin2XML gateway of sorts??? I don't follow, could you explain further? Perhaps give an example? > > Sure would be nicer than just HTML templates... > > Bryan > > - > Forwarded by the Webmin development list at web...@we... > To remove yourself from this list, go to > http://lists.sourceforge.net/lists/listinfo/webadmin-devel > -- Nick Jennings |
From: Nick J. <ni...@na...> - 2001-06-11 20:32:36
|
On Mon, Jun 11, 2001 at 12:27:50PM +1000, Jamie Cameron wrote: > > You're right, changing the format of the HTML output by webmin is quite > difficult - basically, you have to change the CGI programs themselves. > The themes support was mainly designed for changing images and colours, > not so much for the replacement of the actual programs. > > The only solution to this would be to move all the HTML from the CGI programs > into separate template HTML files, which could then be modified by themes. > However, this would be a massive task as every single CGI would need > to be modified .. unless someone can suggest a clever shortcut or automated > way of doing it? I think alot of aspects of the code should be redesigned. Are you willing to put effort into this? or are you pretty happy just supporting the current code? Is this an open development project or do all patches go through you? -- Nick Jennings |
From: Jamie C. <jca...@we...> - 2001-06-12 03:12:52
|
Nick Jennings wrote: > > On Mon, Jun 11, 2001 at 12:27:50PM +1000, Jamie Cameron wrote: > > > > You're right, changing the format of the HTML output by webmin is quite > > difficult - basically, you have to change the CGI programs themselves. > > The themes support was mainly designed for changing images and colours, > > not so much for the replacement of the actual programs. > > > > The only solution to this would be to move all the HTML from the CGI programs > > into separate template HTML files, which could then be modified by themes. > > However, this would be a massive task as every single CGI would need > > to be modified .. unless someone can suggest a clever shortcut or automated > > way of doing it? > > I think alot of aspects of the code should be redesigned. Are you willing > to put effort into this? or are you pretty happy just supporting the > current code? Definately, if it is worth the effort. Up till now I have been focusing on adding new features and modules rather than major re-designs .. However, maybe the time for a re-design of some key features has come. > Is this an open development project or do all patches go through you? All the patches go through me. - Jamie |
From: Nick J. <ni...@na...> - 2001-06-12 19:10:09
|
On Tue, Jun 12, 2001 at 01:17:02PM +1000, Jamie Cameron wrote: > Nick Jennings wrote: > > > > I think alot of aspects of the code should be redesigned. Are you willing > > to put effort into this? or are you pretty happy just supporting the > > current code? > > Definately, if it is worth the effort. Up till now I have been focusing > on adding new features and modules rather than major re-designs .. However, > maybe the time for a re-design of some key features has come. The problem I am having, is that the code is almost completely uncommented. Also, I am not used to the style of programming you use, syntax and variable names, as well as the global variables etc. (pollution of namespace from 'required' scripts etc.) Is there any documentation covering the way the core of webmin works? How each script interacts from init (via miniserv) on through to when it's displaying modules in the index.cgi ? > > Is this an open development project or do all patches go through you? > > All the patches go through me. Ok. If I have any, I will post to the list then. -- Nick Jennings |
From: Jamie C. <jca...@we...> - 2001-06-14 01:55:58
|
Nick Jennings wrote: > > On Tue, Jun 12, 2001 at 01:17:02PM +1000, Jamie Cameron wrote: > > Nick Jennings wrote: > > > > > > I think alot of aspects of the code should be redesigned. Are you willing > > > to put effort into this? or are you pretty happy just supporting the > > > current code? > > > > Definately, if it is worth the effort. Up till now I have been focusing > > on adding new features and modules rather than major re-designs .. However, > > maybe the time for a re-design of some key features has come. > > The problem I am having, is that the code is almost completely uncommented. > Also, I am not used to the style of programming you use, syntax and > variable names, as well as the global variables etc. (pollution of namespace > from 'required' scripts etc.) > > Is there any documentation covering the way the core of webmin works? How > each script interacts from init (via miniserv) on through to when it's > displaying modules in the index.cgi ? There's no documentation like that, but I could provide some info if you have some questions. Basically, miniserv is just a normal webserver and the webmin programs are just perl CGIs.. - Jamie |