[webapp] 批量处理eslint格式告警
This commit is contained in:
@@ -50,19 +50,13 @@ import { environment } from '@env/environment';
|
||||
<header-user></header-user>
|
||||
</layout-default-header-item>
|
||||
<ng-template #asideUserTpl>
|
||||
<div nz-dropdown nzTrigger="click" [nzDropdownMenu]="userMenu" class="alain-default__aside-user">
|
||||
<nz-avatar class="alain-default__aside-user-avatar" [nzSrc]="user.avatar"></nz-avatar>
|
||||
<div nz-dropdown nzTrigger="click" class="alain-default__aside-user">
|
||||
<nz-avatar class="alain-default__aside-user-avatar" [nzSrc]="avatar"></nz-avatar>
|
||||
<div class="alain-default__aside-user-info">
|
||||
<strong>{{ user.name }}</strong>
|
||||
<p class="mb0">{{ user.email }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<nz-dropdown-menu #userMenu="nzDropdownMenu">
|
||||
<ul nz-menu>
|
||||
<li nz-menu-item routerLink="/pro/account/center">{{ 'menu.account.center' | i18n }}</li>
|
||||
<li nz-menu-item routerLink="/pro/account/settings">{{ 'menu.account.settings' | i18n }}</li>
|
||||
</ul>
|
||||
</nz-dropdown-menu>
|
||||
</ng-template>
|
||||
<ng-template #contentTpl>
|
||||
<router-outlet></router-outlet>
|
||||
@@ -71,13 +65,14 @@ import { environment } from '@env/environment';
|
||||
|
||||
<setting-drawer *ngIf="showSettingDrawer"></setting-drawer>
|
||||
<theme-btn></theme-btn>
|
||||
`,
|
||||
`
|
||||
})
|
||||
export class LayoutBasicComponent {
|
||||
options: LayoutDefaultOptions = {
|
||||
logoExpanded: `./assets/brand_white.svg`,
|
||||
logoCollapsed: `./assets/logo.svg`,
|
||||
logoCollapsed: `./assets/logo.svg`
|
||||
};
|
||||
avatar: string = `./assets/logo.svg`;
|
||||
searchToggleStatus = false;
|
||||
showSettingDrawer = !environment.production;
|
||||
get user(): User {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, OnInit} from '@angular/core';
|
||||
import {NoticeIconSelect, NoticeItem } from '@delon/abc/notice-icon';
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, OnInit } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { I18NService } from '@core';
|
||||
import { NoticeIconSelect, NoticeItem } from '@delon/abc/notice-icon';
|
||||
import { ALAIN_I18N_TOKEN } from '@delon/theme';
|
||||
import { NzI18nService } from 'ng-zorro-antd/i18n';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import {AlertService} from "../../../service/alert.service";
|
||||
import {ALAIN_I18N_TOKEN} from "@delon/theme";
|
||||
import {I18NService} from "@core";
|
||||
import {Router} from "@angular/router";
|
||||
|
||||
import { AlertService } from '../../../service/alert.service';
|
||||
|
||||
@Component({
|
||||
selector: 'header-notify',
|
||||
@@ -22,8 +23,7 @@ import {Router} from "@angular/router";
|
||||
`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class HeaderNotifyComponent implements OnInit{
|
||||
|
||||
export class HeaderNotifyComponent implements OnInit {
|
||||
data: NoticeItem[] = [
|
||||
{
|
||||
title: '近期未处理告警',
|
||||
@@ -36,12 +36,14 @@ export class HeaderNotifyComponent implements OnInit{
|
||||
count = 0;
|
||||
loading = false;
|
||||
|
||||
constructor(private msg: NzMessageService,
|
||||
private nzI18n: NzI18nService,
|
||||
private router: Router,
|
||||
@Inject(ALAIN_I18N_TOKEN) private i18nSvc: I18NService,
|
||||
private alertSvc: AlertService,
|
||||
private cdr: ChangeDetectorRef) {}
|
||||
constructor(
|
||||
private msg: NzMessageService,
|
||||
private nzI18n: NzI18nService,
|
||||
private router: Router,
|
||||
@Inject(ALAIN_I18N_TOKEN) private i18nSvc: I18NService,
|
||||
private alertSvc: AlertService,
|
||||
private cdr: ChangeDetectorRef
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.loadData();
|
||||
@@ -52,8 +54,8 @@ export class HeaderNotifyComponent implements OnInit{
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
let loadAlerts$ = this.alertSvc.searchAlerts(0, undefined,undefined, 0, 5)
|
||||
.subscribe(message => {
|
||||
let loadAlerts$ = this.alertSvc.searchAlerts(0, undefined, undefined, 0, 5).subscribe(
|
||||
message => {
|
||||
loadAlerts$.unsubscribe();
|
||||
if (message.code === 0) {
|
||||
let page = message.data;
|
||||
@@ -61,26 +63,28 @@ export class HeaderNotifyComponent implements OnInit{
|
||||
this.data[0].list = [];
|
||||
alerts.forEach(alert => {
|
||||
let item = {
|
||||
id: alert.id,
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
|
||||
title: '监控-' + alert.monitorName +'-发出' + this.i18nSvc.fanyi(`alert.priority.${alert.priority}`),
|
||||
datetime: alert.gmtCreate,
|
||||
color: 'blue',
|
||||
type: '近期未处理告警'
|
||||
}
|
||||
id: alert.id,
|
||||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
|
||||
title: `监控-${alert.monitorName}-发出${this.i18nSvc.fanyi(`alert.priority.${alert.priority}`)}`,
|
||||
datetime: alert.gmtCreate,
|
||||
color: 'blue',
|
||||
type: '近期未处理告警'
|
||||
};
|
||||
this.data[0].list.push(item);
|
||||
})
|
||||
});
|
||||
this.count = page.totalElements;
|
||||
} else {
|
||||
console.warn(message.msg);
|
||||
}
|
||||
this.loading = false;
|
||||
this.cdr.detectChanges();
|
||||
}, error => {
|
||||
},
|
||||
error => {
|
||||
loadAlerts$.unsubscribe();
|
||||
console.error(error.msg);
|
||||
this.loading = false;
|
||||
})
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
gotoAlertCenter(type: string): void {
|
||||
|
||||
@@ -12,8 +12,9 @@ import {
|
||||
} from '@angular/core';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { debounceTime, distinctUntilChanged, tap } from 'rxjs/operators';
|
||||
import {MonitorService} from "../../../service/monitor.service";
|
||||
import {Monitor} from "../../../pojo/Monitor";
|
||||
|
||||
import { Monitor } from '../../../pojo/Monitor';
|
||||
import { MonitorService } from '../../../service/monitor.service';
|
||||
|
||||
@Component({
|
||||
selector: 'header-search',
|
||||
@@ -40,7 +41,7 @@ import {Monitor} from "../../../pojo/Monitor";
|
||||
<nz-auto-option *ngFor="let option of options" [nzValue]="option.id" [nzLabel]="option.name">
|
||||
<a [routerLink]="['/monitors/' + option.id]">
|
||||
监控名称: {{ option.name }}
|
||||
<span style="left:50% ; position: absolute;">监控Host: {{option.host}}</span>
|
||||
<span style="left:50% ; position: absolute;">监控Host: {{ option.host }}</span>
|
||||
<span style="right: 10px; position: absolute;"><i nz-icon nzType="arrow-right" nzTheme="outline"></i></span>
|
||||
</a>
|
||||
</nz-auto-option>
|
||||
@@ -73,9 +74,7 @@ export class HeaderSearchComponent implements AfterViewInit, OnDestroy {
|
||||
}
|
||||
@Output() readonly toggleChangeChange = new EventEmitter<boolean>();
|
||||
|
||||
constructor(private el: ElementRef<HTMLElement>,
|
||||
private cdr: ChangeDetectorRef,
|
||||
private monitorSvc : MonitorService) {}
|
||||
constructor(private el: ElementRef<HTMLElement>, private cdr: ChangeDetectorRef, private monitorSvc: MonitorService) {}
|
||||
|
||||
ngAfterViewInit(): void {
|
||||
this.qIpt = this.el.nativeElement.querySelector('.ant-input') as HTMLInputElement;
|
||||
@@ -91,8 +90,8 @@ export class HeaderSearchComponent implements AfterViewInit, OnDestroy {
|
||||
)
|
||||
.subscribe(value => {
|
||||
// 远程加载搜索数据
|
||||
let searchMonitors$ = this.monitorSvc.searchMonitors(value, value, 0, 10)
|
||||
.subscribe(message => {
|
||||
let searchMonitors$ = this.monitorSvc.searchMonitors(value, value, 0, 10).subscribe(
|
||||
message => {
|
||||
this.loading = false;
|
||||
searchMonitors$.unsubscribe();
|
||||
if (message.code === 0) {
|
||||
@@ -102,11 +101,13 @@ export class HeaderSearchComponent implements AfterViewInit, OnDestroy {
|
||||
} else {
|
||||
console.warn(message.msg);
|
||||
}
|
||||
}, error => {
|
||||
},
|
||||
error => {
|
||||
this.loading = false;
|
||||
searchMonitors$.unsubscribe();
|
||||
console.error(error.msg);
|
||||
})
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { SettingsService, User } from '@delon/theme';
|
||||
import {LocalStorageService} from "../../../service/local-storage.service";
|
||||
|
||||
import { LocalStorageService } from '../../../service/local-storage.service';
|
||||
|
||||
@Component({
|
||||
selector: 'header-user',
|
||||
@@ -12,14 +13,6 @@ import {LocalStorageService} from "../../../service/local-storage.service";
|
||||
</div>
|
||||
<nz-dropdown-menu #userMenu="nzDropdownMenu">
|
||||
<div nz-menu class="width-sm">
|
||||
<div nz-menu-item routerLink="/pro/account/center">
|
||||
<i nz-icon nzType="user" class="mr-sm"></i>
|
||||
{{ 'menu.account.center' | i18n }}
|
||||
</div>
|
||||
<div nz-menu-item routerLink="/pro/account/settings">
|
||||
<i nz-icon nzType="setting" class="mr-sm"></i>
|
||||
{{ 'menu.account.settings' | i18n }}
|
||||
</div>
|
||||
<li nz-menu-divider></li>
|
||||
<div nz-menu-item (click)="logout()">
|
||||
<i nz-icon nzType="logout" class="mr-sm"></i>
|
||||
@@ -35,9 +28,7 @@ export class HeaderUserComponent {
|
||||
return this.settings.user;
|
||||
}
|
||||
|
||||
constructor(private settings: SettingsService,
|
||||
private router: Router,
|
||||
private localStorageSvc : LocalStorageService) {}
|
||||
constructor(private settings: SettingsService, private router: Router, private localStorageSvc: LocalStorageService) {}
|
||||
|
||||
logout(): void {
|
||||
this.localStorageSvc.clear();
|
||||
|
||||
@@ -25,7 +25,7 @@ import { HeaderFullScreenComponent } from './basic/widgets/fullscreen.component'
|
||||
import { HeaderI18nComponent } from './basic/widgets/i18n.component';
|
||||
import { HeaderSearchComponent } from './basic/widgets/search.component';
|
||||
import { HeaderUserComponent } from './basic/widgets/user.component';
|
||||
import {HeaderNotifyComponent} from "./basic/widgets/notify.component";
|
||||
import { HeaderNotifyComponent } from './basic/widgets/notify.component';
|
||||
import { LayoutBlankComponent } from './blank/blank.component';
|
||||
|
||||
const COMPONENTS = [LayoutBasicComponent, LayoutBlankComponent];
|
||||
@@ -41,9 +41,7 @@ const HEADER_COMPONENTS = [
|
||||
|
||||
// passport
|
||||
import { LayoutPassportComponent } from './passport/passport.component';
|
||||
const PASSPORT = [
|
||||
LayoutPassportComponent
|
||||
];
|
||||
const PASSPORT = [LayoutPassportComponent];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -64,9 +62,9 @@ const PASSPORT = [
|
||||
NzSpinModule,
|
||||
NzBadgeModule,
|
||||
NzAvatarModule,
|
||||
NzIconModule,
|
||||
NzIconModule
|
||||
],
|
||||
declarations: [...COMPONENTS, ...HEADER_COMPONENTS, ...PASSPORT],
|
||||
exports: [...COMPONENTS, ...PASSPORT],
|
||||
exports: [...COMPONENTS, ...PASSPORT]
|
||||
})
|
||||
export class LayoutModule { }
|
||||
export class LayoutModule {}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="wrap">
|
||||
<div class="top">
|
||||
<div class="head">
|
||||
<img class="logo" src="./assets/logo.svg" alt="">
|
||||
<img class="logo" src="./assets/logo.svg" alt="" />
|
||||
<span class="title">探云</span>
|
||||
</div>
|
||||
<div class="desc">易用友好的高性能监控云服务</div>
|
||||
|
||||
@@ -9,16 +9,8 @@ import { DA_SERVICE_TOKEN, ITokenService } from '@delon/auth';
|
||||
export class LayoutPassportComponent implements OnInit {
|
||||
links = [
|
||||
{
|
||||
title: '帮助',
|
||||
href: ''
|
||||
},
|
||||
{
|
||||
title: '隐私',
|
||||
href: ''
|
||||
},
|
||||
{
|
||||
title: '条款',
|
||||
href: ''
|
||||
title: '欢迎使用TanCloud探云-监控云服务-tancloud.cn',
|
||||
href: 'https://tancloud.cn'
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user