From 72eef89810d33a55903fb5fd84cacdf07df63468 Mon Sep 17 00:00:00 2001 From: Leonardo Arena Date: Wed, 30 Dec 2015 13:54:49 +0000 Subject: community/racktables: speed up some slow rendering pages --- community/racktables/APKBUILD | 23 +++++--- community/racktables/slow-pages.patch | 106 ++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+), 7 deletions(-) create mode 100644 community/racktables/slow-pages.patch (limited to 'community/racktables') diff --git a/community/racktables/APKBUILD b/community/racktables/APKBUILD index a0b2a6791b..13f0b53ae0 100644 --- a/community/racktables/APKBUILD +++ b/community/racktables/APKBUILD @@ -3,7 +3,7 @@ pkgname=racktables _realname=RackTables pkgver=0.20.10 -pkgrel=0 +pkgrel=1 pkgdesc="Server room asset management" url="http://racktables.org" arch="noarch" @@ -13,15 +13,21 @@ depends_dev= makedepends="$depends_dev" install= subpackages="$pkgname-doc" -source="http://downloads.sourceforge.net/project/$pkgname/$_realname-${pkgver}.tar.gz" pkggroups="www-data" +source="http://downloads.sourceforge.net/project/$pkgname/$_realname-${pkgver}.tar.gz + slow-pages.patch" + _builddir="$srcdir"/$_realname-$pkgver prepare() { + local i cd "$_builddir" - # apply patches here - return 0 + for i in $source; do + case $i in + *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;; + esac + done } build() { @@ -44,6 +50,9 @@ package() { "$pkgdir"/usr/share/webapps/RackTables/wwwroot/index.php } -md5sums="0b1d04522216f0ecafe83823f9a56391 RackTables-0.20.10.tar.gz" -sha256sums="b418926bc726cebec0f29b6b7c73eae33e474c0ea05aae05f45afe035478d12b RackTables-0.20.10.tar.gz" -sha512sums="2e985e4fb8aa2ebca0ed17729c918eeecfde09c3962bf6cefff719fb6e9394aca31e585f81eb4e9d201d40710220edccdce5b99967ac0fd630fb47f7906d261e RackTables-0.20.10.tar.gz" +md5sums="0b1d04522216f0ecafe83823f9a56391 RackTables-0.20.10.tar.gz +4dcbd2ed05176ab5767f1c29f8eff8dd slow-pages.patch" +sha256sums="b418926bc726cebec0f29b6b7c73eae33e474c0ea05aae05f45afe035478d12b RackTables-0.20.10.tar.gz +c8528768ff3724f66235185e24455479c0169f926c3175f3cf5f88f5170bcb14 slow-pages.patch" +sha512sums="2e985e4fb8aa2ebca0ed17729c918eeecfde09c3962bf6cefff719fb6e9394aca31e585f81eb4e9d201d40710220edccdce5b99967ac0fd630fb47f7906d261e RackTables-0.20.10.tar.gz +7501e0346e4bc34e950e1e6b90b4f22ec137c2416a973e4ed5ec3280d3811bcc64894f145ee0be988208029ed3524b776b51228b5515995af9f0145a88ada47d slow-pages.patch" diff --git a/community/racktables/slow-pages.patch b/community/racktables/slow-pages.patch new file mode 100644 index 0000000000..58c2ddd219 --- /dev/null +++ b/community/racktables/slow-pages.patch @@ -0,0 +1,106 @@ +--- a/wwwroot/inc/interface-lib.php ++++ b/wwwroot/inc/interface-lib.php +@@ -403,6 +403,36 @@ + ">"; + } + ++//jlee new method start ++function mkImageButton ($tag, $location_id = '', $title = '', $do_input = FALSE) ++{ ++ global $image; ++ if (!isset ($image[$tag])) ++ $tag = 'error'; ++ $img = $image[$tag]; ++ $img['path'] = '?module=chrome&uri=' . $img['path']; ++ if ($do_input == TRUE){ ++ echo ++ ""; ++ } ++ else{ ++ echo ++ ""; ++ } ++} ++//jlee new method end ++ + function escapeString ($value, $do_db_escape = FALSE) + { + $ret = htmlspecialchars ($value, ENT_QUOTES, 'UTF-8'); +@@ -967,7 +997,6 @@ + foreach ($extra as $inputname => $inputvalue) + printf ('', htmlspecialchars ($inputname, ENT_QUOTES), htmlspecialchars ($inputvalue, ENT_QUOTES)); + } +- + + // Display hrefs for all of a file's parents. If scissors are requested, + // prepend cutting button to each of them. +--- a/wwwroot/inc/interface.php ++++ b/wwwroot/inc/interface.php +@@ -616,7 +616,8 @@ + printOpFormIntro ('addRow'); + echo ''; + printImageHREF ('create', 'Add new row', TRUE); +- echo ''; ++ echo ''; + printImageHREF ('create', 'Add new row', TRUE); +@@ -629,16 +630,32 @@ + printNewItemTR (); + foreach (listCells ('row') as $row_id => $rowInfo) + { ++ + echo ''; + if ($rc = $rowInfo['rackc']) + printImageHREF ('nodestroy', "${rc} rack(s) here"); + else + echo getOpLink (array('op'=>'deleteRow', 'row_id'=>$row_id), '', 'destroy', 'Delete row'); +- printOpFormIntro ('updateRow', array ('row_id' => $row_id)); +- echo ''; +- echo '"; ++ printOpFormIntro ('updateRow', array ('row_id' => $row_id)); ++ ++ //jlee start ++ //echo ''; ++ //echo '"; ++ echo '
'; //jlee - add div field ++ echo $rowInfo['location_name']; ++ echo "
"; ++ echo ""; //hidden container to hold final value ++ echo ""; ++ echo ""; ++ echo "
".$rowInfo['name']."
"; ++ echo ""; //hidden containers to hold final value ++ echo ""; ++ ++ mkImageButton ('pencil', $rowInfo['location_id'], 'Edit row', TRUE); //jlee try adding an edit button ++ echo " "; ++ //jlee end + printImageHREF ('save', 'Save changes', TRUE); + echo ""; + echo "" . mkCellA ($rowInfo) . ""; +@@ -648,6 +665,7 @@ + printNewItemTR (); + echo "
\n"; + finishPortlet(); ++ addJS('js/inline-row-edit.js'); //jlee add reference to new js file + } + + function renderRow ($row_id) +Only in b: wwwroot/js/inline-row-edit.js -- cgit v1.2.3