mirror of https://github.com/jetkvm/kvm.git
remove macro description
This commit is contained in:
parent
223558a6a0
commit
5c3424e89f
|
@ -46,7 +46,6 @@ func (s *KeyboardMacroStep) Validate() error {
|
|||
type KeyboardMacro struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Steps []KeyboardMacroStep `json:"steps"`
|
||||
SortOrder int `json:"sortOrder,omitempty"`
|
||||
}
|
||||
|
|
|
@ -822,7 +822,6 @@ func setKeyboardMacros(params KeyboardMacrosParams) (interface{}, error) {
|
|||
}
|
||||
|
||||
name, _ := macroMap["name"].(string)
|
||||
description, _ := macroMap["description"].(string)
|
||||
|
||||
sortOrder := i + 1
|
||||
if sortOrderFloat, ok := macroMap["sortOrder"].(float64); ok {
|
||||
|
@ -866,7 +865,6 @@ func setKeyboardMacros(params KeyboardMacrosParams) (interface{}, error) {
|
|||
macro := KeyboardMacro{
|
||||
ID: id,
|
||||
Name: name,
|
||||
Description: description,
|
||||
Steps: steps,
|
||||
SortOrder: sortOrder,
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ export default function MacroBar() {
|
|||
{macros.map(macro => (
|
||||
<Button
|
||||
key={macro.id}
|
||||
aria-label={macro.description || macro.name}
|
||||
aria-label={macro.name}
|
||||
size="XS"
|
||||
theme="light"
|
||||
text={macro.name}
|
||||
|
|
|
@ -14,6 +14,8 @@ import Fieldset from "@/components/Fieldset";
|
|||
import { SelectMenuBasic } from "@/components/SelectMenuBasic";
|
||||
import EmptyCard from "@/components/EmptyCard";
|
||||
import { Combobox } from "@/components/Combobox";
|
||||
import { CardHeader } from "@/components/CardHeader";
|
||||
import Card from "@/components/Card";
|
||||
|
||||
const DEFAULT_DELAY = 50;
|
||||
|
||||
|
@ -921,12 +923,11 @@ export default function SettingsMacrosRoute() {
|
|||
)}
|
||||
<div className={`space-y-4 ${loading ? 'hidden' : ''}`}>
|
||||
{showAddMacro && (
|
||||
<div className="rounded-md border border-slate-200 bg-white p-3 dark:border-slate-700 dark:bg-slate-800">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<h3 className="text-sm font-semibold text-black dark:text-white">Add New Macro</h3>
|
||||
</div>
|
||||
<Fieldset>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-2">
|
||||
<Card className="p-3">
|
||||
<CardHeader
|
||||
headline="Add New Macro"
|
||||
/>
|
||||
<Fieldset className="mt-4">
|
||||
<InputFieldWithLabel
|
||||
type="text"
|
||||
label="Macro Name"
|
||||
|
@ -942,22 +943,6 @@ export default function SettingsMacrosRoute() {
|
|||
}
|
||||
}}
|
||||
/>
|
||||
<InputFieldWithLabel
|
||||
type="text"
|
||||
label="Description"
|
||||
placeholder="Description (optional)"
|
||||
value={newMacro.description}
|
||||
error={errors.description}
|
||||
onChange={e => {
|
||||
setNewMacro(prev => ({ ...prev, description: e.target.value }));
|
||||
if (errors.description) {
|
||||
const newErrors = { ...errors };
|
||||
delete newErrors.description;
|
||||
setErrors(newErrors);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Fieldset>
|
||||
|
||||
<div className="mt-4">
|
||||
|
@ -1085,7 +1070,7 @@ export default function SettingsMacrosRoute() {
|
|||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
)}
|
||||
{macros.length === 0 && !showAddMacro && (
|
||||
<EmptyCard
|
||||
|
@ -1105,9 +1090,11 @@ export default function SettingsMacrosRoute() {
|
|||
<div className="space-y-1">
|
||||
{macros.map((macro, index) =>
|
||||
editingMacro && editingMacro.id === macro.id ? (
|
||||
<div key={macro.id} className="rounded-md border border-blue-300 bg-blue-50 p-3 dark:border-blue-700 dark:bg-blue-900/20">
|
||||
<Fieldset>
|
||||
<div className="mb-2 grid grid-cols-1 md:grid-cols-2 gap-2">
|
||||
<Card key={macro.id} className="border-blue-300 bg-blue-50 p-3 dark:border-blue-700 dark:bg-blue-900/20">
|
||||
<CardHeader
|
||||
headline="Edit Macro"
|
||||
/>
|
||||
<Fieldset className="mt-4">
|
||||
<InputFieldWithLabel
|
||||
type="text"
|
||||
label="Macro Name"
|
||||
|
@ -1123,22 +1110,6 @@ export default function SettingsMacrosRoute() {
|
|||
}
|
||||
}}
|
||||
/>
|
||||
<InputFieldWithLabel
|
||||
type="text"
|
||||
label="Description"
|
||||
placeholder="Description (optional)"
|
||||
value={editingMacro.description}
|
||||
error={errors.description}
|
||||
onChange={e => {
|
||||
setEditingMacro({ ...editingMacro, description: e.target.value });
|
||||
if (errors.description) {
|
||||
const newErrors = { ...errors };
|
||||
delete newErrors.description;
|
||||
setErrors(newErrors);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</Fieldset>
|
||||
|
||||
<div className="mt-4">
|
||||
|
@ -1238,7 +1209,7 @@ export default function SettingsMacrosRoute() {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
) : (
|
||||
<div
|
||||
key={macro.id}
|
||||
|
@ -1272,11 +1243,6 @@ export default function SettingsMacrosRoute() {
|
|||
<h4 className="truncate text-sm font-medium text-black dark:text-white">
|
||||
{macro.name}
|
||||
</h4>
|
||||
{macro.description && (
|
||||
<p className="truncate text-xs text-slate-500 dark:text-slate-400">
|
||||
{macro.description}
|
||||
</p>
|
||||
)}
|
||||
<p className="mt-1 text-xs text-slate-500 dark:text-slate-400 overflow-hidden">
|
||||
<span className="flex flex-wrap items-center">
|
||||
{macro.steps.slice(0, 3).map((step, stepIndex) => {
|
||||
|
|
Loading…
Reference in New Issue