Fix "Clear Oem Logs" functionality in System Logs

Issue Symptom:
1. "Clear Oem Logs" button didn't show on webui when type select to "Oem".
2. "Clear Oem Logs" button was showed on then pressed with fix, but the function didn't work correctly.
   Event logs were deleted instead of Oem logs.

Root cause:
1. getSystemLogs() always get Event logs by default no matter type be selected to "Oem".
2. clearSystemLogs() always clear Event logs by default no matter type be selected to "Oem".

Solution:
1. According "recordType" to get Oem logs from uri:
   '/redfish/v1/Systems/' + DataService.systemName + '/LogServices/Crashdump/Entries'
2. According "selectedRecordType" to clear Oem logs by action: uri = '/redfish/v1/Systems/' +
   DataService.systemName + '/LogServices/Crashdump/Actions/LogService.ClearLog'

Modified files:
webui/app/common/services/api-utils.js
webui/app/server-health/controllers/syslog-controller.html
webui/app/server-health/controllers/syslog-controller.js

Tested by:
1. In WebUI/Server health/System Logs, select system log type as "Oem", then click "Clear Oem Logs" button.
   The Oem logs (CPU Crashdump log) all were deleted.
2. Select system log type as "Event", then click "Clear Event Logs" button.
   The System Event Log all were deleted.

Signed-off-by: Tim Lee <timlee660101@gmail.com>
Change-Id: I2a3d42a61f53df84b88585cf7c65a10688eaef05
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 4298884..091f72b 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -53,6 +53,10 @@
         getSystemLogs: function(recordType) {
           var uri = '/redfish/v1/Systems/' + DataService.systemName +
               '/LogServices/EventLog/Entries';
+          if (recordType == 'Oem') {
+            var uri = '/redfish/v1/Systems/' + DataService.systemName +
+                '/LogServices/Crashdump/Entries';
+          }
           return $http({
                    method: 'GET',
                    url: DataService.getHost() + uri,
@@ -74,9 +78,13 @@
                     console.log(JSON.stringify(error));
                   });
         },
-        clearSystemLogs: function() {
+        clearSystemLogs: function(selectedRecordType) {
           var uri = '/redfish/v1/Systems/' + DataService.systemName +
               '/LogServices/EventLog/Actions/LogService.ClearLog';
+          if (selectedRecordType == 'Oem') {
+            var uri = '/redfish/v1/Systems/' + DataService.systemName +
+                '/LogServices/Crashdump/Actions/LogService.ClearLog';
+          }
           return $http({
             method: 'POST',
             url: DataService.getHost() + uri,
diff --git a/app/server-health/controllers/syslog-controller.html b/app/server-health/controllers/syslog-controller.html
index 9e04f49..11918bb 100644
--- a/app/server-health/controllers/syslog-controller.html
+++ b/app/server-health/controllers/syslog-controller.html
@@ -21,7 +21,7 @@
               </p>
             </div>
             <div class="inline__confirm-buttons">
-              <button class="btn-primary" ng-click="clearSystemLogEntries()">Yes</button>
+              <button class="btn-primary" ng-click="clearSystemLogEntries(selectedRecordType)">Yes</button>
               <button class="btn-primary" ng-click="confirm = false">No</button>
             </div>
           </div>
diff --git a/app/server-health/controllers/syslog-controller.js b/app/server-health/controllers/syslog-controller.js
index c073320..ad54dd2 100644
--- a/app/server-health/controllers/syslog-controller.js
+++ b/app/server-health/controllers/syslog-controller.js
@@ -59,9 +59,9 @@
                 });
           };
 
-          $scope.clearSystemLogEntries = function() {
+          $scope.clearSystemLogEntries = function(selectedRecordType) {
             $scope.confirm = false;
-            APIUtils.clearSystemLogs()
+            APIUtils.clearSystemLogs(selectedRecordType)
                 .then(
                     function(res) {
                       console.log(JSON.stringify(res));