New 3cx tapi server url
This commit is contained in:
@@ -22,7 +22,7 @@ module.exports = {
|
|||||||
'GM.setValue'
|
'GM.setValue'
|
||||||
],
|
],
|
||||||
connect: [
|
connect: [
|
||||||
'cpatapi.cpsrvweb2016.cp-austria.at'
|
'3cxtapi.cp-austria.at'
|
||||||
],
|
],
|
||||||
'run-at': 'document-end'
|
'run-at': 'document-end'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import * as chrono from 'chrono-node'
|
|||||||
import { TapiContact } from './tapi-contact'
|
import { TapiContact } from './tapi-contact'
|
||||||
import { extractNumber } from './utils'
|
import { extractNumber } from './utils'
|
||||||
import GM_fetch from '@trim21/gm-fetch'
|
import GM_fetch from '@trim21/gm-fetch'
|
||||||
|
import { Config } from './config'
|
||||||
|
|
||||||
export class CallHistory {
|
export class CallHistory {
|
||||||
private callerIds: { [number: string]: TapiContact } = {}
|
private callerIds: { [number: string]: TapiContact } = {}
|
||||||
@@ -86,7 +87,7 @@ export class CallHistory {
|
|||||||
if (this.callerIds[number] !== undefined) {
|
if (this.callerIds[number] !== undefined) {
|
||||||
this.updateCallHistoryEntry(element, this.callerIds[number])
|
this.updateCallHistoryEntry(element, this.callerIds[number])
|
||||||
} else {
|
} else {
|
||||||
var response = await GM_fetch('http://cpatapi.cpsrvweb2016.cp-austria.at/callerid/' + encodeURIComponent(number))
|
var response = await GM_fetch(Config.tapi_server_url + '/callerid/' + encodeURIComponent(number))
|
||||||
var callerId: TapiContact = { tD_NAME: '' }
|
var callerId: TapiContact = { tD_NAME: '' }
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
callerId = await response.json() as TapiContact
|
callerId = await response.json() as TapiContact
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import GM_fetch from '@trim21/gm-fetch'
|
import GM_fetch from '@trim21/gm-fetch'
|
||||||
import { TapiContact } from './tapi-contact'
|
import { TapiContact } from './tapi-contact'
|
||||||
import { extractNumber } from './utils'
|
import { extractNumber } from './utils'
|
||||||
|
import { Config } from './config'
|
||||||
|
|
||||||
export class CallNotification {
|
export class CallNotification {
|
||||||
public async showCallNotification (element: HTMLElement) {
|
public async showCallNotification (element: HTMLElement) {
|
||||||
@@ -14,7 +15,7 @@ export class CallNotification {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log('TAPI searching callerid for', number)
|
console.log('TAPI searching callerid for', number)
|
||||||
var response = await GM_fetch('http://cpatapi.cpsrvweb2016.cp-austria.at/callerid/' + encodeURIComponent(number))
|
var response = await GM_fetch(Config.tapi_server_url + '/callerid/' + encodeURIComponent(number))
|
||||||
console.log('TAPI callerid response', response)
|
console.log('TAPI callerid response', response)
|
||||||
var notification = {
|
var notification = {
|
||||||
text: number
|
text: number
|
||||||
|
|||||||
5
client/src/config.ts
Normal file
5
client/src/config.ts
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
class _Config {
|
||||||
|
public tapi_server_url: string = 'https://3cxtapi.cp-austria.at'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Config = new _Config()
|
||||||
@@ -3,6 +3,7 @@ import { TapiContact } from './tapi-contact'
|
|||||||
import { debounce } from './debounce'
|
import { debounce } from './debounce'
|
||||||
import { fireChangeEvents } from './utils'
|
import { fireChangeEvents } from './utils'
|
||||||
import GM_fetch from '@trim21/gm-fetch'
|
import GM_fetch from '@trim21/gm-fetch'
|
||||||
|
import { Config } from './config'
|
||||||
|
|
||||||
export class Search {
|
export class Search {
|
||||||
private currentSearchText = ''
|
private currentSearchText = ''
|
||||||
@@ -103,7 +104,7 @@ export class Search {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log('Searching TAPI')
|
console.log('Searching TAPI')
|
||||||
var response = await GM_fetch('http://cpatapi.cpsrvweb2016.cp-austria.at/search?query=' + encodeURIComponent(searchText))
|
var response = await GM_fetch(Config.tapi_server_url + '/search?query=' + encodeURIComponent(searchText))
|
||||||
console.log('TAPI Search response', response)
|
console.log('TAPI Search response', response)
|
||||||
var contacts = await response.json() as TapiContact[]
|
var contacts = await response.json() as TapiContact[]
|
||||||
console.log('TAPI Contacts', contacts)
|
console.log('TAPI Contacts', contacts)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { Config } from './config';
|
||||||
import './status.css';
|
import './status.css';
|
||||||
import { ZcStatus } from './zc-status';
|
import { ZcStatus } from './zc-status';
|
||||||
import GM_fetch from "@trim21/gm-fetch";
|
import GM_fetch from "@trim21/gm-fetch";
|
||||||
@@ -26,7 +27,7 @@ export class Status {
|
|||||||
private async checkStatus() {
|
private async checkStatus() {
|
||||||
if (this._enabled) {
|
if (this._enabled) {
|
||||||
try {
|
try {
|
||||||
var response = await GM_fetch('http://cpatapi.cpsrvweb2016.cp-austria.at/availability/' + encodeURIComponent(this._user));
|
var response = await GM_fetch(Config.tapi_server_url + '/availability/' + encodeURIComponent(this._user));
|
||||||
if (response.status == 200) {
|
if (response.status == 200) {
|
||||||
var status = await response.json() as ZcStatus;
|
var status = await response.json() as ZcStatus;
|
||||||
if (this._currentStatus !== status.loggedIn) {
|
if (this._currentStatus !== status.loggedIn) {
|
||||||
@@ -69,44 +70,44 @@ export class Status {
|
|||||||
menu.appendChild(link);
|
menu.appendChild(link);
|
||||||
|
|
||||||
var html =
|
var html =
|
||||||
'<div role="document" class="modal-dialog">' +
|
'<div role="document" class="modal-dialog">' +
|
||||||
' <div class="modal-content">' +
|
' <div class="modal-content">' +
|
||||||
' <div class="modal-header">' +
|
' <div class="modal-header">' +
|
||||||
' <h4 class="modal-title">ZeitConsens Status</h4><button id="zc-btnClose" type="button" aria-label="Close" class="btn-close" data-qa="modal-cross"></button>' +
|
' <h4 class="modal-title">ZeitConsens Status</h4><button id="zc-btnClose" type="button" aria-label="Close" class="btn-close" data-qa="modal-cross"></button>' +
|
||||||
' </div>' +
|
' </div>' +
|
||||||
' <div class="modal-body">' +
|
' <div class="modal-body">' +
|
||||||
' <div class="form-group">' +
|
' <div class="form-group">' +
|
||||||
' <label for="tapi-zc-user">Username</label>' +
|
' <label for="tapi-zc-user">Username</label>' +
|
||||||
' <input type="text" class="form-control" name="tapi-zc-user" id="tapi-zc-user">' +
|
' <input type="text" class="form-control" name="tapi-zc-user" id="tapi-zc-user">' +
|
||||||
' </div>' +
|
' </div>' +
|
||||||
' <div class="form-group">' +
|
' <div class="form-group">' +
|
||||||
' <label for="tapi-zc-on">Signed in</label>' +
|
' <label for="tapi-zc-on">Signed in</label>' +
|
||||||
' <select id="tapi-zc-on" class="form-control">' +
|
' <select id="tapi-zc-on" class="form-control">' +
|
||||||
' <option value="menuAvailable">Available</option>' +
|
' <option value="menuAvailable">Available</option>' +
|
||||||
' <option value="menuOutofoffice">Do Not Disturb</option>' +
|
' <option value="menuOutofoffice">Do Not Disturb</option>' +
|
||||||
' <option value="menuCustom1">Verfügbar DW</option>' +
|
' <option value="menuCustom1">Verfügbar DW</option>' +
|
||||||
' </select>' +
|
' </select>' +
|
||||||
' </div>' +
|
' </div>' +
|
||||||
' <div class="form-group">' +
|
' <div class="form-group">' +
|
||||||
' <label for="tapi-zc-off">Signed out</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>' +
|
||||||
' </select>' +
|
' </select>' +
|
||||||
' </div>' +
|
' </div>' +
|
||||||
' <div class="checkbox">' +
|
' <div class="checkbox">' +
|
||||||
' <label class="i-checks" for="tapi-zc-enabled">' +
|
' <label class="i-checks" for="tapi-zc-enabled">' +
|
||||||
' <input type="checkbox" id="tapi-zc-enabled">' +
|
' <input type="checkbox" id="tapi-zc-enabled">' +
|
||||||
' <i></i><span>Enabled</span>' +
|
' <i></i><span>Enabled</span>' +
|
||||||
' </label>' +
|
' </label>' +
|
||||||
' </div>' +
|
' </div>' +
|
||||||
' </div>' +
|
' </div>' +
|
||||||
//' <div class="modal-footer">' +
|
//' <div class="modal-footer">' +
|
||||||
//' <button id="zc-btnOk" type="button" class="btn btn-primary" data-qa="modal-ok">OK </button>' +
|
//' <button id="zc-btnOk" type="button" class="btn btn-primary" data-qa="modal-ok">OK </button>' +
|
||||||
//' <button id="zc-btnCancel" type="button" class="btn btn-border" data-qa="modal-close">Cancel </button>' +
|
//' <button id="zc-btnCancel" type="button" class="btn btn-border" data-qa="modal-close">Cancel </button>' +
|
||||||
//' </div>' +
|
//' </div>' +
|
||||||
' </div>' +
|
' </div>' +
|
||||||
'</div>';
|
'</div>';
|
||||||
var modal = document.createElement('modal-container');
|
var modal = document.createElement('modal-container');
|
||||||
modal.id = 'zc-modal';
|
modal.id = 'zc-modal';
|
||||||
modal.classList.add('modal');
|
modal.classList.add('modal');
|
||||||
|
|||||||
Reference in New Issue
Block a user