mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-19 21:11:32 +01:00
Update switcher icons, fix bug makeIconClass, add guid to new workspace name (#1444)
This commit is contained in:
parent
edab90aa55
commit
34b73b8bea
@ -43,20 +43,20 @@ const colors = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const icons = [
|
const icons = [
|
||||||
|
"circle",
|
||||||
"triangle",
|
"triangle",
|
||||||
"star",
|
"star",
|
||||||
"cube",
|
|
||||||
"gem",
|
|
||||||
"chess-knight",
|
|
||||||
"heart",
|
"heart",
|
||||||
"plane",
|
"bolt",
|
||||||
|
"solid@cloud",
|
||||||
|
"moon",
|
||||||
|
"layer-group",
|
||||||
"rocket",
|
"rocket",
|
||||||
"shield-cat",
|
"flask",
|
||||||
"paw-simple",
|
"paperclip",
|
||||||
"umbrella",
|
"chart-line",
|
||||||
"graduation-cap",
|
"graduation-cap",
|
||||||
"mug-hot",
|
"mug-hot",
|
||||||
"circle",
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const ColorSelector = memo(({ colors, selectedColor, onSelect, className }: ColorSelectorProps) => {
|
const ColorSelector = memo(({ colors, selectedColor, onSelect, className }: ColorSelectorProps) => {
|
||||||
@ -209,7 +209,12 @@ const WorkspaceSwitcher = () => {
|
|||||||
|
|
||||||
const saveWorkspace = () => {
|
const saveWorkspace = () => {
|
||||||
setObjectValue(
|
setObjectValue(
|
||||||
{ ...activeWorkspace, name: "New Workspace", icon: "circle", color: colors[0] },
|
{
|
||||||
|
...activeWorkspace,
|
||||||
|
name: `New Workspace (${activeWorkspace.oid.slice(0, 5)})`,
|
||||||
|
icon: icons[0],
|
||||||
|
color: colors[0],
|
||||||
|
},
|
||||||
undefined,
|
undefined,
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
@ -91,7 +91,7 @@ function makeIconClass(icon: string, fw: boolean, opts?: { spin?: boolean; defau
|
|||||||
if (icon.match(/^(solid@)?[a-z0-9-]+$/)) {
|
if (icon.match(/^(solid@)?[a-z0-9-]+$/)) {
|
||||||
// strip off "solid@" prefix if it exists
|
// strip off "solid@" prefix if it exists
|
||||||
icon = icon.replace(/^solid@/, "");
|
icon = icon.replace(/^solid@/, "");
|
||||||
return clsx(`fa fa-sharp fa-solid fa-${icon}`, fw ? "fa-fw" : null, opts?.spin ? "fa-spin" : null);
|
return clsx(`fa fa-solid fa-${icon}`, fw ? "fa-fw" : null, opts?.spin ? "fa-spin" : null);
|
||||||
}
|
}
|
||||||
if (icon.match(/^regular@[a-z0-9-]+$/)) {
|
if (icon.match(/^regular@[a-z0-9-]+$/)) {
|
||||||
// strip off the "regular@" prefix if it exists
|
// strip off the "regular@" prefix if it exists
|
||||||
|
Loading…
Reference in New Issue
Block a user