diff --git a/src/localize/languages/en.json b/src/localize/languages/en.json index 613a78a0..224df18e 100644 --- a/src/localize/languages/en.json +++ b/src/localize/languages/en.json @@ -28,6 +28,9 @@ "name": "Repository Name", "downloads": "Downloads", "stars": "Stars", + "installed_version": "Installed version", + "available_version": "Available version", + "status": "Status", "category": "Category", "last_updated": "Updated" }, @@ -107,6 +110,10 @@ "report": "Request for removal", "update_information": "Update information" }, + "repository_status": { + "pending-restart": "Pending restart", + "pending-upgrade": "Pending update" + }, "menu": { "about": "About HACS", "custom_repositories": "Custom repositories", diff --git a/src/panels/hacs-experimental-panel.ts b/src/panels/hacs-experimental-panel.ts index 99775020..1ec8d95d 100644 --- a/src/panels/hacs-experimental-panel.ts +++ b/src/panels/hacs-experimental-panel.ts @@ -50,6 +50,9 @@ const tableColumnDefaults = { downloads: true, stars: true, last_updated: true, + installed_version: false, + available_version: false, + status: false, category: true, }; @@ -405,6 +408,40 @@ export class HacsExperimentalPanel extends LitElement { template: (last_updated: string, repository: RepositoryBase) => repository.new ? "-" : relativeTime(new Date(last_updated), this.hass.locale), }, + installed_version: { + ...defaultKeyData, + title: this.hacs.localize("column.installed_version"), + hidden: narrow || !tableColumnsOptions.installed_version, + sortable: true, + direction: + this.activeSort?.column === "installed_version" ? this.activeSort.direction : null, + width: "10%", + template: (installed_version: string, repository: RepositoryBase) => + repository.installed ? installed_version : "-", + }, + available_version: { + ...defaultKeyData, + title: this.hacs.localize("column.available_version"), + hidden: narrow || !tableColumnsOptions.available_version, + sortable: true, + direction: + this.activeSort?.column === "available_version" ? this.activeSort.direction : null, + width: "10%", + template: (available_version: string, repository: RepositoryBase) => + repository.installed ? available_version : "-", + }, + status: { + ...defaultKeyData, + title: this.hacs.localize("column.status"), + hidden: narrow || !tableColumnsOptions.status, + sortable: true, + direction: this.activeSort?.column === "status" ? this.activeSort.direction : null, + width: "10%", + template: (status: string) => + ["pending-restart", "pending-upgrade"].includes(status) + ? this.hacs.localize(`repository_status.${status}`) + : "-", + }, category: { ...defaultKeyData, title: this.hacs.localize("column.category"),