]> git.proxmox.com Git - pmg-api.git/commitdiff
pmgproxy: add link to extjs for api-viewer
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 17 Aug 2019 10:45:12 +0000 (12:45 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 17 Aug 2019 10:45:16 +0000 (12:45 +0200)
allows us to remove the external loading of extjs from the cloudflare
cdn in pmg-docs easier with having the external hosted version in
mind.

Adapted from the pveproxy version [0] with the same goal.

[0]: https://git.proxmox.com/?p=pve-manager.git;a=commitdiff;h=eb65703b55ce97df59d82404fcdd6f6831658158

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PMG/Service/pmgproxy.pm

index 9e3ed3def053d8ea83b96d48c4c0ed32c12df556..8dbcf09c7787d112164b9ecfe3e9a213a46b8783 100755 (executable)
@@ -47,6 +47,7 @@ sub add_dirs {
 }
 
 my $gui_base_dir = "/usr/share/javascript/pmg-gui";
+my $extjs_dir = "/usr/share/javascript/extjs/";
 my $fontawesome_dir = "/usr/share/fonts-font-awesome";
 my $xtermjs_dir = '/usr/share/pve-xtermjs';
 my $framework7_dir = '/usr/share/javascript/framework7';
@@ -67,7 +68,7 @@ sub init {
     my $dirs = {};
 
     add_dirs($dirs, '/pve2/locale/', '/usr/share/pmg-i18n/');
-    add_dirs($dirs, '/pve2/ext6/', '/usr/share/javascript/extjs/');
+    add_dirs($dirs, '/pve2/ext6/', $extjs_dir);
     add_dirs($dirs, '/pve2/images/' => "$gui_base_dir/images/");
     add_dirs($dirs, '/pve2/css/' => "$gui_base_dir/css/");
     add_dirs($dirs, '/pve2/js/' => "$gui_base_dir/js/");
@@ -78,6 +79,7 @@ sub init {
     add_dirs($dirs, '/framework7/js/' => "$framework7_dir/js/");
     add_dirs($dirs, '/xtermjs/' => "$xtermjs_dir/");
     add_dirs($dirs, '/pmg-docs/' => '/usr/share/pmg-docs/');
+    add_dirs($dirs, '/pmg-docs/api-viewer/extjs/' => $extjs_dir);
 
     $self->{server_config} = {
        title => 'Proxmox Mail Gateway API',