Improve global market dashboard UX and settings
- Add global market dashboard APIs/assets and improve data robustness (incl. crypto heatmap by market cap) - Enhance global market UI (map+heatmap layout, loading behavior, formatting, theme tweaks) - Fix Settings LLM Provider select to render label/value options correctly - Rename Indicator Community to Official Community and move it to the bottom - Add search fallback when Google quota is exhausted
This commit is contained in:
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* Global Market Dashboard API
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
const BASE_URL = '/api/global-market'
|
||||
|
||||
/**
|
||||
* Get global market overview (indices, forex, crypto, commodities)
|
||||
* Includes geo coordinates for world map display
|
||||
*/
|
||||
export function getMarketOverview () {
|
||||
return request({
|
||||
url: `${BASE_URL}/overview`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get market heatmap data (crypto, stock sectors, forex)
|
||||
*/
|
||||
export function getMarketHeatmap () {
|
||||
return request({
|
||||
url: `${BASE_URL}/heatmap`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get financial news - separated by language (cn/en)
|
||||
* @param {string} lang - Language filter: 'cn', 'en', or 'all' (default)
|
||||
*/
|
||||
export function getMarketNews (lang = 'all') {
|
||||
return request({
|
||||
url: `${BASE_URL}/news`,
|
||||
method: 'get',
|
||||
params: { lang }
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get economic calendar with impact indicators
|
||||
*/
|
||||
export function getEconomicCalendar () {
|
||||
return request({
|
||||
url: `${BASE_URL}/calendar`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get market sentiment (Fear & Greed Index, VIX)
|
||||
*/
|
||||
export function getMarketSentiment () {
|
||||
return request({
|
||||
url: `${BASE_URL}/sentiment`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get trading opportunities based on technical analysis
|
||||
*/
|
||||
export function getTradingOpportunities () {
|
||||
return request({
|
||||
url: `${BASE_URL}/opportunities`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Force refresh all market data (clears cache)
|
||||
*/
|
||||
export function refreshMarketData () {
|
||||
return request({
|
||||
url: `${BASE_URL}/refresh`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user