feat:V3.0.1
This commit is contained in:
BIN
front/public/dex.png
Normal file
BIN
front/public/dex.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
@@ -1,5 +1,3 @@
|
||||
use tauri::Manager;
|
||||
|
||||
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
||||
#[tauri::command]
|
||||
fn greet(name: &str) -> String {
|
||||
|
||||
@@ -78,51 +78,36 @@ const handleClick: MenuProps['onClick'] = (e) => {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const theme = ref({
|
||||
"token": {
|
||||
"colorPrimary": "#67eac3",
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="tw:h-screen tw:w-screen">
|
||||
<a-page-header class="tw:fixed tw:h-16" style="border: 1px solid rgb(235, 237, 240)" title="DeEarthX"
|
||||
sub-title="V3"
|
||||
:avatar="{ src: '../assets/tianpao.jpg' }"
|
||||
>
|
||||
<a-config-provider :theme="theme">
|
||||
<div class="tw:h-screen tw:w-screen">
|
||||
<a-page-header class="tw:fixed tw:h-16" style="border: 1px solid rgb(235, 237, 240)" title="DeEarthX"
|
||||
sub-title="V3" :avatar="{ src: './public/dex.png' }">
|
||||
<template #extra>
|
||||
<a-button @click="contant">作者B站</a-button>
|
||||
<a-button @click="contant">作者B站</a-button>
|
||||
</template>
|
||||
|
||||
</a-page-header>
|
||||
<div class="tw:flex tw:full tw:h-89/100">
|
||||
<a-menu id="menu" style="width: 144px;" :selectedKeys="selectedKeys" mode="inline" :items="items" @click="handleClick"/>
|
||||
<RouterView />
|
||||
</a-page-header>
|
||||
<div class="tw:flex tw:full tw:h-89/100">
|
||||
<a-menu id="menu" style="width: 144px;" :selectedKeys="selectedKeys" mode="inline" :items="items"
|
||||
@click="handleClick" />
|
||||
<RouterView />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-config-provider>
|
||||
</template>
|
||||
|
||||
|
||||
<style>
|
||||
/* 禁止选择文本的样式 */
|
||||
h1 {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select:none;
|
||||
}
|
||||
|
||||
li {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select:none;
|
||||
}
|
||||
|
||||
p {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
user-select:none;
|
||||
}
|
||||
|
||||
span {
|
||||
h1,li,p,span {
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
-ms-user-select: none;
|
||||
|
||||
@@ -4,8 +4,9 @@ import { InboxOutlined } from '@ant-design/icons-vue';
|
||||
import { message, StepsProps } from 'ant-design-vue';
|
||||
import type { UploadFile, UploadChangeParam } from 'ant-design-vue';
|
||||
import {sendNotification,} from '@tauri-apps/plugin-notification';
|
||||
import { SelectProps } from 'ant-design-vue/es/vc-select';
|
||||
interface IWSM {
|
||||
status: "unzip"|"finish"|"changed"|"downloading",
|
||||
status: "unzip"|"finish"|"changed"|"downloading"|"error",
|
||||
result: any
|
||||
}
|
||||
/* 进度显示区 */
|
||||
@@ -72,7 +73,7 @@ function runDeEarthX(data: Blob) {
|
||||
const fd = new FormData();
|
||||
fd.append('file', data);
|
||||
console.log(fd.getAll('file'))
|
||||
fetch('http://localhost:37019/start',{
|
||||
fetch(`http://localhost:37019/start?mode=${Cselect.value}`,{
|
||||
method:'POST',
|
||||
body:fd
|
||||
}).then(async res=>res.json()).then(()=>{
|
||||
@@ -81,6 +82,7 @@ function runDeEarthX(data: Blob) {
|
||||
}
|
||||
const prog = ref({status:"active",percent:0,display:true})
|
||||
const dprog = ref({status:"active",percent:0,display:true})
|
||||
const CanO = ref(true);
|
||||
function prews(){
|
||||
const ws = new WebSocket('ws://localhost:37019/')
|
||||
// ws.addEventListener('message',(wsm)=>{
|
||||
@@ -93,6 +95,10 @@ function prews(){
|
||||
ws.addEventListener('message',(wsm)=>{
|
||||
const _data = JSON.parse(wsm.data) as IWSM
|
||||
//console.log(_data)
|
||||
if (_data.status === "error" && _data.result === "jini") {
|
||||
CanO.value = false;
|
||||
message.error("未在系统变量中找到Java!请安装Java!否则开服模式将无法使用!")
|
||||
}
|
||||
if (_data.status === "changed") { //状态更改
|
||||
setyps_current.value ++;
|
||||
}
|
||||
@@ -126,6 +132,26 @@ function prews(){
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/* 选择区 */
|
||||
const Moptions = ref<SelectProps['options']>([
|
||||
{
|
||||
label: '开服模式',
|
||||
value: 'server',
|
||||
disabled: CanO.value ? false : true
|
||||
},
|
||||
{
|
||||
label: '上传模式',
|
||||
value: 'upload',
|
||||
disabled: false
|
||||
}
|
||||
])
|
||||
|
||||
const Cselect = ref(CanO ? 'server' : 'upload')
|
||||
|
||||
function handleSelect(value: string) {
|
||||
Cselect.value = value;
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="tw:h-full tw:w-full tw:relative">
|
||||
@@ -145,7 +171,14 @@ function prews(){
|
||||
请使用.zip(CurseForge、MCBBS)和.mrpck(Modrinth)文件
|
||||
</p>
|
||||
</a-upload-dragger>
|
||||
<a-button :disabled="BtnisDisabled" type="primary" @click="handleUpload" style="margin-top: 32px">
|
||||
<a-select
|
||||
ref="select"
|
||||
:options="Moptions"
|
||||
:value="Cselect"
|
||||
style="width: 120px;margin-top: 32px"
|
||||
@select="handleSelect"
|
||||
></a-select>
|
||||
<a-button :disabled="BtnisDisabled" type="primary" @click="handleUpload" style="margin-top: 6px">
|
||||
开始
|
||||
</a-button>
|
||||
</div>
|
||||
|
||||
@@ -12,73 +12,82 @@ interface IConfig {
|
||||
dexpub: boolean;
|
||||
mixins: boolean;
|
||||
};
|
||||
oaf: boolean
|
||||
}
|
||||
const config = ref<IConfig>({mirror: {bmclapi: false, mcimirror: false}, filter: {hashes: false, dexpub: false, mixins: false}})
|
||||
fetch('http://localhost:37019/config/get',{
|
||||
const config = ref<IConfig>({ mirror: { bmclapi: false, mcimirror: false }, filter: { hashes: false, dexpub: false, mixins: false }, oaf: false})
|
||||
fetch('http://localhost:37019/config/get', {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(res=>res.json()).then(res=>config.value = res)
|
||||
}).then(res => res.json()).then(res => config.value = res)
|
||||
|
||||
let first = true;
|
||||
watch(config,(newv)=>{ //写入Config
|
||||
if(!first){
|
||||
fetch('http://localhost:37019/config/post',{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(newv)
|
||||
}).then(res=>{
|
||||
if(res.status === 200){
|
||||
message.success('配置已保存')
|
||||
}
|
||||
})
|
||||
watch(config, (newv) => { //写入Config
|
||||
if (!first) {
|
||||
fetch('http://localhost:37019/config/post', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(newv)
|
||||
}).then(res => {
|
||||
if (res.status === 200) {
|
||||
message.success('配置已保存')
|
||||
}
|
||||
})
|
||||
// shell.Command.create('core',['writeconfig',JSON.stringify(newv)]).execute().then(()=>{
|
||||
// message.success('配置已保存')
|
||||
// })
|
||||
console.log(newv)
|
||||
return
|
||||
}
|
||||
}
|
||||
first = false;
|
||||
},{deep:true})
|
||||
}, { deep: true })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="tw:h-full tw:w-full">
|
||||
<h1 class="tw:text-3xl tw:font-black tw:tracking-tight tw:text-center">
|
||||
<span class="tw:bg-gradient-to-r tw:from-emerald-500 tw:to-cyan-500 tw:bg-clip-text tw:text-transparent">
|
||||
DeEarth X
|
||||
</span>
|
||||
<span>设置</span>
|
||||
</h1>
|
||||
<div class="tw:border-t-2 tw:border-gray-400 tw:mt-6 tw:mb-2"></div>
|
||||
<!-- DeEarth设置 -->
|
||||
<h1 class="tw:text-xl tw:font-black tw:tracking-tight tw:text-center">模组筛选设置</h1>
|
||||
<div class="tw:flex">
|
||||
<div class="tw:flex tw:ml-5 tw:mt-2">
|
||||
<p class="tw:text-gray-600">哈希过滤</p>
|
||||
<a-switch class="tw:left-2" v-model:checked="config.filter.hashes" />
|
||||
</div>
|
||||
<div class="tw:flex tw:ml-5 tw:mt-2">
|
||||
<p class="tw:text-gray-600">DeP过滤</p>
|
||||
<a-switch class="tw:left-2" v-model:checked="config.filter.dexpub" />
|
||||
</div>
|
||||
<div class="tw:flex tw:ml-5 tw:mt-2">
|
||||
<p class="tw:text-gray-600">Mixin过滤</p>
|
||||
<a-switch class="tw:left-2" v-model:checked="config.filter.mixins" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- DeEarth设置 -->
|
||||
<div class="tw:border-t-2 tw:border-gray-400 tw:mt-6 tw:mb-2"></div>
|
||||
<!-- 下载源设置 -->
|
||||
<h1 class="tw:text-xl tw:font-black tw:tracking-tight tw:text-center">下载源设置</h1>
|
||||
<div class="tw:flex">
|
||||
<div class="tw:flex tw:ml-5 tw:mt-2">
|
||||
<p class="tw:text-gray-600">MCIM镜像源</p>
|
||||
<a-switch class="tw:left-2" v-model:checked="config.mirror.mcimirror" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="tw:h-full tw:w-full">
|
||||
<h1 class="tw:text-3xl tw:font-black tw:tracking-tight tw:text-center">
|
||||
<span class="tw:bg-gradient-to-r tw:from-emerald-500 tw:to-cyan-500 tw:bg-clip-text tw:text-transparent">
|
||||
DeEarth X
|
||||
</span>
|
||||
<span>设置</span>
|
||||
</h1>
|
||||
<div class="tw:border-t-2 tw:border-gray-400 tw:mt-6 tw:mb-2"></div>
|
||||
<!-- DeEarth设置 -->
|
||||
<h1 class="tw:text-xl tw:font-black tw:tracking-tight tw:text-center">模组筛选设置</h1>
|
||||
<div class="tw:flex">
|
||||
<div class="tw:flex tw:ml-5 tw:mt-2">
|
||||
<p class="tw:text-gray-600">哈希过滤</p>
|
||||
<a-switch class="tw:left-2" v-model:checked="config.filter.hashes" />
|
||||
</div>
|
||||
<div class="tw:flex tw:ml-5 tw:mt-2">
|
||||
<p class="tw:text-gray-600">DeP过滤</p>
|
||||
<a-switch class="tw:left-2" v-model:checked="config.filter.dexpub" />
|
||||
</div>
|
||||
<div class="tw:flex tw:ml-5 tw:mt-2">
|
||||
<p class="tw:text-gray-600">Mixin过滤</p>
|
||||
<a-switch class="tw:left-2" v-model:checked="config.filter.mixins" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- DeEarth设置 -->
|
||||
<div class="tw:border-t-2 tw:border-gray-400 tw:mt-6 tw:mb-2"></div>
|
||||
<!-- 下载源设置 -->
|
||||
<h1 class="tw:text-xl tw:font-black tw:tracking-tight tw:text-center">下载源设置</h1>
|
||||
<div class="tw:flex">
|
||||
<div class="tw:flex tw:ml-5 tw:mt-2">
|
||||
<p class="tw:text-gray-600">MCIM镜像源</p>
|
||||
<a-switch class="tw:left-2" v-model:checked="config.mirror.mcimirror" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="tw:border-t-2 tw:border-gray-400 tw:mt-6 tw:mb-2"></div>
|
||||
<!-- DeEarthX管理 -->
|
||||
<div class="tw:flex">
|
||||
<div class="tw:flex tw:ml-5 tw:mt-2">
|
||||
<p class="tw:text-gray-600">完毕后打开目录</p>
|
||||
<a-switch class="tw:left-2" v-model:checked="config.oaf" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user