Ticket #1969: statuspage_remote_freespace.diff
File statuspage_remote_freespace.diff, 2.4 KB (added by , 18 years ago) |
---|
-
programs/mythbackend/httpstatus.cpp
old new void HttpStatus::FillStatusXML( QDomDocu 1201 1201 { 1202 1202 long long mTotal = 0, mUsed = 0, mAvail = 0; 1203 1203 long long gTotal = 0, gUsed = 0, gAvail = 0; 1204 QString hosts = "_local _";1204 QString hosts = "_local"; 1205 1205 QMap <QString, bool> backendsCounted; 1206 1206 QString encoderHost; 1207 1207 QMap<int, EncoderLink *>::Iterator eit; … … void HttpStatus::FillStatusXML( QDomDocu 1246 1246 storage.setAttribute("_total_free" , (int)(gAvail>>10)); 1247 1247 1248 1248 if (hosts != "") 1249 hosts += ",_total _";1249 hosts += ",_total"; 1250 1250 storage.setAttribute("slaves", hosts); 1251 1251 } 1252 1252 … … int HttpStatus::PrintMachineInfo( QTextS 2064 2064 2065 2065 if (!e.isNull()) 2066 2066 { 2067 QString slaves = e.attribute("slaves", "_local _");2067 QString slaves = e.attribute("slaves", "_local"); 2068 2068 QStringList tokens = QStringList::split(",", slaves); 2069 2069 2070 2070 os << " Disk Usage:<br />\r\n"; … … int HttpStatus::PrintMachineInfo( QTextS 2072 2072 2073 2073 for (unsigned int i = 0; i < tokens.size(); i++) 2074 2074 { 2075 int nFree = e.attribute(tokens[i] + " free" , "0" ).toInt();2076 int nTotal= e.attribute(tokens[i] + " total", "0" ).toInt();2077 int nUsed = e.attribute(tokens[i] + " used" , "0" ).toInt();2075 int nFree = e.attribute(tokens[i] + "_free" , "0" ).toInt(); 2076 int nTotal= e.attribute(tokens[i] + "_total", "0" ).toInt(); 2077 int nUsed = e.attribute(tokens[i] + "_used" , "0" ).toInt(); 2078 2078 2079 if (slaves == "_local _")2079 if (slaves == "_local") 2080 2080 { 2081 2081 // do nothing 2082 2082 } 2083 else if (tokens[i] == "_local _")2083 else if (tokens[i] == "_local") 2084 2084 { 2085 2085 os << " <li>Master Backend:\r\n" 2086 2086 << " <ul>\r\n"; 2087 2087 } 2088 else if (tokens[i] == "_total _")2088 else if (tokens[i] == "_total") 2089 2089 { 2090 2090 os << " <li>Total Disk Space:\r\n" 2091 2091 << " <ul>\r\n";