Skip to content

Commit

Permalink
Fixed GUISearch
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleYang0531 committed Jun 29, 2024
1 parent ab83b26 commit a1930a3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ emsdk
plugins/*.so
plugins/enableList.json
# make
public
public
phigros
16 changes: 8 additions & 8 deletions make
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ echo -e "${YELLOW}Compiling Sonolus Server using g++...${WHITE}"
g++ main.cpp -o sonolus\
-ldl -lpthread -lcrypto -lssl -ljsoncpp -std=c++14 -g -w \
-DENABLE_SONOLUS -DENABLE_MYSQL -lmysqlclient -DENABLE_SQLITE -lsqlite3 -DENABLE_CURL -lcurl -DENABLE_ZIP -lzip
echo -e "${YELLOW}Compiling libsonolush using g++...${WHITE}"
g++ plugins/libsonolush/libsonolush.cpp -o plugins/libsonolush.so \
-g -std=c++17 -fPIC -shared -w\
-DENABLE_SONOLUS -DENABLE_MYSQL -DENABLE_SQLITE -DENABLE_CURL -DENABLE_ZIP
echo -e "${YELLOW}Compiling libonedrive using g++...${WHITE}"
g++ plugins/libonedrive/libonedrive.cpp -o plugins/libonedrive.so \
-ldl -lpthread -lcrypto -lssl -ljsoncpp -std=c++17 -fPIC -shared -g -w\
-DENABLE_SONOLUS -DENABLE_MYSQL -DENABLE_SQLITE -DENABLE_CURL -DENABLE_ZIP
# echo -e "${YELLOW}Compiling libsonolush using g++...${WHITE}"
# g++ plugins/libsonolush/libsonolush.cpp -o plugins/libsonolush.so \
# -g -std=c++17 -fPIC -shared -w\
# -DENABLE_SONOLUS -DENABLE_MYSQL -DENABLE_SQLITE -DENABLE_CURL -DENABLE_ZIP
# echo -e "${YELLOW}Compiling libonedrive using g++...${WHITE}"
# g++ plugins/libonedrive/libonedrive.cpp -o plugins/libonedrive.so \
# -ldl -lpthread -lcrypto -lssl -ljsoncpp -std=c++17 -fPIC -shared -g -w\
# -DENABLE_SONOLUS -DENABLE_MYSQL -DENABLE_SQLITE -DENABLE_CURL -DENABLE_ZIP
echo -e "${YELLOW}Done.${WHITE}"
echo -e ""
echo -e "You can type \`./sonolus serve\` to start your server."
1 change: 0 additions & 1 deletion phigros
Submodule phigros deleted from 46727c
10 changes: 5 additions & 5 deletions web/gui/ItemSearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ auto GUISearch = [](client_conn conn, http_request request, param argv) {
argList["page.title"] = "{{language.search}} | " + appConfig["server.title"].asString();
argList["html.navbar"] = fetchNavBar("{{language.search}}").output(); string searchOptions = "";
searchOptions += "<h2 class=\"flex-grow py-1 text-xl font-bold sm:py-1.5 sm:text-3xl\">{{language.quick}}</h2>";
searchOptions += fetchSectionSearch(fetchSearchText("quick_keywords", "{{language.KEYWORDS}}", "{{language.KEYWORDS_PLACEHOLDER}}", args["quick_keywords"], "", 0, 0).output(), "/" + argv[0] + "/list", "quick").output();
searchOptions += fetchSectionSearch(fetchSearchText("quick_keywords", "{{language.KEYWORDS}}", "{{language.KEYWORDS_PLACEHOLDER}}", "\"" + args["quick_keywords"] + "\"", "", 0, 0).output(), "/" + argv[0] + "/list", "quick").output();
for (int i = 0; i < Searches.size(); i++) {
searchOptions += "<h2 class=\"flex-grow py-1 text-xl font-bold sm:py-1.5 sm:text-3xl\">" + Searches[i]["title"].asString() + "</h2>";
string sections = ""; string type = Searches[i]["type"].asString();
for (int j = 0; j < Searches[i]["options"].size(); j++) {
auto item = Searches[i]["options"][j]; string query = item["query"].asString();
if (item["type"].asString() == "text") sections += fetchSearchText(
type + "_" + query, item["name"].asString(), item["placeholder"].asString(), "\"" + args[type + "_" + query] + "\"", "", 0, 0).output();
type + "_" + query, item["name"].asString(), item["placeholder"].asString(), "\"" + args[type + "_" + query] + "\"", "\"\"", 0, 0).output();
if (item["type"].asString() == "toggle") sections += fetchSearchToggle(
type + "_" + query, item["name"].asString(), args[type + "_" + query].c_str(), "", 0, 0).output();
type + "_" + query, item["name"].asString(), args[type + "_" + query].c_str(), "0", 0, 0).output();
if (item["type"].asString() == "slider") sections += fetchSearchSlider(
type + "_" + query, item["name"].asString(), args[type + "_" + query].c_str(), "", item["min"].asInt(), item["max"].asInt(), item["step"].asInt(), 0, 0).output();
type + "_" + query, item["name"].asString(), args[type + "_" + query].c_str(), "0", item["min"].asInt(), item["max"].asInt(), item["step"].asInt(), 0, 0).output();
if (item["type"].asString() == "select") {
vector<string> values = {};
for (int k = 0; k < item["values"].size(); k++) values.push_back(item["values"][k].asString());
sections += fetchSearchSelect(type + "_" + query, item["name"].asString(), values, args[type + "_" + query].c_str(), "", 0, 0).output();
sections += fetchSearchSelect(type + "_" + query, item["name"].asString(), values, args[type + "_" + query].c_str(), "0", 0, 0).output();
}
} searchOptions += fetchSectionSearch(sections, "/" + argv[0] + "/list", type).output();
} argList["html.searchOptions"] = searchOptions;
Expand Down

0 comments on commit a1930a3

Please sign in to comment.