mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01:00
Use one unified widgets.json file for managing widgets in the sidebar (#1250)
Renames defaultwidgets.json file in defaultconfig to widgets.json and removes references to defaultwidgets in the codebase and documentation. Going forward, users will see one unified list of widgets in the sidebar with no separator between default and custom widgets. Users can manually move any edits to their defaultwidgets.json file into their widgets.json file to get back their overrides.
This commit is contained in:
parent
92271408dc
commit
3216bc2389
@ -59,7 +59,7 @@ There is no UI to edit your default terminal font family. But, it _can_ be overr
|
|||||||
|
|
||||||
See [Custom Widgets](/customwidgets) for detailed documentation around changing what appears in your right widget sidebar.
|
See [Custom Widgets](/customwidgets) for detailed documentation around changing what appears in your right widget sidebar.
|
||||||
|
|
||||||
Using widgets.json (and defaultwidgets.json) you'll be able to remove any default widgets and add widgets of your own. You can fully customize the icons, colors, text, and defaults (like directories, webpages, AI model, remote connection, commands, etc.) of your custom widgets.
|
Using widgets.json, you'll be able to remove any default widgets and add widgets of your own. You can fully customize the icons, colors, text, and defaults (like directories, webpages, AI model, remote connection, commands, etc.) of your custom widgets.
|
||||||
|
|
||||||
You can also suppress the help widgets in the bottom right by setting the config key `widget:showhelp` to `false`.
|
You can also suppress the help widgets in the bottom right by setting the config key `widget:showhelp` to `false`.
|
||||||
|
|
||||||
|
@ -53,15 +53,9 @@ const Widgets = memo(() => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
const showHelp = fullConfig?.settings?.["widget:showhelp"] ?? true;
|
const showHelp = fullConfig?.settings?.["widget:showhelp"] ?? true;
|
||||||
const showDivider = keyLen(fullConfig?.defaultwidgets) > 0 && keyLen(fullConfig?.widgets) > 0;
|
|
||||||
const defaultWidgets = sortByDisplayOrder(fullConfig?.defaultwidgets);
|
|
||||||
const widgets = sortByDisplayOrder(fullConfig?.widgets);
|
const widgets = sortByDisplayOrder(fullConfig?.widgets);
|
||||||
return (
|
return (
|
||||||
<div className="workspace-widgets">
|
<div className="workspace-widgets">
|
||||||
{defaultWidgets.map((data, idx) => (
|
|
||||||
<Widget key={`defwidget-${idx}`} widget={data} />
|
|
||||||
))}
|
|
||||||
{showDivider ? <div className="widget-divider" /> : null}
|
|
||||||
{widgets?.map((data, idx) => <Widget key={`widget-${idx}`} widget={data} />)}
|
{widgets?.map((data, idx) => <Widget key={`widget-${idx}`} widget={data} />)}
|
||||||
{showHelp ? (
|
{showHelp ? (
|
||||||
<>
|
<>
|
||||||
|
1
frontend/types/gotypes.d.ts
vendored
1
frontend/types/gotypes.d.ts
vendored
@ -259,7 +259,6 @@ declare global {
|
|||||||
type FullConfigType = {
|
type FullConfigType = {
|
||||||
settings: SettingsType;
|
settings: SettingsType;
|
||||||
mimetypes: {[key: string]: MimeTypeConfigType};
|
mimetypes: {[key: string]: MimeTypeConfigType};
|
||||||
defaultwidgets: {[key: string]: WidgetConfigType};
|
|
||||||
widgets: {[key: string]: WidgetConfigType};
|
widgets: {[key: string]: WidgetConfigType};
|
||||||
presets: {[key: string]: MetaType};
|
presets: {[key: string]: MetaType};
|
||||||
termthemes: {[key: string]: TermThemeType};
|
termthemes: {[key: string]: TermThemeType};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"defwidget@terminal": {
|
"defwidget@terminal": {
|
||||||
"display:order": 1,
|
"display:order": -5
|
||||||
"icon": "square-terminal",
|
"icon": "square-terminal",
|
||||||
"label": "terminal",
|
"label": "terminal",
|
||||||
"blockdef": {
|
"blockdef": {
|
||||||
@ -11,7 +11,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defwidget@files": {
|
"defwidget@files": {
|
||||||
"display:order": 2,
|
"display:order": -4,
|
||||||
"icon": "folder",
|
"icon": "folder",
|
||||||
"label": "files",
|
"label": "files",
|
||||||
"blockdef": {
|
"blockdef": {
|
||||||
@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defwidget@web": {
|
"defwidget@web": {
|
||||||
"display:order": 3,
|
"display:order": -3,
|
||||||
"icon": "globe",
|
"icon": "globe",
|
||||||
"label": "web",
|
"label": "web",
|
||||||
"blockdef": {
|
"blockdef": {
|
||||||
@ -32,7 +32,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defwidget@ai": {
|
"defwidget@ai": {
|
||||||
"display:order": 4,
|
"display:order": -2,
|
||||||
"icon": "sparkles",
|
"icon": "sparkles",
|
||||||
"label": "ai",
|
"label": "ai",
|
||||||
"blockdef": {
|
"blockdef": {
|
||||||
@ -42,7 +42,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defwidget@sysinfo": {
|
"defwidget@sysinfo": {
|
||||||
"display:order": 5,
|
"display:order": -1,
|
||||||
"icon": "chart-line",
|
"icon": "chart-line",
|
||||||
"label": "sysinfo",
|
"label": "sysinfo",
|
||||||
"blockdef": {
|
"blockdef": {
|
@ -119,13 +119,12 @@ type ConfigError struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FullConfigType struct {
|
type FullConfigType struct {
|
||||||
Settings SettingsType `json:"settings" merge:"meta"`
|
Settings SettingsType `json:"settings" merge:"meta"`
|
||||||
MimeTypes map[string]MimeTypeConfigType `json:"mimetypes"`
|
MimeTypes map[string]MimeTypeConfigType `json:"mimetypes"`
|
||||||
DefaultWidgets map[string]WidgetConfigType `json:"defaultwidgets"`
|
Widgets map[string]WidgetConfigType `json:"widgets"`
|
||||||
Widgets map[string]WidgetConfigType `json:"widgets"`
|
Presets map[string]waveobj.MetaMapType `json:"presets"`
|
||||||
Presets map[string]waveobj.MetaMapType `json:"presets"`
|
TermThemes map[string]TermThemeType `json:"termthemes"`
|
||||||
TermThemes map[string]TermThemeType `json:"termthemes"`
|
ConfigErrors []ConfigError `json:"configerrors" configfile:"-"`
|
||||||
ConfigErrors []ConfigError `json:"configerrors" configfile:"-"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func goBackWS(barr []byte, offset int) int {
|
func goBackWS(barr []byte, offset int) int {
|
||||||
|
Loading…
Reference in New Issue
Block a user