Merge remote-tracking branch 'origin/master' into releases/4.0.0
This commit is contained in:
@@ -31,9 +31,9 @@
|
||||
"description": "Versions marked as pre-release may contain unknown issues or bugs and are not recommended for production use. If you encounter any problems, please visit ",
|
||||
"issueLink": "GitHub Issues"
|
||||
},
|
||||
"tip": "💡 TIP: Switching to an older version or a specific version will not re-download the dashboard files, which may cause some data display errors. You can find the corresponding dashboard files dist.zip at",
|
||||
"tipLink": "here",
|
||||
"tipContinue": ", extract and replace the data/dist folder. Of course, the frontend source code is in the dashboard directory, you can also build it yourself using npm install and npm build.",
|
||||
"tip": "💡 TIP:",
|
||||
"tipLink": "",
|
||||
"tipContinue": "By default, the corresponding version of the WebUI files will be downloaded when switching versions. The WebUI code is located in the dashboard directory of the project, and you can use npm to build it yourself.",
|
||||
"dockerTip": "The `Update to Latest Version` button will try to update both the bot main program and the dashboard. If you are using Docker deployment, you can also re-pull the image or use",
|
||||
"dockerTipLink": "watchtower",
|
||||
"dockerTipContinue": "to automatically monitor and pull.",
|
||||
|
||||
@@ -31,9 +31,8 @@
|
||||
"description": "标有预发布标签的版本可能存在未知问题或 Bug,不建议在生产环境使用。如发现问题,请提交至 ",
|
||||
"issueLink": "GitHub Issues"
|
||||
},
|
||||
"tip": "💡 TIP: 跳到旧版本或者切换到某个版本不会重新下载管理面板文件,这可能会造成部分数据显示错误。您可在",
|
||||
"tipLink": "此处",
|
||||
"tipContinue": "找到对应的面板文件 dist.zip,解压后替换 data/dist 文件夹即可。当然,前端源代码在 dashboard 目录下,你也可以自己使用 npm install 和 npm build 构建。",
|
||||
"tip": "💡 TIP: ",
|
||||
"tipContinue": "默认在切换版本时会下载对应版本的 WebUI 文件。WebUI 代码位于项目的 dashboard 目录,您可使用 npm 自行构建。",
|
||||
"dockerTip": "`更新到最新版本` 按钮会同时尝试更新机器人主程序和管理面板。如果您正在使用 Docker 部署,也可以重新拉取镜像或者使用",
|
||||
"dockerTipLink": "watchtower",
|
||||
"dockerTipContinue": "来自动监控拉取。",
|
||||
|
||||
@@ -37,7 +37,7 @@ let dashboardHasNewVersion = ref(false);
|
||||
let dashboardCurrentVersion = ref('');
|
||||
let version = ref('');
|
||||
let releases = ref([]);
|
||||
let devCommits = ref([]);
|
||||
let devCommits = ref<{ sha: string; date: string; message: string }[]>([]);
|
||||
let updatingDashboardLoading = ref(false);
|
||||
let installLoading = ref(false);
|
||||
|
||||
@@ -190,23 +190,46 @@ function getReleases() {
|
||||
}
|
||||
|
||||
function getDevCommits() {
|
||||
fetch('https://api.github.com/repos/Soulter/AstrBot/commits', {
|
||||
headers: {
|
||||
'Host': 'api.github.com',
|
||||
'Referer': 'https://api.github.com'
|
||||
}
|
||||
})
|
||||
let proxy = localStorage.getItem('selectedGitHubProxy') || '';
|
||||
const originalUrl = "https://api.github.com/repos/Soulter/AstrBot/commits";
|
||||
let commits_url = originalUrl;
|
||||
if (proxy !== '') {
|
||||
proxy = proxy.endsWith('/') ? proxy : proxy + '/';
|
||||
commits_url = proxy + originalUrl;
|
||||
}
|
||||
|
||||
function fetchCommits(url: string, onError?: () => void) {
|
||||
fetch(url, {
|
||||
headers: {
|
||||
'Host': 'api.github.com',
|
||||
'Referer': 'https://api.github.com'
|
||||
}
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
devCommits.value = data.map((commit: any) => ({
|
||||
sha: commit.sha,
|
||||
date: new Date(commit.commit.author.date).toLocaleString(),
|
||||
message: commit.commit.message
|
||||
}));
|
||||
devCommits.value = Array.isArray(data)
|
||||
? data.map((commit: any) => ({
|
||||
sha: commit.sha,
|
||||
date: new Date(commit.commit.author.date).toLocaleString(),
|
||||
message: commit.commit.message
|
||||
}))
|
||||
: [];
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
if (onError) {
|
||||
onError();
|
||||
} else {
|
||||
console.log('获取开发版提交信息失败:', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
fetchCommits(commits_url, () => {
|
||||
if (proxy !== '' && commits_url !== originalUrl) {
|
||||
console.log('使用代理请求失败,尝试直接请求');
|
||||
fetchCommits(originalUrl);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function switchVersion(version: string) {
|
||||
@@ -343,8 +366,7 @@ commonStore.getStartTime();
|
||||
</div>
|
||||
|
||||
<div class="mb-4 mt-4">
|
||||
<small>{{ t('core.header.updateDialog.tip') }} <a
|
||||
href="https://github.com/Soulter/AstrBot/releases">{{ t('core.header.updateDialog.tipLink') }}</a>
|
||||
<small>{{ t('core.header.updateDialog.tip') }}
|
||||
{{ t('core.header.updateDialog.tipContinue') }}</small>
|
||||
</div>
|
||||
|
||||
@@ -384,7 +406,7 @@ commonStore.getStartTime();
|
||||
</div>
|
||||
</v-alert>
|
||||
|
||||
<v-data-table :headers="releasesHeader" :items="releases" item-key="name">
|
||||
<v-data-table :headers="releasesHeader" :items="releases" item-key="name" :items-per-page="5">
|
||||
<template v-slot:item.tag_name="{ item }: { item: { tag_name: string } }">
|
||||
<div class="d-flex align-center">
|
||||
<span>{{ item.tag_name }}</span>
|
||||
|
||||
@@ -480,7 +480,7 @@
|
||||
|
||||
<!-- 会话命名编辑对话框 -->
|
||||
<v-dialog v-model="nameEditDialog" max-width="500" min-height="60%">
|
||||
<v-card v-if="selectedSessionForName" rounded="12">
|
||||
<v-card v-if="selectedSessionForName">
|
||||
<v-card-title class="bg-primary text-white py-3 px-4" style="display: flex; align-items: center;">
|
||||
<v-icon color="white" class="me-2">mdi-rename-box</v-icon>
|
||||
<span>{{ tm('nameEditor.title') }}</span>
|
||||
@@ -490,8 +490,9 @@
|
||||
</v-btn>
|
||||
</v-card-title>
|
||||
|
||||
<v-card-text class="pa-4">
|
||||
<v-text-field
|
||||
<v-card-text>
|
||||
<div style="padding-left: 16px; padding-right: 16px;">
|
||||
<v-text-field
|
||||
v-model="newSessionName"
|
||||
:label="tm('nameEditor.customName')"
|
||||
:placeholder="tm('nameEditor.placeholder')"
|
||||
@@ -518,6 +519,7 @@
|
||||
>
|
||||
{{ tm('nameEditor.hint') }}
|
||||
</v-alert>
|
||||
</div>
|
||||
</v-card-text>
|
||||
|
||||
<v-card-actions class="px-4 pb-4">
|
||||
|
||||
Reference in New Issue
Block a user