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