Loading modules/updates/updates.cpp +16 −2 Changes for modules/updates/updates.cpp: 16 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <fcntl.h> #include <poll.h> #include <sys/stat.h> #include <sys/utsname.h> #include <sys/wait.h> #include <unistd.h> Loading Loading @@ -261,13 +262,26 @@ std::vector<Repo> repos() { return list; } // $basearch/$arch as dnf5 fills them in (FenrirOS: the machine's architecture) std::string substVars(std::string s) { struct utsname u {}; uname(&u); for (const char *var : {"$basearch", "${basearch}", "$arch", "${arch}"}) { for (size_t at = s.find(var); at != std::string::npos; at = s.find(var, at)) { s.replace(at, strlen(var), u.machine); at += strlen(u.machine); } } return s; } json_object *reposJson() { json_object *a = json_object_new_array(); for (auto &r : repos()) { json_object *o = json_object_new_object(); json_object_object_add(o, "id", jstr(r.id)); json_object_object_add(o, "name", jstr(r.name)); json_object_object_add(o, "baseurl", jstr(r.baseurl)); json_object_object_add(o, "name", jstr(substVars(r.name))); json_object_object_add(o, "baseurl", jstr(substVars(r.baseurl))); json_object_object_add(o, "enabled", json_object_new_boolean(r.enabled)); json_object_object_add(o, "file", jstr(r.file)); json_object_array_add(a, o); Loading www/modules/updates.js +5 −3 Changes for www/modules/updates.js: 5 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -26,7 +26,8 @@ 'started {0}, took {1}': 'gestartet {0}, Dauer {1}', 'Changed packages': 'Geänderte Pakete', 'From': 'Von', 'To': 'Auf', 'new': 'neu', 'Nothing changed.': 'Nichts geändert.', 'Output of dnf5': 'Ausgabe von dnf5', 'Repositories': 'Repositorys', 'Name': 'Name', 'Address': 'Adresse', 'Status': 'Status', 'enabled': 'aktiv', 'disabled': 'aus', 'Enable': 'Aktivieren', 'Disable': 'Deaktivieren', 'repository enabled': 'aktiv', 'repository disabled': 'aus', 'Enable repository': 'Aktivieren', 'Disable repository': 'Deaktivieren', '{0} enabled.': '{0} aktiviert.', '{0} disabled.': '{0} deaktiviert.', 'No repositories in /etc/yum.repos.d.': 'Keine Repositorys in /etc/yum.repos.d.', 'Select all': 'Alle auswählen', Loading Loading @@ -157,9 +158,10 @@ {title: t('Repository'), render: r => h('strong', {}, r.id)}, {title: t('Name'), render: r => r.name}, {title: t('Address'), render: r => h('span', {class: 'mono'}, r.baseurl)}, {title: t('Status'), render: r => h('span', {class: 'badge ' + (r.enabled ? 'ok' : '')}, t(r.enabled ? 'enabled' : 'disabled'))}, {title: t('Status'), render: r => h('span', {class: 'badge ' + (r.enabled ? 'ok' : '')}, t(r.enabled ? 'repository enabled' : 'repository disabled'))}, {title: '', class: 'actions', render: r => h('button', {class: 'small', onclick: () => setRepo(r, !r.enabled)}, t(r.enabled ? 'Disable' : 'Enable'))}, t(r.enabled ? 'Disable repository' : 'Enable repository'))}, ], s.repos || [], t('No repositories in /etc/yum.repos.d.'))); } Loading Loading
modules/updates/updates.cpp +16 −2 Changes for modules/updates/updates.cpp: 16 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <fcntl.h> #include <poll.h> #include <sys/stat.h> #include <sys/utsname.h> #include <sys/wait.h> #include <unistd.h> Loading Loading @@ -261,13 +262,26 @@ std::vector<Repo> repos() { return list; } // $basearch/$arch as dnf5 fills them in (FenrirOS: the machine's architecture) std::string substVars(std::string s) { struct utsname u {}; uname(&u); for (const char *var : {"$basearch", "${basearch}", "$arch", "${arch}"}) { for (size_t at = s.find(var); at != std::string::npos; at = s.find(var, at)) { s.replace(at, strlen(var), u.machine); at += strlen(u.machine); } } return s; } json_object *reposJson() { json_object *a = json_object_new_array(); for (auto &r : repos()) { json_object *o = json_object_new_object(); json_object_object_add(o, "id", jstr(r.id)); json_object_object_add(o, "name", jstr(r.name)); json_object_object_add(o, "baseurl", jstr(r.baseurl)); json_object_object_add(o, "name", jstr(substVars(r.name))); json_object_object_add(o, "baseurl", jstr(substVars(r.baseurl))); json_object_object_add(o, "enabled", json_object_new_boolean(r.enabled)); json_object_object_add(o, "file", jstr(r.file)); json_object_array_add(a, o); Loading
www/modules/updates.js +5 −3 Changes for www/modules/updates.js: 5 added lines, 3 removed lines. Original line number Diff line number Diff line Loading @@ -26,7 +26,8 @@ 'started {0}, took {1}': 'gestartet {0}, Dauer {1}', 'Changed packages': 'Geänderte Pakete', 'From': 'Von', 'To': 'Auf', 'new': 'neu', 'Nothing changed.': 'Nichts geändert.', 'Output of dnf5': 'Ausgabe von dnf5', 'Repositories': 'Repositorys', 'Name': 'Name', 'Address': 'Adresse', 'Status': 'Status', 'enabled': 'aktiv', 'disabled': 'aus', 'Enable': 'Aktivieren', 'Disable': 'Deaktivieren', 'repository enabled': 'aktiv', 'repository disabled': 'aus', 'Enable repository': 'Aktivieren', 'Disable repository': 'Deaktivieren', '{0} enabled.': '{0} aktiviert.', '{0} disabled.': '{0} deaktiviert.', 'No repositories in /etc/yum.repos.d.': 'Keine Repositorys in /etc/yum.repos.d.', 'Select all': 'Alle auswählen', Loading Loading @@ -157,9 +158,10 @@ {title: t('Repository'), render: r => h('strong', {}, r.id)}, {title: t('Name'), render: r => r.name}, {title: t('Address'), render: r => h('span', {class: 'mono'}, r.baseurl)}, {title: t('Status'), render: r => h('span', {class: 'badge ' + (r.enabled ? 'ok' : '')}, t(r.enabled ? 'enabled' : 'disabled'))}, {title: t('Status'), render: r => h('span', {class: 'badge ' + (r.enabled ? 'ok' : '')}, t(r.enabled ? 'repository enabled' : 'repository disabled'))}, {title: '', class: 'actions', render: r => h('button', {class: 'small', onclick: () => setRepo(r, !r.enabled)}, t(r.enabled ? 'Disable' : 'Enable'))}, t(r.enabled ? 'Disable repository' : 'Enable repository'))}, ], s.repos || [], t('No repositories in /etc/yum.repos.d.'))); } Loading