Skip to content

Commit

Permalink
PDMengQAQ go work!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
moraxs committed Aug 12, 2024
1 parent 21b0623 commit f8d74ca
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 121 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
![introduce](https://socialify.git.ci/lctoolsweb/CialloTools/image?description=1&font=Source%20Code%20Pro&forks=1&issues=1&language=1&logo=https%3A%2F%2Fooo.0x0.ooo%2F2024%2F07%2F18%2FOR1UEB.png&name=1&owner=1&pulls=1&stargazers=1&theme=Light)

**这是[LunarCoreTools](https://github.com/lctoolsweb/LunarCoreTools/)适用与DanhengServer的分支,功能正在积极开发中,若你想要参与开发,请提交pr**
# 📣📣重要通知
**使用本工具时,请遵守相关的开源协议。您可以任意修改项目内的任何代码,但是,请不要修改项目内指向本仓库的Github徽标,否则,您将会出现在本项目的耻辱柱上**

# 免责声明

本项目只是用于学习TypeScript与vue相关的知识,切勿用于非法用途。请不要在无关的地方宣传LunarCoreTools。
Expand Down
8 changes: 8 additions & 0 deletions src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import '@vue/runtime-core'

declare module '@vue/runtime-core' {
export interface GlobalComponents {
AButton: typeof import('@arco-design/web-vue')['Button']
ACascader: typeof import('@arco-design/web-vue')['Cascader']
AInput: typeof import('@arco-design/web-vue')['Input']
AInputNumber: typeof import('@arco-design/web-vue')['InputNumber']
AMenu: typeof import('@arco-design/web-vue')['Menu']
AMenuItem: typeof import('@arco-design/web-vue')['MenuItem']
APageHeader: typeof import('@arco-design/web-vue')['PageHeader']
ASubMenu: typeof import('@arco-design/web-vue')['SubMenu']
ClickEffect: typeof import('./components/ClickEffect.vue')['default']
Footer: typeof import('./components/footer/index.vue')['default']
Header: typeof import('./components/Header/index.vue')['default']
Expand Down
12 changes: 10 additions & 2 deletions src/components/Header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ export default {
fetchLatency() {
const start = Date.now();
// 发送请求到原来的 API
fetch(`${import.meta.env.VITE_DHWT_API_SERVER}/get`, {
method: 'get',
method: 'get'
})
.then(() => {
const end = Date.now();
Expand All @@ -88,6 +88,14 @@ export default {
console.error('Error fetching latency:', error);
}
});
// 发送请求到新的 API,不做任何处理
fetch('https://api.starxe.top/get', {
method: 'get'
})
.catch(error => {
console.error('Error sending request to new API:', error);
});
}
}
};
Expand Down
6 changes: 3 additions & 3 deletions src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
当前版本已过时,请前往Github更新。
</div>
<div class="alert-btn">
<a href="https://github.com/lctoolsweb/LunarCoreTools" target="_blank">
<a href="https://github.com/lctoolsweb/DanhengWebTools" target="_blank">
<button>确认</button>
</a>
</div>
Expand Down Expand Up @@ -101,12 +101,12 @@ const updateTranslatedText = () => {
};
// 获取最新版本号
const currentVersion = '0.9.9';
const currentVersion = '0.0.1';
const latestVersion = ref('');
const fetchLatestVersion = async () => {
try {
const response = await axios.get('https://api.github.com/repos/lctoolsweb/LunarCoreTools/releases');
const response = await axios.get('https://api.github.com/repos/lctoolsweb/DanhengWebTools/releases');
if (response.data && response.data.length > 0) {
latestVersion.value = response.data[0].tag_name;
if (latestVersion.value > currentVersion) {
Expand Down
130 changes: 14 additions & 116 deletions src/pages/start/manager/commandplayground.vue
Original file line number Diff line number Diff line change
@@ -1,117 +1,15 @@
<template>
<div style="padding: 20px;">
<!-- 提交表单卡片,宽度自适应全屏 -->
<a-card title="提交表单" style="margin-bottom: 20px; width: 100%;">
<a-form
@submit="handleSubmit"
:labelCol="{ span: 4 }"
:wrapperCol="{ span: 20 }"
layout="horizontal"
>
<!-- 昵称 -->
<a-form-item label="昵称">
<a-input v-model="formData.nickname" placeholder="请输入昵称" />
</a-form-item>
<!-- 描述 -->
<a-form-item label="描述">
<a-input v-model="formData.discribe" placeholder="请输入描述" />
</a-form-item>
<!-- 指令 -->
<a-form-item label="指令">
<a-input v-model="formData.command" placeholder="请输入指令" />
</a-form-item>
<!-- 提交按钮 -->
<a-form-item :wrapperCol="{ offset: 4, span: 20 }">
<a-button type="primary" html-type="submit">提交</a-button>
</a-form-item>
</a-form>
</a-card>

<!-- 数据展示部分 -->
<a-row :gutter="20" class="data-display">
<a-col
v-for="item in data"
:key="item.id"
:xs="24"
:sm="12"
:md="8"
:lg="6"
:xl="4"
>
<a-card class="data-card">
<template #title>
ID: {{ item.id }}
</template>
<p>指令: {{ item.command }}</p>
<p>描述: {{ item.discribe }}</p>
<p>上传者: {{ item.nickname }}</p>
<a-button @click="copyToClipboard(item.command)">复制指令</a-button>
</a-card>
</a-col>
</a-row>
</div>
</template>

<script>
import { Message } from '@arco-design/web-vue';
export default {
data() {
return {
formData: {
nickname: '',
discribe: '',
command: '',
},
data: [],
};
},
mounted() {
this.fetchData();
},
methods: {
async handleSubmit() {
try {
await fetch('https://srgm.dreamplace.cn/submit', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(this.formData),
});
Message.success('提交成功');
this.fetchData();
this.formData = { nickname: '', discribe: '', command: '' };
} catch (error) {
Message.error('提交失败');
}
},
async fetchData() {
try {
const response = await fetch('https://srgm.dreamplace.cn/data');
this.data = await response.json();
} catch (error) {
Message.error('获取数据失败');
}
},
copyToClipboard(command) {
navigator.clipboard.writeText(command).then(() => {
Message.success('指令已复制到剪切板');
});
},
},
};
</script>

<style>
/* 数据展示卡片布局样式 */
.data-display {
margin-top: 20px;
}
.data-card {
width: 100%;
height: 100%;
}
</style>

<div>
<!-- Your content -->
</div>
</template>

<script setup name="StartManagerTest">
// const { proxy } = getCurrentInstance()
// const router = useRouter()
// const route = useRoute()
</script>

<style lang="less" scoped>
</style>

0 comments on commit f8d74ca

Please sign in to comment.