]>
git.proxmox.com Git - proxmox-widget-toolkit.git/blob - src/panel/NodeInfoRepoStatus.js
1 Ext
.define('Proxmox.widget.NodeInfoRepoStatus', {
2 extend
: 'Proxmox.widget.Info',
3 alias
: 'widget.pmxNodeInfoRepoStatus',
5 title
: gettext('Repository Status'),
16 subscriptionActive
: '',
17 noSubscriptionRepo
: '',
23 repoStatus: function(get) {
24 if (get('subscriptionActive') === '' || get('enterpriseRepo') === '') {
28 if (get('noSubscriptionRepo') || get('testRepo')) {
29 return 'non-production';
30 } else if (get('subscriptionActive') && get('enterpriseRepo')) {
32 } else if (!get('subscriptionActive') && get('enterpriseRepo')) {
34 } else if (!get('enterpriseRepo') || !get('noSubscriptionRepo') || !get('testRepo')) {
40 repoStatusMessage: function(get) {
42 let view
= me
.getView();
44 const status
= get('repoStatus');
46 let repoLink
= ` <a data-qtip="${gettext("Open Repositories Panel")}"
47 href="${view.repoLink}">
48 <i class="fa black fa-chevron-right txt-shadow-hover"></i>
51 return Proxmox
.Utils
.formatNodeRepoStatus(status
, view
.product
) + repoLink
;
56 setValue: function(value
) { // for binding below
57 this.updateValue(value
);
61 value
: '{repoStatusMessage}',
64 setRepositoryInfo: function(standardRepos
) {
66 let vm
= me
.getViewModel();
68 for (const standardRepo
of standardRepos
) {
69 const handle
= standardRepo
.handle
;
70 const status
= standardRepo
.status
|| 0;
72 if (handle
=== "enterprise") {
73 vm
.set('enterpriseRepo', status
);
74 } else if (handle
=== "no-subscription") {
75 vm
.set('noSubscriptionRepo', status
);
76 } else if (handle
=== "test") {
77 vm
.set('testRepo', status
);
82 setSubscriptionStatus: function(status
) {
84 let vm
= me
.getViewModel();
86 vm
.set('subscriptionActive', status
);
89 initComponent: function() {
92 if (me
.product
=== undefined) {
93 throw "no product name provided";
96 if (me
.repoLink
=== undefined) {
97 throw "no repo link href provided";