Jelajahi Sumber

HUE-6138 [editor] Add page route for specific job links

Johan Ahlen 8 tahun lalu
induk
melakukan
0b5342f2a5

+ 12 - 5
apps/jobbrowser/src/jobbrowser/templates/job_browser.mako

@@ -1315,15 +1315,22 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
             break;
           default:
             var isJob = true;
-            if (/oozie-oozi-W/.test(h)) { viewModel.interface('workflows'); }
-            else if (/oozie-oozi-C/.test(h)) { viewModel.interface('schedules'); }
-            else if (/oozie-oozi-B/.test(h)) { viewModel.interface('bundles'); }
-            else { isJob = false; }
+            if (/oozie-oozi-W/.test(h)) {
+              viewModel.interface('workflows');
+            } else if (/oozie-oozi-C/.test(h)) {
+              viewModel.interface('schedules')
+            } else if (/oozie-oozi-B/.test(h)) {
+              viewModel.interface('bundles');
+            } else if (/job_/.test(h)) {
+              viewModel.interface('jobs');
+            } else {
+              isJob = false;
+            }
             if (isJob) {
               new Job(viewModel, {id: h}).fetchJob();
             }
         }
-      }
+      };
 
       window.onhashchange = function () {
         loadHash();

+ 4 - 0
desktop/core/src/desktop/templates/hue.mako

@@ -808,6 +808,10 @@ ${ assist.assistPanel() }
             })
           }},
           { url: '/jobbrowser/apps', app: 'jobbrowser' },
+          { url: '/jobbrowser/jobs/job_*', app: function (ctx) {
+            page.redirect('/jobbrowser/jobs/#!job_' + _.trimRight(ctx.params[0], '/'));
+          }},
+          { url: '/jobbrowser/jobs', app: 'jobbrowser' },
           { url: '/logs', app: 'logs' },
           { url: '/metastore', app: function () {
             page('/metastore/tables');

+ 1 - 1
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -691,7 +691,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
   <div class="snippet-log-container margin-bottom-10" data-bind="visible: showLogs() && status() != 'ready' && status() != 'loading'" style="display: none;">
     <div data-bind="delayedOverflow, css: resultsKlass" style="margin-top: 5px; position: relative;">
       <ul data-bind="visible: jobs().length > 0, foreach: jobs" class="unstyled jobs-overlay">
-        <li data-bind="attr: {'id': $data.name.substr(4)}"><a data-bind="text: $.trim($data.name), attr: { href: $data.url }" target="_blank"></a>
+        <li data-bind="attr: {'id': $data.name.substr(4)}"><a data-bind="text: $.trim($data.name), hueLink: $data.url" target="_blank"></a>
           <!-- ko if: typeof percentJob !== 'undefined' && percentJob() > -1 -->
           <div class="progress-job progress active pull-left" style="background-color: #FFF; width: 100%" data-bind="css: {'progress-warning': percentJob() < 100, 'progress-success': percentJob() === 100}">
             <div class="bar" data-bind="style: {'width': percentJob() + '%'}"></div>