Signed-off-by: Fabian Ebner <[email protected]>
---
 src/node/APTRepositories.js | 88 +++++++++++++++++++++++++++++++++++--
 1 file changed, 85 insertions(+), 3 deletions(-)

diff --git a/src/node/APTRepositories.js b/src/node/APTRepositories.js
index 5982306..2c46af5 100644
--- a/src/node/APTRepositories.js
+++ b/src/node/APTRepositories.js
@@ -1,3 +1,25 @@
+Ext.define('Proxmox.node.APTRepositories', {
+    extend: 'Ext.container.Container',
+    xtype: 'proxmoxNodeAPTRepositories',
+
+    mixins: ['Proxmox.Mixin.CBind'],
+
+    items: [
+       {
+           xtype: 'proxmoxNodeAPTRepositoriesMain',
+           cbind: {
+               nodename: '{nodename}',
+           },
+       },
+       {
+           xtype: 'proxmoxNodeAPTRepositoriesWarnings',
+           cbind: {
+               nodename: '{nodename}',
+           },
+       },
+    ],
+});
+
 Ext.define('apt-repolist', {
     extend: 'Ext.data.Model',
     fields: [
@@ -27,10 +49,9 @@ Ext.define('apt-repolist', {
     ],
 });
 
-Ext.define('Proxmox.node.APTRepositories', {
+Ext.define('Proxmox.node.APTRepositoriesMain', {
     extend: 'Ext.grid.GridPanel',
-
-    xtype: 'proxmoxNodeAPTRepositories',
+    xtype: 'proxmoxNodeAPTRepositoriesMain',
 
     sortableColumns: false,
 
@@ -129,3 +150,64 @@ Ext.define('Proxmox.node.APTRepositories', {
        me.callParent();
     },
 });
+
+Ext.define('apt-repolist-warnings', {
+    extend: 'Ext.data.Model',
+    fields: [
+       {
+           name: "location",
+           convert: function(value, record) {
+               let path = record.data.path;
+               if (value || !path) {
+                   return value;
+               }
+               let number = record.data.number || '';
+               return path + ':' + number;
+           },
+       },
+       'message',
+    ],
+});
+
+Ext.define('Proxmox.node.APTRepositoriesWarnings', {
+    extend: 'Ext.grid.GridPanel',
+    xtype: 'proxmoxNodeAPTRepositoriesWarnings',
+
+    columns: [
+       {
+           header: "Warning",
+           dataIndex: "message",
+           flex: 1,
+       },
+       {
+           header: "Location",
+           dataIndex: "location",
+           flex: 1,
+       },
+    ],
+
+    initComponent: function() {
+       let me = this;
+
+       if (!me.nodename) {
+           throw "no node name specified";
+       }
+
+       let store = Ext.create('Ext.data.Store', {
+           model: 'apt-repolist-warnings',
+           proxy: {
+               type: 'proxmox',
+               url: "/api2/json/nodes/" + me.nodename + 
"/apt/repositoriescheck",
+           },
+       });
+
+       Ext.apply(me, {
+           store: store,
+       });
+
+       Proxmox.Utils.monStoreErrors(me, store, true);
+       store.load();
+
+       me.callParent();
+    },
+});
-- 
2.20.1



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to