feat(plugins/wakatime): add an option to include other languages (#928)
This commit is contained in:
@@ -117,6 +117,17 @@
|
||||
<br>
|
||||
<b>default:</b> current<br></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap"><h4><code>plugin_wakatime_others</code></h4></td>
|
||||
<td rowspan="2"><p>Including Other Languages</p>
|
||||
<img width="900" height="1" alt=""></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap="nowrap">✨ On <code>master</code>/<code>main</code><br>
|
||||
<b>type:</b> <code>boolean</code>
|
||||
<br>
|
||||
<b>default:</b> no<br></td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--/options-->
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ export default async function({login, q, imports, data, account}, {enabled = fal
|
||||
return null
|
||||
|
||||
//Load inputs
|
||||
let {sections, days, limit, url, user} = imports.metadata.plugins.wakatime.inputs({data, account, q})
|
||||
let {sections, days, limit, url, user, "languages.other":others} = imports.metadata.plugins.wakatime.inputs({data, account, q})
|
||||
if (!limit)
|
||||
limit = void limit
|
||||
const range = {
|
||||
@@ -24,8 +24,8 @@ export default async function({login, q, imports, data, account}, {enabled = fal
|
||||
sections,
|
||||
days,
|
||||
time:{
|
||||
total:stats.total_seconds / (60 * 60),
|
||||
daily:stats.daily_average / (60 * 60),
|
||||
total:(others ? stats.total_seconds_including_other_language : stats.total_seconds) / (60 * 60),
|
||||
daily:(others ? stats.daily_average_including_other_language : stats.daily_average) / (60 * 60),
|
||||
},
|
||||
projects:stats.projects?.map(({name, percent, total_seconds:total}) => ({name, percent:percent / 100, total})).sort((a, b) => b.percent - a.percent).slice(0, limit),
|
||||
languages:stats.languages?.map(({name, percent, total_seconds:total}) => ({name, percent:percent / 100, total})).sort((a, b) => b.percent - a.percent).slice(0, limit),
|
||||
|
||||
@@ -73,4 +73,9 @@ inputs:
|
||||
description: WakaTime username
|
||||
type: string
|
||||
default: current
|
||||
preset: no
|
||||
preset: no
|
||||
|
||||
plugin_wakatime_languages_other:
|
||||
description: Including Other Languages
|
||||
type: boolean
|
||||
default: no
|
||||
|
||||
Reference in New Issue
Block a user