1 Commits

Author SHA1 Message Date
b6124f5ee8 Version 8.0.0. 2021-08-27 18:14:41 +02:00
5 changed files with 1019 additions and 505 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
{
"name": "3cp-tapi",
"description": "Build your UserScript with webpack",
"version": "8.0.1",
"version": "8.0.0",
"author": {
"name": "Daniel Triendl",
"email": "d.triendl@cp-solutions.at"
@ -20,7 +20,7 @@
},
"repository": {
"type": "git",
"url": "https://source.cp-austria.at/git/CPATRD/3cx_tapi.git"
"url": "http://scootaloo.cp-austria.at/gitlist/3cx_tapi.git"
},
"private": true,
"dependencies": {

View File

@ -43,7 +43,7 @@ npm run build
## distribution
```
cp "dist/3CX TAPI.prod.user.js" 3CX_TAPI.user.js
cp dist/index.prod.user.js 3CX_TAPI.user.js
```
And commit 3CX_TAPI.user.js

View File

@ -11,7 +11,6 @@
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
color: #000;
background-color: #fff;
}
.show {

View File

@ -45,7 +45,7 @@ export class Status {
' </select>' +
'</div>' +
'<div class="form-group">' +
' <label for="tapi-zc-off">Signed out</label>' +
' <label for="tapi-zc-off">Signed in</label>' +
' <select id="tapi-zc-off" class="form-control">' +
' <option value="menuAway">Away</option>' +
' <option value="menuOutofoffice">Do Not Disturb</option>' +
@ -109,25 +109,21 @@ export class Status {
private async checkStatus() {
if (this._enabled) {
try {
var response = await axios.get<ZcStatus>('http://cpatapi.cpsrvweb2016.cp-austria.at/availability/' + encodeURIComponent(this._user));
var response = await axios.get<ZcStatus>('http://cpatapi.cpsrvweb2016.cp-austria.at/availability/' + encodeURIComponent(this._user));
if (response.status == 200) {
var status = response.data;
if (this._currentStatus !== status.loggedIn) {
this._currentStatus = status.loggedIn;
console.log('New status, loggedIn', this._currentStatus);
(document.getElementsByClassName("current-status")[0] as HTMLAnchorElement).click();
setTimeout(() => {
var statusId = this._currentStatus ? this._statusOn : this._statusOff;
(document.getElementById(statusId) as HTMLAnchorElement).click();
}, 1000);
}
if (response.status == 200) {
var status = response.data;
if (this._currentStatus !== status.loggedIn) {
this._currentStatus = status.loggedIn;
console.log('New status, loggedIn', this._currentStatus);
(document.getElementsByClassName("current-status")[0] as HTMLAnchorElement).click();
setTimeout(() => {
var statusId = this._currentStatus ? this._statusOn : this._statusOff;
(document.getElementById(statusId) as HTMLAnchorElement).click();
}, 1000);
}
} catch (error) {
console.log(error);
}
setTimeout(() => this.checkStatus(), 30000);
setTimeout(() => this.checkStatus(), 10000);
}
}
}