5 Commits

Author SHA1 Message Date
ad5c8ece12 Bump Version to 8.0.1 2021-08-30 08:03:49 +02:00
0455cb1926 Fixed typo 2021-08-28 17:16:36 +02:00
3e33155276 Make popup background non-transparent 2021-08-28 11:49:49 +02:00
de34a6c66e Updated source url 2021-08-27 18:40:33 +02:00
a4a346b48d Version 8.0.0. 2021-08-27 18:29:36 +02:00
5 changed files with 7931 additions and 5355 deletions

File diff suppressed because one or more lines are too long

View File

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

View File

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

View File

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

View File

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