plugins: api._

Massimo Melina committed Feb 11, 2025 at 19:29 UTC 8dd9eb77c0017bf9b040a40080ef18726afc1852
3 files changed +7 -2
admin/src/LogsPage.ts
+2 -2
@@ -138,7 +138,8 @@ export function LogFile({ file, footerSide, hidden, limit, filter, ...rest }: Lo
138 }
139 })
140 const { list, setList, error, connecting, reload } = useApiList(firstSight && 'get_log', { file }, { limit, invert, pause, map: enhanceLogLine })
141 - if (file === 'ips')
141 + const isIps = file === 'ips'
142 + if (isIps)
143 reloadIps = reload
144 const tsColumn: GridColDef = {
145 field: 'ts',
@@ -155,7 +156,6 @@ export function LogFile({ file, footerSide, hidden, limit, filter, ...rest }: Lo
156 [list, showApi, filter])
157 const blockIp = useBlockIp()
158 const isConsole = file === 'console'
158 - const isIps = file === 'ips'
159 return hidden ? null : h(DataTable, {
160 persist: 'log_' + file,
161 error,
dev-plugins.md
+4
@@ -208,6 +208,7 @@ The `api` object you get as parameter of the `init` contains the following:
208
209 - `getConfig(key?: string): any` get plugin's config value, described in `exports.config`.
210 If key is not provided, an object with all keys is returned.
211 + If it's an array/object, DON'T modify it to then use setConfig, as it won't persist. You should first clone it.
212
213 - `setConfig(key: string, value: any)` set plugin's config value.
214
@@ -304,6 +305,8 @@ The `api` object you get as parameter of the `init` contains the following:
305
306 - `renameAccount(from: string, to: string): boolean` returns true if it succeeds.
307
308 +- `_` [lodash library](https://lodash.com/docs/)
309 +
310 ## Frontend specific
311
312 The following information applies to the default frontend, and may not apply to a custom one.
@@ -769,6 +772,7 @@ If you want to override a text regardless of the language, use the special langu
772 - api.subscribeConfig supports multiple keys
773 - api.getAccount, addAccount, delAccount, updateAccount, renameAccount, getUsernames
774 - automatic unload of api.subscribeConfig
775 + - api._
776 - 10.3 (v0.55.0)
777 - HFS.copyTextToClipboard
778 - HFS.urlParams
src/plugins.ts
+1
@@ -126,6 +126,7 @@ async function initPlugin(pl: any, morePassedToInit?: { id: string } & Dict<any>
126 notifyClient,
127 addBlock,
128 misc,
129 + _,
130 ctxBelongsTo,
131 getCurrentUsername,
132 getAccount, getUsernames, addAccount, delAccount, updateAccount, renameAccount,