Fix PC installed-applications rendering; minor UI cleanups
The PC detail Installed Applications section 500d and vanished on any real PC: ComputerInstalledApp had no to_dict, so the endpoint errored and the v-if hid the section. Added the serializer (curated version wins over the raw collected string, app name + description included) and aligned PCDetail to the flat payload; regression test added. Also: employee detail skips its USB panels when the usb plugin is disabled (was firing 404s), and the shopfloor kiosk header is now light-on-dark for readability. 810 tests pass; PC 259 installed apps verified live. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -183,6 +183,25 @@ class ComputerInstalledApp(db.Model):
|
||||
db.Index('idx_compapp_app', 'appid'),
|
||||
)
|
||||
|
||||
def to_dict(self):
|
||||
# Curated AppVersion wins; else the raw collected version string.
|
||||
version = None
|
||||
if self.appversion is not None:
|
||||
version = self.appversion.version
|
||||
elif self.installedversion:
|
||||
version = self.installedversion
|
||||
return {
|
||||
'id': self.id,
|
||||
'computerid': self.computerid,
|
||||
'appid': self.appid,
|
||||
'appname': self.application.appname if self.application else None,
|
||||
'appdescription': self.application.appdescription if self.application else None,
|
||||
'appversionid': self.appversionid,
|
||||
'installedversion': version,
|
||||
'installeddate': self.installeddate.isoformat() + 'Z' if self.installeddate else None,
|
||||
'isactive': self.isactive,
|
||||
}
|
||||
|
||||
|
||||
class AccessProtocol(db.Model):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user