Push für Serveranwendung in Gitea implementiert
Dieser Commit ist enthalten in:
HG
2025-12-30 17:25:14 +00:00
committet von Server Deploy
Ursprung 87c391d2e6
Commit c8707d6cf4
30 geänderte Dateien mit 11907 neuen und 170 gelöschten Zeilen

Datei anzeigen

@ -87,6 +87,15 @@ class ApiClient {
this.setCsrfToken(newCsrfToken);
}
// Update auth token if refreshed by server
const newAuthToken = response.headers.get('X-New-Token');
if (newAuthToken) {
this.setToken(newAuthToken);
window.dispatchEvent(new CustomEvent('auth:token-refreshed', {
detail: { token: newAuthToken }
}));
}
// Handle 401 Unauthorized
if (response.status === 401) {
this.setToken(null);
@ -827,6 +836,54 @@ class ApiClient {
async gitRenameBranch(projectId, oldName, newName) {
return this.post(`/git/rename-branch/${projectId}`, { oldName, newName });
}
// =====================
// SERVER GIT ENDPOINTS (Server-Modus)
// =====================
async getServerGitInfo() {
return this.get('/git/server/info');
}
async getServerGitStatus() {
return this.get('/git/server/status');
}
async getServerGitBranches() {
return this.get('/git/server/branches');
}
async getServerGitCommits(limit = 20) {
return this.get(`/git/server/commits?limit=${limit}`);
}
async getServerGitRemote() {
return this.get('/git/server/remote');
}
async serverGitStage() {
return this.post('/git/server/stage', {});
}
async serverGitCommit(message, stageAll = true) {
return this.post('/git/server/commit', { message, stageAll });
}
async serverGitPush(branch = null, force = false) {
return this.post('/git/server/push', { branch, force });
}
async serverGitPull(branch = null) {
return this.post('/git/server/pull', { branch });
}
async serverGitFetch() {
return this.post('/git/server/fetch', {});
}
async serverGitCheckout(branch) {
return this.post('/git/server/checkout', { branch });
}
}
// Custom API Error Class