3838 <div class =" flex gap-2 align-center" style =" height : 34px ;" >
3939 <template v-if =" isDevModeAvailable " >
4040 <DeveloperModeToggle data-el =" device-devmode-toggle" :device =" device" :disabled =" disableModeToggle" :disabledReason =" disableModeToggleReason" @mode-change =" setDeviceMode" />
41- <button v-if =" !isVisitingAdmin" v-ff-tooltip:left =" !editorAvailable ? 'You can edit flows directly when Developer Mode is enabled, and your Edge Instance is connected.' : 'Open Edge Instance Editor'" data-action =" open-editor" class =" ff-btn transition-fade--color ff-btn--secondary ff-btn-icon h-9" :disabled =" !editorAvailable" @click =" openTunnel(true)" >
42- Open Editor
43- <span class =" ff-btn--icon ff-btn--icon-right" >
44- <ExternalLinkIcon />
45- </span >
46- </button >
41+ <device-editor-link
42+ :device =" device"
43+ :title =" !editorAvailable ? 'You can edit flows directly when Developer Mode is enabled, and your Edge Instance is connected.' : 'Open Edge Instance Editor'"
44+ :disabled =" !editorAvailable"
45+ :primary =" editorAvailable"
46+ data-action =" open-editor"
47+ @open-immersive-editor =" openTunnel({launchEditor: true, event: $event, immersive: true})"
48+ @open-editor =" openTunnel({launchEditor: true, event: $event, immersive: false})"
49+ />
4750 </template >
4851 <FinishSetupButton v-if =" hasPermission('device:create', {application: device.application}) && neverConnected" :device =" device" />
49- <DropdownMenu v-if =" hasPermission('device:change-status', permissionContext) && actionsDropdownOptions.length" data-el =" device-actions-dropdown" buttonClass =" ff-btn ff-btn--primary" :options =" actionsDropdownOptions" >Actions</DropdownMenu >
52+ <DropdownMenu
53+ v-if =" hasPermission('device:change-status', permissionContext) && actionsDropdownOptions.length"
54+ data-el =" device-actions-dropdown"
55+ :buttonClass =" `ff-btn ff-btn-icon ${ editorAvailable ? 'ff-btn--secondary' : 'ff-btn--primary'}`"
56+ :options =" actionsDropdownOptions"
57+ >
58+ <CogIcon class =" ff-btn--icon ff-btn--icon-left" />
59+ Actions
60+ </DropdownMenu >
5061 </div >
5162 </template >
5263 </SectionNavigationHeader >
110121
111122<script >
112123
113- import { ExternalLinkIcon } from ' @heroicons/vue/outline'
114- // import { TerminalIcon } from '@heroicons/vue/solid'
124+ import { CogIcon } from ' @heroicons/vue/solid/index.js'
115125import semver from ' semver'
116126import { mapState } from ' vuex'
117127
@@ -122,6 +132,7 @@ import SectionNavigationHeader from '../../components/SectionNavigationHeader.vu
122132import StatusBadge from ' ../../components/StatusBadge.vue'
123133import SubscriptionExpiredBanner from ' ../../components/banners/SubscriptionExpired.vue'
124134import TeamTrialBanner from ' ../../components/banners/TeamTrial.vue'
135+ import { useNavigationHelper } from ' ../../composables/NavigationHelper.js'
125136import usePermissions from ' ../../composables/Permissions.js'
126137import deviceActionsMixin from ' ../../mixins/DeviceActions.js'
127138
@@ -136,6 +147,7 @@ import DeviceAssignInstanceDialog from '../team/Devices/dialogs/DeviceAssignInst
136147import AssignDeviceDialog from ' ./components/AssignDeviceDialog.vue'
137148
138149import DeveloperModeToggle from ' ./components/DeveloperModeToggle.vue'
150+ import DeviceEditorLink from ' ./components/DeviceEditorLink.vue'
139151import DeviceLastSeenBadge from ' ./components/DeviceLastSeenBadge.vue'
140152import DeviceModeBadge from ' ./components/DeviceModeBadge.vue'
141153
@@ -155,8 +167,9 @@ const deviceTransitionStates = [
155167export default {
156168 name: ' DevicePage' ,
157169 components: {
170+ CogIcon,
171+ DeviceEditorLink,
158172 FinishSetupButton,
159- ExternalLinkIcon,
160173 DeveloperModeToggle,
161174 DeviceModeBadge,
162175 DeviceLastSeenBadge,
@@ -172,8 +185,9 @@ export default {
172185 mixins: [deviceActionsMixin],
173186 setup () {
174187 const { hasPermission , isVisitingAdmin } = usePermissions ()
188+ const { navigateTo , openInANewTab } = useNavigationHelper ()
175189
176- return { hasPermission, isVisitingAdmin }
190+ return { hasPermission, isVisitingAdmin, navigateTo, openInANewTab }
177191 },
178192 data : function () {
179193 return {
@@ -425,16 +439,23 @@ export default {
425439
426440 Alerts .emit (' Device successfully assigned to application.' , ' confirmation' )
427441 },
428- openEditor () {
442+ openEditor ({ event = null , immersive = false } = {} ) {
429443 this .$store .dispatch (' ux/validateUserAction' , ' hasOpenedDeviceEditor' )
430- window .open (this .deviceEditorURL , ` device-editor-${ this .device .id } ` )
431- // this.$router.push({ name: 'device-editor' })
444+ if (! immersive) {
445+ this .openInANewTab (this .deviceEditorURL , ` device-editor-${ this .device .id } ` )
446+ } else {
447+ this .navigateTo (' editor' , event , { target: ` device-editor-${ this .device .id } ` })
448+ }
432449 },
433- async openTunnel (launchEditor = false ) {
450+ async openTunnel ({
451+ event ,
452+ immersive = true ,
453+ launchEditor = false
454+ } = {}) {
434455 try {
435456 if (this .deviceRunning ) {
436457 if (this .device .editor ? .enabled && this .device .editor ? .connected && this .device .editor ? .local ) {
437- this .openEditor ()
458+ this .openEditor ({ event , immersive } )
438459 } else {
439460 this .openingTunnel = true
440461 this .$refs .dialog .show ()
@@ -448,7 +469,7 @@ export default {
448469 if (this .device .editor ? .enabled && this .device .editor ? .connected ) {
449470 if (this .device .editor ? .local ) {
450471 if (launchEditor) {
451- this .openEditor ()
472+ this .openEditor ({ event , immersive } )
452473 }
453474 } else {
454475 pollTunnelStatus (done, attempt + 1 , 200 )
0 commit comments