Add image runtime installation and profile deletion controls

This commit is contained in:
Mikei386
2026-09-28 18:12:33 +02:00
parent c584bbcaa6
commit fd797a6c8d
14 changed files with 244 additions and 15 deletions
+9
View File
@@ -66,6 +66,15 @@ class Profiles:
temp=self.path.with_suffix('.tmp');temp.write_text(json.dumps(rows));temp.replace(self.path);self.rows=rows
return row
def delete(self,data):
if set(data)!={'id','revision'}:raise ValueError('Ungültige Profilfelder.')
with self.lock:
old=next((p for p in self.rows if p['id']==data['id']),None)
if not old or old['revision']!=data['revision']:raise ValueError('Profil geändert oder nicht gefunden. Ansicht neu laden.')
rows=[p for p in self.rows if p is not old]
temp=self.path.with_suffix('.tmp');temp.write_text(json.dumps(rows));temp.replace(self.path);self.rows=rows
return {'deleted':old['id']}
def _component(self,model,role,ident):
if model['repo']!=QWEN_REPO or role not in QWEN_COMPONENTS:raise ValueError('Für dieses Modell ist kein geprüftes Komponentenrezept hinterlegt.')
item=self.catalog.entry(ident)