-
Notifications
You must be signed in to change notification settings - Fork 24
Add Applications Center with module management features #982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
76 commits
Select commit
Hold shift + click to select a range
1fe3dd0
feat(i18n): add application management translations
stephdl ba43e89
feat(ui): update software center icon and add applications link
stephdl 1981b22
feat(ui): add RestartModuleModal component for application restart co…
stephdl fc0426f
feat(ui): add SetInstanceLabelModal component for editing instance la…
stephdl 9ee0b5e
feat(ui): add route for Applications Center view
stephdl 3dbaa0e
feat(ui): update navigation from software center to applications center
stephdl 4997002
feat(ui): refactor RestartModuleModal and SetInstanceLabelModal integ…
stephdl c20e0f2
feat(ui): add Applications Center view with module management features
stephdl cb4101b
feat(ui): remove isStableUpdateAvailable method from ApplicationsCenter
stephdl 41b4b46
feat(ui): remove installedModules computed property from Applications…
stephdl 3872068
feat(ui): remove console log from updateInstance method in SoftwareCe…
stephdl 89cc40a
fix(ui): handle potential null value for node_ui_name in search filter
stephdl b10a4a0
fix(ui): update uninstalling and restarting messages for clarity
stephdl 20d2ab5
refactor(ui): remove updateModules method and related task handling
stephdl 0b3a913
refactor(ui): remove unused appToUpdate property from ApplicationsCen…
stephdl 300b171
fix(ui): capitalize module names in ApplicationsCenter component
stephdl 32d0f5f
refactor(ui): remove commented-out listRepositories call in Applicati…
stephdl 6bf459c
fix(ui): update comment to improve clarity in ApplicationsCenter comp…
stephdl 08a34b4
fix(ui): update i18nTableColumns method to clarify last column for ov…
stephdl a07efcc
feat(agent): add set-note action and input validation schema
stephdl c704dec
feat(modules): add ui_note field to list_installed function for enhan…
stephdl 3e0d50f
feat(applications): add note functionality with modal for application…
stephdl e25eddf
feat(applications): enhance note functionality with edit option and v…
stephdl 23f13bf
refactor(software_center): update translation keys for instance manag…
stephdl c7c8449
feat(applications): add cloneOrMoveAppData to enhance clone/move func…
stephdl 5b45780
feat(applications): update updateInstance method to handle testing ve…
stephdl bc5b2e4
Apply suggestions from translation review
stephdl 22a9a5c
Apply suggestions from translation review
stephdl 90c74e5
Apply suggestions from code review
stephdl 72b9852
Apply suggestions from code review
stephdl 8817d2d
Update core/ui/src/components/applications-center/AddNoteModal.vue
stephdl 45e9d07
Add loading state to modals and improve template formatting
stephdl 5731b73
Update core/ui/src/views/ApplicationsCenter.vue
stephdl e408e79
Update core/ui/src/views/ApplicationsCenter.vue
stephdl cd4434d
Update @nethserver/ns8-ui-lib to version 1.6.0 in package.json and ya…
stephdl a4cd209
Merge branch 'sdl-7663' of github.com:NethServer/ns8-core into sdl-7663
stephdl ea00b9f
Remove unnecessary styles from module logo in ApplicationsCenter.vue
stephdl 5e5ba34
Merge branch 'main' into sdl-7663
stephdl 4e3d70d
Refactor NodeCard and NodeDetail components to use cv-link for applic…
stephdl e6e9c37
Add cloneOrMoveAppData to cloneOrMove instance in ApplicationsCenter
stephdl a500e80
Add filter applications placeholder text in ApplicationsCenter
stephdl 93cfd1a
Add tooltips for software center and applications titles to enhance u…
stephdl c096b47
Add AppInfoModal and implement app info display on logo click in Appl…
stephdl 76d422d
Enhance tooltips in ApplicationsCenter and SoftwareCenter with naviga…
stephdl 7803a47
Remove unused appToUninstall variable from ApplicationsCenter to stre…
stephdl 08a72d0
Update application description wording for consistency in translation…
stephdl f1899b6
Refactor AddNoteModal layout for improved styling and structure
stephdl 6f6831a
Improve layout of AddNoteModal by adjusting alignment and text positi…
stephdl b0bb7fa
Refactor goToApplications method to use object syntax for router push
stephdl 2485e1b
Update core/ui/src/components/software-center/SetInstanceLabelModal.vue
stephdl faa9439
Refactor SetInstanceLabelModal and related components to remove unuse…
stephdl e7c4168
Add pictogram to empty state in ApplicationsCenter view
stephdl b909271
Refactor ApplicationsCenter to replace cloneOrMoveAppData with appInf…
stephdl 762a372
Refactor ApplicationsCenter to simplify overflow menu items by removi…
stephdl 5c84817
Refactor ApplicationsCenter to use template slot for icon in NsMenuIt…
stephdl 71dbd62
Fix component name from SoftwareCenter to ApplicationsCenter for cons…
stephdl b270320
Refactor comment in ApplicationsCenter to clarify purpose of workarou…
stephdl 6d32084
Add restartModule property to component data for state management
stephdl e83657a
Remove default filter setting logic from created lifecycle hook in Ap…
stephdl 6e01bcc
Refactor SetInstanceLabelModal to improve error handling and streamli…
stephdl d69df08
Refactor RestartModuleModal and ApplicationsCenter to enhance error h…
stephdl 79d8ac6
Remove unused form elements from RestartModuleModal and SetInstanceLa…
stephdl 25aa9eb
Refactor AddNoteModal and ApplicationsCenter to improve state managem…
stephdl df362a9
Refactor tooltips in ApplicationsCenter and SoftwareCenter to use i18…
stephdl e8b6737
Refactor SetInstanceLabelModal to unify inputLabel handling and impro…
stephdl 35d8ed8
Add validation messages for instance label length and character restr…
stephdl acff079
Fix validation logic for note length and update primary button state …
stephdl e2503fc
Reset note input on modal close in AddNoteModal
stephdl cdedea5
Make application names clickable in ApplicationsCenter and adjust fon…
stephdl fc6fb83
Remove note reset on modal close in AddNoteModal and inputLabel reset…
stephdl fe02757
Fix validation logic for note input in AddNoteModal to handle alphanu…
stephdl 08774f5
Enhance RestartModuleModal with warning notification and improve erro…
stephdl 419721f
fix: improve query parameters management
andre8244 1d82dfc
fix: link to applications page
andre8244 5a94234
fix: focus input field when opening modals
andre8244 e77b1b4
Apply suggestions from translation review
stephdl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
core/imageroot/usr/local/agent/actions/set-note/50set_note
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/usr/bin/env python3 | ||
|
|
||
| # | ||
| # Copyright (C) 2025 Nethesis S.r.l. | ||
| # SPDX-License-Identifier: GPL-3.0-or-later | ||
| # | ||
|
|
||
| import json | ||
| import sys | ||
| import agent | ||
| import os | ||
|
|
||
| agent_id = os.environ['AGENT_ID'] | ||
|
|
||
| request = json.load(sys.stdin) | ||
|
|
||
| rdb = agent.redis_connect(privileged=True) | ||
| rdb.set(agent_id + '/ui_note', request['note']) |
21 changes: 21 additions & 0 deletions
21
core/imageroot/usr/local/agent/actions/set-note/validate-input.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "title": "set-note input", | ||
| "$id": "http://schema.nethserver.org/agent/set-note-input.json", | ||
| "description": "A short note to help identify or describe a module instance. The note is visible in Applications Center.", | ||
| "examples": [ | ||
| { | ||
| "note": "this module is for my personal use" | ||
| } | ||
| ], | ||
| "type": "object", | ||
| "required": [ | ||
| "note" | ||
| ], | ||
| "properties": { | ||
| "note": { | ||
| "type": "string", | ||
| "maxLength": 100 | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
164 changes: 164 additions & 0 deletions
164
core/ui/src/components/applications-center/AddNoteModal.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,164 @@ | ||
| <template> | ||
| <NsModal | ||
| :visible="visible" | ||
| :isLoading="loading.saveNote" | ||
| @primary-click="saveNote" | ||
| :primary-button-disabled="invalidNoteAlphanum ? true : false" | ||
| @modal-hidden="onModalHidden" | ||
| size="default" | ||
| > | ||
stephdl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <template slot="title">{{ | ||
| isEdit ? $t("applications.edit_note") : $t("applications.add_note") | ||
| }}</template> | ||
| <template slot="content"> | ||
| <div class="mg-bottom-md">{{ $t("applications.note_description") }}</div> | ||
| <div class="flex flex-col"> | ||
| <div class="flex items-center justify-between"> | ||
| <div class="bx--label no-mg-bottom"> | ||
| {{ $t("applications.note") }} | ||
| </div> | ||
| <div class="bx--label no-mg-bottom text-right"> | ||
| {{ note.length }}/100 | ||
| </div> | ||
| </div> | ||
| <cv-text-area | ||
| v-model="note" | ||
| :placeholder="$t('applications.enter_note')" | ||
| :maxLength="100" | ||
| :rows="4" | ||
| :disabled="loading.saveNote" | ||
| :invalid-message="invalidNoteAlphanum || invalidNoteLength" | ||
| :helper-text="$t('applications.note_helper_text')" | ||
| data-modal-primary-focus | ||
| /> | ||
| <cv-inline-notification | ||
| v-if="error.saveNote" | ||
| kind="error" | ||
| :title="$t('action.set-note')" | ||
| :description="error" | ||
| :showCloseButton="false" | ||
| /> | ||
| </div> | ||
| </template> | ||
| <template slot="secondary-button">{{ $t("common.cancel") }}</template> | ||
| <template slot="primary-button">{{ | ||
| isEdit ? $t("common.save") : $t("applications.add_note") | ||
| }}</template> | ||
| </NsModal> | ||
| </template> | ||
|
|
||
| <script> | ||
| import { UtilService, TaskService, IconService } from "@nethserver/ns8-ui-lib"; | ||
| import to from "await-to-js"; | ||
| export default { | ||
| name: "saveNoteModal", | ||
| mixins: [UtilService, TaskService, IconService], | ||
| props: { | ||
| visible: { | ||
| type: Boolean, | ||
| required: true, | ||
| }, | ||
| isEdit: { | ||
| type: Boolean, | ||
| default: false, | ||
| }, | ||
| currentNote: { | ||
| type: String, | ||
| default: "", | ||
| }, | ||
| noteInstance: Object, | ||
| }, | ||
| data() { | ||
| return { | ||
| note: this.currentNote, | ||
| error: { saveNote: "" }, | ||
| loading: { saveNote: false }, | ||
| }; | ||
| }, | ||
| watch: { | ||
| currentNote(newVal) { | ||
| this.note = newVal; | ||
| }, | ||
| visible(newVal) { | ||
| if (newVal) { | ||
| this.note = this.currentNote; | ||
| } | ||
| }, | ||
| }, | ||
| computed: { | ||
| invalidNoteAlphanum() { | ||
| const alphanumRegex = /^[a-zA-Z0-9 ]*$/; | ||
| if (!alphanumRegex.test(this.note)) { | ||
| return this.$t("applications.note_alphanum_only"); | ||
| } | ||
| return ""; | ||
| }, | ||
| invalidNoteLength() { | ||
| if (this.note.length == 100) { | ||
| return this.$t("applications.note_too_long"); | ||
| } | ||
| return ""; | ||
| }, | ||
| }, | ||
| methods: { | ||
| onModalHidden() { | ||
| this.clearErrors(); | ||
| this.$emit("hide"); | ||
| }, | ||
| async saveNote() { | ||
| this.error.saveNote = ""; | ||
| this.loading.saveNote = true; | ||
| const taskAction = "set-note"; | ||
| const eventId = this.getUuid(); | ||
|
|
||
| // register to task completion | ||
| this.$root.$once( | ||
| `${taskAction}-completed-${eventId}`, | ||
| this.saveNoteCompleted | ||
| ); | ||
| // register to task error | ||
| this.$root.$once( | ||
| `${taskAction}-aborted-${eventId}`, | ||
| this.saveNoteAborted | ||
| ); | ||
|
|
||
| const res = await to( | ||
| this.createModuleTaskForApp(this.noteInstance.id, { | ||
| action: taskAction, | ||
| data: { | ||
| note: this.note, | ||
| }, | ||
| extra: { | ||
| title: this.$t("action." + taskAction), | ||
| isNotificationHidden: true, | ||
| eventId, | ||
| }, | ||
| }) | ||
| ); | ||
| const err = res[0]; | ||
|
|
||
| if (err) { | ||
| console.error(`error creating task ${taskAction}`, err); | ||
| this.error.saveNote = this.getErrorMessage(err); | ||
| this.loading.saveNote = false; | ||
| return; | ||
| } | ||
| // emit event to close modal | ||
| this.$emit("hide"); | ||
| }, | ||
| saveNoteAborted(taskResult, taskContext) { | ||
| console.error(`${taskContext.action} aborted`, taskResult); | ||
| this.error.saveNote = this.$t("error.generic_error"); | ||
| this.loading.saveNote = false; | ||
| }, | ||
| saveNoteCompleted() { | ||
| this.loading.saveNote = false; | ||
| this.$emit("hide"); | ||
| this.$emit("saveNoteCompleted"); | ||
| }, | ||
| }, | ||
| }; | ||
| </script> | ||
| <style scoped lang="scss"> | ||
| @import "../../styles/carbon-utils"; | ||
| </style> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.