-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2896 from FlowFuse/2895-device-assignment-ux
New "Assign Device" dialog, exposed at Device page & new "Assignment" Settings
- Loading branch information
Showing
5 changed files
with
384 additions
and
15 deletions.
There are no files selected for viewing
This file contains 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 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
71 changes: 71 additions & 0 deletions
71
frontend/src/pages/device/components/AssignDeviceDialog.vue
This file contains 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,71 @@ | ||
<template> | ||
<ff-dialog | ||
id="assign-device-dialog" | ||
ref="dialog" | ||
header="Assign Device" | ||
class="ff-dialog-fixed-height" | ||
data-el="assign-device-dialog" | ||
:disable-primary="!assignOption" | ||
@confirm="select" | ||
> | ||
<template #default> | ||
<p class="text-sm text-gray-500"> | ||
Please select whether you want to assign this Device to an Instance or an Application. | ||
</p> | ||
<ff-tile-selection v-model="assignOption"> | ||
<ff-tile-selection-option | ||
value="instance" label="Instance" data-form="assign-to-instance" | ||
description="<p>Auto-deploy flows from the bound Instance directly to this Device.</p></br><p>You can still remotely edit and create Snapshots on the Device when the Device is in 'Developer Mode'.</p>" | ||
/> | ||
<ff-tile-selection-option | ||
value="application" label="Application" data-form="assign-to-application" | ||
description="<p>Flows on this Device can only be edited and deployed via the 'Remote Editor' feature, available in 'Developer Mode'.</p></br><p>You can create Snapshots here for version control of the flows on your Device</p>" | ||
/> | ||
</ff-tile-selection> | ||
</template> | ||
</ff-dialog> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'AssignDeviceDialog', | ||
emits: ['assignOptionSelected'], | ||
setup () { | ||
return { | ||
async show () { | ||
this.$refs.dialog.show() | ||
} | ||
} | ||
}, | ||
data () { | ||
return { | ||
assignOption: null | ||
} | ||
}, | ||
methods: { | ||
select () { | ||
this.$emit('assignOptionSelected', this.assignOption) | ||
this.assignOption = null | ||
}, | ||
close () { | ||
this.$refs.dialog.close() | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
#assign-device-dialog { | ||
.ff-tile-selection { | ||
margin-top: 1rem; | ||
display: grid; | ||
grid-template-columns: repeat(2, 1fr); | ||
gap: 1rem; | ||
} | ||
.ff-tile-selection-option { | ||
width: auto; | ||
margin: 0; | ||
} | ||
} | ||
</style> |
This file contains 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.