|
1
|
|
|
/* |
|
2
|
|
|
* Copyright © MIKO LLC - All Rights Reserved |
|
3
|
|
|
* Unauthorized copying of this file, via any medium is strictly prohibited |
|
4
|
|
|
* Proprietary and confidential |
|
5
|
|
|
* Written by Nikolay Beketov, 8 2020 |
|
6
|
|
|
*/ |
|
7
|
|
|
/* global sessionStorage, PbxApi */ |
|
8
|
|
|
|
|
9
|
|
|
const systemDiagnosticCapture = { |
|
10
|
|
|
$startBtn: $('#start-capture-button'), |
|
11
|
|
|
$stopBtn: $('#stop-capture-button'), |
|
12
|
|
|
$showBtn: $('#show-last-log'), |
|
13
|
|
|
initialize() { |
|
14
|
|
|
if (sessionStorage.getItem('LogsCaptureStatus') === 'started') { |
|
15
|
|
|
systemDiagnosticCapture.$startBtn.addClass('disabled loading'); |
|
16
|
|
|
systemDiagnosticCapture.$stopBtn.removeClass('disabled'); |
|
17
|
|
|
} else { |
|
18
|
|
|
systemDiagnosticCapture.$startBtn.removeClass('disabled loading'); |
|
19
|
|
|
systemDiagnosticCapture.$stopBtn.addClass('disabled'); |
|
20
|
|
|
} |
|
21
|
|
|
systemDiagnosticCapture.$startBtn.on('click', (e) => { |
|
22
|
|
|
e.preventDefault(); |
|
23
|
|
|
systemDiagnosticCapture.$startBtn.addClass('disabled loading'); |
|
24
|
|
|
systemDiagnosticCapture.$stopBtn.removeClass('disabled'); |
|
25
|
|
|
PbxApi.SystemStartLogsCapture(); |
|
26
|
|
|
}); |
|
27
|
|
|
systemDiagnosticCapture.$stopBtn.on('click', (e) => { |
|
28
|
|
|
e.preventDefault(); |
|
29
|
|
|
systemDiagnosticCapture.$startBtn.removeClass('disabled loading'); |
|
30
|
|
|
systemDiagnosticCapture.$stopBtn.addClass('disabled'); |
|
31
|
|
|
PbxApi.SystemStopLogsCapture(); |
|
32
|
|
|
}); |
|
33
|
|
|
|
|
34
|
|
|
}, |
|
35
|
|
|
}; |
|
36
|
|
|
|
|
37
|
|
|
$(document).ready(() => { |
|
38
|
|
|
systemDiagnosticCapture.initialize(); |
|
39
|
|
|
}); |
|
40
|
|
|
|
|
41
|
|
|
|