diff --git a/indra/newview/llfloatergridstatus.cpp b/indra/newview/llfloatergridstatus.cpp index 9745e17bbb05e647d5b180f3473823c04b35c05d..2c2e5a05150d3b9d60725568a7bb2db5085a59c3 100644 --- a/indra/newview/llfloatergridstatus.cpp +++ b/indra/newview/llfloatergridstatus.cpp @@ -37,6 +37,7 @@ #include "lltoolbarview.h" #include "llviewercontrol.h" #include "llxmltree.h" +#include "llviewernetwork.h" std::map<std::string, std::string> LLFloaterGridStatus::sItemsMap; const std::string DEFAULT_GRID_STATUS_URL = "http://status.secondlifegrid.net/"; @@ -65,7 +66,7 @@ void LLFloaterGridStatus::onOpen(const LLSD& key) applyPreferredRect(); if (mWebBrowser) { - mWebBrowser->navigateTo(DEFAULT_GRID_STATUS_URL, HTTP_CONTENT_TEXT_HTML); + mWebBrowser->navigateTo(LLGridManager::instance().getGridStatusURL(), HTTP_CONTENT_TEXT_HTML); } } @@ -97,7 +98,7 @@ void LLFloaterGridStatus::getGridStatusRSSCoro() httpOpts->setSSLVerifyPeer(false); // We want this data even if SSL fails httpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_TEXT_XML); - std::string url = gSavedSettings.getString("GridStatusRSS"); + std::string url = LLGridManager::instance().getGridStatusRSSURL(); LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts, httpHeaders); LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS]; @@ -110,7 +111,7 @@ void LLFloaterGridStatus::getGridStatusRSSCoro() const LLSD::Binary &rawBody = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_RAW].asBinary(); std::string body(rawBody.begin(), rawBody.end()); - std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"grid_status_rss.xml"); + std::string fullpath = gDirUtilp->getExpandedFilename(LL_PATH_CACHE_PER_GRID, "grid_status_rss.xml"); if(!gSavedSettings.getBOOL("TestGridStatusRSSFromFile")) { llofstream custom_file_out(fullpath.c_str(), std::ios::trunc); diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index d25da10a5bc81aaeb37fe7b10aebc16e42d208de..a8e4f5c83d6011af258e701ef9b43466c2fc8f77 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -52,6 +52,10 @@ const std::string GRID_HELPER_URI_VALUE = "helper_uri"; const std::string GRID_LOGIN_PAGE_VALUE = "login_page"; /// url for the web profile site const std::string GRID_WEB_PROFILE_VALUE = "web_profile_url"; +/// url for the web profile site +const std::string GRID_STATUS_PAGE_URL = "grid_status"; +/// url for the web profile site +const std::string GRID_STATUS_RSS_URL = "grid_status_rss"; /// internal data on system grids const std::string GRID_IS_SYSTEM_GRID_VALUE = "system_grid"; /// whether this is single or double names @@ -148,6 +152,8 @@ void LLGridManager::initialize(const std::string& grid_file) "https://join.secondlife.com/?sourceid=AlchemyViewer", ALCHEMY_UPDATE_SERVICE, MAIN_GRID_WEB_PROFILE_URL, + "http://status.secondlifegrid.net/", + "https://status.secondlifegrid.net/history.atom", "Linden Lab", "secondlife", "Agni"); @@ -160,6 +166,8 @@ void LLGridManager::initialize(const std::string& grid_file) "https://join.secondlife.com/?sourceid=AlchemyViewer", ALCHEMY_UPDATE_SERVICE, "https://my.aditi.lindenlab.com/", + "http://status.secondlifegrid.net/", + "https://status.secondlifegrid.net/history.atom", "Linden Lab", "secondlife", "Aditi"); @@ -383,6 +391,8 @@ void LLGridManager::addSystemGrid(const std::string& label, const std::string& register_url, const std::string& update_url_base, const std::string& web_profile_url, + const std::string& grid_status_url, + const std::string& grid_status_rss_url, const std::string& administrator, const std::string& platform, const std::string& login_id) @@ -396,6 +406,8 @@ void LLGridManager::addSystemGrid(const std::string& label, grid[GRID_LOGIN_PAGE_VALUE] = login_page; grid[GRID_UPDATE_SERVICE_URL] = update_url_base; grid[GRID_WEB_PROFILE_VALUE] = web_profile_url; + grid[GRID_STATUS_PAGE_URL] = grid_status_url; + grid[GRID_STATUS_RSS_URL] = grid_status_rss_url; grid[GRID_IS_SYSTEM_GRID_VALUE] = true; grid[GRID_LOGIN_IDENTIFIER_TYPES] = LLSD::emptyArray(); grid[GRID_LOGIN_IDENTIFIER_TYPES].append(CRED_IDENTIFIER_TYPE_AGENT); @@ -575,6 +587,16 @@ void LLGridManager::gridInfoResponderCoro(const std::string uri, bool hypergrid) grid[GRID_ACCOUNT_REGISTRATION_URL] = node->getTextContents(); LL_DEBUGS("GridManager") << "[\"register\"]: " << grid[GRID_ACCOUNT_REGISTRATION_URL] << LL_ENDL; } + else if (node->hasName("GridStatus")) + { + grid[GRID_STATUS_PAGE_URL] = node->getTextContents(); + LL_DEBUGS("GridManager") << "[\"gridstatus\"]: " << grid[GRID_STATUS_PAGE_URL] << LL_ENDL; + } + else if (node->hasName("GridStatusRSS")) + { + grid[GRID_STATUS_RSS_URL] = node->getTextContents(); + LL_DEBUGS("GridManager") << "[\"gridstatusrss\"]: " << grid[GRID_STATUS_RSS_URL] << LL_ENDL; + } else if (node->hasName("password")) { grid[GRID_FORGOT_PASSWORD_URL] = node->getTextContents(); @@ -909,6 +931,36 @@ std::string LLGridManager::getCreateAccountURL() const return url; } +std::string LLGridManager::getGridStatusURL(const std::string& grid) const +{ + std::string grid_status_url; + std::string grid_name = getGrid(grid); + if (!grid_name.empty()) + { + grid_status_url = mGridList[grid_name][GRID_STATUS_PAGE_URL].asString(); + } + else + { + LL_WARNS("GridManager") << "invalid grid '" << grid << "'" << LL_ENDL; + } + return grid_status_url; +} + +std::string LLGridManager::getGridStatusRSSURL(const std::string& grid) const +{ + std::string grid_status_rss_url; + std::string grid_name = getGrid(grid); + if (!grid_name.empty()) + { + grid_status_rss_url = mGridList[grid_name][GRID_STATUS_RSS_URL].asString(); + } + else + { + LL_WARNS("GridManager") << "invalid grid '" << grid << "'" << LL_ENDL; + } + return grid_status_rss_url; +} + std::string LLGridManager::getWebProfileURL(const std::string& grid) { std::string web_profile_url; diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h index 85222e1e6baedb7ba5dd4d3010d1e3b689db8494..7e2f06bdf14fc4c30235379da1e69d0a99cd820f 100644 --- a/indra/newview/llviewernetwork.h +++ b/indra/newview/llviewernetwork.h @@ -143,6 +143,14 @@ class LLGridManager final : public LLSingleton<LLGridManager> /// Get the url for creating an account for the selected grid std::string getCreateAccountURL() const; + /// Get the url for the grid status page + std::string getGridStatusURL(const std::string& grid) const; + std::string getGridStatusURL() const { return getGridStatusURL(mGrid); }; + + /// Get the url for the grid status rss feed + std::string getGridStatusRSSURL(const std::string& grid) const; + std::string getGridStatusRSSURL() const { return getGridStatusRSSURL(mGrid); }; + /// Get the id to be used as a short name in url path components or parameters std::string getGridLoginID() const; @@ -290,6 +298,8 @@ class LLGridManager final : public LLSingleton<LLGridManager> const std::string& register_url, const std::string& update_url_base, const std::string& web_profile_url, + const std::string& grid_status_url, + const std::string& grid_status_rss_url, const std::string& administrator, const std::string& platform, const std::string& login_id = "");