Skip to content

Commit 510a69d

Browse files
authored
Merge pull request #17 from Shikakiben/test
Test
2 parents 047bc6a + bb949aa commit 510a69d

File tree

5 files changed

+61
-29
lines changed

5 files changed

+61
-29
lines changed

README.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,59 @@
1-
<p align="center">
2-
<img src="https://github.com/Shikakiben/AM-GUI/blob/main/AM-GUI.png?raw=true" width="128" />
3-
</p>
4-
5-
6-
7-
# AM-GUI
8-
1+
<div align="center">
2+
<img src="https://github.com/Shikakiben/AM-GUI/blob/main/AM-GUI.png?raw=true" width="60">
3+
<h1 align="center">AM-GUI</h1>
4+
<p align="center">A simple graphical frontend to easily install, update, and manage AppImage and other portable formats on Linux, powered by <a href="https://github.com/ivan-hc/AM">AM</a>.</p>
5+
96
[![GitHub Downloads](https://img.shields.io/github/downloads/Shikakiben/AM-GUI/total?logo=github&label=GitHub%20Downloads)](https://github.com/Shikakiben/AM-GUI/releases/latest)
107
[![CI Build Status](https://github.com//Shikakiben/AM-GUI/actions/workflows/appimage.yml/badge.svg)](https://github.com/Shikakiben/AM-GUI/releases/latest)
118

9+
<br>
10+
11+
<img src="screenshots/light.png" width="800"/>
1212

13+
</div>
14+
<br>
15+
<br>
16+
<br>
1317

14-
* [Latest Stable Release](https://github.com/Shikakiben/AM-GUI/releases/latest) AppImage , Beta , it will be helpfull to reporte issues , Alpine linux need more testing
15-
18+
19+
* [Latest Stable Release](https://github.com/Shikakiben/AM-GUI/releases/latest) AppImage, Beta,it will be helpful to report issues. Alpine Linux needs more testing.
20+
<br>
21+
<br>
22+
1623

1724

1825
---
1926

20-
**AM-GUI** is an Electron-based application that serves as a graphical Front for [AM](https://github.com/ivan-hc/AM). “AM”/“AppMan” is a set of scripts and modules for installing, updating, and managing AppImage packages and other portable formats on Linux.
27+
2128

2229
⚠️ **This project is under development and some features may not work or may be incomplete.**
2330

24-
**ALL credit goes to [Ivan](https://github.com/ivan-hc) for his amazing work! I only handel the GUI, learning how to proprely yell at gpt-4.1, to make sur that this little f$@¤=# does not mess that much with the code.**
31+
**ALL credit goes to [Ivan](https://github.com/ivan-hc) for his amazing work! I only handle the GUI, learning how to properly yell at gpt-4.1, to make sure that this little f$@¤=# does not mess that much with the code.**
2532

2633
---
2734

2835

29-
## developemen installation
36+
## Development installation
3037

31-
- requirement:
38+
- Requirements:
3239

3340
[Node.js](https://nodejs.org/) (>=20, 22 recommended)
3441

35-
if you d'ont have it on your package manager see: https://nodejs.org/fr/download
42+
If you don't have it in your package manager, see: https://nodejs.org/fr/download
3643

37-
you may need to install the following build tools
44+
&nbsp;you may need to install the following build tools:
3845

39-
*Debian/Ubuntu*:
46+
*Debian/Ubuntu*:
4047
```bash
4148
sudo apt install build-essential python3 make gcc g++
4249
```
43-
*Fedora*:
50+
*Fedora*:
4451
```bash
4552
sudo dnf install @development-tools python3
4653
```
4754

4855

49-
- Clone repository and install:
56+
- Clone the repository and install:
5057

5158
```bash
5259
git clone https://github.com/Shikakiben/AM-GUI.git

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ <h2 class="panel-heading-sm centered" data-i18n="advanced.title">Mode avancé</h
167167
<span class="cmd-desc" data-i18n="advanced.cmd.remove">supprimer une app</span>
168168
</li>
169169
<li class="cmd-row">
170-
<button type="button" class="copy-cmd" data-copy="am -e &lt;git-url&gt; &lt;appname&gt; [keyword]">am -e &lt;git-url&gt; &lt;appname&gt; [keyword]</button>
171-
<button type="button" class="copy-cmd" data-copy="appman -e &lt;git-url&gt; &lt;appname&gt; [keyword]">appman -e &lt;git-url&gt; &lt;appname&gt; [keyword]</button>
170+
<button type="button" class="copy-cmd" data-copy="am -e &lt;git-url&gt; &lt;appname&gt;">am -e &lt;git-url&gt; &lt;appname&gt;</button>
171+
<button type="button" class="copy-cmd" data-copy="appman -e &lt;git-url&gt; &lt;appname&gt;">appman -e &lt;git-url&gt; &lt;appname&gt;</button>
172172
<span class="cmd-desc" data-i18n="advanced.cmd.extra">installer une app personnalisée depuis GitHub</span>
173173
</li>
174174
<li class="cmd-row">

screenshots/dark.png

202 KB
Loading

screenshots/light.png

155 KB
Loading

src/renderer/renderer.js

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,6 +1496,7 @@ let updatesTerminalFallbackMode = false;
14961496
let updatesTerminalExpanded = false;
14971497
let updateSpinnerBusy = false;
14981498
let activeUpdateStreamId = null;
1499+
let updatesStreamBuffer = ''; // Buffer pour accumuler la sortie du streaming
14991500
const updateStreamWaiters = new Map();
15001501
const updatesPanel = document.getElementById('updatesPanel');
15011502
const advancedPanel = document.getElementById('advancedPanel');
@@ -2911,21 +2912,26 @@ window.electronAPI?.onUpdatesProgress?.((msg) => {
29112912
switch (msg.kind) {
29122913
case 'start':
29132914
activeUpdateStreamId = msg.id;
2915+
updatesStreamBuffer = ''; // Reset le buffer au début
29142916
revealUpdatesTerminal();
29152917
resetUpdatesTerminal();
29162918
appendUpdatesTerminalChunk(`\x1b[36m${t('updates.logHeader') || 'am -u'}\x1b[0m\r\n`);
29172919
break;
29182920
case 'data':
2919-
appendUpdatesTerminalChunk(typeof msg.chunk === 'string' ? msg.chunk : '');
2921+
if (typeof msg.chunk === 'string') {
2922+
updatesStreamBuffer += msg.chunk; // Accumule la sortie
2923+
appendUpdatesTerminalChunk(msg.chunk);
2924+
}
29202925
break;
29212926
case 'done':
29222927
appendUpdatesTerminalChunk(`\r\n\x1b[32m${t('updates.logCompleted') || 'Terminé'} (code ${typeof msg.code === 'number' ? msg.code : 0})\x1b[0m\r\n`);
2923-
resolveUpdateWaiter(msg, false);
2928+
// Passe la sortie accumulée dans le message résolu
2929+
resolveUpdateWaiter({ ...msg, output: updatesStreamBuffer }, false);
29242930
activeUpdateStreamId = null;
29252931
break;
29262932
case 'error':
29272933
appendUpdatesTerminalChunk(`\r\n\x1b[31m${msg.message || (t('updates.error') || 'Erreur')}\x1b[0m\r\n`);
2928-
resolveUpdateWaiter(msg, true);
2934+
resolveUpdateWaiter({ ...msg, output: updatesStreamBuffer }, true);
29292935
activeUpdateStreamId = null;
29302936
break;
29312937
}
@@ -2971,17 +2977,35 @@ function parseUpdatedApps(res){
29712977

29722978
function handleUpdateCompletion(fullText){
29732979
const sanitized = stripAnsiSequences(fullText || '');
2980+
// Map pour stocker les nouvelles versions extraites du log
2981+
const newVersions = new Map();
29742982
// Chercher la section "The following apps have been updated:" dans le log
29752983
let filteredUpdated = null;
29762984
const match = sanitized && sanitized.match(/The following apps have been updated:[^\n]*\n([\s\S]*?)\n[-=]{5,}/i);
29772985
if (match) {
2978-
// Extraire les noms d'apps de cette section
2986+
// Extraire les noms d'apps et leurs nouvelles versions de cette section
29792987
filteredUpdated = new Set();
29802988
const lines = match[1].split(/\r?\n/).map(l=>l.trim()).filter(Boolean);
29812989
for (const line of lines) {
29822990
// ligne du type: ◆ citron-nightly 8f38c83a2
2983-
const m = line.match(/^\s*([A-Za-z0-9._-]+)/);
2984-
if (m) filteredUpdated.add(m[1].toLowerCase());
2991+
const m = line.match(/^\s*([A-Za-z0-9._-]+)\s+(.+)?/);
2992+
if (m) {
2993+
const appName = m[1].toLowerCase();
2994+
filteredUpdated.add(appName);
2995+
if (m[2]) newVersions.set(appName, m[2].trim());
2996+
}
2997+
}
2998+
}
2999+
// Parser aussi les lignes du type: appname (oldversion -> newversion)
3000+
const lines = sanitized.split(/\r?\n/);
3001+
for (const raw of lines) {
3002+
const line = raw.trim();
3003+
// Format: appname (1.0 -> 2.0) ou appname (old -> new)
3004+
const arrowMatch = line.match(/^([A-Za-z0-9._-]+)\s*\([^)]*->\s*([^)]+)\)/);
3005+
if (arrowMatch) {
3006+
const appName = arrowMatch[1].toLowerCase();
3007+
const newVer = arrowMatch[2].trim();
3008+
if (newVer && !newVersions.has(appName)) newVersions.set(appName, newVer);
29853009
}
29863010
}
29873011
const updated = parseUpdatedApps(sanitized);
@@ -3001,10 +3025,11 @@ function handleUpdateCompletion(fullText){
30013025
toShow.forEach(nameLower => {
30023026
const wrapper = document.createElement('div'); wrapper.className = 'updated-item';
30033027
const img = document.createElement('img');
3004-
// nameLower comes from parsed output (lowercased). Try to find matching app object for proper casing and version
3028+
// nameLower comes from parsed output (lowercased). Try to find matching app object for proper casing
30053029
const appObj = state.allApps.find(a => String(a.name).toLowerCase() === String(nameLower).toLowerCase());
30063030
const displayName = appObj ? (appObj.name) : nameLower;
3007-
const displayVersion = appObj && appObj.version ? appObj.version : null;
3031+
// Utiliser la nouvelle version extraite du log, sinon fallback sur l'ancienne
3032+
const displayVersion = newVersions.get(nameLower) || (appObj && appObj.version ? appObj.version : null);
30083033
img.src = getIconUrl(displayName);
30093034
img.alt = displayName;
30103035
img.onerror = () => { img.src = 'https://raw.githubusercontent.com/Portable-Linux-Apps/Portable-Linux-Apps.github.io/main/icons/blank.png'; };

0 commit comments

Comments
 (0)