Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
myapps:agent-callback [2022/02/03 14:37] – [JQuery - JSON / HTML Tables] gerardorourkemyapps:agent-callback [2022/02/21 18:25] (current) – [XML Code for createCallback] gerardorourke
Line 215: Line 215:
 </code> </code>
  
 +==== JS Code for createCallback====
 <code JavaScript> <code JavaScript>
 // Author: Gerry O'Rourke // Author: Gerry O'Rourke
 // Agent Callback Gadget // Agent Callback Gadget
 // Date 02/02/2022  Version 1.0 // Date 02/02/2022  Version 1.0
 + 
 var finesse = finesse || {}; var finesse = finesse || {};
 finesse.gadget = finesse.gadget || {}; finesse.gadget = finesse.gadget || {};
 finesse.container = finesse.container || {}; finesse.container = finesse.container || {};
 _clientLogger = finesse.cslogger.ClientLogger || {};  // for logging _clientLogger = finesse.cslogger.ClientLogger || {};  // for logging
- +  
 + 
 /** @namespace */ /** @namespace */
 finesse.modules = finesse.modules || {}; finesse.modules = finesse.modules || {};
 finesse.modules.AgentCallbackGadget = (function ($) { finesse.modules.AgentCallbackGadget = (function ($) {
 + 
     var _user;     var _user;
     var _host = 'w2016-dev';     var _host = 'w2016-dev';
Line 237: Line 238:
     var _callbackText = 'To speak directly to this agent, please call 01 5551234 and enter the 6 digit PIN:';     var _callbackText = 'To speak directly to this agent, please call 01 5551234 and enter the 6 digit PIN:';
     var _version = '1.0';     var _version = '1.0';
 + 
     /**     /**
      * Populates the fields in the gadget with data      * Populates the fields in the gadget with data
Line 245: Line 246:
         gadgets.window.adjustHeight();         gadgets.window.adjustHeight();
     },     },
-     +  
-        + 
     /* This function uses the gadgets.io.makeRequest - to do the REST GET, POST or PUT requests and returns success / error     /* This function uses the gadgets.io.makeRequest - to do the REST GET, POST or PUT requests and returns success / error
      * Reference: https://developers.google.com/gadgets/docs/reference#makerequest      * Reference: https://developers.google.com/gadgets/docs/reference#makerequest
Line 258: Line 259:
         var params, uuid;         var params, uuid;
         _clientLogger.log("makeRequest()");         _clientLogger.log("makeRequest()");
 + 
         // Protect against null dereferencing of options & handlers allowing its (nonexistant) keys to be read as undefined         // Protect against null dereferencing of options & handlers allowing its (nonexistant) keys to be read as undefined
         params = {};         params = {};
Line 264: Line 265:
         handlers.success = _util.validateHandler(handlers.success);         handlers.success = _util.validateHandler(handlers.success);
         handlers.error = _util.validateHandler(handlers.error);         handlers.error = _util.validateHandler(handlers.error);
 + 
         // Request Headers         // Request Headers
         params[gadgets.io.RequestParameters.HEADERS] = {};         params[gadgets.io.RequestParameters.HEADERS] = {};
 + 
         // HTTP method is a passthrough to gadgets.io.makeRequest         // HTTP method is a passthrough to gadgets.io.makeRequest
         params[gadgets.io.RequestParameters.METHOD] = options.method;         params[gadgets.io.RequestParameters.METHOD] = options.method;
 + 
         if (options.method === "GET") {         if (options.method === "GET") {
             // Disable caching for GETs             // Disable caching for GETs
Line 282: Line 283:
             params[gadgets.io.RequestParameters.HEADERS].requestId = uuid;             params[gadgets.io.RequestParameters.HEADERS].requestId = uuid;
             params[gadgets.io.RequestParameters.GET_FULL_HEADERS] = "true";             params[gadgets.io.RequestParameters.GET_FULL_HEADERS] = "true";
- + 
         } else {         } else {
             // Generate a requestID and add it to the headers             // Generate a requestID and add it to the headers
Line 289: Line 290:
             params[gadgets.io.RequestParameters.GET_FULL_HEADERS] = "true";             params[gadgets.io.RequestParameters.GET_FULL_HEADERS] = "true";
         }         }
-         +  
 + 
         // Add content type & body if content body is provided         // Add content type & body if content body is provided
         if (options.content) {         if (options.content) {
Line 298: Line 299:
             params[gadgets.io.RequestParameters.POST_DATA] = options.content;             params[gadgets.io.RequestParameters.POST_DATA] = options.content;
         }         }
 + 
         // Call the gadgets.io.makereqest function with the encoded url         // Call the gadgets.io.makereqest function with the encoded url
         _clientLogger.log("makeRequest(): Making a REST API request to: " + url);         _clientLogger.log("makeRequest(): Making a REST API request to: " + url);
         gadgets.io.makeRequest(encodeURI(url), handleResponse(handlers), params);         gadgets.io.makeRequest(encodeURI(url), handleResponse(handlers), params);
     },     },
-    + 
     /**     /**
      * Handler for the response of the REST API request. This function determines if      * Handler for the response of the REST API request. This function determines if
Line 319: Line 320:
         return function (response) {         return function (response) {
             _clientLogger.log("handleResponse(): The response status code is: " + response.rc);             _clientLogger.log("handleResponse(): The response status code is: " + response.rc);
 + 
             // Send the response to the success handler if the http status             // Send the response to the success handler if the http status
             // code is 200 - 299. Send the response to the error handler             // code is 200 - 299. Send the response to the error handler
Line 334: Line 335:
         };         };
     },     },
-     +  
 + 
     /**     /**
      * Handler for getCallbacks when successful.      * Handler for getCallbacks when successful.
Line 341: Line 342:
     _getCallbacksSuccess = function(response) {     _getCallbacksSuccess = function(response) {
  _clientLogger.log ("_getCallbacksSuccess(): --------");  _clientLogger.log ("_getCallbacksSuccess(): --------");
 + 
  var _getCallbacksSuccessJSON = JSON.parse(response.text);  var _getCallbacksSuccessJSON = JSON.parse(response.text);
  _clientLogger.log ("_getCallbacksSuccess(): _getCallbacksSuccessJSON: " + JSON.stringify(_getCallbacksSuccessJSON)); // Commenting this out to remove authToken from Console Logs  _clientLogger.log ("_getCallbacksSuccess(): _getCallbacksSuccessJSON: " + JSON.stringify(_getCallbacksSuccessJSON)); // Commenting this out to remove authToken from Console Logs
  callbackTableValues = _getCallbacksSuccessJSON;  callbackTableValues = _getCallbacksSuccessJSON;
 + 
  $("#CallbackTable tr").remove(); //Clear table rows before refreshing data  $("#CallbackTable tr").remove(); //Clear table rows before refreshing data
  _clientLogger.log ("_getCallbacksSuccess(): Clear table before regenerating")  _clientLogger.log ("_getCallbacksSuccess(): Clear table before regenerating")
- +  
 + 
  function generateTableHead(table, data) {  function generateTableHead(table, data) {
    let thead = table.createTHead();    let thead = table.createTHead();
Line 360: Line 361:
    }    }
  }  }
 + 
  function generateTable(table, data) {  function generateTable(table, data) {
    for (let element of data) {    for (let element of data) {
Line 371: Line 372:
    }    }
  }  }
 + 
  let table = document.querySelector("#CallbackTable");  let table = document.querySelector("#CallbackTable");
  let data = Object.keys(callbackTableValues[0]);  let data = Object.keys(callbackTableValues[0]);
 + 
  _clientLogger.log ("_getCallbacksSuccess(): Printing Table")  _clientLogger.log ("_getCallbacksSuccess(): Printing Table")
  generateTableHead(table, data);  generateTableHead(table, data);
  generateTable(table, callbackTableValues);  generateTable(table, callbackTableValues);
 + 
  gadgets.window.adjustHeight();  gadgets.window.adjustHeight();
 + 
     },     },
 + 
     /**     /**
      * Handler for getCallback Errors      * Handler for getCallback Errors
Line 390: Line 391:
         var statusCode = response.rc;         var statusCode = response.rc;
         var errorMessage = 'Network or Configuration Error'; //Default Error         var errorMessage = 'Network or Configuration Error'; //Default Error
 + 
         // Checking if we got any HTTP Headers in response (maybe not if there was a Timeout etc.)         // Checking if we got any HTTP Headers in response (maybe not if there was a Timeout etc.)
         if (typeof response.headers != "undefined") {         if (typeof response.headers != "undefined") {
             var myContentType = response.headers["content-type"];             var myContentType = response.headers["content-type"];
             console.log("Content-Type: " + myContentType);             console.log("Content-Type: " + myContentType);
 + 
             //Checking if Content is JSON and so use the error value returned by the server             //Checking if Content is JSON and so use the error value returned by the server
             if (myContentType == "application/json; charset=UTF-8") {             if (myContentType == "application/json; charset=UTF-8") {
Line 405: Line 406:
             }             }
         }         }
 + 
         _clientLogger.log ("_getCallbacksError() - WebServerStatusCode: " + statusCode);         _clientLogger.log ("_getCallbacksError() - WebServerStatusCode: " + statusCode);
         _clientLogger.log ("_getCallbacksError() - errorMessage: " + errorMessage);         _clientLogger.log ("_getCallbacksError() - errorMessage: " + errorMessage);
- +  
 + 
         $('#errorMsgHeader').text("Failed to Retrieve Callbacks!");         $('#errorMsgHeader').text("Failed to Retrieve Callbacks!");
         $('#errorMsgCode').text(statusCode);         $('#errorMsgCode').text(statusCode);
         $('#errorMsgMessage').text(errorMessage);         $('#errorMsgMessage').text(errorMessage);
         $('#errorMsg').show();         $('#errorMsg').show();
 + 
         gadgets.window.adjustHeight();         gadgets.window.adjustHeight();
     },     },
 + 
     /**     /**
      * Handler for getCallbacks when successful.      * Handler for getCallbacks when successful.
Line 423: Line 424:
     _createCallbackSuccess = function(response) {     _createCallbackSuccess = function(response) {
  _clientLogger.log ("_createCallbacksSuccess(): --------");  _clientLogger.log ("_createCallbacksSuccess(): --------");
 + 
  var _getCallbacksSuccessJSON = JSON.parse(response.text);  var _getCallbacksSuccessJSON = JSON.parse(response.text);
  _clientLogger.log ("_createCallbacksSuccess(): _getCallbacksSuccessJSON: " + JSON.stringify(_getCallbacksSuccessJSON)); // Commenting this out to remove authToken from Console Logs  _clientLogger.log ("_createCallbacksSuccess(): _getCallbacksSuccessJSON: " + JSON.stringify(_getCallbacksSuccessJSON)); // Commenting this out to remove authToken from Console Logs
  callbackTableValues = _getCallbacksSuccessJSON;  callbackTableValues = _getCallbacksSuccessJSON;
 + 
  $("#CallbackTable tr").remove(); //Clear table rows before refreshing data  $("#CallbackTable tr").remove(); //Clear table rows before refreshing data
  _clientLogger.log ("_createCallbacksSuccess(): Clear table before regenerating")  _clientLogger.log ("_createCallbacksSuccess(): Clear table before regenerating")
- +  
 + 
  function generateTableHead(table, data) {  function generateTableHead(table, data) {
    let thead = table.createTHead();    let thead = table.createTHead();
Line 442: Line 443:
    }    }
  }  }
 + 
  function generateTable(table, data) {  function generateTable(table, data) {
    for (let element of data) {    for (let element of data) {
Line 453: Line 454:
    }    }
  }  }
 + 
  let table = document.querySelector("#CallbackTable");  let table = document.querySelector("#CallbackTable");
  let data = Object.keys(callbackTableValues[0]);  let data = Object.keys(callbackTableValues[0]);
 + 
  _clientLogger.log ("_createCallbacksSuccess(): Printing Table")  _clientLogger.log ("_createCallbacksSuccess(): Printing Table")
  generateTableHead(table, data);  generateTableHead(table, data);
  generateTable(table, callbackTableValues);  generateTable(table, callbackTableValues);
 +  
 + //Clear Name and Description Fields after successful Callback Creation. 
 + document.getElementById('name').value = ""; 
 + document.getElementById('description').value = ""; 
 + 
  gadgets.window.adjustHeight();  gadgets.window.adjustHeight();
 + 
     },     },
 + 
     /**     /**
      * Handler for getCallback Errors      * Handler for getCallback Errors
Line 472: Line 477:
         var statusCode = response.rc;         var statusCode = response.rc;
         var errorMessage = 'Network or Configuration Error'; //Default Error         var errorMessage = 'Network or Configuration Error'; //Default Error
 + 
         // Checking if we got any HTTP Headers in response (maybe not if there was a Timeout etc.)         // Checking if we got any HTTP Headers in response (maybe not if there was a Timeout etc.)
         if (typeof response.headers != "undefined") {         if (typeof response.headers != "undefined") {
             var myContentType = response.headers["content-type"];             var myContentType = response.headers["content-type"];
             console.log("Content-Type: " + myContentType);             console.log("Content-Type: " + myContentType);
 + 
             //Checking if Content is JSON and so use the error value returned by the server             //Checking if Content is JSON and so use the error value returned by the server
             if (myContentType == "application/json; charset=UTF-8") {             if (myContentType == "application/json; charset=UTF-8") {
Line 487: Line 492:
             }             }
         }         }
 + 
         _clientLogger.log ("_createCallbacksError() - WebServerStatusCode: " + statusCode);         _clientLogger.log ("_createCallbacksError() - WebServerStatusCode: " + statusCode);
         _clientLogger.log ("_createCallbacksError() - errorMessage: " + errorMessage);         _clientLogger.log ("_createCallbacksError() - errorMessage: " + errorMessage);
- +  
 + 
         $('#errorMsgHeader').text("Failed to Retrieve Callbacks!");         $('#errorMsgHeader').text("Failed to Retrieve Callbacks!");
         $('#errorMsgCode').text(statusCode);         $('#errorMsgCode').text(statusCode);
         $('#errorMsgMessage').text(errorMessage);         $('#errorMsgMessage').text(errorMessage);
         $('#errorMsg').show();         $('#errorMsg').show();
 + 
         gadgets.window.adjustHeight();         gadgets.window.adjustHeight();
     },     },
 + 
     /**     /**
      * Handler for the onLoad of a User object.  This occurs when the User object is initially read      * Handler for the onLoad of a User object.  This occurs when the User object is initially read
      * from the Finesse server.  Any once only initialization should be done within this function.      * from the Finesse server.  Any once only initialization should be done within this function.
      */      */
-    + 
      _handleUserLoad = function (userevent) {      _handleUserLoad = function (userevent) {
         _clientLogger.log("_handleUserLoad(): --------");         _clientLogger.log("_handleUserLoad(): --------");
 + 
         _myAgentId = _user.getId();         _myAgentId = _user.getId();
         _clientLogger.log("_handleUserLoad(): Agent ID: " + _myAgentId) ;         _clientLogger.log("_handleUserLoad(): Agent ID: " + _myAgentId) ;
  _getCallbacks();  _getCallbacks();
     },     },
-       + 
     _getCallbacks = function() {     _getCallbacks = function() {
         _clientLogger.log ("_getCallbacks(): --------");         _clientLogger.log ("_getCallbacks(): --------");
 + 
         var url = _baseURL + _getCallbackPath + '?agentId=' + _myAgentId;         var url = _baseURL + _getCallbackPath + '?agentId=' + _myAgentId;
         _clientLogger.log ("_getCallbacks(): URL: " + url);         _clientLogger.log ("_getCallbacks(): URL: " + url);
 + 
         makeRequest(url, {         makeRequest(url, {
             method: 'GET',             method: 'GET',
Line 526: Line 531:
         });         });
     };     };
 + 
     _createCallback = function() {     _createCallback = function() {
         _clientLogger.log ("_createCallback(): --------");         _clientLogger.log ("_createCallback(): --------");
 +  
 + const RadioCallbackExpiryButtons = document.querySelectorAll('input[name="RadioCallbackExpiry"]'); 
 + for (const RadioCallbackExpiryButton of RadioCallbackExpiryButtons) { 
 + if (RadioCallbackExpiryButton.checked) { 
 + ExpiryHours = RadioCallbackExpiryButton.value; 
 + _clientLogger.log ("_createCallback(): ExpiryHours: " + ExpiryHours + " hours"); 
 + break; 
 +
 +
 + 
  var name = document.getElementById('name').value;  var name = document.getElementById('name').value;
- if (name===""){name = " - "};+ if (name===""){name = "-"};
  var description = document.getElementById('description').value;  var description = document.getElementById('description').value;
- if (description===""){description = " - "};+ if (description===""){description = "-"};
         _clientLogger.log ("_createCallback(): Name: " + name);         _clientLogger.log ("_createCallback(): Name: " + name);
-  +  
- document.getElementById('name').value = ""; +        var url = _baseURL + _createCallbackPath + '?agentId=' + _myAgentId + '&customerName=' + name + '&description=' + description + '&expireIn=' + ExpiryHours;
- document.getElementById('description').value = ""; +
- +
-        var url = _baseURL + _createCallbackPath + '?agentId=' + _myAgentId + '&customerName=' + name + '&description=' + description + '&expireIn=72';+
         _clientLogger.log ("_createCallback(): URL: " + url);         _clientLogger.log ("_createCallback(): URL: " + url);
 + 
         makeRequest(url, {         makeRequest(url, {
             method: 'GET',             method: 'GET',
Line 549: Line 560:
         });         });
     };     };
 + 
     /** @scope finesse.modules.AgentCallbackGadget */     /** @scope finesse.modules.AgentCallbackGadget */
     return {     return {
Line 557: Line 568:
          */          */
         refreshCallbacks : function () {         refreshCallbacks : function () {
 + // Clear Name and Description Fields
 + document.getElementById('name').value = "";
 + document.getElementById('description').value = "";
 + 
             _getCallbacks();             _getCallbacks();
         },         },
 + 
         /**         /**
          * Create Callback           * Create Callback 
Line 567: Line 582:
             _createCallback();             _createCallback();
         },         },
- + 
         /**         /**
          * Create Callback           * Create Callback 
Line 580: Line 595:
             _clientLogger.log ('copyToClipboard: CallbackId: ' + copyCallbackId);             _clientLogger.log ('copyToClipboard: CallbackId: ' + copyCallbackId);
             _clientLogger.log ('copyToClipboard: ExpiryTime: ' + copyExpiryTime);             _clientLogger.log ('copyToClipboard: ExpiryTime: ' + copyExpiryTime);
 + 
  /* Copy the text inside the text field */  /* Copy the text inside the text field */
  navigator.clipboard.writeText(_callbackText + ' ' + copyCallbackId + '. This callback will expire on ' + copyExpiryTime);  navigator.clipboard.writeText(_callbackText + ' ' + copyCallbackId + '. This callback will expire on ' + copyExpiryTime);
 + 
  /* Alert the copied text */  /* Alert the copied text */
  alert('Copied Callback ID: ' + copyCallbackId + ' to the clipboard');  alert('Copied Callback ID: ' + copyCallbackId + ' to the clipboard');
  },   },
 + 
         /**         /**
          * Performs all initialization for this gadget          * Performs all initialization for this gadget
Line 593: Line 608:
         init : function () {         init : function () {
             var _clientLogger = finesse.cslogger.ClientLogger;   // declare _clientLogger             var _clientLogger = finesse.cslogger.ClientLogger;   // declare _clientLogger
 + 
             // Initiate the ClientLogs. The gadget id will be logged as a part of the message             // Initiate the ClientLogs. The gadget id will be logged as a part of the message
             _clientLogger.init(gadgets.Hub, "AgentCallbackGadget", finesse.gadget.Config);             _clientLogger.init(gadgets.Hub, "AgentCallbackGadget", finesse.gadget.Config);
             _clientLogger.log ("init(): Initializing...");             _clientLogger.log ("init(): Initializing...");
-                + 
             var cfg = finesse.gadget.Config;             var cfg = finesse.gadget.Config;
             _util = finesse.utilities.Utilities;             _util = finesse.utilities.Utilities;
 + 
             // Initiate the ClientServices and load the user object. ClientServices are             // Initiate the ClientServices and load the user object. ClientServices are
             // initialized with a reference to the current configuration.             // initialized with a reference to the current configuration.
             finesse.clientservices.ClientServices.init(cfg, false);             finesse.clientservices.ClientServices.init(cfg, false);
- + 
             gadgets.window.adjustHeight();             gadgets.window.adjustHeight();
-             +  
-    + 
             _user = new finesse.restservices.User({             _user = new finesse.restservices.User({
                 id: finesse.gadget.Config.id,                  id: finesse.gadget.Config.id, 
Line 614: Line 629:
             _clientLogger.log ("init(): Host: " + _host);             _clientLogger.log ("init(): Host: " + _host);
             _clientLogger.log ("init(): Version: " + _version);             _clientLogger.log ("init(): Version: " + _version);
 + 
             // Initiate the ContainerServices and add a handler for when the tab is visible             // Initiate the ContainerServices and add a handler for when the tab is visible
             // to adjust the height of this gadget in case the tab was not visible             // to adjust the height of this gadget in case the tab was not visible
Line 629: Line 644:
     };     };
 }(jQuery)); }(jQuery));
 +</code>
 +
 +==== XML Code for createCallback====
 +<code xml>
 +<?xml version="1.0" encoding="UTF-8"?>
 +<Module>
 + <ModulePrefs title="Agent Callback Gadget" description="Agent Callback Gadget" scrolling="auto">
 + <Require feature="settitle"/>
 + <Require feature="dynamic-height"/>
 + <Require feature="pubsub-2"/>
 + <Require feature="setprefs"/>
 + <Require feature="loadingindicator">
 + <Param name="manual-dismiss">false</Param>
 + <Param name="loading-timeout">10</Param>
 + </Require>
 + </ModulePrefs>
 + <!--Uncomment the below 3 lines if NOT hosting on Finesse server. -->
 + <UserPref name="scheme"
 +           display_name="scheme"
 +           default_value=""/>
 + <UserPref name="host"
 +           display_name="host"
 +           default_value=""/>
 + <UserPref name="hostPort"
 +           display_name="hostPort"
 +           default_value=""/>
 + <Content type="html">
 +<![CDATA[
 +            <!DOCTYPE html>
 +            <head>
 +                <!-- Styling -->
 +                <link rel="stylesheet" href="./bootstrap-4.6.1-dist/css/bootstrap.min.css" type="text/css" />
 +                <link rel="stylesheet" href="./AgentCallback.css" type="text/css" />
 +
 + <!-- jQuery - uncomment if NOT hosting on Finesse server -->
 + <script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/jquery.min.js"></script>
 +
 + <!-- Finesse Library - uncomment if NOT hosting on Finesse server -->
 + <script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/finesse.js"></script>
 +
 +                <!-- Bootstrap - Must appear After jQuery JS-->
 +                <script type="text/javascript" src="./bootstrap-4.6.1-dist/js/bootstrap.min.js"></script>
 +
 +            
 +                <!-- Gadget Business Logic -->
 +                <script type="text/javascript" src="./AgentCallback.js"></script>
 +            </head>
 +
 +            <body class="claro">
 +
 + <div class="container">
 +
 + <div id="errorMsg" class="alert alert-warning alert-dismissible fade show" role="alert" style="display: none">
 +   <div><strong><span id="errorMsgHeader"></span></strong></div>
 +   <div><strong>Error Code:&nbsp;</strong><span id="errorMsgCode"></span></div>
 +   <div><strong>Error Message:&nbsp;</strong><span id="errorMsgMessage"></span></div>
 +   <button type="button" class="close" data-hide="alert" aria-label="Close" onclick="$('#errorMsg').hide();gadgets.window.adjustHeight(800);">
 + <span aria-hidden="true">&times;</span>
 +   </button>
 + </div>
 +
 + <div class="alert alert-primary" role="alert">
 + <strong>Agent Callback Number:</strong> 01 555 1234
 + </div>
 + <form>
 +
 + <div class="row">
 + <div class="col">
 + <label for="name"><strong>Name</strong></label>
 + </div>
 + <div class="col">
 + <label for="description"><strong>Description</strong></label>
 + </div>
 + </div>
 + <div class="row">
 + <div class="col">
 + <input type="text" class="form-control" id="name" placeholder="Enter the customer's name" maxlength="40">
 + </div>
 + <div class="col">
 + <input type="text" class="form-control" id="description" placeholder="Enter a description" maxlength="40">
 + </div>
 + </div>
 +
 + <div>&nbsp;</div>
 +
 + <div class="custom-control custom-radio custom-control-inline">
 + <input class="form-check-input" type="radio" name="RadioCallbackExpiry" id="RadioButton1" value="1" checked>
 + <label class="form-check-label" for="RadioButton1">
 + 1 hour
 + </label>
 + </div>
 + <div class="custom-control custom-radio custom-control-inline">
 + <input class="form-check-input" type="radio" name="RadioCallbackExpiry" id="RadioButton2" value="24">
 + <label class="form-check-label" for="RadioButton2">
 + 1 day
 + </label>
 + </div>
 + <div class="custom-control custom-radio custom-control-inline">
 + <input class="form-check-input" type="radio" name="RadioCallbackExpiry" id="RadioButton3" value="168">
 + <label class="form-check-label" for="RadioButton3">
 + 1 week
 + </label>
 + </div>
 +
 + <div class="custom-control custom-radio custom-control-inline" style="width: 200px;">
 + <button type="button" class="btn btn-outline-success" id="createCallback" onClick="finesse.modules.AgentCallbackGadget.createCallback()">Create</button>
 + <button type="button" class="btn btn-outline-secondary" id="refreshCallbacks" onClick="finesse.modules.AgentCallbackGadget.refreshCallbacks()">Refresh</button>
 + <button type="button" class="btn btn-outline-info" id="copyToClipboard" onClick="finesse.modules.AgentCallbackGadget.copyToClipboard()">Copy</button>
 + </div>
 +
 + </form>
 +
 + <hr>
 +
 + <div class="table-responsive" style="height: 500px;">
 + <table class="table" id="CallbackTable">
 + </table>
 + </div>
 + </div>
 +            </body>
 +            <script type="text/javascript"> gadgets.HubSettings.onConnect = function () {finesse.modules.AgentCallbackGadget.init();};</script>
 +        ]]></Content>
 +</Module>
 </code> </code>
  • myapps/agent-callback.1643899068.txt.gz
  • Last modified: 2022/02/03 14:37
  • by gerardorourke