]> git.proxmox.com Git - proxmox-widget-toolkit.git/blobdiff - src/Utils.js
vlan edit: Fix automatic field disabling
[proxmox-widget-toolkit.git] / src / Utils.js
index f9a43e367f7c08b374c6cd939d710e28904bb6ee..af5f1db27279198b45324662d7339b9bea15edfb 100644 (file)
@@ -5,13 +5,6 @@ if (!Ext.isDefined(Proxmox.Setup.auth_cookie_name)) {
     throw "Proxmox library not initialized";
 }
 
-// avoid errors related to Accessible Rich Internet Applications
-// (access for people with disabilities)
-// TODO reenable after all components are upgraded
-Ext.enableAria = false;
-Ext.enableAriaButtons = false;
-Ext.enableAriaPanels = false;
-
 // avoid errors when running without development tools
 if (!Ext.isDefined(Ext.global.console)) {
     let console = {
@@ -461,7 +454,7 @@ utilities: {
                success: function(response, opts) {
                    let res = response.result;
                    if (res === null || res === undefined || !res || res
-                       .data.status !== 'Active') {
+                       .data.status.toLowerCase() !== 'active') {
                        Ext.Msg.show({
                            title: gettext('No valid subscription'),
                            icon: Ext.Msg.WARNING,
@@ -562,94 +555,15 @@ utilities: {
     },
 
     task_desc_table: {
-       acmenewcert: ['SRV', gettext('Order Certificate')],
-       acmeregister: ['ACME Account', gettext('Register')],
-       acmedeactivate: ['ACME Account', gettext('Deactivate')],
-       acmeupdate: ['ACME Account', gettext('Update')],
-       acmerefresh: ['ACME Account', gettext('Refresh')],
-       acmerenew: ['SRV', gettext('Renew Certificate')],
-       acmerevoke: ['SRV', gettext('Revoke Certificate')],
-       'auth-realm-sync': [gettext('Realm'), gettext('Sync')],
-       'auth-realm-sync-test': [gettext('Realm'), gettext('Sync Preview')],
-       'move_volume': ['CT', gettext('Move Volume')],
-       clustercreate: ['', gettext('Create Cluster')],
-       clusterjoin: ['', gettext('Join Cluster')],
+       aptupdate: ['', gettext('Update package database')],
        diskinit: ['Disk', gettext('Initialize Disk with GPT')],
-       vncproxy: ['VM/CT', gettext('Console')],
-       spiceproxy: ['VM/CT', gettext('Console') + ' (Spice)'],
-       vncshell: ['', gettext('Shell')],
        spiceshell: ['', gettext('Shell') + ' (Spice)'],
-       qmsnapshot: ['VM', gettext('Snapshot')],
-       qmrollback: ['VM', gettext('Rollback')],
-       qmdelsnapshot: ['VM', gettext('Delete Snapshot')],
-       qmcreate: ['VM', gettext('Create')],
-       qmrestore: ['VM', gettext('Restore')],
-       qmdestroy: ['VM', gettext('Destroy')],
-       qmigrate: ['VM', gettext('Migrate')],
-       qmclone: ['VM', gettext('Clone')],
-       qmmove: ['VM', gettext('Move disk')],
-       qmtemplate: ['VM', gettext('Convert to template')],
-       qmstart: ['VM', gettext('Start')],
-       qmstop: ['VM', gettext('Stop')],
-       qmreset: ['VM', gettext('Reset')],
-       qmshutdown: ['VM', gettext('Shutdown')],
-       qmreboot: ['VM', gettext('Reboot')],
-       qmsuspend: ['VM', gettext('Hibernate')],
-       qmpause: ['VM', gettext('Pause')],
-       qmresume: ['VM', gettext('Resume')],
-       qmconfig: ['VM', gettext('Configure')],
-       vzsnapshot: ['CT', gettext('Snapshot')],
-       vzrollback: ['CT', gettext('Rollback')],
-       vzdelsnapshot: ['CT', gettext('Delete Snapshot')],
-       vzcreate: ['CT', gettext('Create')],
-       vzrestore: ['CT', gettext('Restore')],
-       vzdestroy: ['CT', gettext('Destroy')],
-       vzmigrate: ['CT', gettext('Migrate')],
-       vzclone: ['CT', gettext('Clone')],
-       vztemplate: ['CT', gettext('Convert to template')],
-       vzstart: ['CT', gettext('Start')],
-       vzstop: ['CT', gettext('Stop')],
-       vzmount: ['CT', gettext('Mount')],
-       vzumount: ['CT', gettext('Unmount')],
-       vzshutdown: ['CT', gettext('Shutdown')],
-       vzreboot: ['CT', gettext('Reboot')],
-       vzsuspend: ['CT', gettext('Suspend')],
-       vzresume: ['CT', gettext('Resume')],
-       push_file: ['CT', gettext('Push file')],
-       pull_file: ['CT', gettext('Pull file')],
-       hamigrate: ['HA', gettext('Migrate')],
-       hastart: ['HA', gettext('Start')],
-       hastop: ['HA', gettext('Stop')],
-       hashutdown: ['HA', gettext('Shutdown')],
+       srvreload: ['SRV', gettext('Reload')],
+       srvrestart: ['SRV', gettext('Restart')],
        srvstart: ['SRV', gettext('Start')],
        srvstop: ['SRV', gettext('Stop')],
-       srvrestart: ['SRV', gettext('Restart')],
-       srvreload: ['SRV', gettext('Reload')],
-       cephcreatemgr: ['Ceph Manager', gettext('Create')],
-       cephdestroymgr: ['Ceph Manager', gettext('Destroy')],
-       cephcreatemon: ['Ceph Monitor', gettext('Create')],
-       cephdestroymon: ['Ceph Monitor', gettext('Destroy')],
-       cephcreateosd: ['Ceph OSD', gettext('Create')],
-       cephdestroyosd: ['Ceph OSD', gettext('Destroy')],
-       cephcreatepool: ['Ceph Pool', gettext('Create')],
-       cephdestroypool: ['Ceph Pool', gettext('Destroy')],
-       cephfscreate: ['CephFS', gettext('Create')],
-       cephcreatemds: ['Ceph Metadata Server', gettext('Create')],
-       cephdestroymds: ['Ceph Metadata Server', gettext('Destroy')],
-       imgcopy: ['', gettext('Copy data')],
-       imgdel: ['', gettext('Erase data')],
-       unknownimgdel: ['', gettext('Destroy image from unknown guest')],
-       download: ['', gettext('Download')],
-       vzdump: (type, id) => id ? `VM/CT ${id} - ${gettext('Backup')}` : gettext('Backup Job'),
-       aptupdate: ['', gettext('Update package database')],
-       startall: ['', gettext('Start all VMs and Containers')],
-       stopall: ['', gettext('Stop all VMs and Containers')],
-       migrateall: ['', gettext('Migrate all VMs and Containers')],
-       dircreate: [gettext('Directory Storage'), gettext('Create')],
-       dirremove: [gettext('Directory'), gettext('Remove')],
-       lvmcreate: [gettext('LVM Storage'), gettext('Create')],
-       lvmthincreate: [gettext('LVM-Thin Storage'), gettext('Create')],
-       zfscreate: [gettext('ZFS Storage'), gettext('Create')],
+       termproxy: ['', gettext('Console') + ' (xterm.js)'],
+       vncshell: ['', gettext('Shell')],
     },
 
     // to add or change existing for product specific ones
@@ -712,7 +626,6 @@ utilities: {
     },
 
     systemd_unescape: function(string_value) {
-
        const charcode_0 = '0'.charCodeAt(0);
        const charcode_9 = '9'.charCodeAt(0);
        const charcode_A = 'A'.charCodeAt(0);
@@ -864,11 +777,11 @@ utilities: {
        }
        // try to normalize - and _ separators, to support asciidoc and sphinx
        // references at the same time.
-       let section_minus_normalized = section.replace(/_/, '-');
+       let section_minus_normalized = section.replace(/_/g, '-');
        if (helpMap[section_minus_normalized]) {
            return helpMap[section_minus_normalized];
        }
-       let section_underscore_normalized = section.replace(/-/, '_');
+       let section_underscore_normalized = section.replace(/-/g, '_');
        return helpMap[section_underscore_normalized];
     },
 
@@ -941,7 +854,7 @@ utilities: {
        me.HostPort_match = new RegExp("^(" + IPV4_REGEXP + "|" + DnsName_REGEXP + ")(?::(\\d+))?$");
        me.HostPortBrackets_match = new RegExp("^\\[(" + IPV6_REGEXP + "|" + IPV4_REGEXP + "|" + DnsName_REGEXP + ")\\](?::(\\d+))?$");
        me.IP6_dotnotation_match = new RegExp("^(" + IPV6_REGEXP + ")(?:\\.(\\d+))?$");
-       me.Vlan_match = /^vlan(\\d+)/;
-       me.VlanInterface_match = /(\\w+)\\.(\\d+)/;
+       me.Vlan_match = /^vlan(\d+)/;
+       me.VlanInterface_match = /(\w+)\.(\d+)/;
     },
 });