Browse Source

RIDIN SPINNUHS, also start working on "step 2"

Andy Baugh 5 năm trước cách đây
mục cha
commit
7b71d529ca
3 tập tin đã thay đổi với 31 bổ sung25 xóa
  1. 10 1
      cgi/pgupgrade.cgi
  2. 1 0
      js/pgupgrade.js
  3. 20 24
      templates/ui/pgupgrade.tmpl

+ 10 - 1
cgi/pgupgrade.cgi

@@ -7,11 +7,19 @@ package Troglodyne::CGI::PgUpgrade;
 use strict;
 use warnings;
 
-use Cpanel::Template ();
+use Cpanel::Template           ();
+use Cpanel::LoadModule::Custom ();
  
 run() unless caller();
  
 sub run {
+    Cpanel::LoadModule::Custom::load_perl_module("Troglodyne::CGI");
+    my $args = Troglodyne::CGI::get_args();
+    my $tmpl = 'pgupgrade';
+    if( $args->{'version'} ) {
+        $tmpl = 'pginstall';
+    }
+
     print "Content-type: text/html\r\n\r\n";
     Cpanel::Template::process_template(
         'whostmgr',
@@ -20,6 +28,7 @@ sub run {
             'print'         => 1,
         }
     );
+
     exit;
 }
 

+ 1 - 0
js/pgupgrade.js

@@ -35,6 +35,7 @@ function versionHandler () {
     </td>
 </tr>`;
         }
+        document.getElementById('loadingCell').remove();
         document.querySelector('#upgradeForm > table > tbody').innerHTML = rows;
     } else {
         console.log(obj.error);

+ 20 - 24
templates/ui/pgupgrade.tmpl

@@ -33,31 +33,27 @@ This interface at least attempts to take care of those issues for you.
     </p>
 </div>
 <h3>Current Version</h3>
-<div id="psqlVersion">Loading...</div>
+<div id="psqlVersion">Loading... <span class="fa fa-spin fa-spinner"></span></div>
 <h3>Select a Version</h3>
-<form id="upgradeForm" name="upgradeForm" action="step2.cgi" method="GET">
-<table class="table table-striped">
-    <thead>
-        <tr>
-            <th>Version</th>
-            <th>Features</th>
-            <th>Release Date</th>
-            <th>End of Life</th>
-        </th>
-    </thead>
-    <tbody>
-        <tr>
-            <td colspan=5 id="enableReposCell" style="display: none;">
-                <div class="callout callout-info">
-                    <button class="btn btn-default" onclick="window.enableCommunityRepos()">
-                        Enable PostgreSQL Community Repositories
-                    </button>
-                </div>
-            </td>
-        </tr>
-    </tbody>
-</table>
-<input id="submit" name="submit" class="btn btn-success" type="submit" value="Continue" title="Please select a version above to continue"></input>
+<form id="upgradeForm" name="upgradeForm" action="pgupgrade.cgi" method="GET">
+    <table class="table table-striped">
+        <thead>
+            <tr>
+                <th>Version</th>
+                <th>Features</th>
+                <th>Release Date</th>
+                <th>End of Life</th>
+            </th>
+        </thead>
+        <tbody>
+            <tr>
+                <td colspan=5 id="loadingCell">
+                    Loading... <span class="fa fa-spin fa-spinner"></span>
+                </td>
+            </tr>
+        </tbody>
+    </table>
+    <input id="submit" name="submit" class="btn btn-success" type="submit" value="Continue" title="Please select a version above to continue"></input>
 </form>
 <script type="text/javascript" src="js/pgupgrade.js"></script>
 [% END %]