ConfigSetter.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <!DOCTYPE html>
  2. <!--
  3. Licensed Materials - Property of IBM
  4. IBM Cognos Products: bi-utils
  5. (C) Copyright IBM Corp. 2017, 2018
  6. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  7. -->
  8. <html>
  9. <head>
  10. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  11. </head>
  12. <body>
  13. <h3>Advanced configuration values can now be set in the main UI at Manage -> Configuration -> System -> Advanced Settings</h3>
  14. </body>
  15. </html>
  16. <!--
  17. <html>
  18. <head>
  19. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  20. <script src="../lib/jquery/3.3.1/jquery.min.js"></script>
  21. <script type="text/javascript">
  22. $(document).ready(function(){
  23. // click on button submit
  24. $("#submit").on('click', function(){
  25. document.getElementById("updating").innerText = " updating...";
  26. $.ajax({
  27. headers: {'X-XSRF-Token': getCookie('XSRF-TOKEN')},
  28. url: '../v1/configuration/keys/global',
  29. type : 'PUT',
  30. contentType: 'application/json',
  31. data : '{"' + $("#form :input[name='name']").val() + '":"' + $("#form :input[name='value']").val() + '"}',
  32. error: function(xhr, resp, text) {
  33. console.log(xhr, resp, text);
  34. document.getElementById("updating").innerText = "";
  35. alert(text);
  36. },
  37. success: function() {
  38. document.getElementById("updating").innerText = "";
  39. alert("Configuration updated.");
  40. }
  41. })
  42. });
  43. });
  44. </script>
  45. <script>
  46. function getCookie(c_name) {
  47. if (document.cookie.length > 0) {
  48. c_start = document.cookie.indexOf(c_name + "=");
  49. if (c_start != -1) {
  50. c_start = c_start + c_name.length + 1;
  51. c_end = document.cookie.indexOf(";", c_start);
  52. if (c_end == -1) {
  53. c_end = document.cookie.length;
  54. }
  55. return unescape(document.cookie.substring(c_start, c_end));
  56. }
  57. }
  58. return "";
  59. }
  60. function getval() {
  61. var name = $("#form :input[name='name']").val();
  62. $.ajax({
  63. headers: {'X-XSRF-Token': getCookie('XSRF-TOKEN')},
  64. url: '../v1/configuration/keys/' + name,
  65. type : 'GET',
  66. dataType: 'json',
  67. success : function(data) {
  68. $("#form :input[name='value']").val(data[name]);
  69. },
  70. error: function(xhr, resp, text) {
  71. console.log(xhr, resp, text);
  72. }
  73. })
  74. }
  75. </script>
  76. </head>
  77. <body>
  78. <h1>Set Configuration Values</h1>
  79. <h3>First log into Cognos Analytics as a System Administrator</h3>
  80. <p>Changes may take up to 10sec to apply. No server restart required.</p>
  81. <form id="form" action="" method="post">
  82. Name: <input type="text" name="name" size="50" onblur="getval()" autofocus/><span id='description'></span><br>
  83. Value: <input type="text" name="value" size="50">
  84. <br>
  85. <input id="submit" type="button" name="submit" value="submit"><span id="updating"/>
  86. </form>
  87. </body>
  88. </html>
  89. -->