展示最近的提交记录
This commit is contained in:
@@ -330,9 +330,16 @@ export class ApiService extends HttpService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
lastestUpdateTime() {
|
lastestUpdate() {
|
||||||
return super.Service<string>({
|
return super.Service<{
|
||||||
path: '/lastestUpdateTime',
|
lastUpdateTime: string;
|
||||||
|
lastUpdateInfo: string;
|
||||||
|
lastCommit: string;
|
||||||
|
committerAuthor: string;
|
||||||
|
committerDate: string;
|
||||||
|
commitUrl: string
|
||||||
|
}>({
|
||||||
|
path: '/lastestUpdate',
|
||||||
method: 'GET'
|
method: 'GET'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,31 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="zh-update">
|
<div class="zh-update">
|
||||||
<div class="zh-update-log">
|
<div class="zh-update-log">
|
||||||
<div class="zh-update-log-title">
|
<div class="zh-update-log-title" *ngIf="lastUpdate">
|
||||||
<h1>更新日志</h1>
|
<h1>更新日志</h1>
|
||||||
<p>最后更新于 {{lastUpdateTime}}</p>
|
<p>最后更新于:
|
||||||
|
<nz-tag nzColor="red">{{lastUpdate.lastUpdateTime}}</nz-tag>
|
||||||
|
</p>
|
||||||
|
<p>最后更新内容:
|
||||||
|
<nz-tag nzColor="volcano">{{lastUpdate.lastUpdateInfo}}</nz-tag>
|
||||||
|
</p>
|
||||||
|
<p>最后提交代码于:
|
||||||
|
<nz-tag nzColor="purple">{{lastUpdate.committerDate}}</nz-tag>
|
||||||
|
</p>
|
||||||
|
<p>最后提交内容:
|
||||||
|
<a [href]="lastUpdate.commitUrl" target="_blank">
|
||||||
|
<nz-tag nzColor="#f50" class="pointer">{{lastUpdate.lastCommit}}</nz-tag>
|
||||||
|
</a>
|
||||||
|
By
|
||||||
|
<a href="https://github.com/xiaohai2271" target="_blank">
|
||||||
|
<nz-tag nzColor="cyan" class="pointer">{{lastUpdate.committerAuthor}}</nz-tag>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<span>最后构建状态 </span>
|
||||||
|
<img alt="build Status"
|
||||||
|
src="https://img.shields.io/github/workflow/status/xiaohai2271/blog-frontEnd/Node.js CI">
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="zh-update-log-content">
|
<div class="zh-update-log-content">
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
nz-tag {
|
||||||
|
text-indent: initial;
|
||||||
|
}
|
||||||
|
.pointer{
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
@media screen and (min-width: 768px) {
|
@media screen and (min-width: 768px) {
|
||||||
.site-inner {
|
.site-inner {
|
||||||
margin: 0 19%;
|
margin: 0 19%;
|
||||||
|
|||||||
@@ -14,12 +14,19 @@ export class UpdateComponent implements OnInit {
|
|||||||
titleService.setTitle('小海博客 | 网站更新记录');
|
titleService.setTitle('小海博客 | 网站更新记录');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastUpdate: {
|
||||||
lastUpdateTime: string;
|
lastUpdateTime: string;
|
||||||
|
lastUpdateInfo: string;
|
||||||
|
lastCommit: string;
|
||||||
|
committerAuthor: string;
|
||||||
|
committerDate: string;
|
||||||
|
commitUrl:string
|
||||||
|
} ;
|
||||||
webUpdate: { id: number, info: string, time: string }[] = [];
|
webUpdate: { id: number, info: string, time: string }[] = [];
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.apiService.lastestUpdateTime().subscribe(data => {
|
this.apiService.lastestUpdate().subscribe(data => {
|
||||||
this.lastUpdateTime = data.result;
|
this.lastUpdate = data.result;
|
||||||
});
|
});
|
||||||
this.apiService.webUpdate().subscribe(data => {
|
this.apiService.webUpdate().subscribe(data => {
|
||||||
this.webUpdate = data.result.reverse();
|
this.webUpdate = data.result.reverse();
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import {NgModule} from '@angular/core';
|
|||||||
import {CommonModule} from '@angular/common';
|
import {CommonModule} from '@angular/common';
|
||||||
import {UpdateComponent} from './update.component';
|
import {UpdateComponent} from './update.component';
|
||||||
import {Route, RouterModule} from '@angular/router';
|
import {Route, RouterModule} from '@angular/router';
|
||||||
|
import {NzTagModule} from "ng-zorro-antd";
|
||||||
|
|
||||||
const routes: Route[] = [{path: '**', component: UpdateComponent}];
|
const routes: Route[] = [{path: '**', component: UpdateComponent}];
|
||||||
|
|
||||||
@@ -9,7 +10,8 @@ const routes: Route[] = [{path: '**', component: UpdateComponent}];
|
|||||||
declarations: [UpdateComponent],
|
declarations: [UpdateComponent],
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
RouterModule.forChild(routes)
|
RouterModule.forChild(routes),
|
||||||
|
NzTagModule
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class UpdateModule {
|
export class UpdateModule {
|
||||||
|
|||||||
Reference in New Issue
Block a user