This commit is contained in:
2025-12-20 03:47:10 +01:00
parent 8428bf9c82
commit dcba044cd6
179 changed files with 10345 additions and 786 deletions

11
frontend/js/api.js Normal file → Executable file
View File

@@ -1,6 +1,7 @@
// Linux BenchTools - API Client
const API_BASE_URL = window.location.protocol + '//' + window.location.hostname + ':8007/api';
const API_BASE_URL = (window.BenchConfig && window.BenchConfig.backendApiUrl)
|| `${window.location.protocol}//${window.location.hostname}:8007/api`;
class BenchAPI {
constructor(baseURL = API_BASE_URL) {
@@ -143,6 +144,14 @@ class BenchAPI {
return this.get(`/benchmarks/${benchmarkId}`);
}
// Update benchmark fields
async updateBenchmark(benchmarkId, data) {
return this.request(`/benchmarks/${benchmarkId}`, {
method: 'PATCH',
body: JSON.stringify(data)
});
}
// Get all benchmarks
async getAllBenchmarks(params = {}) {
return this.get('/benchmarks', params);