Add mobile gui beta

This commit is contained in:
kwaroran
2024-09-09 21:25:38 +09:00
parent eb8e1d31c8
commit 7f4d6b1597
13 changed files with 297 additions and 74 deletions

View File

@@ -728,6 +728,7 @@ export interface Database{
falLoraScale: number
moduleIntergration: string
customCSS: string
betaMobileGUI:boolean
}
export interface customscript{

View File

@@ -9,7 +9,7 @@ import {open} from '@tauri-apps/api/shell'
import { DataBase, loadedStore, setDatabase, type Database, defaultSdDataFunc } from "./database";
import { appWindow } from "@tauri-apps/api/window";
import { checkRisuUpdate } from "../update";
import { botMakerMode, selectedCharID } from "../stores";
import { MobileGUI, botMakerMode, selectedCharID } from "../stores";
import { Body, ResponseType, fetch as TauriFetch } from "@tauri-apps/api/http";
import { loadPlugins } from "../plugins/plugins";
import { alertConfirm, alertError, alertNormal, alertNormalWait, alertSelect, alertTOS } from "../alert";
@@ -533,6 +533,9 @@ export async function loadData() {
if(db.botSettingAtStart){
botMakerMode.set(true)
}
if(db.betaMobileGUI && window.innerWidth <= 800){
MobileGUI.set(true)
}
loadedStore.set(true)
selectedCharID.set(-1)
startObserveDom()

View File

@@ -28,8 +28,10 @@ export const botMakerMode = writable(false)
export const moduleBackgroundEmbedding = writable('')
export const openPresetList = writable(false)
export const openPersonaList = writable(false)
export const MobileGUI = writable(false)
export const MobileGUIStack = writable(0)
export const MobileSideBar = writable(false)
//optimization
export const CurrentCharacter = writable(null) as Writable<character | groupChat>
export const CurrentSimpleCharacter = writable(null) as Writable<simpleCharacterArgument>
export const CurrentChat = writable(null) as Writable<Chat>
@@ -47,6 +49,7 @@ export const HideIconStore = writable(false)
export const UserIconProtrait = writable(false)
export const CustomCSSStore = writable('')
export const SafeModeStore = writable(false)
export const MobileSearch = writable('')
let lastGlobalEnabledModules: string[] = []
let lastChatEnabledModules: string[] = []