]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/dc/Support.js
ui: realm: clarify that the sync jobs really are for the realm
[pve-manager.git] / www / manager6 / dc / Support.js
1 Ext.define('PVE.dc.Support', {
2 extend: 'Ext.panel.Panel',
3 alias: 'widget.pveDcSupport',
4 pveGuidePath: '/pve-docs/index.html',
5 onlineHelp: 'getting_help',
6
7 invalidHtml: '<h1>No valid subscription</h1>' + PVE.Utils.noSubKeyHtml,
8
9 communityHtml: 'Please use the public community <a target="_blank" href="https://forum.proxmox.com">forum</a> for any questions.',
10
11 activeHtml: 'Please use our <a target="_blank" href="https://my.proxmox.com">support portal</a> for any questions. You can also use the public community <a target="_blank" href="https://forum.proxmox.com">forum</a> to get additional information.',
12
13 bugzillaHtml: '<h1>Bug Tracking</h1>Our bug tracking system is available <a target="_blank" href="https://bugzilla.proxmox.com">here</a>.',
14
15 docuHtml: function() {
16 var me = this;
17 var guideUrl = window.location.origin + me.pveGuidePath;
18 var text = Ext.String.format('<h1>Documentation</h1>'
19 + 'The official Proxmox VE Administration Guide'
20 + ' is included with this installation and can be browsed at '
21 + '<a target="_blank" href="{0}">{0}</a>', guideUrl);
22 return text;
23 },
24
25 updateActive: function(data) {
26 var me = this;
27
28 var html = '<h1>' + data.productname + '</h1>' + me.activeHtml;
29 html += '<br><br>' + me.docuHtml();
30 html += '<br><br>' + me.bugzillaHtml;
31
32 me.update(html);
33 },
34
35 updateCommunity: function(data) {
36 var me = this;
37
38 var html = '<h1>' + data.productname + '</h1>' + me.communityHtml;
39 html += '<br><br>' + me.docuHtml();
40 html += '<br><br>' + me.bugzillaHtml;
41
42 me.update(html);
43 },
44
45 updateInactive: function(data) {
46 var me = this;
47 me.update(me.invalidHtml);
48 },
49
50 initComponent: function() {
51 let me = this;
52
53 let reload = function() {
54 Proxmox.Utils.API2Request({
55 url: '/nodes/localhost/subscription',
56 method: 'GET',
57 waitMsgTarget: me,
58 failure: function(response, opts) {
59 Ext.Msg.alert(gettext('Error'), response.htmlStatus);
60 me.update(`${gettext('Unable to load subscription status')}: ${response.htmlStatus}`);
61 },
62 success: function(response, opts) {
63 let data = response.result.data;
64 if (data?.status.toLowerCase() === 'active') {
65 if (data.level === 'c') {
66 me.updateCommunity(data);
67 } else {
68 me.updateActive(data);
69 }
70 } else {
71 me.updateInactive(data);
72 }
73 },
74 });
75 };
76
77 Ext.apply(me, {
78 autoScroll: true,
79 bodyStyle: 'padding:10px',
80 listeners: {
81 activate: reload,
82 },
83 });
84
85 me.callParent();
86 },
87 });