From 2e4eeb7e4ff5d6d02ca374cbdb9acdbeae791393 Mon Sep 17 00:00:00 2001 From: Matteo Di Lorenzi Date: Tue, 19 May 2026 18:19:13 +0200 Subject: [PATCH 1/2] refactor(community): add automatic updates and remote database functionalities without subscription --- src/i18n/en.json | 3 -- src/i18n/it.json | 3 -- src/i18n/ta.json | 3 -- src/views/standalone/system/UpdateView.vue | 35 ++----------- .../users_objects/UsersDatabaseView.vue | 49 +++---------------- 5 files changed, 10 insertions(+), 83 deletions(-) diff --git a/src/i18n/en.json b/src/i18n/en.json index 2b6ac6fab..2b85bc988 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -883,8 +883,6 @@ "edit_scheduled_date": "Edit scheduled date", "update": "Update", "automatic_updates": "Automatic updates", - "automatic_updates_tooltip": "Enable to activate automatic updates. Available only with subscription.", - "go_to_subscription": "Go to subscription", "automatic_updates_enabled_message": "Automatic updates successfully enabled", "automatic_updates_disabled_message": "Automatic updates successfully disabled", "schedule_update": "Schedule update", @@ -2277,7 +2275,6 @@ "unchanged": "Unchanged", "remote_database_added": "Remote database added", "remote_database_added_description": "{name} added successfully", - "add_remote_database_tooltip": "Remote users databases are available only with a subscription plan", "administrator": "Administrator user", "administrator_tooltip": "A user promoted to administrator can access the administration web interface and configure this unit.", "remove_admin": "Remove from administrator users", diff --git a/src/i18n/it.json b/src/i18n/it.json index ac8aab312..5e83575a1 100644 --- a/src/i18n/it.json +++ b/src/i18n/it.json @@ -1626,8 +1626,6 @@ "automatic_updates": "Aggiornamenti automatici", "automatic_updates_enabled_message": "Aggiornamenti automatici abilitati con successo", "automatic_updates_disabled_message": "Aggiornamenti automatici disattivati con successo", - "automatic_updates_tooltip": "Abilita per attivare gli aggiornamenti automatici. Disponibile solo con subscription.", - "go_to_subscription": "Vai a subscription", "schedule_update": "Pianifica aggiornamento", "no_updates_available": "Nessun aggiornamento disponibilw", "new_release_available": "Nuova versione disponibile", @@ -1745,7 +1743,6 @@ "set_admin": "Impostare come utente amministratore", "remove_admin": "Rimuovi dagli utenti amministratori", "administrator_table_tooltip": "Utente amministratore", - "add_remote_database_tooltip": "I database degli utenti remoti sono disponibili solo con subscription", "administrator_tooltip": "Un utente promosso ad amministratore può accedere all'interfaccia web di amministrazione e configurare questa unità.", "user_bind_dn": "User bind DN personalizzato", "user_bind_dn_tooltip": "Distinguished Name (DN) utilizzato per collegarsi al server LDAP. Questo campo sovrascrive il bind DN calcolato. Utilizzare quando ci si autenticata ad un server Active Directory. Può contenere una variabile '%u' che verrà espansa con il nome dell'utente. Esempio: '%u{'@'}secretexample.com', 'SECRETEXAMPLE\\%u'", diff --git a/src/i18n/ta.json b/src/i18n/ta.json index 643e85140..63843c99c 100644 --- a/src/i18n/ta.json +++ b/src/i18n/ta.json @@ -860,8 +860,6 @@ "edit_scheduled_date": "திட்டமிடப்பட்ட தேதியைத் திருத்தவும்", "update": "புதுப்பிப்பு", "automatic_updates": "தானியங்கி புதுப்பிப்புகள்", - "automatic_updates_tooltip": "தானியங்கி புதுப்பிப்புகளை செயல்படுத்த இயக்கவும். சந்தாவுடன் மட்டுமே கிடைக்கும்.", - "go_to_subscription": "சந்தாவிற்கு செல்க", "automatic_updates_enabled_message": "தானியங்கி புதுப்பிப்புகள் வெற்றிகரமாக இயக்கப்பட்டன", "automatic_updates_disabled_message": "தானியங்கி புதுப்பிப்புகள் வெற்றிகரமாக முடக்கப்பட்டன", "schedule_update": "அட்டவணை புதுப்பிப்பு", @@ -2185,7 +2183,6 @@ "unchanged": "மாறாதது", "remote_database_added": "தொலைநிலை தரவுத்தளம் சேர்க்கப்பட்டது", "remote_database_added_description": "{name} வெற்றிகரமாக சேர்க்கப்பட்டது", - "add_remote_database_tooltip": "தொலைநிலை பயனர்களின் தரவுத்தளங்கள் சந்தா திட்டத்துடன் மட்டுமே கிடைக்கும்", "administrator": "நிர்வாகி பயனர்", "administrator_tooltip": "நிர்வாகியாக பதவி உயர்வு பெற்ற ஒரு பயனர், நிர்வாக இணைய இடைமுகத்தை அணுகி இந்த அலகை உள்ளமைக்க முடியும்.", "remove_admin": "நிர்வாகி பயனர்களிடமிருந்து அகற்று", diff --git a/src/views/standalone/system/UpdateView.vue b/src/views/standalone/system/UpdateView.vue index 8e01191c0..7ed07c61a 100644 --- a/src/views/standalone/system/UpdateView.vue +++ b/src/views/standalone/system/UpdateView.vue @@ -4,13 +4,10 @@ import { NeButton, NeHeading, NeInlineNotification, - NeLink, NeModal, NeSkeleton, - NeToggle, - NeTooltip + NeToggle } from '@nethesis/vue-components' -import { getStandaloneRoutePrefix } from '@/lib/router' import { useI18n } from 'vue-i18n' import FormLayout from '@/components/standalone/FormLayout.vue' import ScheduleUpdateDrawer from '@/components/standalone/update/ScheduleUpdateDrawer.vue' @@ -21,7 +18,6 @@ import UpdatePackagesModal from '@/components/standalone/update/UpdatePackagesMo import SystemUpdateInProgressModal from '@/components/standalone/update/SystemUpdateInProgressModal.vue' import { getProductName } from '@/lib/config' import { useNotificationsStore } from '@/stores/notifications' -import { useRouter } from 'vue-router' import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' export type PackageUpdate = { @@ -38,7 +34,6 @@ export type SystemUpdate = { const { t } = useI18n() const notificationsStore = useNotificationsStore() -const router = useRouter() const loading = ref(true) const error = ref({ @@ -62,7 +57,6 @@ const isApplyingSystemUpdate = ref(false) const noPackageUpdatesAvailable = ref(false) const automaticUpdatesEnabled = ref(false) -const isSubscriptionActive = ref(false) const isChangingAutomaticUpdatesSetting = ref(false) const showScheduleUpdateDrawer = ref(false) @@ -93,10 +87,6 @@ async function fetchUpdatesStatus() { lastPackageUpdateCheck.value = new Date(lastPackageUpdateCheckResponse.lastCheck * 1000) } - const subscriptionResponse = await ubusCall('ns.subscription', 'info') - isSubscriptionActive.value = - subscriptionResponse.data.systemd_id != '' && subscriptionResponse.data.active - automaticUpdatesEnabled.value = ( await ubusCall('ns.update', 'get-automatic-updates-status') ).data.enabled @@ -265,30 +255,11 @@ onMounted(() => {
- - + />
diff --git a/src/views/standalone/users_objects/UsersDatabaseView.vue b/src/views/standalone/users_objects/UsersDatabaseView.vue index dd4547543..def523519 100644 --- a/src/views/standalone/users_objects/UsersDatabaseView.vue +++ b/src/views/standalone/users_objects/UsersDatabaseView.vue @@ -7,8 +7,7 @@ import { NeSkeleton, NeInlineNotification, getAxiosErrorMessage, - NeTabs, - NeTooltip + NeTabs } from '@nethesis/vue-components' import { onMounted } from 'vue' import { ref } from 'vue' @@ -31,10 +30,7 @@ const { t } = useI18n() const uciChangesStore = useUciPendingChangesStore() const notificationsStore = useNotificationsStore() -const loading = ref({ - listDatabases: true, - getSubscriptionInfo: true -}) +const loadingDatabases = ref(true) const databases = ref([]) const error = ref({ listDatabases: '', @@ -43,13 +39,12 @@ const error = ref({ getSubscriptionInfoDetails: '' }) const showCreateDrawer = ref(false) -const activeSubscription = ref(false) const { tabs, selectedTab } = useTabs([]) async function fetchDatabases(resetSelectedTab: boolean = false) { try { - loading.value.listDatabases = true + loadingDatabases.value = true if (resetSelectedTab) { selectedTab.value = '' } @@ -65,7 +60,7 @@ async function fetchDatabases(resetSelectedTab: boolean = false) { error.value.listDatabases = t(getAxiosErrorMessage(err)) error.value.listDatabasesDetails = err.toString() } finally { - loading.value.listDatabases = false + loadingDatabases.value = false } } @@ -76,30 +71,14 @@ async function reloadDatabases(resetSelectedTab: boolean = false) { onMounted(() => { fetchDatabases() - fetchSubscriptionInfo() }) - -async function fetchSubscriptionInfo() { - loading.value.getSubscriptionInfo = true - - try { - const res = await ubusCall('ns.subscription', 'info') - - activeSubscription.value = (res.data?.systemd_id && res.data?.active) || false - } catch (err: any) { - error.value.getSubscriptionInfo = t(getAxiosErrorMessage(err)) - error.value.getSubscriptionInfoDetails = err.toString() - } finally { - loading.value.getSubscriptionInfo = false - } -}