Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@
},
"src/views/standalone/users_objects/UsersDatabaseView.vue": {
"@typescript-eslint/no-explicit-any": {
"count": 2
"count": 1
}
},
"src/views/standalone/vpn/IPsecTunnelView.vue": {
Expand Down
3 changes: 0 additions & 3 deletions src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 0 additions & 3 deletions src/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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'",
Expand Down
3 changes: 0 additions & 3 deletions src/i18n/ta.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "அட்டவணை புதுப்பிப்பு",
Expand Down Expand Up @@ -2185,7 +2183,6 @@
"unchanged": "மாறாதது",
"remote_database_added": "தொலைநிலை தரவுத்தளம் சேர்க்கப்பட்டது",
"remote_database_added_description": "{name} வெற்றிகரமாக சேர்க்கப்பட்டது",
"add_remote_database_tooltip": "தொலைநிலை பயனர்களின் தரவுத்தளங்கள் சந்தா திட்டத்துடன் மட்டுமே கிடைக்கும்",
"administrator": "நிர்வாகி பயனர்",
"administrator_tooltip": "நிர்வாகியாக பதவி உயர்வு பெற்ற ஒரு பயனர், நிர்வாக இணைய இடைமுகத்தை அணுகி இந்த அலகை உள்ளமைக்க முடியும்.",
"remove_admin": "நிர்வாகி பயனர்களிடமிருந்து அகற்று",
Expand Down
35 changes: 3 additions & 32 deletions src/views/standalone/system/UpdateView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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 = {
Expand All @@ -38,7 +34,6 @@ export type SystemUpdate = {

const { t } = useI18n()
const notificationsStore = useNotificationsStore()
const router = useRouter()

const loading = ref(true)
const error = ref({
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -265,30 +255,11 @@ onMounted(() => {
<div class="mt-6">
<NeToggle
v-model="automaticUpdatesEnabled"
:disabled="!isSubscriptionActive || isChangingAutomaticUpdatesSetting"
:disabled="isChangingAutomaticUpdatesSetting"
:label="automaticUpdatesEnabled ? t('common.enabled') : t('common.disabled')"
:top-label="t('standalone.update.automatic_updates')"
@update:model-value="handleAutomaticUpdatesToggle"
>
<template #topTooltip>
<NeTooltip>
<template #content>
<p>
{{ t('standalone.update.automatic_updates_tooltip') }}
</p>
<NeLink
inverted-theme
@click="
() => {
router.push(`${getStandaloneRoutePrefix()}/system/subscription`)
}
"
>{{ t('standalone.update.go_to_subscription') }}</NeLink
>
</template>
</NeTooltip>
</template>
</NeToggle>
/>
</div>
</template>
</FormLayout>
Expand Down
49 changes: 7 additions & 42 deletions src/views/standalone/users_objects/UsersDatabaseView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import {
NeSkeleton,
NeInlineNotification,
getAxiosErrorMessage,
NeTabs,
NeTooltip
NeTabs
} from '@nethesis/vue-components'
import { onMounted } from 'vue'
import { ref } from 'vue'
Expand All @@ -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<UserDatabase[]>([])
const error = ref({
listDatabases: '',
Expand All @@ -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 = ''
}
Expand All @@ -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
}
}

Expand All @@ -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
}
}
</script>

<template>
<div class="mb-6 flex flex-row items-center justify-between">
<NeHeading tag="h3">{{ t('standalone.users_database.title') }}</NeHeading>
<!-- add remote database button (subscription only) -->
<NeButton v-if="activeSubscription" kind="secondary" @click="showCreateDrawer = true"
<!-- add remote database button -->
<NeButton kind="secondary" @click="showCreateDrawer = true"
><template #prefix>
<font-awesome-icon
:icon="['fas', 'circle-plus']"
Expand All @@ -108,20 +87,6 @@ async function fetchSubscriptionInfo() {
/> </template
>{{ t('standalone.users_database.add_remote_database') }}</NeButton
>
<!-- disabled add remote database button for community -->
<NeTooltip v-else trigger-event="mouseenter focus" placement="bottom">
<template #trigger>
<NeButton kind="secondary" disabled>
<template #prefix>
<font-awesome-icon :icon="['fas', 'circle-plus']" class="h-4 w-4" aria-hidden="true" />
</template>
{{ t('standalone.users_database.add_remote_database') }}
</NeButton>
</template>
<template #content>
{{ t('standalone.users_database.add_remote_database_tooltip') }}
</template>
</NeTooltip>
</div>
<!-- list databases error -->
<NeInlineNotification
Expand All @@ -147,7 +112,7 @@ async function fetchSubscriptionInfo() {
{{ error.listDatabasesDetails }}
</template></NeInlineNotification
>
<NeSkeleton v-if="loading.listDatabases || loading.getSubscriptionInfo" :lines="10" size="lg" />
<NeSkeleton v-if="loadingDatabases" :lines="10" size="lg" />
<div v-else-if="!error.listDatabases && !error.getSubscriptionInfo">
<NeTabs
:selected="selectedTab"
Expand Down
Loading