Add image runtime installation and profile deletion controls
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user