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.

81 lines
2.2KB

  1. <template>
  2. <div id="index">
  3. <v-card class="bench elevation-5" :loading="loading">
  4. <v-card-title>
  5. <h2>Benchmarks</h2>
  6. <v-spacer></v-spacer>
  7. <v-text-field class="search" v-model="search" append-icon="magnify" label="Search" single-line hide-details></v-text-field>
  8. </v-card-title>
  9. <v-data-table :search="search" multi-sort :headers="headers" :items="benchmarks" :items-per-page="5">
  10. <template v-slot:item.timestamp="{ item }">
  11. <span>{{ new Date(item.timestamp).toLocaleDateString() }}</span>
  12. </template>
  13. </v-data-table>
  14. </v-card>
  15. <h4>Submit your own benchmarks <router-link to="/submit">here</router-link></h4>
  16. <h5>Admin panel <router-link to="/login">here</router-link></h5>
  17. </div>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. loading: true,
  24. search: "",
  25. headers: [
  26. {
  27. text: "Vendor",
  28. align: "start",
  29. value: "vendor"
  30. },
  31. {
  32. text: "Model",
  33. value: "model"
  34. },
  35. {
  36. text: "Memory",
  37. value: "memory"
  38. },
  39. {
  40. text: "Hashrate (h/s)",
  41. value: "hashrate"
  42. },
  43. {
  44. text: "Watts (w)",
  45. value: "watts"
  46. },
  47. {
  48. text: "Miner",
  49. value: "minerVersion"
  50. },
  51. {
  52. text: "Submitted On",
  53. value: "timestamp",
  54. class: "Date"
  55. },
  56. {
  57. text: "User",
  58. value: "owner"
  59. }
  60. ],
  61. benchmarks: []
  62. }
  63. },
  64. mounted() {
  65. fetch(this.$api + "/api/benchmarks").then(result => result.json()).then(json => {
  66. this.benchmarks = json
  67. this.loading = false
  68. })
  69. }
  70. }
  71. </script>
  72. <style scoped>
  73. .bench {
  74. margin: 10%;
  75. margin-top: 5%;
  76. margin-bottom: 2%;
  77. padding: 2%;
  78. }
  79. </style>