mirror of
https://gitlab.com/bignutty/labscore.git
synced 2025-06-09 06:33:05 -04:00
add weather result card
This commit is contained in:
parent
ad5c680f86
commit
2b9904788a
2 changed files with 29 additions and 0 deletions
|
@ -40,6 +40,7 @@ const SEARCH_CARD_TYPES = {
|
|||
DATA_FINANCE: 21,
|
||||
DATA_DICTIONARY: 22,
|
||||
DATA_TRANSLATE: 23,
|
||||
DATA_WEATHER: 24,
|
||||
PIVOT_IMAGES: 100
|
||||
}
|
||||
|
||||
|
@ -213,6 +214,19 @@ function createSearchResultPage(context, result, doodle){
|
|||
}
|
||||
})
|
||||
|
||||
break;
|
||||
case SEARCH_CARD_TYPES.DATA_WEATHER:
|
||||
res = createEmbed("default", context, {
|
||||
description: `-# ${result.weather.place}\n## ${result.weather.temperature}`,
|
||||
thumbnail: {
|
||||
url: result.weather.icon
|
||||
},
|
||||
footer: {
|
||||
iconUrl: STATICS.weather,
|
||||
text: `Weather • ${context.application.name}`
|
||||
}
|
||||
})
|
||||
|
||||
break;
|
||||
case SEARCH_CARD_TYPES.PIVOT_IMAGES:
|
||||
res = createEmbed("default", context, {
|
||||
|
|
|
@ -23,6 +23,7 @@ function renderFooter(context, doodle){
|
|||
|
||||
// These have to be synced with the backend (search_service/endpoints/google).
|
||||
|
||||
|
||||
const SEARCH_CARD_TYPES = {
|
||||
UNKNONW: 0,
|
||||
SEARCH_RESULT: 1,
|
||||
|
@ -39,6 +40,7 @@ const SEARCH_CARD_TYPES = {
|
|||
DATA_FINANCE: 21,
|
||||
DATA_DICTIONARY: 22,
|
||||
DATA_TRANSLATE: 23,
|
||||
DATA_WEATHER: 24,
|
||||
PIVOT_IMAGES: 100
|
||||
}
|
||||
|
||||
|
@ -212,6 +214,19 @@ function createSearchResultPage(context, result, doodle){
|
|||
}
|
||||
})
|
||||
|
||||
break;
|
||||
case SEARCH_CARD_TYPES.DATA_WEATHER:
|
||||
res = createEmbed("default", context, {
|
||||
description: `-# ${result.weather.place}\n## ${result.weather.temperature}`,
|
||||
thumbnail: {
|
||||
url: result.weather.icon
|
||||
},
|
||||
footer: {
|
||||
iconUrl: STATICS.weather,
|
||||
text: `Weather • ${context.application.name}`
|
||||
}
|
||||
})
|
||||
|
||||
break;
|
||||
case SEARCH_CARD_TYPES.PIVOT_IMAGES:
|
||||
res = createEmbed("default", context, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue