Ajout d'un affichage des informations dans la modale
This commit is contained in:
0
client/src/app/app.component.css
Normal file
0
client/src/app/app.component.css
Normal file
30
client/src/app/app.component.html
Normal file
30
client/src/app/app.component.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * Delete the template below * * * * * * * * * -->
|
||||
<!-- * * * * * * * to get started with your project! * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
|
||||
|
||||
<main class="main">
|
||||
<nav>
|
||||
<a mat-button [routerLink]="['/']">Home</a>
|
||||
<a mat-button [routerLink]="['/device-list']">Device-list</a>
|
||||
</nav>
|
||||
<div class="content">
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * The content above * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * * -->
|
||||
<!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
|
||||
|
||||
|
||||
<router-outlet></router-outlet>
|
||||
29
client/src/app/app.component.spec.ts
Normal file
29
client/src/app/app.component.spec.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { AppComponent } from './app.component';
|
||||
|
||||
describe('AppComponent', () => {
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [AppComponent],
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
it('should create the app', () => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.componentInstance;
|
||||
expect(app).toBeTruthy();
|
||||
});
|
||||
|
||||
it(`should have the 'electron-app' title`, () => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
const app = fixture.componentInstance;
|
||||
expect(app.title).toEqual('electron-app');
|
||||
});
|
||||
|
||||
it('should render title', () => {
|
||||
const fixture = TestBed.createComponent(AppComponent);
|
||||
fixture.detectChanges();
|
||||
const compiled = fixture.nativeElement as HTMLElement;
|
||||
expect(compiled.querySelector('h1')?.textContent).toContain('Hello, electron-app');
|
||||
});
|
||||
});
|
||||
18
client/src/app/app.component.ts
Normal file
18
client/src/app/app.component.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import {MatMenuModule} from '@angular/material/menu';
|
||||
import {MatButtonModule} from '@angular/material/button';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
standalone: true,
|
||||
imports: [CommonModule, RouterOutlet, RouterModule, MatButtonModule, MatMenuModule],
|
||||
templateUrl: './app.component.html',
|
||||
styleUrl: './app.component.css'
|
||||
})
|
||||
export class AppComponent {
|
||||
title = 'electron-app';
|
||||
}
|
||||
9
client/src/app/app.config.ts
Normal file
9
client/src/app/app.config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { ApplicationConfig } from '@angular/core';
|
||||
import { provideRouter } from '@angular/router';
|
||||
|
||||
import { routes } from './app.routes';
|
||||
import { provideAnimations } from '@angular/platform-browser/animations';
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [provideRouter(routes), provideAnimations()]
|
||||
};
|
||||
16
client/src/app/app.routes.ts
Normal file
16
client/src/app/app.routes.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Routes } from '@angular/router';
|
||||
import {DeviceListComponent} from "./device-list/device-list.component";
|
||||
import {HomeComponent} from "./home/home.component";
|
||||
|
||||
export const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: HomeComponent,
|
||||
title: 'Home page'
|
||||
},
|
||||
{
|
||||
path: 'device-list',
|
||||
component: DeviceListComponent,
|
||||
title: 'Home details'
|
||||
}
|
||||
];
|
||||
29
client/src/app/device-list/device-list.component.html
Normal file
29
client/src/app/device-list/device-list.component.html
Normal file
@@ -0,0 +1,29 @@
|
||||
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
|
||||
|
||||
<!--- Note that these columns can be defined in any order.
|
||||
The actual rendered columns are set as a property on the row definition" -->
|
||||
|
||||
<!-- Name Column -->
|
||||
<ng-container matColumnDef="device">
|
||||
<th mat-header-cell *matHeaderCellDef> Nom </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.device}} </td>
|
||||
</ng-container>
|
||||
|
||||
<!-- Weight Column -->
|
||||
<ng-container matColumnDef="mountpoint">
|
||||
<th mat-header-cell *matHeaderCellDef> Point de montages </th>
|
||||
<td mat-cell *matCellDef="let element"> <ul><li *ngFor="let mountPoint of element.mountpoint"> {{ mountPoint.label }}</li></ul> </td>
|
||||
</ng-container>
|
||||
|
||||
<!-- Weight Column -->
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef> Actions </th>
|
||||
<td mat-cell *matCellDef="let element">
|
||||
<button mat-fab color="green" aria-label="Ajouter un Ligthshow sur cet appareil" (click)="openElement(element)">
|
||||
<mat-icon>add</mat-icon>
|
||||
</button> </td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
||||
56
client/src/app/device-list/device-list.component.ts
Normal file
56
client/src/app/device-list/device-list.component.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {MatTableModule} from '@angular/material/table';
|
||||
import {CommonModule} from "@angular/common";
|
||||
import {MatIconModule} from "@angular/material/icon";
|
||||
import {MatButtonModule} from "@angular/material/button";
|
||||
import {MatDialogModule} from "@angular/material/dialog";
|
||||
|
||||
export interface DeviceList {
|
||||
device: string;
|
||||
mountpoint: MountPoint[];
|
||||
}
|
||||
|
||||
export interface MountPoint {
|
||||
path: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
const ELEMENT_DATA: DeviceList[] = [];
|
||||
|
||||
@Component({
|
||||
selector: 'app-device-list',
|
||||
standalone: true,
|
||||
imports: [MatTableModule, CommonModule, MatIconModule, MatButtonModule],
|
||||
templateUrl: `./device-list.component.html`,
|
||||
styleUrl: './device-list.component.css'
|
||||
})
|
||||
export class DeviceListComponent implements OnInit {
|
||||
|
||||
displayedColumns: string[] = ['device', 'mountpoint', 'actions'];
|
||||
dataSource : DeviceList[] = [];
|
||||
|
||||
ngOnInit(): void {
|
||||
(<any>window).versions.deviceInfo().then((e:any ) => {
|
||||
this.dataSource = e;
|
||||
})
|
||||
}
|
||||
|
||||
openElement(deviceList : DeviceList) : void {
|
||||
const dialogRef = this.dialog.open(DialogContentExampleDialog);
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
console.log(`Dialog result: ${result}`);
|
||||
});
|
||||
}
|
||||
openDialog() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'dialog-content-example-dialog',
|
||||
templateUrl: 'dialog-content-example-dialog.html',
|
||||
standalone: true,
|
||||
imports: [MatDialogModule, MatButtonModule],
|
||||
})
|
||||
export class DialogContentExampleDialog {}
|
||||
64
client/src/app/device-list/dialog-content-add-dialog.html
Normal file
64
client/src/app/device-list/dialog-content-add-dialog.html
Normal file
@@ -0,0 +1,64 @@
|
||||
<h2 mat-dialog-title>Install Angular</h2>
|
||||
<mat-dialog-content class="mat-typography">
|
||||
<h3>Develop across all platforms</h3>
|
||||
<p>Learn one way to build applications with Angular and reuse your code and abilities to build
|
||||
apps for any deployment target. For web, mobile web, native mobile and native desktop.</p>
|
||||
|
||||
<h3>Speed & Performance</h3>
|
||||
<p>Achieve the maximum speed possible on the Web Platform today, and take it further, via Web
|
||||
Workers and server-side rendering. Angular puts you in control over scalability. Meet huge
|
||||
data requirements by building data models on RxJS, Immutable.js or another push-model.</p>
|
||||
|
||||
<h3>Incredible tooling</h3>
|
||||
<p>Build features quickly with simple, declarative templates. Extend the template language with
|
||||
your own components and use a wide array of existing components. Get immediate Angular-specific
|
||||
help and feedback with nearly every IDE and editor. All this comes together so you can focus
|
||||
on building amazing apps rather than trying to make the code work.</p>
|
||||
|
||||
<h3>Loved by millions</h3>
|
||||
<p>From prototype through global deployment, Angular delivers the productivity and scalable
|
||||
infrastructure that supports Google's largest applications.</p>
|
||||
|
||||
<h3>What is Angular?</h3>
|
||||
|
||||
<p>Angular is a platform that makes it easy to build applications with the web. Angular
|
||||
combines declarative templates, dependency injection, end to end tooling, and integrated
|
||||
best practices to solve development challenges. Angular empowers developers to build
|
||||
applications that live on the web, mobile, or the desktop</p>
|
||||
|
||||
<h3>Architecture overview</h3>
|
||||
|
||||
<p>Angular is a platform and framework for building client applications in HTML and TypeScript.
|
||||
Angular is itself written in TypeScript. It implements core and optional functionality as a
|
||||
set of TypeScript libraries that you import into your apps.</p>
|
||||
|
||||
<p>The basic building blocks of an Angular application are NgModules, which provide a compilation
|
||||
context for components. NgModules collect related code into functional sets; an Angular app is
|
||||
defined by a set of NgModules. An app always has at least a root module that enables
|
||||
bootstrapping, and typically has many more feature modules.</p>
|
||||
|
||||
<p>Components define views, which are sets of screen elements that Angular can choose among and
|
||||
modify according to your program logic and data. Every app has at least a root component.</p>
|
||||
|
||||
<p>Components use services, which provide specific functionality not directly related to views.
|
||||
Service providers can be injected into components as dependencies, making your code modular,
|
||||
reusable, and efficient.</p>
|
||||
|
||||
<p>Both components and services are simply classes, with decorators that mark their type and
|
||||
provide metadata that tells Angular how to use them.</p>
|
||||
|
||||
<p>The metadata for a component class associates it with a template that defines a view. A
|
||||
template combines ordinary HTML with Angular directives and binding markup that allow Angular
|
||||
to modify the HTML before rendering it for display.</p>
|
||||
|
||||
<p>The metadata for a service class provides the information Angular needs to make it available
|
||||
to components through Dependency Injection (DI).</p>
|
||||
|
||||
<p>An app's components typically define many views, arranged hierarchically. Angular provides
|
||||
the Router service to help you define navigation paths among views. The router provides
|
||||
sophisticated in-browser navigational capabilities.</p>
|
||||
</mat-dialog-content>
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-button mat-dialog-close>Cancel</button>
|
||||
<button mat-button [mat-dialog-close]="true" cdkFocusInitial>Install</button>
|
||||
</mat-dialog-actions>
|
||||
0
client/src/app/home/home.component.css
Normal file
0
client/src/app/home/home.component.css
Normal file
6
client/src/app/home/home.component.html
Normal file
6
client/src/app/home/home.component.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<p>home works!</p>
|
||||
<a [routerLink]="['/device-list']">
|
||||
<header class="brand-name">
|
||||
<img class="brand-logo" [src]="icon" alt="logo" aria-hidden="true">
|
||||
</header>
|
||||
</a>
|
||||
15
client/src/app/home/home.component.ts
Normal file
15
client/src/app/home/home.component.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-home',
|
||||
standalone: true,
|
||||
imports: [RouterModule],
|
||||
templateUrl: './home.component.html',
|
||||
styleUrl: './home.component.css'
|
||||
})
|
||||
export class HomeComponent {
|
||||
|
||||
icon: string = "/logo.ico"
|
||||
|
||||
}
|
||||
BIN
client/src/favicon.ico
Normal file
BIN
client/src/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
15
client/src/index.html
Normal file
15
client/src/index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>ElectronApp</title>
|
||||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<app-root></app-root>
|
||||
</body>
|
||||
</html>
|
||||
7
client/src/main.ts
Normal file
7
client/src/main.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { bootstrapApplication } from '@angular/platform-browser';
|
||||
import { appConfig } from './app/app.config';
|
||||
import { AppComponent } from './app/app.component';
|
||||
|
||||
|
||||
bootstrapApplication(AppComponent, appConfig)
|
||||
.catch((err) => console.error(err));
|
||||
4
client/src/styles.css
Normal file
4
client/src/styles.css
Normal file
@@ -0,0 +1,4 @@
|
||||
/* You can add global styles to this file, and also import other style files */
|
||||
|
||||
html, body { height: 100%; }
|
||||
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
|
||||
Reference in New Issue
Block a user