Add description support to UI (#3079)

This commit is contained in:
Pascal Vizeli 2019-04-09 22:53:10 +02:00 committed by GitHub
parent 4d2390daf4
commit eda168247c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,6 +37,7 @@ class HassioAddonNetwork extends EventsMixin(PolymerElement) {
<tr> <tr>
<th>Container</th> <th>Container</th>
<th>Host</th> <th>Host</th>
<th>Description</th>
</tr> </tr>
<template is="dom-repeat" items="[[config]]"> <template is="dom-repeat" items="[[config]]">
<tr> <tr>
@ -47,6 +48,7 @@ class HassioAddonNetwork extends EventsMixin(PolymerElement) {
no-label-float="" no-label-float=""
></paper-input> ></paper-input>
</td> </td>
<td>[[item.description]]</td>
</tr> </tr>
</template> </template>
</tbody> </tbody>
@ -89,9 +91,11 @@ class HassioAddonNetwork extends EventsMixin(PolymerElement) {
if (!addon) return; if (!addon) return;
const network = addon.network || {}; const network = addon.network || {};
const description = addon.network_description || {};
const items = Object.keys(network).map((key) => ({ const items = Object.keys(network).map((key) => ({
container: key, container: key,
host: network[key], host: network[key],
description: description[key],
})); }));
this.config = items.sort(function(el1, el2) { this.config = items.sort(function(el1, el2) {
return el1.host - el2.host; return el1.host - el2.host;