ADD: Basic save
This commit is contained in:
1
src/preload/index.d.ts
vendored
1
src/preload/index.d.ts
vendored
@@ -7,6 +7,7 @@ export interface INanoDevicesAPI {
|
|||||||
callback: (eventid: string, deviceid: string, data: any) => void
|
callback: (eventid: string, deviceid: string, data: any) => void
|
||||||
): void
|
): void
|
||||||
send(deviceid: string, jsonstr: string): Promise<void>
|
send(deviceid: string, jsonstr: string): Promise<void>
|
||||||
|
save(deviceid: string): Promise<void>
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IElectronAPI {
|
export interface IElectronAPI {
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ contextBridge.exposeInMainWorld('nanoDevicesAPI', {
|
|||||||
},
|
},
|
||||||
send(deviceid, obj) {
|
send(deviceid, obj) {
|
||||||
return ipcRenderer.invoke('nanodevices:send', deviceid, JSON.stringify(obj))
|
return ipcRenderer.invoke('nanodevices:send', deviceid, JSON.stringify(obj))
|
||||||
|
},
|
||||||
|
save(deviceid) {
|
||||||
|
return ipcRenderer.invoke('nanodevices:send', deviceid, JSON.stringify({ save: true }))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -145,6 +145,7 @@
|
|||||||
: 'border-2'
|
: 'border-2'
|
||||||
"
|
"
|
||||||
class="app-titlebar-button"
|
class="app-titlebar-button"
|
||||||
|
@click="nanoDevicesAPI.save(store.connectedId)"
|
||||||
>
|
>
|
||||||
Save
|
Save
|
||||||
</MenubarButton>
|
</MenubarButton>
|
||||||
@@ -208,7 +209,7 @@ const showDisconnectButton = ref(false)
|
|||||||
|
|
||||||
const isMaximized = ref(false)
|
const isMaximized = ref(false)
|
||||||
|
|
||||||
const { electronAPI } = window
|
const { electronAPI, nanoDevicesAPI } = window
|
||||||
|
|
||||||
const isMacOS = electronAPI.platform === 'darwin'
|
const isMacOS = electronAPI.platform === 'darwin'
|
||||||
const zoomFactor = ref(1)
|
const zoomFactor = ref(1)
|
||||||
|
|||||||
@@ -14,6 +14,14 @@ import mockData from '@renderer/data/nanoConfig.json'
|
|||||||
|
|
||||||
const { nanoDevicesAPI } = window
|
const { nanoDevicesAPI } = window
|
||||||
|
|
||||||
|
// TODO: Define Profile type
|
||||||
|
|
||||||
|
// TODO: Define Device type
|
||||||
|
|
||||||
|
// TODO: Define Key type
|
||||||
|
|
||||||
|
// TODO: Define ProfileCategory type
|
||||||
|
|
||||||
export const useStore = defineStore('main', {
|
export const useStore = defineStore('main', {
|
||||||
state: () => {
|
state: () => {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user