This commit is contained in:
phoenix
2024-12-26 23:12:28 +08:00
parent 4d81f04fec
commit 69fd60ab0a
11 changed files with 219 additions and 11 deletions
@@ -0,0 +1,28 @@
import { Component, OnInit } from '@angular/core';
import axios from 'axios';
import { FormsModule } from '@angular/forms';
import { CommonModule } from '@angular/common';
@Component({
selector: 'app-kill-process',
templateUrl: './kill-process.component.html',
styleUrls: ['./kill-process.component.scss'],
imports: [FormsModule,CommonModule]
})
export class KillProcessComponent implements OnInit {
processId: number = 0;
message: string = '';
constructor() { }
ngOnInit(): void {}
async killProcess() {
try {
const response = await axios.post('http://localhost:5000/api/kill-process', this.processId.toString());
this.message = response.data;
} catch (error) {
console.error('Error killing process:', error);
this.message = 'An error occurred while trying to kill the process.';
}
}
}