showInvoices.html 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Quarkus Finance Web Application</title>
  6. <script type="text/javascript">
  7. function changeContent(url) {
  8. document.getElementById("messages").innerHTML = { contentMessages };
  9. return (false);
  10. }
  11. function showInvoiceForm() {
  12. document.getElementById("messages").innerHTML = "<form action='addinvoices' method='get'>"
  13. + "<br/>Invoice ID: <input type='text' id='invoiceId' name='invoiceId'/>"
  14. + "<br/>Customer: <input type='text' id='name' name='name'/>"
  15. + "<br/>Product: <input type='text' id='item' name='item'/>"
  16. + "<br/>Date: <input type='text' id='date' name='date'/>"
  17. + "<br/>Amount: <input type='text' id='amount' name='amount'/>"
  18. + "<br/><input type='submit'/>"
  19. + "</form>"
  20. }
  21. function showCampaignList(e){
  22. (e || window.event).preventDefault();
  23. fetch("showcampaigns/list")
  24. .then((response) => response.text())
  25. .then((html) => {
  26. document.getElementById("messages").innerHTML = html;
  27. })
  28. .catch((error) => {
  29. console.warn(error);
  30. document.getElementById("messages").innerHTML = error;
  31. });
  32. }
  33. </script>
  34. <link rel="stylesheet" type="text/css" href="styles.css" />
  35. </head>
  36. <body>
  37. <div class="banner-wrapper">
  38. <div class="grid">
  39. <div class="banner">
  40. <div class="grid">
  41. <div class="callout">Quarkus Finance Web Application</div>
  42. <div class="app-details">
  43. <h5>Red Hat Training</h5>
  44. <ul>
  45. <li>Java Quarkus</li>
  46. <li>OIDC integration with <code>quarkus-oidc</code> extension.</li>
  47. <li>Authentication Code Flow with confidential client.</li>
  48. </ul>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="content-wrapper">
  55. <div class="grid">
  56. <div class="left-column">
  57. <br />&rsaquo;
  58. <code>@Path protected by Java annotation @Authenticated <a href="showtokens" class="path-link">Show my access token</a></code>
  59. <br />&rsaquo;
  60. <code>@Path protected by Java annotation @RolesAllowed("finance-user") <a href="showinvoices" class="path-link">/showinvoices</a></code>
  61. <br />&rsaquo;
  62. <code>@Path protected by Java annotation @RolesAllowed("finance-admin") <a onclick="javascript:showInvoiceForm();return false;" class="path-link">/addinvoices </a></code>
  63. <!-- <br />&rsaquo; <code>@Path public: <a href="showcampaigns/list" class="path-link">External API: http://localhost:3000/campaign/list</a></code>-->
  64. <br />&rsaquo;
  65. <code>@Path protected in external API(authenticated user) <a onclick="javascript:showCampaignList();return false;" class="path-link">External API: http://localhost:3000/campaign/list</a></code>
  66. </div>
  67. <div class="right-column" id="messages">
  68. <table border="1">
  69. <tr><th>Invoice ID</th> <th>Item</th><th>Customer</th><th>Date</th><th>Amount (€)</th> </tr>
  70. {#for invoice in invoices}
  71. <tr>
  72. <td>{invoice.id}</td>
  73. <td>{invoice.item}</td>
  74. <td>{invoice.name}</td>
  75. <td>{invoice.date}</td>
  76. <td>{invoice.amount}</td>
  77. </tr>
  78. {/for}
  79. </table>
  80. <div><a href="/finance">Back</a></div>
  81. </div>
  82. </div>
  83. </div>
  84. </body>
  85. </html>