Skip to content

Commit

Permalink
about and new run gui
Browse files Browse the repository at this point in the history
  • Loading branch information
neferin12 committed Apr 28, 2024
1 parent 7b556b8 commit 8cec8a5
Show file tree
Hide file tree
Showing 24 changed files with 894 additions and 494 deletions.
Binary file modified gui/tauri-gui/.yarn/install-state.gz
Binary file not shown.
37 changes: 37 additions & 0 deletions gui/tauri-gui/components.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}

declare module 'vue' {
export interface GlobalComponents {
BButton: typeof import('bootstrap-vue-next')['BButton']
BCollapse: typeof import('bootstrap-vue-next')['BCollapse']
BContainer: typeof import('bootstrap-vue-next')['BContainer']
BDropdownItem: typeof import('bootstrap-vue-next')['BDropdownItem']
BForm: typeof import('bootstrap-vue-next')['BForm']
BFormCheckbox: typeof import('bootstrap-vue-next')['BFormCheckbox']
BFormGroup: typeof import('bootstrap-vue-next')['BFormGroup']
BFormInput: typeof import('bootstrap-vue-next')['BFormInput']
BInputGroup: typeof import('bootstrap-vue-next')['BInputGroup']
BInputGroupAppend: typeof import('bootstrap-vue-next')['BInputGroupAppend']
BNavbarBrand: typeof import('bootstrap-vue-next')['BNavbarBrand']
BNavbarNav: typeof import('bootstrap-vue-next')['BNavbarNav']
BNavbarToggle: typeof import('bootstrap-vue-next')['BNavbarToggle']
BNavForm: typeof import('bootstrap-vue-next')['BNavForm']
BNavItem: typeof import('bootstrap-vue-next')['BNavItem']
BNavItemDropdown: typeof import('bootstrap-vue-next')['BNavItemDropdown']
BTable: typeof import('bootstrap-vue-next')['BTable']
BTableSimple: typeof import('bootstrap-vue-next')['BTableSimple']
BTbody: typeof import('bootstrap-vue-next')['BTbody']
BTd: typeof import('bootstrap-vue-next')['BTd']
BTr: typeof import('bootstrap-vue-next')['BTr']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
export interface ComponentCustomProperties {
vBColorMode: typeof import('bootstrap-vue-next')['vBColorMode']
}
}
4 changes: 2 additions & 2 deletions gui/tauri-gui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
<title>RiSM GUI</title>
</head>
<body>
<body data-bs-theme="dark">
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
Expand Down
7 changes: 6 additions & 1 deletion gui/tauri-gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,30 @@
"scripts": {
"dev": "vite",
"tauri-dev": "yarn tauri dev",
"tauri-build": "yarn tauri build",
"tauri-build": "yarn tauri build -b deb",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --build --force"
},
"dependencies": {
"@tauri-apps/api": "^1.5.4",
"bootstrap": "^5.3.3",
"bootstrap-vue-next": "^0.17.2",
"pinia": "^2.1.7",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
},
"devDependencies": {
"@tauri-apps/cli": "^1.5.12",
"@tsconfig/node20": "^20.1.4",
"@types/bootstrap": "^5",
"@types/node": "^20.12.5",
"@vitejs/plugin-vue": "^5.0.4",
"@vue/tsconfig": "^0.5.1",
"npm-run-all2": "^6.1.2",
"typescript": "~5.4.0",
"unplugin-vue-components": "^0.26.0",
"vite": "^5.2.8",
"vue-tsc": "^2.0.11"
},
Expand Down
114 changes: 113 additions & 1 deletion gui/tauri-gui/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions gui/tauri-gui/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "app"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
description = "Graphical User Interface for RISM"
authors = ["Julian Pollinger"]
license = ""
repository = ""
default-run = "app"
Expand All @@ -17,11 +17,12 @@ tauri-build = { version = "1.5.1", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.6.2", features = [] }
tauri = { version = "1.6.2", features = ["dialog-open"] }
rism = { path = "../../../rust"}

[features]
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
# If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes.
# DO NOT REMOVE!!
custom-protocol = [ "tauri/custom-protocol" ]
bundle_z3 = ["rism/static-link-z3"]
19 changes: 19 additions & 0 deletions gui/tauri-gui/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]

const VERSION: &str = env!("CARGO_PKG_VERSION");

#[tauri::command]
fn get_version() -> String {
return String::from(VERSION);
}

#[tauri::command]
fn uses_system_z3() -> bool {
#[cfg(feature = "bundle_z3")]
return false;

#[cfg(not(feature = "bundle_z3"))]
return true;
}


fn main() {
tauri::Builder::default()
.invoke_handler(tauri::generate_handler![get_version,uses_system_z3])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

11 changes: 7 additions & 4 deletions gui/tauri-gui/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
},
"tauri": {
"allowlist": {
"all": false
"all": false,
"dialog": {
"open": true
}
},
"bundle": {
"active": true,
Expand Down Expand Up @@ -56,10 +59,10 @@
"windows": [
{
"fullscreen": false,
"height": 600,
"resizable": true,
"height": 650,
"resizable": false,
"title": "RiSM",
"width": 800
"width": 1000
}
]
}
Expand Down
Loading

0 comments on commit 8cec8a5

Please sign in to comment.