-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc55460
commit a3d0455
Showing
15 changed files
with
90 additions
and
61 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
app/controllers/api/v2/rh_cloud/advisor_engine_config_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Api | ||
module V2 | ||
module RhCloud | ||
class AdvisorEngineConfigController < ::Api::V2::BaseController | ||
include ::Api::Version2 | ||
|
||
api :GET, "/rh_cloud/advisor_engine_config", N_("Show if system is configured to use local Foreman Advisor Engine.") | ||
def show | ||
render json: { | ||
use_local_advisor_engine: ForemanRhCloud.with_local_advisor_engine?, | ||
}, status: :ok | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 6 additions & 19 deletions
25
webpack/InsightsCloudSync/Components/InsightsSettings/InsightsSettings.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { useAPI } from 'foremanReact/common/hooks/API/APIHooks'; | ||
import { | ||
ADVISOR_ENGINE_CONFIG_KEY, | ||
ADVISOR_ENGINE_CONFIG_PATH, | ||
} from '../../InsightsCloudSync/Components/InsightsTable/InsightsTableConstants'; | ||
|
||
export const useAdvisorEngineConfig = () => { | ||
const { response: advisorEngineConfig } = useAPI( | ||
'get', | ||
ADVISOR_ENGINE_CONFIG_PATH, | ||
{ | ||
key: ADVISOR_ENGINE_CONFIG_KEY, | ||
} | ||
); | ||
|
||
// eslint-disable-next-line camelcase | ||
const isLocalAdvisorEngine = advisorEngineConfig?.use_local_advisor_engine; | ||
return isLocalAdvisorEngine; | ||
}; |