Fixed style error.

pull/3445/head
ruibaby 2019-05-03 23:53:08 +08:00
parent faf18322c6
commit 03b4dcde15
4 changed files with 89 additions and 23 deletions

View File

@ -11,6 +11,13 @@ adminApi.counts = () => {
}) })
} }
adminApi.environments = () => {
return service({
url: `${baseUrl}/environments`,
method: 'get'
})
}
adminApi.install = data => { adminApi.install = data => {
return service({ return service({
url: `${baseUrl}/installations`, url: `${baseUrl}/installations`,

View File

@ -1,19 +1,22 @@
<template> <template>
<page-view> <page-view>
<a-row :gutter="24"> <a-row :gutter="12">
<a-col <a-col
:xl="6" :xl="6"
:lg="6" :lg="6"
:md="12" :md="12"
:sm="12" :sm="12"
:xs="12" :xs="12"
:style="{ marginBottom: '24px' }" :style="{ marginBottom: '12px' }"
> >
<analysis-card <analysis-card
:loading="countsLoading" :loading="countsLoading"
title="文章" title="文章"
:number="countsData.postCount" :number="countsData.postCount"
> >
<router-link :to="{ name:'PostList' }" slot="action">
<a-icon type="link" />
</router-link>
</analysis-card> </analysis-card>
</a-col> </a-col>
<a-col <a-col
@ -22,13 +25,16 @@
:md="12" :md="12"
:sm="12" :sm="12"
:xs="12" :xs="12"
:style="{ marginBottom: '24px' }" :style="{ marginBottom: '12px' }"
> >
<analysis-card <analysis-card
:loading="countsLoading" :loading="countsLoading"
title="评论" title="评论"
:number="countsData.commentCount" :number="countsData.commentCount"
> >
<router-link :to="{ name:'Comments' }" slot="action">
<a-icon type="link" />
</router-link>
</analysis-card> </analysis-card>
</a-col> </a-col>
<a-col <a-col
@ -37,13 +43,16 @@
:md="12" :md="12"
:sm="12" :sm="12"
:xs="12" :xs="12"
:style="{ marginBottom: '24px' }" :style="{ marginBottom: '12px' }"
> >
<analysis-card <analysis-card
:loading="countsLoading" :loading="countsLoading"
title="附件" title="附件"
:number="countsData.attachmentCount" :number="countsData.attachmentCount"
> >
<router-link :to="{ name:'Attachments' }" slot="action">
<a-icon type="link" />
</router-link>
</analysis-card> </analysis-card>
</a-col> </a-col>
<a-col <a-col
@ -52,13 +61,16 @@
:md="12" :md="12"
:sm="12" :sm="12"
:xs="12" :xs="12"
:style="{ marginBottom: '24px' }" :style="{ marginBottom: '12px' }"
> >
<analysis-card <analysis-card
:loading="countsLoading" :loading="countsLoading"
title="成立天数" title="成立天数"
:number="countsData.establishDays" :number="countsData.establishDays"
> >
<a-tooltip :title="'已成立'+countsData.establishDays+'天了'" slot="action">
<a href="javascript:void(0);"><a-icon type="info-circle-o" /></a>
</a-tooltip>
</analysis-card> </analysis-card>
</a-col> </a-col>
</a-row> </a-row>
@ -69,6 +81,7 @@
:md="12" :md="12"
:sm="24" :sm="24"
:xs="24" :xs="24"
:style="{ marginBottom: '12px' }"
> >
<a-card <a-card
:loading="postLoading" :loading="postLoading"
@ -84,6 +97,7 @@
:md="12" :md="12"
:sm="24" :sm="24"
:xs="24" :xs="24"
:style="{ marginBottom: '12px' }"
> >
<a-card <a-card
:loading="commentLoading" :loading="commentLoading"
@ -99,9 +113,10 @@
:md="12" :md="12"
:sm="24" :sm="24"
:xs="24" :xs="24"
:style="{ marginBottom: '12px' }"
> >
<a-card <a-card
:loading="commentLoading" :loading="logLoading"
:bordered="false" :bordered="false"
title="最新日志" title="最新日志"
> >
@ -218,8 +233,8 @@ export default {
}, },
getCounts() { getCounts() {
adminApi.counts().then(response => { adminApi.counts().then(response => {
this.countsLoading = false
this.countsData = response.data.data this.countsData = response.data.data
this.countsLoading = false
}) })
} }
} }

View File

@ -1,18 +1,23 @@
<template> <template>
<a-card <a-card
:loading="loading" :loading="loading"
:body-style="{ padding: '8px 24px 8px' }" :body-style="{ padding: '18px 24px 18px' }"
:bordered="false" :bordered="false"
> >
<div class="card-main"> <div class="analysis-card-container">
<div class="meta">
<span class="analysis-card-title">
<slot name="title">
{{ title }}
</slot>
</span>
<span class="analysis-card-action">
<slot name="action"></slot>
</span>
</div>
<div class="number"> <div class="number">
<slot name="number"> <slot name="number">
<span>{{ number }}</span> <span>{{ typeof number === 'function' && number() || number }}</span>
</slot>
</div>
<div class="title">
<slot name="title">
<span>{{ title }}</span>
</slot> </slot>
</div> </div>
</div> </div>
@ -41,13 +46,35 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.card-main { .analysis-card-container {
.number { position: relative;
color: #000; overflow: hidden;
margin-bottom: 0; width: 100%;
font-size: 38px; .meta {
line-height: 38px; position: relative;
height: 38px; overflow: hidden;
width: 100%;
color: rgba(0, 0, 0, 0.45);
font-size: 14px;
line-height: 22px;
.analysis-card-action {
cursor: pointer;
position: absolute;
top: 0;
right: 0;
}
} }
} }
.number {
overflow: hidden;
text-overflow: ellipsis;
word-break: break-all;
white-space: nowrap;
color: #000;
margin-top: 4px;
margin-bottom: 0;
font-size: 32px;
line-height: 38px;
height: 38px;
}
</style> </style>

View File

@ -14,8 +14,13 @@
<ul> <ul>
<li>版本1.0</li> <li>版本1.0</li>
<li>数据库h2databse</li> <li>数据库h2databse</li>
<li>运行时长2小时45分钟</li> <li>启动时间{{ environments.startTime | moment }}</li>
</ul> </ul>
<a
href="https://github.com/halo-dev"
target="_blank"
>开源地址
<a-icon type="link" /></a>&nbsp;
<a <a
href="https://docs.halo.run" href="https://docs.halo.run"
target="_blank" target="_blank"
@ -75,9 +80,11 @@
</template> </template>
<script> <script>
import adminApi from '@/api/admin'
export default { export default {
data() { data() {
return { return {
environments: {},
developers: [ developers: [
{ {
name: 'Ryan Wang', name: 'Ryan Wang',
@ -135,6 +142,16 @@ export default {
} }
] ]
} }
},
created() {
this.getEnvironments()
},
methods: {
getEnvironments() {
adminApi.environments().then(response => {
this.environments = response.data.data
})
}
} }
} }
</script> </script>