[web-app]bugfix: recently alerts in dashboard load error when go back (#105)

This commit is contained in:
tomsun28
2022-04-24 22:39:59 +08:00
committed by GitHub
parent bcce79f9cc
commit 15aae19140
9 changed files with 27 additions and 19 deletions

View File

@@ -135,7 +135,14 @@
>
<i nz-icon nzType="up-circle" nzTheme="outline"></i>
</button>
<button nz-button nzType="primary" nzDanger (click)="onDeleteOneAlert(data.id)" nz-tooltip [nzTooltipTitle]="'alert.center.delete' | i18n">
<button
nz-button
nzType="primary"
nzDanger
(click)="onDeleteOneAlert(data.id)"
nz-tooltip
[nzTooltipTitle]="'alert.center.delete' | i18n"
>
<i nz-icon nzType="delete" nzTheme="outline"></i>
</button>
</td>

View File

@@ -116,12 +116,12 @@
</nz-table>
</nz-tab>
<nz-tab [nzTitle]="'alert.notice.rule' | i18n">
<button nz-button nzType="primary" (click)="syncRule()" >
<button nz-button nzType="primary" (click)="syncRule()">
<i nz-icon nzType="sync" nzTheme="outline"></i>
{{ 'common.refresh' | i18n }}
</button>
<button nz-button nzType="primary" (click)="onNewNoticeRule()" >
<button nz-button nzType="primary" (click)="onNewNoticeRule()">
<i nz-icon nzType="appstore-add" nzTheme="outline"></i>
{{ 'alert.notice.rule.new' | i18n }}
</button>

View File

@@ -29,7 +29,6 @@
{{ 'common.button.delete' | i18n }}
</button>
<nz-table
#fixedTable
[nzData]="defines"

View File

@@ -10,8 +10,7 @@
</div>
<div nz-col nzSpan="14" class="p-md text-white">
<nz-tag class="mb-xs">
<span>{{ 'monitor.status.available' | i18n }} </span
><span style="font-weight: bolder">{{ appCountService.availableSize }}</span>
<span>{{ 'monitor.status.available' | i18n }} </span><span style="font-weight: bolder">{{ appCountService.availableSize }}</span>
</nz-tag>
<nz-tag class="mb-xs">
<span>{{ 'monitor.status.unavailable' | i18n }} </span
@@ -91,10 +90,12 @@
<span>{{ 'monitor.status.available' | i18n }} </span><span style="font-weight: bolder">{{ appCountCustom.availableSize }}</span>
</nz-tag>
<nz-tag class="mb-xs">
<span>{{ 'monitor.status.unavailable' | i18n }} </span><span style="font-weight: bolder">{{ appCountCustom.unAvailableSize }}</span>
<span>{{ 'monitor.status.unavailable' | i18n }} </span
><span style="font-weight: bolder">{{ appCountCustom.unAvailableSize }}</span>
</nz-tag>
<nz-tag class="mb-xs">
<span>{{ 'monitor.status.unreachable' | i18n }} </span><span style="font-weight: bolder">{{ appCountCustom.unReachableSize }}</span>
<span>{{ 'monitor.status.unreachable' | i18n }} </span
><span style="font-weight: bolder">{{ appCountCustom.unReachableSize }}</span>
</nz-tag>
<nz-tag class="mb-xs">
<span>{{ 'monitor.status.un-manage' | i18n }} </span><span style="font-weight: bolder">{{ appCountCustom.unManageSize }}</span>

View File

@@ -352,6 +352,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
if (message.code === 0) {
let page = message.data;
this.alerts = page.content;
this.cdr.detectChanges();
} else {
console.warn(message.msg);
}

View File

@@ -24,12 +24,11 @@
</a>
</button>
<button nz-button nzType="primary" (click)="onEnableManageMonitors()">
<i nz-icon nzType="up-circle" nzTheme="outline"></i>
{{ 'monitors.enable' | i18n }}
</button>
<button nz-button nzType="primary" (click)="onCancelManageMonitors()">
<button nz-button nzType="primary" nzDanger (click)="onCancelManageMonitors()">
<i nz-icon nzType="down-circle" nzTheme="outline"></i>
{{ 'monitors.cancel' | i18n }}
</button>
@@ -139,6 +138,7 @@
</button>
<button
nz-button
nzDanger
nzType="primary"
(click)="onCancelManageOneMonitor(data.id)"
nz-tooltip

View File

@@ -22,7 +22,7 @@ const routes: Routes = [
children: [
// todo 根据路由自动生成面包屑
{ path: '', redirectTo: 'dashboard', pathMatch: 'full' },
{ path: 'dashboard', component: DashboardComponent, data: { title: '仪表盘' } },
{ path: 'dashboard', component: DashboardComponent, data: { titleI18n: 'menu.dashboard' } },
{ path: 'exception', loadChildren: () => import('./exception/exception.module').then(m => m.ExceptionModule) },
{ path: 'monitors', loadChildren: () => import('./monitor/monitor.module').then(m => m.MonitorModule) },
{ path: 'alert', loadChildren: () => import('./alert/alert.module').then(m => m.AlertModule) }
@@ -40,8 +40,8 @@ const routes: Routes = [
path: 'passport',
component: LayoutPassportComponent,
children: [
{ path: 'login', component: UserLoginComponent, data: { title: '登录' } },
{ path: 'lock', component: UserLockComponent, data: { title: '锁屏' } }
{ path: 'login', component: UserLoginComponent, data: { titleI18n: 'app.login.login' } },
{ path: 'lock', component: UserLockComponent, data: { titleI18n: 'app.lock' } }
]
},
{ path: '**', redirectTo: 'exception/404' }

View File

@@ -2,6 +2,8 @@ import { NgModule, Type } from '@angular/core';
import { SharedModule } from '@shared';
// dashboard pages
import { NzTagModule } from 'ng-zorro-antd/tag';
import { NzTimelineModule } from 'ng-zorro-antd/timeline';
import { NgxEchartsModule } from 'ngx-echarts';
import { DashboardComponent } from './dashboard/dashboard.component';
@@ -10,8 +12,6 @@ import { UserLockComponent } from './passport/lock/lock.component';
// passport pages
import { UserLoginComponent } from './passport/login/login.component';
import { RouteRoutingModule } from './routes-routing.module';
import { NzTagModule } from 'ng-zorro-antd/tag';
import { NzTimelineModule } from 'ng-zorro-antd/timeline';
const COMPONENTS: Array<Type<void>> = [
DashboardComponent,