Added function to collect support cfg
This commit is contained in:
parent
7874f1bcf2
commit
f27e8ac79f
@ -112,11 +112,11 @@
|
|||||||
});
|
});
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
loadLog();
|
loadLog();
|
||||||
}, 3000); //5 seconds
|
}, 5000);
|
||||||
|
|
||||||
function loadLog() {
|
function loadLog() {
|
||||||
$("#logContent").load("/log");
|
$("#logContent").load("/log");
|
||||||
//$("#logContent").load("/test/status.json");
|
//$("#logContent").load("/test/log");
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -124,12 +124,26 @@
|
|||||||
View error log
|
View error log
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
<button class="btn btn-secondary btn-sm" type="button" data-bs-toggle="tooltip" name="github-btn" id="github-btn" title="Go to github and place a issue">
|
||||||
|
Submit a issue on github
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button class="btn btn-secondary btn-sm" type="button" data-bs-toggle="collapse" data-bs-target="#collapseSupport" aria-expanded="false" aria-controls="collapseSupport" data-bs-toggle="tooltip" name="support-btn" id="support-btn" title="Collect data relevant for a support case">
|
||||||
|
Gather support information
|
||||||
|
</button>
|
||||||
|
|
||||||
<div class="collapse row-margin-10" id="collapseLog">
|
<div class="collapse row-margin-10" id="collapseLog">
|
||||||
<div class="card card-body">
|
<div class="card card-body">
|
||||||
<pre><code class="card-text" id="logContent"></code></pre>
|
<pre><code class="card-text" id="logContent"></code></pre>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="collapse row-margin-10" id="collapseSupport">
|
||||||
|
<div class="card card-body">
|
||||||
|
<pre><code class="card-text" id="supportContent"></code></pre>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -177,8 +191,78 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var debug = {};
|
||||||
|
|
||||||
window.onload = start;
|
window.onload = start;
|
||||||
|
|
||||||
|
$("#github-btn").click(function(e){
|
||||||
|
window.location.href = "https://github.com/mp-se/gravitymon/issues";
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#support-btn").click(function(e){
|
||||||
|
$('#spinner').show();
|
||||||
|
|
||||||
|
var url = "/api/config";
|
||||||
|
//var url = "/test/config.json";
|
||||||
|
$.getJSON(url, function (cfg) {
|
||||||
|
debug = {};
|
||||||
|
debug["mdns"] = cfg["mdns"];
|
||||||
|
debug["id"] = cfg["id"];
|
||||||
|
|
||||||
|
debug["sleep-interval"] = cfg["sleep-interval"];
|
||||||
|
debug["temp-format"] = cfg["temp-format"];
|
||||||
|
|
||||||
|
debug["gravity-format"] = cfg["gravity-format"];
|
||||||
|
debug["gravity-temp-adjustment"] = cfg["gravity-temp-adjustment"];
|
||||||
|
|
||||||
|
debug["voltage-factor"] = cfg["voltage-factor"];
|
||||||
|
debug["platform"] = cfg["platform"];
|
||||||
|
debug["ble"] = cfg["ble"];
|
||||||
|
debug["gyro-temp"] = cfg["gyro-temp"];
|
||||||
|
debug["gyro-calibration-data"] = cfg["gyro-calibration-data"];
|
||||||
|
debug["temp-adjustment-value"] = cfg["temp-adjustment-value"];
|
||||||
|
|
||||||
|
var url = "/api/status";
|
||||||
|
//var url = "/test/status.json";
|
||||||
|
$.getJSON(url, function (cfg) {
|
||||||
|
debug["runtime-average"] = cfg["runtime-average"];
|
||||||
|
debug["rssi"] = cfg["rssi"];
|
||||||
|
debug["app-ver"] = cfg["app-ver"];
|
||||||
|
debug["app-build"] = cfg["app-build"];
|
||||||
|
});
|
||||||
|
|
||||||
|
var url = "/api/config/format";
|
||||||
|
//var url = "/test/format.json";
|
||||||
|
$.getJSON(url, function (cfg) {
|
||||||
|
debug["formats"] = cfg;
|
||||||
|
|
||||||
|
var url = "/api/config/advanced";
|
||||||
|
//var url = "/test/adv.json";
|
||||||
|
$.getJSON(url, function (cfg) {
|
||||||
|
debug["advanced"] = cfg;
|
||||||
|
|
||||||
|
var url = "/api/upload";
|
||||||
|
//var url = "/test/upload.json";
|
||||||
|
$.getJSON(url, function (cfg) {
|
||||||
|
debug["files"] = cfg;
|
||||||
|
|
||||||
|
var url = "/log";
|
||||||
|
//var url = "/test/log";
|
||||||
|
$.ajax({url: url, method: 'get', success: function (data) {
|
||||||
|
debug["log"] = data.split("\n");
|
||||||
|
var s = JSON.stringify(debug, null, 2);
|
||||||
|
$("#supportContent").text( s );
|
||||||
|
$('#spinner').hide();
|
||||||
|
navigator.clipboard.writeText(s);
|
||||||
|
alert("Support information copied to clipboard");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$("#sleep-mode").click(function(e){
|
$("#sleep-mode").click(function(e){
|
||||||
console.log( "Blocking sleep mode = " + $("#sleep-mode").is(":checked"));
|
console.log( "Blocking sleep mode = " + $("#sleep-mode").is(":checked"));
|
||||||
$.ajax( {
|
$.ajax( {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1130,17 +1130,17 @@ const char* WebServerHandler::getHtmlFileName(HtmlFile item) {
|
|||||||
Log.notice(F("WEB : Looking up filename for %d." CR), item);
|
Log.notice(F("WEB : Looking up filename for %d." CR), item);
|
||||||
|
|
||||||
switch (item) {
|
switch (item) {
|
||||||
case HTML_INDEX:
|
case HtmlFile::HTML_INDEX:
|
||||||
return "index.min.htm";
|
return "index.min.htm";
|
||||||
case HTML_CONFIG:
|
case HtmlFile::HTML_CONFIG:
|
||||||
return "config.min.htm";
|
return "config.min.htm";
|
||||||
case HTML_CALIBRATION:
|
case HtmlFile::HTML_CALIBRATION:
|
||||||
return "calibration.min.htm";
|
return "calibration.min.htm";
|
||||||
case HTML_FORMAT:
|
case HtmlFile::HTML_FORMAT:
|
||||||
return "format.min.htm";
|
return "format.min.htm";
|
||||||
case HTML_ABOUT:
|
case HtmlFile::HTML_ABOUT:
|
||||||
return "about.min.htm";
|
return "about.min.htm";
|
||||||
case HTML_TEST:
|
case HtmlFile::HTML_TEST:
|
||||||
return "test.min.htm";
|
return "test.min.htm";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,8 +5,11 @@ Releases
|
|||||||
|
|
||||||
v1.0.0-beta2
|
v1.0.0-beta2
|
||||||
------------
|
------------
|
||||||
* Moved applying sensor resolution in loop so we dont need to reboot.
|
* Moved applying temp sensor resolution in loop so there is no need to reboot.
|
||||||
* Updated docs with information from beta1
|
* Advanced software settings is only disabled if settings contain default values.
|
||||||
|
* Added button on indexpage to direct to github issues.
|
||||||
|
* Added button to extract important information for support requests.
|
||||||
|
* Updated docs with information from beta1.
|
||||||
|
|
||||||
v1.0.0-beta1
|
v1.0.0-beta1
|
||||||
------------
|
------------
|
||||||
|
@ -1,8 +1,22 @@
|
|||||||
{
|
{
|
||||||
"index": false,
|
"index": true,
|
||||||
"config": false,
|
"config": false,
|
||||||
"calibration": false,
|
"calibration": true,
|
||||||
"format": false,
|
"format": true,
|
||||||
|
"about": false,
|
||||||
"test": false,
|
"test": false,
|
||||||
"about": true
|
"files": [
|
||||||
|
{
|
||||||
|
"file-name": "calibration.min.htm",
|
||||||
|
"file-size": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file-name": "drd.dat",
|
||||||
|
"file-size": 4
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"file-name": "error.log",
|
||||||
|
"file-size": 839
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user