Merge remote-tracking branch 'origin/remote_logging_refactoring' into remote_logging_refactoring

This commit is contained in:
BenDr0id 2018-08-02 16:37:12 +02:00
commit cbc56a3a64
3 changed files with 7 additions and 7 deletions

View file

@ -69,8 +69,7 @@ Check the [Coin Configuration](https://github.com/Bendr0id/xmrigCC/wiki/Coin-con
**XMRigCC Dashboard** **XMRigCC Dashboard**
![Screenshot of XMRigCC Dashboard](https://i.imgur.com/VwJaf26.png) ![Screenshot of XMRigCC Dashboard](https://imgur.com/UrdTHpM.png)
#### Table of contents #### Table of contents
* [Download](#download) * [Download](#download)

View file

@ -416,10 +416,10 @@
type: "GET", type: "GET",
url: "/admin/getClientLog?clientId=" + clientId, url: "/admin/getClientLog?clientId=" + clientId,
dataType:"json", dataType:"json",
success: function(jsonClientLog) { success: function(data) {
var htmlContent = "<div class='form-group' id='viewer' data-value='" + clientId + "'>" + var htmlContent = "<div class='form-group' id='viewer' data-value='" + clientId + "'>" +
"<label for='config'>Log of: " + clientId + " (" + clientIp + ")</label>"+ "<label for='config'>Log of: " + clientId + " (" + clientIp + ")</label>"+
"<textarea class='form-control' rows='20' id='log'>" + JSON.stringify(jsonClientLog,undefined, 2) + "</textarea>" + "<textarea class='form-control' rows='20' id='log'>" + data.client_log + "</textarea>" +
"</div>"; "</div>";
$('#minerLog').find('.modal-body').html(htmlContent); $('#minerLog').find('.modal-body').html(htmlContent);
@ -442,8 +442,8 @@
type: "GET", type: "GET",
url: "/admin/getClientLog?clientId=" + clientId, url: "/admin/getClientLog?clientId=" + clientId,
dataType:"json", dataType:"json",
success: function(jsonClientLog) { success: function(data) {
$('#log').val(JSON.stringify(jsonClientLog,undefined, 2)); $('#log').val(data.client_log);
}, },
error: function (data) { error: function (data) {
setError('<strong>Unable to fetch ' + clientId + ' log.</strong> - Please make sure it is enabled on the miner!'); setError('<strong>Unable to fetch ' + clientId + ' log.</strong> - Please make sure it is enabled on the miner!');

View file

@ -288,7 +288,8 @@ unsigned Service::getClientLog(const std::string& clientId, std::string& resp)
data << m_row.c_str() << std::endl; data << m_row.c_str() << std::endl;
} }
respDocument.AddMember("client_log", rapidjson::StringRef(data.str().c_str()), allocator); std::string log = data.str();
respDocument.AddMember("client_log", rapidjson::StringRef(log.c_str()), allocator);
rapidjson::StringBuffer buffer(0, 4096); rapidjson::StringBuffer buffer(0, 4096);
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer); rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);