@samitouri / QOSami-HFS / commits / 4a1a835d

plugin: config.type=showHtml #903

Massimo Melina committed Feb 16, 2025 at 21:44 UTC 4a1a835d25247d51caf1d126ca5fd608fead985f
3 files changed +6 -7
admin/src/InstalledPlugins.ts
+1 -2
@@ -169,8 +169,6 @@ export function renderName({ row, value }: any) {
169
170 function makeFields(config: any, values: any) {
171 return Object.entries(config).map(([k,o]: [string,any]) => {
172 - if (!_.isPlainObject(o))
173 - return typeof o === 'string' ? h(Html, {}, o) : o
172 let { type, defaultValue, fields, frontend, helperText, showIf, ...rest } = o
173 try {
174 if (typeof showIf === 'string') // compile once
@@ -203,6 +201,7 @@ const type2comp = {
201 vfs_path: VfsPathField,
202 username: UsernameField,
203 color: ColorField,
204 + showHtml: ({ html }: any) => h(Html, {}, String(html)),
205 }
206
207 export async function startPlugin(id: string) {
dev-plugins.md
+4 -4
@@ -201,8 +201,8 @@ Based on `type`, other properties are supported:
201 - `groups: undefined | boolean` true if you want only groups, false if you want only users. Default is undefined.
202 - `multiple: boolean` if you set this to true, the field will allow the selection of multiple accounts,
203 and the resulting value will be array of strings, instead of a string. Default is false.
204 -
205 -FieldDescriptor can, instead of an object, be a string, but that won't count as an actual field, but will just be displayed as HTML.
204 +- `showHtml`
205 + - `html: string` HTML code to display.
206
207 ## api object
208
@@ -767,7 +767,7 @@ If you want to override a text regardless of the language, use the special langu
767
768 ## API version history
769
770 -- 11.5 (v0.56.0)
770 +- 11.6 (v0.56.0)
771 - api.setError
772 - frontend events: afterBreadcrumbs, afterFolderStats, afterFilter
773 - config.type.vfs_path: folders, files
@@ -775,7 +775,7 @@ If you want to override a text regardless of the language, use the special langu
775 - api.getAccount, addAccount, delAccount, updateAccount, renameAccount, getUsernames
776 - automatic unload of api.subscribeConfig
777 - api._
778 - - config as html-string
778 + - config.type=showHtml
779 - 10.3 (v0.55.0)
780 - HFS.copyTextToClipboard
781 - HFS.urlParams
src/const.ts
+1 -1
@@ -9,7 +9,7 @@ import { formatTimestamp } from './cross'
9 import { argv } from './argv'
10 export * from './cross-const'
11
12 -export const API_VERSION = 11.5
12 +export const API_VERSION = 11.6
13 export const COMPATIBLE_API_VERSION = 1 // while changes in the api are not breaking, this number stays the same, otherwise it is made equal to API_VERSION
14
15 // you can add arguments with this file, currently used for the update process on mac/linux