You've already forked AstralRinth
forked from didirus/AstralRinth
Fix some small things (#658)
This commit is contained in:
4
Cargo.lock
generated
4
Cargo.lock
generated
@@ -888,9 +888,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "daedalus"
|
name = "daedalus"
|
||||||
version = "0.1.23"
|
version = "0.1.25"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d14d655650f5f0fd5b88946d4add0f1b02d866e40632304cfe1427240bfd2430"
|
checksum = "247a958ffad4a2a44fb081a2b1ef39d6b4698c179949542b202236a460102762"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode 2.0.0-rc.3",
|
"bincode 2.0.0-rc.3",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "theseus"
|
name = "theseus"
|
||||||
version = "0.5.3"
|
version = "0.5.4"
|
||||||
authors = ["Jai A <jaiagr+gpg@pm.me>"]
|
authors = ["Jai A <jaiagr+gpg@pm.me>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ tempfile = "3.5.0"
|
|||||||
urlencoding = "2.1.3"
|
urlencoding = "2.1.3"
|
||||||
|
|
||||||
chrono = { version = "0.4.19", features = ["serde"] }
|
chrono = { version = "0.4.19", features = ["serde"] }
|
||||||
daedalus = { version = "0.1.23" }
|
daedalus = { version = "0.1.25" }
|
||||||
dirs = "5.0.1"
|
dirs = "5.0.1"
|
||||||
|
|
||||||
regex = "1.5"
|
regex = "1.5"
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ pub async fn auto_install_java(java_version: u32) -> crate::Result<PathBuf> {
|
|||||||
let packages = fetch_json::<Vec<Package>>(
|
let packages = fetch_json::<Vec<Package>>(
|
||||||
Method::GET,
|
Method::GET,
|
||||||
&format!(
|
&format!(
|
||||||
"https://api.azul.com/metadata/v1/zulu/packages?arch={}&java_version={}&os={}&archive_type=zip&javafx_bundled=false&java_package_type=jre&page_size=1",
|
"https://api.azul.com/metadata/v1/zulu/packages?arch={}&java_version={}&os={}&archive_type=zip&javafx_bundled=false&java_package_type=jdk&page_size=1",
|
||||||
std::env::consts::ARCH, java_version, std::env::consts::OS
|
std::env::consts::ARCH, java_version, std::env::consts::OS
|
||||||
),
|
),
|
||||||
None,
|
None,
|
||||||
|
|||||||
@@ -90,22 +90,6 @@ pub async fn login_2fa(
|
|||||||
Ok(creds)
|
Ok(creds)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument]
|
|
||||||
pub async fn login_minecraft(
|
|
||||||
flow: &str,
|
|
||||||
) -> crate::Result<ModrinthCredentialsResult> {
|
|
||||||
let state = crate::State::get().await?;
|
|
||||||
let creds =
|
|
||||||
crate::state::login_minecraft(flow, &state.fetch_semaphore).await?;
|
|
||||||
|
|
||||||
if let ModrinthCredentialsResult::Credentials(creds) = &creds {
|
|
||||||
let mut write = state.credentials.write().await;
|
|
||||||
write.login(creds.clone()).await?;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(creds)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tracing::instrument]
|
#[tracing::instrument]
|
||||||
pub async fn create_account(
|
pub async fn create_account(
|
||||||
username: &str,
|
username: &str,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "theseus_cli"
|
name = "theseus_cli"
|
||||||
version = "0.5.3"
|
version = "0.5.4"
|
||||||
authors = ["Jai A <jaiagr+gpg@pm.me>"]
|
authors = ["Jai A <jaiagr+gpg@pm.me>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "theseus_gui",
|
"name": "theseus_gui",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.5.3",
|
"version": "0.5.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "theseus_gui"
|
name = "theseus_gui"
|
||||||
version = "0.5.3"
|
version = "0.5.4"
|
||||||
description = "A Tauri App"
|
description = "A Tauri App"
|
||||||
authors = ["you"]
|
authors = ["you"]
|
||||||
license = ""
|
license = ""
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ pub fn init<R: tauri::Runtime>() -> TauriPlugin<R> {
|
|||||||
cancel_flow,
|
cancel_flow,
|
||||||
login_pass,
|
login_pass,
|
||||||
login_2fa,
|
login_2fa,
|
||||||
login_minecraft,
|
|
||||||
create_account,
|
create_account,
|
||||||
refresh,
|
refresh,
|
||||||
logout,
|
logout,
|
||||||
@@ -49,11 +48,6 @@ pub async fn login_2fa(code: &str, flow: &str) -> Result<ModrinthCredentials> {
|
|||||||
Ok(theseus::mr_auth::login_2fa(code, flow).await?)
|
Ok(theseus::mr_auth::login_2fa(code, flow).await?)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
|
||||||
pub async fn login_minecraft(flow: &str) -> Result<ModrinthCredentialsResult> {
|
|
||||||
Ok(theseus::mr_auth::login_minecraft(flow).await?)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn create_account(
|
pub async fn create_account(
|
||||||
username: &str,
|
username: &str,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
},
|
},
|
||||||
"package": {
|
"package": {
|
||||||
"productName": "Modrinth App",
|
"productName": "Modrinth App",
|
||||||
"version": "0.5.3"
|
"version": "0.5.4"
|
||||||
},
|
},
|
||||||
"tauri": {
|
"tauri": {
|
||||||
"allowlist": {
|
"allowlist": {
|
||||||
|
|||||||
@@ -38,7 +38,17 @@ const initFiles = async () => {
|
|||||||
.map((folder) => ({
|
.map((folder) => ({
|
||||||
path: folder,
|
path: folder,
|
||||||
name: folder.split(sep).pop(),
|
name: folder.split(sep).pop(),
|
||||||
selected: false,
|
selected:
|
||||||
|
folder.startsWith('mods') ||
|
||||||
|
folder.startsWith('datapacks') ||
|
||||||
|
folder.startsWith('resourcepacks') ||
|
||||||
|
folder.startsWith('shaderpacks') ||
|
||||||
|
folder.startsWith('config'),
|
||||||
|
disabled:
|
||||||
|
folder === 'profile.json' ||
|
||||||
|
folder.startsWith('modrinth_logs') ||
|
||||||
|
folder.startsWith('.fabric') ||
|
||||||
|
folder.includes('.DS_Store'),
|
||||||
}))
|
}))
|
||||||
.forEach((pathData) => {
|
.forEach((pathData) => {
|
||||||
const parent = pathData.path.split(sep).slice(0, -1).join(sep)
|
const parent = pathData.path.split(sep).slice(0, -1).join(sep)
|
||||||
@@ -115,7 +125,7 @@ const exportPack = async () => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="table">
|
<div class="table">
|
||||||
<div class="table-head">
|
<div class="table-head">
|
||||||
<div class="table-cell">Select files as overrides</div>
|
<div class="table-cell">Select files and folders to include in pack</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-content">
|
<div class="table-content">
|
||||||
<div v-for="[path, children] of folders" :key="path.name" class="table-row">
|
<div v-for="[path, children] of folders" :key="path.name" class="table-row">
|
||||||
@@ -125,6 +135,7 @@ const exportPack = async () => {
|
|||||||
:model-value="children.every((child) => child.selected)"
|
:model-value="children.every((child) => child.selected)"
|
||||||
:label="path.name"
|
:label="path.name"
|
||||||
class="select-checkbox"
|
class="select-checkbox"
|
||||||
|
:disabled="children.every((x) => x.disabled)"
|
||||||
@update:model-value="
|
@update:model-value="
|
||||||
(newValue) => children.forEach((child) => (child.selected = newValue))
|
(newValue) => children.forEach((child) => (child.selected = newValue))
|
||||||
"
|
"
|
||||||
@@ -137,7 +148,12 @@ const exportPack = async () => {
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="path.showingMore" class="file-secondary">
|
<div v-if="path.showingMore" class="file-secondary">
|
||||||
<div v-for="child in children" :key="child.path" class="file-secondary-row">
|
<div v-for="child in children" :key="child.path" class="file-secondary-row">
|
||||||
<Checkbox v-model="child.selected" :label="child.name" class="select-checkbox" />
|
<Checkbox
|
||||||
|
v-model="child.selected"
|
||||||
|
:label="child.name"
|
||||||
|
class="select-checkbox"
|
||||||
|
:disabled="child.disabled"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -145,7 +161,12 @@ const exportPack = async () => {
|
|||||||
<div v-for="file in files" :key="file.path" class="table-row">
|
<div v-for="file in files" :key="file.path" class="table-row">
|
||||||
<div class="table-cell file-entry">
|
<div class="table-cell file-entry">
|
||||||
<div class="file-primary">
|
<div class="file-primary">
|
||||||
<Checkbox v-model="file.selected" :label="file.name" class="select-checkbox" />
|
<Checkbox
|
||||||
|
v-model="file.selected"
|
||||||
|
:label="file.name"
|
||||||
|
:disabled="file.disabled"
|
||||||
|
class="select-checkbox"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ import {
|
|||||||
login_2fa,
|
login_2fa,
|
||||||
create_account,
|
create_account,
|
||||||
login_pass,
|
login_pass,
|
||||||
get as getCreds,
|
|
||||||
login_minecraft,
|
|
||||||
} from '@/helpers/mr_auth.js'
|
} from '@/helpers/mr_auth.js'
|
||||||
import { handleError, useNotifications } from '@/store/state.js'
|
import { handleError, useNotifications } from '@/store/state.js'
|
||||||
import { onMounted, ref } from 'vue'
|
import { onMounted, ref } from 'vue'
|
||||||
@@ -33,10 +31,6 @@ const props = defineProps({
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
flow: {
|
|
||||||
type: String,
|
|
||||||
default: null,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const loggingIn = ref(true)
|
const loggingIn = ref(true)
|
||||||
@@ -118,15 +112,6 @@ async function createAccount() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function goToNextPage() {
|
async function goToNextPage() {
|
||||||
const creds = await getCreds().catch(handleError)
|
|
||||||
if (!creds) {
|
|
||||||
try {
|
|
||||||
await login_minecraft(props.flow)
|
|
||||||
} catch {
|
|
||||||
/* empty */
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
props.nextPage()
|
props.nextPage()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,6 @@ export async function login_2fa(code, flow) {
|
|||||||
return await invoke('plugin:mr_auth|login_2fa', { code, flow })
|
return await invoke('plugin:mr_auth|login_2fa', { code, flow })
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function login_minecraft(flow) {
|
|
||||||
return await invoke('plugin:mr_auth|login_minecraft', { flow })
|
|
||||||
}
|
|
||||||
export async function create_account(username, email, password, challenge, signUpNewsletter) {
|
export async function create_account(username, email, password, challenge, signUpNewsletter) {
|
||||||
return await invoke('plugin:mr_auth|create_account', {
|
return await invoke('plugin:mr_auth|create_account', {
|
||||||
username,
|
username,
|
||||||
|
|||||||
Reference in New Issue
Block a user