First commit

This commit is contained in:
2026-03-18 22:42:33 +09:00
commit 50657066a6
64 changed files with 5290 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
import Dexie, { type EntityTable } from "dexie";
export interface Settings {
id: number;
name: string;
value: string;
}
export interface Server {
id: number;
name: string;
value: string;
}
export default class extends Dexie {
server!: EntityTable<Server, "id">;
settings!: EntityTable<Settings, "id">;
constructor() {
super("lynq-chat");
this.version(1).stores({
server: "++id,&name",
settings: "++id,&name",
});
/*(async () => {
await this.open();
await this.transaction("rw", this.settings, async () => {
const defaults = {
"key": "value",
};
for (const [name, value] of Object.entries(defaults)) {
const exists = await this.settings
.where("name")
.equals(name)
.first();
if (!exists) {
await this.settings.add({ name, value });
}
}
});
})();*/
};
}
export async function getByIndex<T>(
table: EntityTable<T, any>,
index: string,
indexValue: any
): Promise<T | undefined> {
return await table.where(index).equals(indexValue).first();
}
+9
View File
@@ -0,0 +1,9 @@
import { reactive } from "vue";
const routerStatus = reactive<{
isLoad: boolean;
}>({
isLoad: false,
});
export default routerStatus;