opennetadmin / ona

OpenNetAdmin IP Address Management (IPAM) system
opennetadmin.com
GNU General Public License v2.0
137 stars 35 forks source link

rack-maint reverse numbering order #45

Closed paulwollner closed 11 years ago

paulwollner commented 11 years ago

When using the rack-maint plugin, the racks are always numbered from from top to bottom.

It would be nice to have the ability to set the ordering on a per rack basis

paulwollner commented 11 years ago

Patch below addresses this feature

diff -Nu rack2/README.md rack1/README.md --- rack2/README.md 2013-04-16 10:15:34.095250000 +0200 +++ rack1/README.md 2013-04-16 10:13:27.889364000 +0200 @@ -35,7 +35,7 @@ Future

diff -Nu rack2/install.sql rack1/install.sql --- rack2/install.sql 2013-04-16 10:14:44.205831000 +0200 +++ rack1/install.sql 2013-04-16 10:14:39.410680000 +0200 @@ -4,6 +4,7 @@ name varchar(64) NOT NULL, description varchar(255) NOT NULL, size int(10) NOT NULL COMMENT 'How many U are in this rack',

@@ -317,6 +317,7 @@ size=INT Size of rack in units description=STRING Description location=STRING|id Location of rack

@@ -597,7 +604,7 @@ $options['alt_name'] = ''; }

@@ -1356,6 +1379,19 @@

     <tr>

@@ -2164,11 +2201,18 @@ EOL;

diff -Nu rack2/upgrade-1.0-1.1.sql rack1/upgrade-1.0-1.1.sql --- rack2/upgrade-1.0-1.1.sql 1970-01-01 02:00:00.000000000 +0200 +++ rack1/upgrade-1.0-1.1.sql 2013-04-16 10:14:39.415676000 +0200 @@ -0,0 +1,2 @@ + +ALTER TABLE racks ADD numbering ENUM( 'DESC', 'ASC' ) NOT NULL DEFAULT 'DESC' COMMENT 'Direction of rack numbering';

bpothier commented 11 years ago

Thank you for the patch! Unfortunately, GitHub parsed it for you... I was able to manually unparse most of it, but some of the embedded HTML markup got more munged than I could unmunge.. :( I think if you put 3 back quotes (```) at the top & bottom of your patch/post, GH will display it as-is. Also, do you need to update the $version in plugin_info.php as well? Brian

mattpascoe commented 11 years ago

FYI.. The patch does seem to do the job.. I'm trying to get it rolled back into the codebase for the rack_maint plugin:

https://github.com/opennetadmin/rack_maint

Keep an eye out there. Thanks much @paulwollner for your work on this!

mattpascoe commented 11 years ago

I'm closing this issue. Its also similar to issue opennetadmin/rack_maint#1 in the rack_maint project. I've merged these updates into that repository.