Compare commits
1 Commits
v8.0.1
...
b6124f5ee8
Author | SHA1 | Date | |
---|---|---|---|
b6124f5ee8 |
1487
3CX_TAPI.user.js
1487
3CX_TAPI.user.js
File diff suppressed because one or more lines are too long
@ -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": {
|
||||
|
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user