Compare commits

...

5 Commits

Author SHA1 Message Date
hi2hi
56959c7733 💥 调整工作流 2024-12-09 14:38:13 +00:00
hi2hi
aee3c5634b 调整发布工作流 2024-12-09 14:31:21 +00:00
hi2hi
71eba02126 🚀 0.4.10 2024-12-09 14:28:43 +00:00
hi2hi
998955fa31 更新发布工作流,优化版本号处理和发布说明,调整README中的版本下载说明 2024-12-09 14:28:25 +00:00
hi2hi
6558f2ffe9 🪄 单独处理darwin系统、windows系统的LOGO 2024-12-09 14:11:13 +00:00
6 changed files with 37 additions and 23 deletions

View File

@ -18,27 +18,27 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 2 # 获取最近的两次提交
fetch-depth: 2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # 根据项目需求调整版本
node-version: '20'
- name: Install dependencies
run: npm install
- name: Get version from package.json
id: get_version
run: echo "::set-output name=version::$(node -p "require('./package.json').version")"
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
- name: Determine version
id: determine_version
run: |
if [ "${{ github.event.inputs.version }}" ]; then
echo "::set-output name=version::${{ github.event.inputs.version }}"
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
else
echo "::set-output name=version::${{ steps.get_version.outputs.version }}"
echo "version=${{ steps.get_version.outputs.version }}" >> $GITHUB_OUTPUT
fi
- name: Create Release
@ -131,20 +131,16 @@ jobs:
- name: Add release notes
run: |
# 获取最近一次提交的变更内容
git log -1 --pretty=format:"%s%n%b" > changes.txt
# 获取现有的发布说明
gh release view v${{ steps.determine_version.outputs.version }} --json body -q .body > body.txt
# 将变更内容添加到发布说明中
echo -e "### Changes in this release\n" >> body.txt
cat changes.txt >> body.txt
# 获取最近一次提交的变更内容
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:"%s%n%b" >> body.txt
# 添加其他发布说明
echo -e "\n哪吒V1请下载dist.zip\n哪吒V0请下载v0-${{ steps.determine_version.outputs.version }}-all.zip\n至于all是全量包cdn-jsdelivr是jsdelivr引用版cdn-loli是cdnjs引用版\nv0版本构建物通过修改./config.js指定nezhaVersion版本可以正常在v1中使用" >> body.txt
echo -e "\n哪吒V1请下载dist.zip\n哪吒V0请下载v0-${{ steps.determine_version.outputs.version }}-cdn-jsdelivr.zip\n -all是全量包-cdn-jsdelivr是jsdelivr引用版-cdn-loli是cdnjs的loli.net引用版\nv0版本构建物通过修改./config.js指定nezhaVersion版本号为'v1'v1也可以正常使用" >> body.txt
# 更新发布说明
gh release edit v${{ steps.determine_version.outputs.version }} --notes-file body.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,6 +1,6 @@
{
"name": "nazhua",
"version": "0.4.9",
"version": "0.4.10",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -15,7 +15,7 @@
默认的数据是基于V0
### Release版本的nazhua
V1下载最新版本[Releases](https://github.com/hi2shark/nazhua/releases)的`dist.zip`
V0下载最新版本[Releases](https://github.com/hi2shark/nazhua/releases)的`v0-{版本}-all.zip`或`v0-{版本}.zip`;
V0下载最新版本[Releases](https://github.com/hi2shark/nazhua/releases)的`v0-{版本}-all.zip`或`v0-{版本}-cdn-{CDN供应方}.zip`;
## 关于点阵地图
点阵地图是一个失真的地图,地图边际与城市位置都不是真实的经纬度坐标,因此无法通过经纬度来定位城市。

View File

@ -192,6 +192,23 @@ export function calcTransfer(bytes) {
return result;
}
export function getPlatformLogoIconClassName(platform) {
const platformStr = (platform || '').toLowerCase();
if (platformStr.includes('windows') || platformStr.includes('microsoft')) {
return 'ri-microsoft-fill';
}
switch (platformStr) {
case 'darwin':
case 'macos':
return 'fl-apple';
default:
}
if (platform) {
return `fl-${platform}`;
}
return 'ri-server-line';
}
/**
* 获取系统发行版本
*/

View File

@ -21,12 +21,9 @@
class="cpu-mem-group"
>
<span
v-if="info?.Host?.Platform"
class="system-os-icon"
>
<span
:class="'fl-' + info?.Host?.Platform"
/>
<span :class="platformLogoIconClassName" />
</span>
<span class="core-mem">{{ cpuAndMemAndDisk }}</span>
</span>
@ -91,6 +88,7 @@ const { cpuAndMemAndDisk } = handleServerInfo({
const slogan = computed(() => props.info?.PublicNote?.customData?.slogan);
const cpuInfo = computed(() => hostUtils.getCPUInfo(props.info?.Host?.CPU?.[0]));
const platformLogoIconClassName = computed(() => hostUtils.getPlatformLogoIconClassName(props.info?.Host?.Platform));
</script>
<style lang="scss" scoped>

View File

@ -18,10 +18,7 @@
<span
class="server-flag"
>
<span
class="fi"
:class="'fi-' + (info?.Host?.CountryCode || 'un')"
/>
<span :class="platformLogoIconClassName" />
</span>
<span class="server-name">
{{ info.Name }}
@ -66,9 +63,13 @@
* 单节点
*/
import {
computed,
} from 'vue';
import {
useRouter,
} from 'vue-router';
import * as hostUtils from '@/utils/host';
import handleServerInfo from '@/views/composable/server-info';
import ServerRealTime from '@/views/components/server/server-real-time.vue';
@ -91,6 +92,8 @@ const { cpuAndMemAndDisk } = handleServerInfo({
props,
});
const platformLogoIconClassName = computed(() => hostUtils.getPlatformLogoIconClassName(props.info?.Host?.Platform));
function openDetail() {
router.push({
name: 'ServerDetail',