*) blacklists will only displayed partly now with 50 entries per page by default, this should make it easier to administrate large lists

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5568 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 16 years ago
parent f6da5f8f00
commit 910c2aaed6

@ -116,16 +116,38 @@
<input type="submit" /> <input type="submit" />
</div> </div>
</form> </form>
<form name ="selectRange" action="Blacklist_p.html" method="post">
<input type="hidden" name="currentBlacklist" value="#[currentBlacklist]#" />
<input type="hidden" name="action" value="selectRange" />
<p>Show entries:
<select name="offset" size="1" onChange="document.selectRange.submit();">
#{subListOffset}#
<option value="#[value]#" #(selected)#::selected="selected"#(/selected)#>#[fvalue]# - #[tvalue]#</option>
#{/subListOffset}#
</select>
&nbsp;
Entries per page:
<select name="size" size="1" onChange="document.selectRange.submit();">
#{subListSize}#
<option value="#[value]#" #(selected)#::selected="selected"#(/selected)#>#[text]#</option>
#{/subListSize}#
</select>
&nbsp;
<input type="submit" value="Go" />
</p>
</form>
:: ::
<p>Edit existing pattern(s):</p> <p>Edit existing pattern(s):</p>
<form action="Blacklist_p.html" method="post" enctype="multipart/form-data"> <form name="editBlacklistEntry" action="Blacklist_p.html" method="post" enctype="multipart/form-data">
<div> <div>
<input type="hidden" name="currentBlacklist" value="#[currentBlacklist]#" /> <input type="hidden" name="currentBlacklist" value="#[currentBlacklist]#" />
<input type="hidden" name="action" value="editBlacklistEntry" />
#{editList}# #{editList}#
<input type="text" name="editedBlacklistEntry.#[count]#" size="50" value="#[item]#"/> <input type="text" name="editedBlacklistEntry.#[count]#" size="50" value="#[item]#"/>
<input type="hidden" name="selectedBlacklistEntry.#[count]#" value="#[item]#"/> <input type="hidden" name="selectedBlacklistEntry.#[count]#" value="#[item]#"/>
#{/editList}# #{/editList}#
<input type="hidden" name="action" value="editBlacklistEntry" />
<br /><br /> <br /><br />
<input type="submit" value="Save URL pattern(s)" /> <input type="submit" value="Save URL pattern(s)" />
</div> </div>

@ -347,6 +347,8 @@ public class Blacklist_p {
prop.put(DISABLED + EDIT + "editList", selectedEntries.length); prop.put(DISABLED + EDIT + "editList", selectedEntries.length);
} }
} }
} else if (action.equals("selectRange")) {
blacklistToUse = post.get("currentBlacklist");
} }
} }
@ -367,7 +369,22 @@ public class Blacklist_p {
// display them // display them
boolean dark = true; boolean dark = true;
for (int j=0;j<sortedlist.length;++j){ int from = 0;
int size = 50;
int to = sortedlist.length;
if (post != null) {
from = post.getInt("offset", 0);
size = post.getInt("size", 50);
to = from + size;
}
if (from > sortedlist.length || from < 0) {
from = 0;
}
if (to > sortedlist.length || size < 1) {
to = sortedlist.length;
}
for (int j = from; j < to; ++j){
final String nextEntry = sortedlist[j]; final String nextEntry = sortedlist[j];
if (nextEntry.length() == 0) continue; if (nextEntry.length() == 0) continue;
@ -379,6 +396,43 @@ public class Blacklist_p {
entryCount++; entryCount++;
} }
prop.put(DISABLED + EDIT + "Itemlist", entryCount); prop.put(DISABLED + EDIT + "Itemlist", entryCount);
// create selection of sublist
entryCount = 0;
int end = -1;
if (sortedlist.length > 0) {
while (end < sortedlist.length) {
prop.put(DISABLED + EDIT + "subListOffset_" + entryCount + "_value", (entryCount * to));
end = (entryCount + 1) * to;
if (end > sortedlist.length) {
end = sortedlist.length;
}
prop.put(DISABLED + EDIT + "subListOffset_" + entryCount + "_fvalue", (entryCount * to) + 1);
prop.put(DISABLED + EDIT + "subListOffset_" + entryCount + "_tvalue", end);
entryCount++;
}
} else {
prop.put(DISABLED + EDIT + "subListOffset_0_value", 0);
prop.put(DISABLED + EDIT + "subListOffset_0_fvalue", 0);
prop.put(DISABLED + EDIT + "subListOffset_0_tvalue", 0);
entryCount++;
}
prop.put(DISABLED + EDIT + "subListOffset", entryCount);
// create selection of list size
int[] sizes = {10,25,50,100,250,-1};
for (int i = 0; i < sizes.length; i++) {
prop.put(DISABLED + EDIT + "subListSize_" + i + "_value", sizes[i]);
if (sizes[i] == -1) {
prop.put(DISABLED + EDIT + "subListSize_" + i + "_text", "all");
} else {
prop.put(DISABLED + EDIT + "subListSize_" + i + "_text", sizes[i]);
}
if (sizes[i] == size) {
prop.put(DISABLED + EDIT + "subListSize_" + i + "_selected", 1);
}
}
prop.put(DISABLED + EDIT + "subListSize", sizes.length);
} }
// List BlackLists // List BlackLists

Loading…
Cancel
Save