You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OAuthItem.vue 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!--
  2. - @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl>
  3. -
  4. - @author Roeland Jago Douma <roeland@famdouma.nl>
  5. -
  6. - @license GNU AGPL version 3 or any later version
  7. -
  8. - This program is free software: you can redistribute it and/or modify
  9. - it under the terms of the GNU Affero General Public License as
  10. - published by the Free Software Foundation, either version 3 of the
  11. - License, or (at your option) any later version.
  12. -
  13. - This program is distributed in the hope that it will be useful,
  14. - but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. - GNU Affero General Public License for more details.
  17. -
  18. - You should have received a copy of the GNU Affero General Public License
  19. - along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. -
  21. -->
  22. <template>
  23. <tr>
  24. <td>{{ name }}</td>
  25. <td>{{ redirectUri }}</td>
  26. <td><code>{{ clientId }}</code></td>
  27. <td><code>{{ renderedSecret }}</code><a class="icon-toggle has-tooltip" :title="t('oauth2', 'Show client secret')" @click="toggleSecret" /></td>
  28. <td class="action-column">
  29. <span><a class="icon-delete has-tooltip" :title="t('oauth2', 'Delete')" @click="$emit('delete', id)" /></span>
  30. </td>
  31. </tr>
  32. </template>
  33. <script>
  34. export default {
  35. name: 'OAuthItem',
  36. props: {
  37. client: {
  38. type: Object,
  39. required: true
  40. }
  41. },
  42. data: function() {
  43. return {
  44. id: this.client.id,
  45. name: this.client.name,
  46. redirectUri: this.client.redirectUri,
  47. clientId: this.client.clientId,
  48. clientSecret: this.client.clientSecret,
  49. renderSecret: false
  50. }
  51. },
  52. computed: {
  53. renderedSecret: function() {
  54. if (this.renderSecret) {
  55. return this.clientSecret
  56. } else {
  57. return '****'
  58. }
  59. }
  60. },
  61. methods: {
  62. toggleSecret() {
  63. this.renderSecret = !this.renderSecret
  64. }
  65. }
  66. }
  67. </script>
  68. <style scoped>
  69. .icon-toggle,
  70. .icon-delete {
  71. display: inline-block;
  72. width: 16px;
  73. height: 16px;
  74. padding: 10px;
  75. vertical-align: middle;
  76. }
  77. td code {
  78. display: inline-block;
  79. vertical-align: middle;
  80. padding: 3px;
  81. }
  82. </style>