Commit 6ce1d41a authored by 神楽坂玲奈's avatar 神楽坂玲奈

fix

parent 4268cf19
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "console-web",
"version": "0.0.0", "version": "0.0.0",
"dependencies": { "dependencies": {
"@angular/animations": "~12.2.0", "@angular/animations": "~12.2.0",
...@@ -115,3 +115,7 @@ ...@@ -115,3 +115,7 @@
#sidebarMenu { #sidebarMenu {
overflow-y: auto; overflow-y: auto;
} }
/*.nav-link {*/
/* padding-bottom: 0;*/
/*}*/
...@@ -17,17 +17,17 @@ ...@@ -17,17 +17,17 @@
<div class='row'> <div class='row'>
<nav id='sidebarMenu' class='col-md-3 col-lg-2 d-md-block bg-light sidebar collapse'> <nav id='sidebarMenu' class='col-md-3 col-lg-2 d-md-block bg-light sidebar collapse'>
<div class='position-sticky pt-3'> <div class='position-sticky pt-3'>
<h6 class='sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted'> <h6 class='sidebar-heading d-flex justify-content-between align-items-center px-3 mb-1 text-muted'>
<span>Apps</span> <span>应用</span>
<a class='link-secondary' href='#' aria-label='Add a new report'> <a class='link-secondary' href='#' aria-label='Add a new report'>
<span data-feather='plus-circle'></span> <span data-feather='plus-circle'></span>
</a> </a>
</h6> </h6>
<ul class='nav flex-column'> <ul class='nav flex-column'>
<li class='nav-item' *ngFor='let app of apps | async'> <li class='nav-item' *ngFor='let app of apps | async'>
<a class='nav-link' [routerLink]="['apps', app.id]"> <a class='nav-link' [routerLink]="['apps', app.id]" routerLinkActive="active">
<img class='feather' [src]='app.icon'> <img class='feather' [src]='app.icon' *ngIf="app.icon">
{{app.id}} {{showName(app)}}
</a> </a>
</li> </li>
</ul> </ul>
......
import {AfterViewInit, Component} from '@angular/core'; import { AfterViewInit, Component } from '@angular/core';
import feather from 'feather-icons'; import feather from 'feather-icons';
import {AppService} from "./app/app.service"; import { AppService, AppsJson } from './app/app.service';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
templateUrl: './mycard.component.html', templateUrl: './mycard.component.html',
styleUrls: ['./mycard.component.css'] styleUrls: ['./mycard.component.css'],
}) })
export class MyCardComponent implements AfterViewInit { export class MyCardComponent implements AfterViewInit {
title = 'console-web'; title = 'console-web';
apps = this.appService.apps; apps = this.appService.apps;
constructor(private appService: AppService) { constructor(private appService: AppService) {}
}
ngAfterViewInit(): void { ngAfterViewInit(): void {
feather.replace(); feather.replace();
} }
// getI18nName(app: AppsJson.App){ // getI18nName(app: AppsJson.App){
// return app.name[''] // return app.name['']
// } // }
showName(app: AppsJson.App) {
if (!app.name) return app.id;
return app.name['zh-CN'];
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment