index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <div>
  3. <el-row :gutter="10">
  4. <el-col :span="12">
  5. <el-card>
  6. <template #header>
  7. <el-divider>gin-vue-admin</el-divider>
  8. </template>
  9. <div>
  10. <el-row>
  11. <el-col
  12. :span="8"
  13. :offset="8"
  14. >
  15. <a href="https://github.com/flipped-aurora/gin-vue-admin">
  16. <img
  17. class="org-img dom-center"
  18. src="@/assets/logo.png"
  19. alt="gin-vue-admin"
  20. >
  21. </a>
  22. </el-col>
  23. </el-row>
  24. <el-row :gutter="10">
  25. <el-col :span="8">
  26. <a href="https://github.com/flipped-aurora/gin-vue-admin">
  27. <img
  28. class="dom-center"
  29. src="https://img.shields.io/github/watchers/flipped-aurora/gin-vue-admin.svg?label=Watch"
  30. alt=""
  31. >
  32. </a>
  33. </el-col>
  34. <el-col :span="8">
  35. <a href="https://github.com/flipped-aurora/gin-vue-admin">
  36. <img
  37. class="dom-center"
  38. src="https://img.shields.io/github/stars/flipped-aurora/gin-vue-admin.svg?style=social"
  39. alt=""
  40. >
  41. </a>
  42. </el-col>
  43. <el-col :span="8">
  44. <a href="https://github.com/flipped-aurora/gin-vue-admin">
  45. <img
  46. class="dom-center"
  47. src="https://img.shields.io/github/forks/flipped-aurora/gin-vue-admin.svg?label=Fork"
  48. alt=""
  49. >
  50. </a>
  51. </el-col>
  52. </el-row>
  53. </div>
  54. </el-card>
  55. <el-card style="margin-top: 20px">
  56. <template #header>
  57. <div>flipped-aurora团队</div>
  58. </template>
  59. <div>
  60. <el-row>
  61. <el-col
  62. :span="8"
  63. :offset="8"
  64. >
  65. <a href="https://github.com/flipped-aurora">
  66. <img
  67. class="org-img dom-center"
  68. src="@/assets/flipped-aurora.png"
  69. alt="flipped-aurora"
  70. >
  71. </a>
  72. </el-col>
  73. </el-row>
  74. <el-row
  75. style="margin-left: 40px"
  76. :gutter="20"
  77. >
  78. <el-col
  79. v-for="(item, index) in members"
  80. :key="index"
  81. :span="8"
  82. >
  83. <a :href="item.html_url">
  84. <img
  85. class="avatar-img"
  86. :src="item.avatar_url"
  87. >
  88. <a
  89. class="author-name"
  90. style=""
  91. >{{ item.login }}</a>
  92. </a>
  93. </el-col>
  94. </el-row>
  95. </div>
  96. </el-card>
  97. </el-col>
  98. <el-col :span="12">
  99. <el-card>
  100. <template #header>
  101. <div>提交记录</div>
  102. </template>
  103. <div>
  104. <el-timeline>
  105. <el-timeline-item
  106. v-for="(item,index) in dataTimeline"
  107. :key="index"
  108. :timestamp="item.from"
  109. placement="top"
  110. >
  111. <el-card>
  112. <h4>{{ item.title }}</h4>
  113. <p>{{ item.message }}</p>
  114. </el-card>
  115. </el-timeline-item>
  116. </el-timeline>
  117. </div>
  118. <el-button
  119. class="load-more"
  120. type="primary"
  121. link
  122. @click="loadMore"
  123. >Load more</el-button>
  124. </el-card>
  125. </el-col>
  126. </el-row>
  127. </div>
  128. </template>
  129. <script setup>
  130. import { ref } from 'vue'
  131. import { Commits, Members } from '@/api/github'
  132. import { formatTimeToStr } from '@/utils/date'
  133. const page = ref(0)
  134. defineOptions({
  135. name: 'About'
  136. })
  137. const loadMore = () => {
  138. page.value++
  139. loadCommits()
  140. }
  141. const dataTimeline = ref([])
  142. const loadCommits = () => {
  143. Commits(page.value).then(({ data }) => {
  144. data.forEach((element) => {
  145. if (element.commit.message) {
  146. dataTimeline.value.push({
  147. from: formatTimeToStr(element.commit.author.date, 'yyyy-MM-dd'),
  148. title: element.commit.author.name,
  149. showDayAndMonth: true,
  150. message: element.commit.message,
  151. })
  152. }
  153. })
  154. })
  155. }
  156. const members = ref([])
  157. const loadMembers = () => {
  158. Members().then(({ data }) => {
  159. members.value = data
  160. members.value.sort()
  161. })
  162. }
  163. loadCommits()
  164. loadMembers()
  165. </script>
  166. <style scoped>
  167. .load-more {
  168. margin-left: 120px;
  169. }
  170. .avatar-img {
  171. float: left;
  172. height: 40px;
  173. width: 40px;
  174. border-radius: 50%;
  175. -webkit-border-radius: 50%;
  176. -moz-border-radius: 50%;
  177. margin-top: 15px;
  178. }
  179. .org-img {
  180. height: 150px;
  181. width: 150px;
  182. }
  183. .author-name {
  184. float: left;
  185. line-height: 65px !important;
  186. margin-left: 10px;
  187. color: darkblue;
  188. line-height: 100px;
  189. font-family: "Lucida Sans", "Lucida Sans Regular", "Lucida Grande",
  190. "Lucida Sans Unicode", Geneva, Verdana, sans-serif;
  191. }
  192. .dom-center {
  193. margin-left: 50%;
  194. transform: translateX(-50%);
  195. }
  196. </style>