diff --git a/frontend/src/pages/application/Devices.vue b/frontend/src/pages/application/Devices.vue index ec96c53925..11cf1a4c59 100644 --- a/frontend/src/pages/application/Devices.vue +++ b/frontend/src/pages/application/Devices.vue @@ -1,6 +1,6 @@ + + + + + @@ -102,10 +114,11 @@ import { PlusSmIcon } from '@heroicons/vue/outline' import { markRaw } from 'vue' -import { mapState } from 'vuex' +import { mapGetters, mapState } from 'vuex' import EmptyState from '../../components/EmptyState.vue' import SectionTopMenu from '../../components/SectionTopMenu.vue' +import FeatureUnavailableToTeam from '../../components/banners/FeatureUnavailableToTeam.vue' import { useNavigationHelper } from '../../composables/NavigationHelper.js' import permissionsMixin from '../../mixins/Permissions.js' @@ -122,7 +135,8 @@ export default { components: { PlusSmIcon, SectionTopMenu, - EmptyState + EmptyState, + FeatureUnavailableToTeam }, mixins: [permissionsMixin], inheritAttrs: false, @@ -151,6 +165,7 @@ export default { }, computed: { ...mapState('account', ['team', 'teamMembership']), + ...mapGetters('account', ['featuresCheck']), cloudColumns () { return [ { label: 'Name', class: ['w-1/2'], component: { is: markRaw(DeploymentName) } }, @@ -182,6 +197,9 @@ export default { }, isVisitingAdmin () { return this.teamMembership.role === Roles.Admin + }, + instancesAvailable () { + return this.featuresCheck?.isHostedInstancesEnabledForTeam } }, mounted () { diff --git a/frontend/src/pages/application/routes.js b/frontend/src/pages/application/routes.js index 276b798c7c..e1f330bd07 100644 --- a/frontend/src/pages/application/routes.js +++ b/frontend/src/pages/application/routes.js @@ -1,9 +1,5 @@ -/** - * WARNING: There is ongoing work to move Application functionality up into applications - * or down into instances. - * - * No new functionality should be added here. - */ +import store from '../../store/index.js' + import ApplicationActivity from './Activity.vue' import Dependencies from './Dependencies/Dependencies.vue' import ApplicationDeviceGroupSettingsEnvironment from './DeviceGroup/Settings/Environment.vue' @@ -25,10 +21,19 @@ import ApplicationSnapshots from './Snapshots.vue' import ApplicationCreateInstance from './createInstance.vue' import ApplicationIndex from './index.vue' +// import account vuex store + export default [ { path: ':id', - redirect: { name: 'ApplicationInstances' }, + redirect: function () { + const features = store.getters['account/featuresCheck'] + if (features.isHostedInstancesEnabledForTeam) { + return { name: 'ApplicationInstances' } + } else { + return { name: 'ApplicationDevices' } + } + }, name: 'Application', component: ApplicationIndex, meta: { diff --git a/frontend/src/pages/instance/components/InstanceForm.vue b/frontend/src/pages/instance/components/InstanceForm.vue index 24edd3c403..96fba71934 100644 --- a/frontend/src/pages/instance/components/InstanceForm.vue +++ b/frontend/src/pages/instance/components/InstanceForm.vue @@ -57,14 +57,14 @@ - + Create Node-RED Instance -
+
@@ -212,7 +212,7 @@ type="submit" >