New 3cx tapi server url
This commit is contained in:
@@ -22,7 +22,7 @@ module.exports = {
|
||||
'GM.setValue'
|
||||
],
|
||||
connect: [
|
||||
'cpatapi.cpsrvweb2016.cp-austria.at'
|
||||
'3cxtapi.cp-austria.at'
|
||||
],
|
||||
'run-at': 'document-end'
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import * as chrono from 'chrono-node'
|
||||
import { TapiContact } from './tapi-contact'
|
||||
import { extractNumber } from './utils'
|
||||
import GM_fetch from '@trim21/gm-fetch'
|
||||
import { Config } from './config'
|
||||
|
||||
export class CallHistory {
|
||||
private callerIds: { [number: string]: TapiContact } = {}
|
||||
@@ -86,7 +87,7 @@ export class CallHistory {
|
||||
if (this.callerIds[number] !== undefined) {
|
||||
this.updateCallHistoryEntry(element, this.callerIds[number])
|
||||
} 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: '' }
|
||||
if (response.status === 200) {
|
||||
callerId = await response.json() as TapiContact
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import GM_fetch from '@trim21/gm-fetch'
|
||||
import { TapiContact } from './tapi-contact'
|
||||
import { extractNumber } from './utils'
|
||||
import { Config } from './config'
|
||||
|
||||
export class CallNotification {
|
||||
public async showCallNotification (element: HTMLElement) {
|
||||
@@ -14,7 +15,7 @@ export class CallNotification {
|
||||
}
|
||||
|
||||
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)
|
||||
var notification = {
|
||||
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 { fireChangeEvents } from './utils'
|
||||
import GM_fetch from '@trim21/gm-fetch'
|
||||
import { Config } from './config'
|
||||
|
||||
export class Search {
|
||||
private currentSearchText = ''
|
||||
@@ -103,7 +104,7 @@ export class Search {
|
||||
return
|
||||
}
|
||||
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)
|
||||
var contacts = await response.json() as TapiContact[]
|
||||
console.log('TAPI Contacts', contacts)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Config } from './config';
|
||||
import './status.css';
|
||||
import { ZcStatus } from './zc-status';
|
||||
import GM_fetch from "@trim21/gm-fetch";
|
||||
@@ -26,7 +27,7 @@ export class Status {
|
||||
private async checkStatus() {
|
||||
if (this._enabled) {
|
||||
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) {
|
||||
var status = await response.json() as ZcStatus;
|
||||
if (this._currentStatus !== status.loggedIn) {
|
||||
@@ -69,44 +70,44 @@ export class Status {
|
||||
menu.appendChild(link);
|
||||
|
||||
var html =
|
||||
'<div role="document" class="modal-dialog">' +
|
||||
' <div class="modal-content">' +
|
||||
' <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>' +
|
||||
' </div>' +
|
||||
' <div class="modal-body">' +
|
||||
' <div class="form-group">' +
|
||||
' <label for="tapi-zc-user">Username</label>' +
|
||||
' <input type="text" class="form-control" name="tapi-zc-user" id="tapi-zc-user">' +
|
||||
' </div>' +
|
||||
' <div class="form-group">' +
|
||||
' <label for="tapi-zc-on">Signed in</label>' +
|
||||
' <select id="tapi-zc-on" class="form-control">' +
|
||||
' <option value="menuAvailable">Available</option>' +
|
||||
' <option value="menuOutofoffice">Do Not Disturb</option>' +
|
||||
' <option value="menuCustom1">Verfügbar DW</option>' +
|
||||
' </select>' +
|
||||
' </div>' +
|
||||
' <div class="form-group">' +
|
||||
' <label for="tapi-zc-off">Signed out</label>' +
|
||||
' <select id="tapi-zc-off" class="form-control">' +
|
||||
' <option value="menuAway">Away</option>' +
|
||||
' <option value="menuOutofoffice">Do Not Disturb</option>' +
|
||||
' </select>' +
|
||||
' </div>' +
|
||||
' <div class="checkbox">' +
|
||||
' <label class="i-checks" for="tapi-zc-enabled">' +
|
||||
' <input type="checkbox" id="tapi-zc-enabled">' +
|
||||
' <i></i><span>Enabled</span>' +
|
||||
' </label>' +
|
||||
' </div>' +
|
||||
' </div>' +
|
||||
//' <div class="modal-footer">' +
|
||||
//' <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>' +
|
||||
//' </div>' +
|
||||
' </div>' +
|
||||
'</div>';
|
||||
'<div role="document" class="modal-dialog">' +
|
||||
' <div class="modal-content">' +
|
||||
' <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>' +
|
||||
' </div>' +
|
||||
' <div class="modal-body">' +
|
||||
' <div class="form-group">' +
|
||||
' <label for="tapi-zc-user">Username</label>' +
|
||||
' <input type="text" class="form-control" name="tapi-zc-user" id="tapi-zc-user">' +
|
||||
' </div>' +
|
||||
' <div class="form-group">' +
|
||||
' <label for="tapi-zc-on">Signed in</label>' +
|
||||
' <select id="tapi-zc-on" class="form-control">' +
|
||||
' <option value="menuAvailable">Available</option>' +
|
||||
' <option value="menuOutofoffice">Do Not Disturb</option>' +
|
||||
' <option value="menuCustom1">Verfügbar DW</option>' +
|
||||
' </select>' +
|
||||
' </div>' +
|
||||
' <div class="form-group">' +
|
||||
' <label for="tapi-zc-off">Signed out</label>' +
|
||||
' <select id="tapi-zc-off" class="form-control">' +
|
||||
' <option value="menuAway">Away</option>' +
|
||||
' <option value="menuOutofoffice">Do Not Disturb</option>' +
|
||||
' </select>' +
|
||||
' </div>' +
|
||||
' <div class="checkbox">' +
|
||||
' <label class="i-checks" for="tapi-zc-enabled">' +
|
||||
' <input type="checkbox" id="tapi-zc-enabled">' +
|
||||
' <i></i><span>Enabled</span>' +
|
||||
' </label>' +
|
||||
' </div>' +
|
||||
' </div>' +
|
||||
//' <div class="modal-footer">' +
|
||||
//' <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>' +
|
||||
//' </div>' +
|
||||
' </div>' +
|
||||
'</div>';
|
||||
var modal = document.createElement('modal-container');
|
||||
modal.id = 'zc-modal';
|
||||
modal.classList.add('modal');
|
||||
|
||||
Reference in New Issue
Block a user