update recipe now can select recipe file

This commit is contained in:
Kenta420 2023-10-03 15:06:50 +07:00
parent b25c836f0c
commit b5cb469a30
11 changed files with 209 additions and 236173 deletions

View file

@ -11,34 +11,28 @@ import { WebsocketService } from 'src/app/shared/services/websocket.service';
standalone: true,
templateUrl: './changelog.component.html',
styleUrls: ['./changelog.component.css'],
imports: [CommonModule,MergeComponent]
imports: [CommonModule, MergeComponent],
})
export class ChangelogComponent {
public displayableLogs: string[] = [];
public displayableMergeJson: string[] = [];
showLogModal:boolean = false;
showMergeModal:boolean = false;
showLogModal: boolean = false;
showMergeModal: boolean = false;
constructor(
private httpClient: HttpClient,
private wss: WebsocketService
){
constructor(private httpClient: HttpClient, private wss: WebsocketService) {
this.fetchLoglist();
// this.translateLogDirToString();
// this.translateLogDirToString();
}
public fetchLoglist(): string[]{
public fetchLoglist(): string[] {
// TODO: Fetch changelog.html
// fetch("/changelog")
let dirlist: any[] = []
let dirlist: any[] = [];
this.wss.connect(environment.wsapi+"/listFileInDir");
this.wss.connect(environment.wsapi + '/listFileInDir');
this.wss.send({
"topic": "changelog",
})
topic: 'changelog',
});
let response = this.wss.data;
console.log(response);
@ -83,10 +77,9 @@ export class ChangelogComponent {
return dirlist;
}
public translateLogDirToString(){
console.log("LogDirList: ", this.displayableLogs)
let dirSelector = document.getElementById("log-dir-list")
public translateLogDirToString() {
console.log('LogDirList: ', this.displayableLogs);
let dirSelector = document.getElementById('log-dir-list');
// for(let dir of this.displayableLogs){
// console.log(dir)
// const p = document.createElement('p');
@ -96,27 +89,27 @@ export class ChangelogComponent {
// }
}
refreshLogList(){
refreshLogList() {
this.fetchLoglist();
this.translateLogDirToString();
}
viewLog(name:string){
viewLog(name: string) {
let cli = new FetchLogService(this.httpClient);
this.showLogModal = !this.showLogModal;
cli.fetchLogsToDisplay("changelog", true, false, name);
cli.fetchLogsToDisplay("changelog", false, false, name);
cli.fetchLogsToDisplay('changelog', true, false, name);
cli.fetchLogsToDisplay('changelog', false, false, name);
}
viewJson(name:string){
viewJson(name: string) {
let cli = new FetchLogService(this.httpClient);
this.showMergeModal = !this.showMergeModal;
cli.fetchLogsToDisplay("merge", false, true, name);
cli.fetchLogsToDisplay('merge', false, true, name);
// cli.fetchLogsToDisplay("", false, false, name);
}
toggleLogModal(target:string){
if(target == "merge"){
toggleLogModal(target: string) {
if (target == 'merge') {
this.showMergeModal = !this.showMergeModal;
} else {
this.showLogModal = !this.showLogModal;