瀏覽代碼

HDFS-12661. Ozone: Support optional documentation link in KSM/SCM webui. Contributed by Elek, Marton.

Anu Engineer 7 年之前
父節點
當前提交
763484e596

+ 11 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/ozone.js

@@ -230,6 +230,16 @@
         });
 
     angular.module('ozone').component('commonTools', {
-        templateUrl: '/static/templates/tools.html'
+        templateUrl: '/static/templates/tools.html',
+        controller: function ($http) {
+            var ctrl = this;
+            ctrl.docs = false;
+            $http.head("/docs/index.html")
+                .then(function (result) {
+                    ctrl.docs = true;
+                },function(){
+                    ctrl.docs = false;
+                });
+        }
     });
 })();

+ 1 - 0
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/templates/tools.html

@@ -34,5 +34,6 @@
                         aria-hidden="true"></a></li>
             </ul>
         </li>
+        <li ng-show="$ctrl.docs"><a href="/docs">Documentation</a></li>
     </ul>
 </div><!--/.nav-collapse -->