Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximperconf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximperconf
Commits
e64e7d14
Commit
e64e7d14
authored
Jan 13, 2026
by
Kirill Unitsaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preset: integrate status indicators into result output
parent
6eeca1f8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
21 deletions
+23
-21
actions.go
preset/actions.go
+0
-0
tools.go
preset/tools.go
+23
-21
No files found.
preset/actions.go
View file @
e64e7d14
This diff is collapsed.
Click to expand it.
preset/tools.go
View file @
e64e7d14
...
...
@@ -34,25 +34,27 @@ func profileStatus(p config.PresetProfile) config.ItemStatus {
return
config
.
ProfileStatus
.
Unavailable
}
func
AppendOpResult
(
res
*
config
.
PresetResult
,
r
opResult
)
{
var
msg
string
func
AppendOpResult
(
res
*
Result
,
r
opResult
)
{
item
:=
ui
.
TreeItem
{
Status
:
r
.
Status
,
}
switch
r
.
Status
{
case
StatusSkipped
:
msg
=
fmt
.
Sprintf
(
"Уже существует: %s — пропущено
"
,
r
.
Target
)
case
StatusDryRun
:
msg
=
fmt
.
Sprintf
(
"[Dry-run]
%s → %s"
,
r
.
Source
,
r
.
Target
)
case
StatusDone
:
msg
=
fmt
.
Sprintf
(
"Выполнено:
%s → %s"
,
r
.
Source
,
r
.
Target
)
case
StatusError
:
msg
=
fmt
.
Sprintf
(
"Ошибка: %s"
,
r
.
Reason
)
switch
{
case
r
.
Status
.
IsEqual
(
config
.
OpStatus
.
Skipped
)
:
item
.
Name
=
fmt
.
Sprintf
(
"Уже существует: %s
"
,
r
.
Target
)
case
r
.
Status
.
IsEqual
(
config
.
OpStatus
.
DryRun
)
:
item
.
Name
=
fmt
.
Sprintf
(
"
%s → %s"
,
r
.
Source
,
r
.
Target
)
case
r
.
Status
.
IsEqual
(
config
.
OpStatus
.
Done
)
:
item
.
Name
=
fmt
.
Sprintf
(
"
%s → %s"
,
r
.
Source
,
r
.
Target
)
case
r
.
Status
.
IsEqual
(
config
.
OpStatus
.
Error
)
:
item
.
Name
=
fmt
.
Sprintf
(
"Ошибка: %s"
,
r
.
Reason
)
}
switch
r
.
Kind
{
case
OpCopy
:
res
.
Copies
=
append
(
res
.
Copies
,
msg
)
res
.
Copies
=
append
(
res
.
Copies
,
item
)
case
OpLink
:
res
.
Links
=
append
(
res
.
Links
,
msg
)
res
.
Links
=
append
(
res
.
Links
,
item
)
}
}
...
...
@@ -78,12 +80,12 @@ func expandPath(path, name string) string {
return
path
}
func
renderPresetResult
(
res
*
config
.
Preset
Result
)
{
ui
.
RenderTree
Line
s
(
"Копируем"
,
res
.
Copies
)
ui
.
RenderTree
Line
s
(
"Создаём ссылки"
,
res
.
Links
)
ui
.
RenderTree
Line
s
(
"Обновляем"
,
res
.
Replaced
)
ui
.
RenderTree
Line
s
(
"Настраиваем систему"
,
res
.
System
)
ui
.
RenderTree
Line
s
(
"Создаём переменные Hyprland"
,
res
.
HyprVars
)
ui
.
RenderTree
Line
s
(
"Подключаем модули Hyprland"
,
res
.
HyprModules
)
ui
.
RenderTree
Line
s
(
"Синхронизируем раскладку Hyprland"
,
res
.
SyncSystemLayouts
)
func
renderPresetResult
(
res
*
Result
)
{
ui
.
RenderTree
Item
s
(
"Копируем"
,
res
.
Copies
)
ui
.
RenderTree
Item
s
(
"Создаём ссылки"
,
res
.
Links
)
ui
.
RenderTree
Item
s
(
"Обновляем"
,
res
.
Replaced
)
ui
.
RenderTree
Item
s
(
"Настраиваем систему"
,
res
.
System
)
ui
.
RenderTree
Item
s
(
"Создаём переменные Hyprland"
,
res
.
HyprVars
)
ui
.
RenderTree
Item
s
(
"Подключаем модули Hyprland"
,
res
.
HyprModules
)
ui
.
RenderTree
Item
s
(
"Синхронизируем раскладку Hyprland"
,
res
.
SyncSystemLayouts
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment