index.vue 5.0 KB

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