Full reformat
This commit is contained in:
40
src/app/modules/panel/panel.component.ts
Normal file
40
src/app/modules/panel/panel.component.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { CommonModule } from "@angular/common";
|
||||
import { Component } from "@angular/core";
|
||||
import { FontAwesomeModule } from "@fortawesome/angular-fontawesome";
|
||||
import { faGithub } from "@fortawesome/free-brands-svg-icons";
|
||||
import { faPowerOff, faVolumeHigh } from "@fortawesome/free-solid-svg-icons";
|
||||
import { PanelSevice } from "../../services/panel.service";
|
||||
|
||||
@Component({
|
||||
standalone: true,
|
||||
selector: "app-panel",
|
||||
imports: [CommonModule, FontAwesomeModule],
|
||||
templateUrl: "./panel.component.html",
|
||||
styleUrls: ["./panel.component.less"],
|
||||
})
|
||||
export class PanelComponent {
|
||||
public time = "";
|
||||
faGithub = faGithub;
|
||||
faVolume = faVolumeHigh;
|
||||
faPower = faPowerOff;
|
||||
constructor(private panelService: PanelSevice) {
|
||||
this.time = this.getTime();
|
||||
setInterval(() => {
|
||||
this.time = this.getTime();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
private getTime() {
|
||||
const time = this.panelService.getTime();
|
||||
return time.toLocaleDateString("en-US", {
|
||||
month: "short",
|
||||
day: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
});
|
||||
}
|
||||
|
||||
goToSource() {
|
||||
window.open("https://git.nwaifu.su/neuro_llc/NwaifuWeb", "_blank");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user