Skip to content

Commit 03bcdbe

Browse files
committed
fixes 20012026
new default wallpaper delete win setup exes new random images backgrounds fix profile-logo first startup fix delete service if tun run fix topology return from another menu
1 parent 78f3007 commit 03bcdbe

File tree

7 files changed

+138
-29
lines changed

7 files changed

+138
-29
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
uses: actions/setup-go@v6
3333
with:
3434
go-version: '1.25'
35+
cache-dependency-path: |
36+
src-go/go.sum
37+
src-service/go.sum
3538
3639
- name: Install Backend Dependencies
3740
shell: pwsh
@@ -63,6 +66,16 @@ jobs:
6366
-ldflags "-s -w -X github.com/legiz-ru/prizrak-box/api.Version=$env:VERSION" `
6467
-o px.exe
6568
69+
- name: Build px-service for ${{ matrix.arch }}
70+
shell: pwsh
71+
env:
72+
CGO_ENABLED: 0
73+
GOARCH: ${{ matrix.arch }}
74+
run: |
75+
cd src-service
76+
go mod download
77+
go build -ldflags "-s -w" -o px-service.exe .
78+
6679
- name: Sync VERSION to package.json
6780
run: node build/sync-version.js
6881

@@ -101,22 +114,13 @@ jobs:
101114
exit 1
102115
}
103116
104-
# --- Squirrel.Windows Assets (FIXED LOGIC) ---
117+
# --- Squirrel.Windows Assets (NUPKG and RELEASES only) ---
105118
$squirrelDir = "out\make\squirrel.windows\$electronArch"
106-
107-
# 1. Find the actual Setup.exe installer file
108-
$installerFile = Get-ChildItem -Path $squirrelDir -Filter "*Setup.exe" | Select-Object -First 1
109-
if ($installerFile) {
110-
Copy-Item -Path $installerFile.FullName -Destination "windows-${arch}-Setup.exe"
111-
} else {
112-
Write-Error "Squirrel.Windows installer (*Setup.exe) file not found in $squirrelDir. Ensure the Squirrel maker ran successfully."
113-
exit 1
114-
}
115-
116-
# 2. Copy RELEASES file (required for Squirrel auto-update)
119+
120+
# 1. Copy RELEASES file (required for Squirrel auto-update)
117121
Copy-Item -Path "$squirrelDir\RELEASES" -Destination "RELEASES" -Force
118-
119-
# 3. Find the full nupkg file
122+
123+
# 2. Find the full nupkg file
120124
$nupkgFile = Get-ChildItem -Path $squirrelDir -Filter "*-full.nupkg" | Select-Object -First 1
121125
if ($nupkgFile) {
122126
Copy-Item -Path $nupkgFile.FullName -Destination "windows-${arch}-full.nupkg"
@@ -132,7 +136,6 @@ jobs:
132136
path: |
133137
windows-${{ matrix.arch }}.zip
134138
windows-${{ matrix.arch }}.msi
135-
windows-${{ matrix.arch }}-Setup.exe
136139
RELEASES
137140
windows-${{ matrix.arch }}-full.nupkg
138141
@@ -165,6 +168,9 @@ jobs:
165168
uses: actions/setup-go@v6
166169
with:
167170
go-version: '1.25'
171+
cache-dependency-path: |
172+
src-go/go.sum
173+
src-service/go.sum
168174
169175
- name: Install Backend Dependencies
170176
run: |
@@ -193,6 +199,15 @@ jobs:
193199
-ldflags "-s -w -X github.com/legiz-ru/prizrak-box/api.Version=${{ env.VERSION }}" \
194200
-o px
195201
202+
- name: Build px-service for ${{ matrix.arch }}
203+
env:
204+
CGO_ENABLED: 0
205+
GOARCH: ${{ matrix.arch }}
206+
run: |
207+
cd src-service
208+
go mod download
209+
go build -ldflags "-s -w" -o px-service .
210+
196211
- name: Sync VERSION to package.json
197212
run: node build/sync-version.js
198213

@@ -262,6 +277,9 @@ jobs:
262277
uses: actions/setup-go@v6
263278
with:
264279
go-version: '1.25'
280+
cache-dependency-path: |
281+
src-go/go.sum
282+
src-service/go.sum
265283
266284
- name: Install Backend Dependencies
267285
run: |
@@ -319,6 +337,15 @@ jobs:
319337
-ldflags "-s -w -X github.com/legiz-ru/prizrak-box/api.Version=${{ env.VERSION }}" \
320338
-o px
321339
340+
- name: Build px-service for ${{ matrix.arch }}
341+
env:
342+
CGO_ENABLED: 0
343+
GOARCH: ${{ matrix.arch }}
344+
run: |
345+
cd src-service
346+
go mod download
347+
go build -ldflags "-s -w" -o px-service .
348+
322349
- name: Sync VERSION to package.json
323350
run: node build/sync-version.js
324351

@@ -570,10 +597,8 @@ jobs:
570597
`### Downloads`,
571598
`* [Windows (amd64, Portable)](https://github.com/${owner}/${repo}/releases/download/${tag}/windows-amd64.zip)`,
572599
`* [Windows (amd64, MSI Installer)](https://github.com/${owner}/${repo}/releases/download/${tag}/windows-amd64.msi)`,
573-
`* [Windows (amd64, Setup)](https://github.com/${owner}/${repo}/releases/download/${tag}/windows-amd64-Setup.exe)`,
574600
`* [Windows (arm64, Portable)](https://github.com/${owner}/${repo}/releases/download/${tag}/windows-arm64.zip)`,
575601
`* [Windows (arm64, MSI Installer)](https://github.com/${owner}/${repo}/releases/download/${tag}/windows-arm64.msi)`,
576-
`* [Windows (arm64, Setup)](https://github.com/${owner}/${repo}/releases/download/${tag}/windows-arm64-Setup.exe)`,
577602
`* [Linux (amd64, deb)](https://github.com/${owner}/${repo}/releases/download/${tag}/linux-amd64.deb)`,
578603
`* [Linux (amd64, rpm)](https://github.com/${owner}/${repo}/releases/download/${tag}/linux-amd64.rpm)`,
579604
`* [Linux (arm64, deb)](https://github.com/${owner}/${repo}/releases/download/${tag}/linux-arm64.deb)`,

public/images/default.jpg

162 KB
Loading

public/json/theme.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,9 @@
8585
{
8686
"id": "random",
8787
"bg": [
88-
"https://bing.img.run/rand.php?a=1",
89-
"https://picsum.photos/1920/1080?a=1",
90-
"https://cdn.seovx.com/?mom=302",
91-
"https://cdn.seovx.com/ha/?mom=302"
88+
"https://img.fanpx.com/random.php?orientation=landscape",
89+
"https://img.fanpx.com/random1.php?orientation=landscape",
90+
"https://picsum.photos/1920/1080?a=1"
9291
],
9392
"rand": true
9493
},

src/components/home/ActiveProfile.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,20 @@ async function refreshProfile() {
4444
const refreshed = await api.refreshProfile(activeProfile.value);
4545
Object.assign(activeProfile.value, refreshed);
4646
47+
// Получаем обновленный список профилей для синхронизации
48+
const fullList = await api.getProfileList();
49+
4750
// Используем toRaw для избежания ошибки клонирования
4851
Events.Emit({
4952
name: "profiles",
50-
data: toRaw(props.profiles)
53+
data: toRaw(fullList)
5154
});
5255
56+
// Также отправляем событие внутри Vue для немедленного обновления
57+
window.dispatchEvent(new CustomEvent('vue-profiles-updated', {
58+
detail: { profiles: toRaw(fullList) }
59+
}));
60+
5361
pSuccess(t('profiles.refresh.success'));
5462
} catch (e) {
5563
if (e['message']) {

src/components/home/WelcomeScreen.vue

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,22 @@ async function addProfile() {
5353
try {
5454
const newProfiles = await api.addProfileFromInput(p);
5555
56+
let firstProfileId = null;
57+
5658
// Если профили добавлены, активируем первый из них
5759
if (newProfiles && newProfiles.length > 0) {
5860
const firstProfile = newProfiles[0];
61+
firstProfileId = firstProfile.id;
62+
63+
// Обновляем профиль для получения полной информации (логотип, имя и т.д.)
64+
if (firstProfile.type === 1) {
65+
try {
66+
await api.refreshProfile(firstProfile);
67+
} catch (e) {
68+
// Игнорируем ошибку обновления, профиль уже добавлен
69+
console.warn('Failed to refresh profile:', e);
70+
}
71+
}
5972
6073
// Переключаемся на новый профиль (эксклюзивно)
6174
await api.switchProfile({
@@ -66,20 +79,47 @@ async function addProfile() {
6679
6780
// Ждём, пока прокси запустится
6881
await api.waitRunning();
82+
}
6983
70-
// Обновляем профиль для получения полной информации (логотип, имя и т.д.)
71-
if (firstProfile.type === 1) {
84+
// Получаем обновленный список профилей ПОСЛЕ refresh
85+
const fullList = await api.getProfileList();
86+
87+
// Находим активный профиль в списке
88+
let activeProfile = fullList?.find((item: any) => item?.primary)
89+
?? fullList?.find((item: any) => item?.selected)
90+
?? fullList?.[0];
91+
92+
// Если профиль все еще без логотипа, делаем refresh еще раз для профиля из списка
93+
if (firstProfileId && activeProfile?.id === firstProfileId && activeProfile?.type === 1) {
94+
if (!activeProfile?.logo && !activeProfile?.icon) {
7295
try {
73-
await api.refreshProfile(firstProfile);
96+
const refreshed = await api.refreshProfile(activeProfile);
97+
Object.assign(activeProfile, refreshed);
7498
} catch (e) {
75-
// Игнорируем ошибку обновления, профиль уже добавлен
76-
console.warn('Failed to refresh profile:', e);
99+
console.warn('Failed to re-refresh profile:', e);
77100
}
78101
}
79102
}
80103
81-
// Получаем обновленный список профилей
82-
const fullList = await api.getProfileList();
104+
// Обновляем webStore.fProfile для корректного отображения в UI
105+
if (activeProfile) {
106+
webStore.fProfile = toRaw({
107+
...activeProfile,
108+
exclusive: true,
109+
});
110+
}
111+
112+
// Отправляем события ПОСЛЕ того как activeProfile точно обновлен
113+
if (activeProfile) {
114+
Events.Emit({
115+
name: "profileChanged",
116+
data: {
117+
profile: toRaw(activeProfile),
118+
exclusive: true,
119+
}
120+
});
121+
window.dispatchEvent(new CustomEvent('profile-changed'));
122+
}
83123
84124
// Отправляем событие обновления профилей (через IPC в Electron)
85125
// Используем toRaw для избежания ошибки клонирования

src/components/setting/MyService.vue

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ async function uninstallService() {
6262
const success = await window.pxService.uninstall();
6363
if (success) {
6464
pSuccess(t('service.uninstall-success'));
65+
// После удаления сервиса перезапускаем backend в обычном режиме
66+
await restartBackendAfterUninstall();
6567
notifyServiceStatusChanged();
6668
await fetchServiceStatus();
6769
} else {
@@ -93,6 +95,26 @@ async function restartBackendAfterInstall() {
9395
}
9496
}
9597
98+
async function restartBackendAfterUninstall() {
99+
try {
100+
// Останавливаем текущий backend (который работал через сервис)
101+
await api.exit();
102+
} catch (e) {
103+
// ignore exit errors - процесс может быть уже остановлен
104+
}
105+
106+
// Ждём, пока Electron автоматически перезапустит backend в обычном режиме
107+
await new Promise((resolve) => setTimeout(resolve, 1500));
108+
109+
try {
110+
// Проверяем, что backend успешно запустился
111+
await api.waitRunning();
112+
} catch (e) {
113+
// Backend не запустился автоматически, требуется ручной перезапуск приложения
114+
pWarning(t('service.restart-required'));
115+
}
116+
}
117+
96118
function notifyServiceStatusChanged() {
97119
window.dispatchEvent(new CustomEvent('service-status-updated'));
98120
}

src/components/topology/ConnectionTopology.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,21 @@ watch(
337337
{ deep: true }
338338
);
339339
340+
watch(
341+
() => sankeyData.value.nodes.length,
342+
(nodeCount) => {
343+
if (nodeCount > 0) {
344+
nextTick(() => {
345+
if (!chart.value) {
346+
initChart();
347+
} else {
348+
updateChart();
349+
}
350+
});
351+
}
352+
}
353+
);
354+
340355
// Lifecycle hooks
341356
onMounted(() => {
342357
nextTick(() => {

0 commit comments

Comments
 (0)