mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-20 00:43:04 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
f0ad19e6c2
|
|||
|
9022a09b4c
|
|||
|
7e3e61afd7
|
|||
|
08f594d164
|
|||
|
046595b51f
|
|||
|
fbc5303690
|
|||
|
ad41d39bfb
|
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "charachorder-device-manager",
|
"name": "charachorder-device-manager",
|
||||||
"version": "1.3.2",
|
"version": "1.4.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "charachorder-device-manager",
|
"name": "charachorder-device-manager",
|
||||||
"version": "1.3.2",
|
"version": "1.4.0",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "charachorder-device-manager",
|
"name": "charachorder-device-manager",
|
||||||
"version": "1.3.2",
|
"version": "1.4.0",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "app"
|
name = "app"
|
||||||
version = "1.3.2"
|
version = "1.4.0"
|
||||||
description = "A Tauri App"
|
description = "A Tauri App"
|
||||||
authors = ["Thea Schöbl <dev@theaninova.de>"]
|
authors = ["Thea Schöbl <dev@theaninova.de>"]
|
||||||
license = "AGPL-3"
|
license = "AGPL-3"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"devPath": "http://localhost:5173",
|
"devPath": "http://localhost:5173",
|
||||||
"distDir": "../build"
|
"distDir": "../build"
|
||||||
},
|
},
|
||||||
"package": { "productName": "amacc1ng", "version": "1.3.2" },
|
"package": { "productName": "amacc1ng", "version": "1.4.0" },
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": { "all": false },
|
"allowlist": { "all": false },
|
||||||
"bundle": {
|
"bundle": {
|
||||||
|
|||||||
1
src/env.d.ts
vendored
1
src/env.d.ts
vendored
@@ -12,6 +12,7 @@ interface ImportMetaEnv {
|
|||||||
readonly VITE_BUGS_URL: string
|
readonly VITE_BUGS_URL: string
|
||||||
readonly VITE_DOCS_URL: string
|
readonly VITE_DOCS_URL: string
|
||||||
readonly VIET_LEARN_URL: string
|
readonly VIET_LEARN_URL: string
|
||||||
|
readonly VITE_LATEST_FIRMWARE: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ImportMeta {
|
interface ImportMeta {
|
||||||
|
|||||||
@@ -17,10 +17,9 @@ const de = {
|
|||||||
RELOAD: "Neu laden",
|
RELOAD: "Neu laden",
|
||||||
},
|
},
|
||||||
backup: {
|
backup: {
|
||||||
TITLE: "Verlauf speichern",
|
TITLE: "Lokale Kopie",
|
||||||
INDIVIDUAL: "Einzeldateien",
|
INDIVIDUAL: "Einzeldateien",
|
||||||
DISCLAIMER:
|
DISCLAIMER: "Das Backup in diesem Browser gespeichert und bleibt nur auf diesem Computer.",
|
||||||
"Der Verlauf wird als Backup in diesem Browser gespeichert. Der Verlauf bleibt auf diesem Computer.",
|
|
||||||
DOWNLOAD: "Alles herunterladen",
|
DOWNLOAD: "Alles herunterladen",
|
||||||
RESTORE: "Wiederherstellen",
|
RESTORE: "Wiederherstellen",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ const en = {
|
|||||||
TITLE: "Update your device",
|
TITLE: "Update your device",
|
||||||
},
|
},
|
||||||
backup: {
|
backup: {
|
||||||
TITLE: "Store History",
|
TITLE: "Local backup",
|
||||||
INDIVIDUAL: "Individual backups",
|
INDIVIDUAL: "Individual backups",
|
||||||
DISCLAIMER: "Your history is stored as a backup in this browser. The history remains on your computer.",
|
DISCLAIMER: "A backup is made and stored in this browser, and always remains only on your computer.",
|
||||||
DOWNLOAD: "Download Everything",
|
DOWNLOAD: "Download Everything",
|
||||||
RESTORE: "Restore",
|
RESTORE: "Restore",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ export async function restoreBackup(event: Event) {
|
|||||||
} else if (isCsvChords(text)) {
|
} else if (isCsvChords(text)) {
|
||||||
restoreFromFile(csvChordsToJson(text))
|
restoreFromFile(csvChordsToJson(text))
|
||||||
} else {
|
} else {
|
||||||
alert("Unknown backup format")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,9 +48,7 @@ export function deserializeActions(native: bigint): number[] {
|
|||||||
const actions = []
|
const actions = []
|
||||||
for (let i = 0; i < 12; i++) {
|
for (let i = 0; i < 12; i++) {
|
||||||
const action = Number(native & 0x3ffn)
|
const action = Number(native & 0x3ffn)
|
||||||
if (action !== 0) {
|
actions.push(action)
|
||||||
actions.push(action)
|
|
||||||
}
|
|
||||||
native >>= 10n
|
native >>= 10n
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ export class CharaDevice {
|
|||||||
async deleteChord(chord: Pick<Chord, "actions">) {
|
async deleteChord(chord: Pick<Chord, "actions">) {
|
||||||
const status = await this.send(`CML C4 ${stringifyChordActions(chord.actions)}`)
|
const status = await this.send(`CML C4 ${stringifyChordActions(chord.actions)}`)
|
||||||
console.log(status)
|
console.log(status)
|
||||||
if (status.at(-1) !== "2") throw new Error(`Failed with status ${status}`)
|
if (status.at(-1) !== "2" && status.at(-1) !== "0") throw new Error(`Failed with status ${status}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ export const setting: Action<HTMLInputElement, {id: number; inverse?: number; sc
|
|||||||
const type = node.getAttribute("type") as "number" | "checkbox"
|
const type = node.getAttribute("type") as "number" | "checkbox"
|
||||||
const min = node.hasAttribute("min") ? Number(node.getAttribute("min")) : undefined
|
const min = node.hasAttribute("min") ? Number(node.getAttribute("min")) : undefined
|
||||||
const max = node.hasAttribute("max") ? Number(node.getAttribute("max")) : undefined
|
const max = node.hasAttribute("max") ? Number(node.getAttribute("max")) : undefined
|
||||||
console.log(min, max, "|", id, "|", node.getAttribute("min"), node.getAttribute("max"))
|
|
||||||
|
|
||||||
const unsubscribe = settings.subscribe(async settings => {
|
const unsubscribe = settings.subscribe(async settings => {
|
||||||
if (id in settings) {
|
if (id in settings) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import {slide, fade} from "svelte/transition"
|
import {slide, fade} from "svelte/transition"
|
||||||
import {preference} from "$lib/preferences"
|
import {preference} from "$lib/preferences"
|
||||||
import LL from "../i18n/i18n-svelte"
|
import LL from "../i18n/i18n-svelte"
|
||||||
|
import {downloadBackup} from "$lib/backup/backup"
|
||||||
|
|
||||||
function reboot() {
|
function reboot() {
|
||||||
$serialPort?.reboot()
|
$serialPort?.reboot()
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function bootloader() {
|
function bootloader() {
|
||||||
|
downloadBackup()
|
||||||
$serialPort?.bootloader()
|
$serialPort?.bootloader()
|
||||||
$serialPort = undefined
|
$serialPort = undefined
|
||||||
rebootInfo = true
|
rebootInfo = true
|
||||||
@@ -51,6 +53,11 @@
|
|||||||
<br />
|
<br />
|
||||||
Version {$serialPort.version}
|
Version {$serialPort.version}
|
||||||
</p>
|
</p>
|
||||||
|
{#if $serialPort.version.toString() !== import.meta.env.VITE_LATEST_FIRMWARE}
|
||||||
|
<a href="https://docs.charachorder.com/CharaChorder%20One.html#updating-the-firmware"
|
||||||
|
>Firmware Update Instructions</a
|
||||||
|
>
|
||||||
|
{/if}
|
||||||
<!--<button on:click={updateFirmware}>Update</button>-->
|
<!--<button on:click={updateFirmware}>Update</button>-->
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
|||||||
@@ -66,12 +66,19 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: chordActions = chord?.actions.slice(chord.actions.lastIndexOf(0) + 1).toSorted(compare)
|
||||||
|
$: compoundIndices = chord?.actions.slice(0, chord.actions.indexOf(0))
|
||||||
|
|
||||||
|
$: {
|
||||||
|
console.log(chord?.actions, chordActions, compoundIndices)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class:deleted={chord && chord.deleted}
|
class:deleted={chord && chord.deleted}
|
||||||
class:edited={chord && chord.actionsChanged}
|
class:edited={chord && chord.actionsChanged}
|
||||||
class:invalid={chord && chord.actions.toSorted(compare).some((it, i) => chord?.actions[i] !== it)}
|
class:invalid={chord && chordActions?.some((it, i) => chordActions?.[i] !== it)}
|
||||||
class="chord"
|
class="chord"
|
||||||
on:click={edit}
|
on:click={edit}
|
||||||
on:keydown={keydown}
|
on:keydown={keydown}
|
||||||
@@ -82,7 +89,15 @@
|
|||||||
{:else if !editing && !chord}
|
{:else if !editing && !chord}
|
||||||
<span>{$LL.configure.chords.NEW_CHORD()}</span>
|
<span>{$LL.configure.chords.NEW_CHORD()}</span>
|
||||||
{/if}
|
{/if}
|
||||||
<ActionString display="keys" actions={editing ? [...pressedKeys].sort(compare) : chord?.actions ?? []} />
|
{#if !editing}
|
||||||
|
{#each compoundIndices ?? [] as index}
|
||||||
|
<sub>{index}</sub>
|
||||||
|
{/each}
|
||||||
|
{#if compoundIndices?.length}
|
||||||
|
<span>→</span>
|
||||||
|
{/if}
|
||||||
|
{/if}
|
||||||
|
<ActionString display="keys" actions={editing ? [...pressedKeys].sort(compare) : chordActions ?? []} />
|
||||||
<button class="icon add" on:click|stopPropagation={addSpecial}>add_circle</button>
|
<button class="icon add" on:click|stopPropagation={addSpecial}>add_circle</button>
|
||||||
<sup>•</sup>
|
<sup>•</sup>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ process.env.VITE_HOMEPAGE_URL = repository.url.replace(/\.git$/, "")
|
|||||||
process.env.VITE_DOCS_URL = homepage
|
process.env.VITE_DOCS_URL = homepage
|
||||||
process.env.VITE_BUGS_URL = bugs.url
|
process.env.VITE_BUGS_URL = bugs.url
|
||||||
process.env.VITE_LEARN_URL = "https://www.iq-eq.io/"
|
process.env.VITE_LEARN_URL = "https://www.iq-eq.io/"
|
||||||
|
process.env.VITE_LATEST_FIRMWARE = "1.1.3"
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
build: {
|
build: {
|
||||||
|
|||||||
Reference in New Issue
Block a user