🐞 fix: 修复部分问题

1. 强制更新无法强制问题
2. 帮助页面无法显示版本号
This commit is contained in:
zhiyu1998 2023-03-12 00:39:27 +08:00
parent 5d3aec4326
commit 6e4a175d3a
4 changed files with 68 additions and 54 deletions

View File

@ -57,11 +57,9 @@ export class update extends plugin {
const pluginName = "rconsole-plugin";
let command = "";
let command = `git -C ./plugins/${pluginName}/ pull --no-rebase`;
if (isForce) {
command = `git checkout . && git -C ./plugins/${pluginName}/ pull --no-rebase`;
} else {
command = `git -C ./plugins/${pluginName}/ pull --no-rebase`;
command = `git reset --hard origin/master && ${command}`;
}
this.oldCommitId = await this.getCommitId(pluginName);
await e.reply("正在执行更新操作,请稍等");

View File

@ -3,17 +3,17 @@ import config from './index.js'
import cfg from '../../../lib/config/config.js'
export default class Help extends base {
constructor (e) {
constructor(e) {
super(e)
this.model = 'help'
}
static async get (e) {
static async get(e) {
let html = new Help(e)
return await html.getData()
}
async getData () {
async getData() {
let helpData = config.getConfig('help')
let groupCfg = cfg.getGroup(this.group_id)
@ -27,7 +27,7 @@ export default class Help extends base {
})
}
let versionData = config.getConfig('version')
const versionData = config.getConfig('version')
const version =
(versionData && versionData.length && versionData[0].version) || '1.0.0'

View File

@ -4,12 +4,14 @@
font-weight: normal;
font-style: normal;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
user-select: none;
}
body {
font-family: sans-serif;
font-size: 16px;
@ -18,12 +20,14 @@ body {
transform: scale(1.5);
transform-origin: 0 0;
}
.container {
width: 788px;
padding: 20px 15px 10px 15px;
background-image: url(../../img/bg.jpeg);
background-size: 100%;
}
.head_box {
border-radius: 15px;
font-family: 'tttgbnumber';
@ -32,22 +36,27 @@ body {
color: white;
box-shadow: 0 5px 10px 0 rgb(0 0 0 / 15%);
}
.head_box .id_text {
font-size: 24px;
}
.head_box .day_text {
font-size: 20px;
}
.head_box .genshin_logo {
position: absolute;
top: -10px;
right: 15px;
width: 97px;
}
.base_info {
position: relative;
padding-left: 10px;
}
.uid {
font-family: tttgbnumber;
}
@ -61,6 +70,7 @@ body {
box-shadow: 0 0 1px 0 #ccc, 2px 2px 4px 0 rgba(50, 50, 50, 0.8);
position: relative;
}
.tab_lable {
position: absolute;
top: -10px;
@ -73,20 +83,24 @@ body {
border-radius: 15px 0px 15px 15px;
z-index: 20;
}
.data_line {
display: flex;
justify-content: space-around;
margin-bottom: 14px;
}
.data_line_item {
width: 100px;
text-align: center;
/*margin: 0 20px;*/
}
.num {
font-family: tttgbnumber;
font-size: 24px;
}
.data_box .lable {
font-size: 14px;
color: #7f858a;
@ -94,7 +108,7 @@ body {
margin-top: 3px;
}
.list{
.list {
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
@ -111,7 +125,8 @@ body {
border-radius: 8px;
margin: 0 0px 10px 10px;
}
.list .item .icon{
.list .item .icon {
width: 24px;
height: 24px;
background-repeat: no-repeat;
@ -119,20 +134,23 @@ body {
position: relative;
flex-shrink: 0;
}
.list .item .title{
.list .item .title {
font-size: 16px;
margin-left: 6px;
line-height: 20px;
}
/* .list .item .title .text{
white-space: nowrap;
} */
.list .item .title .dec{
.list .item .title .dec {
font-size: 12px;
color: #999;
margin-top: 2px;
}
.logo{
.logo {
text-align: center;
font-size: 14px;
color: white;

View File

@ -1,45 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link
rel="stylesheet"
type="text/css"
href="{{pluResPath}}html/help/help.css"
/>
<link rel="preload" href="{{resPath}}font/tttgbnumber.ttf" as="font" />
<link rel="preload" href="{{pluResPath}}img/bg.jpeg" as="image" />
<link rel="preload" href="{{pluResPath}}img/rank/top.png" as="image" />
<link rel="shortcut icon" href="#" />
</head>
{{@headStyle}}
<body>
<div class="container" id="container">
<div class="head_box">
<div class="id_text">R-Plugin</div>
<h2 class="day_text">使用说明-v{{update}}</h2>
<img class="genshin_logo" src="{{pluResPath}}img/rank/top.png" />
</div>
{{each helpData val}}
<div class="data_box">
<div class="tab_lable">
{{val.group}}{{val.disable ? ' - 已禁用' : ''}}
</div>
<div class="list">
{{each val.list item}}
<div class="item">
<img class="icon" src="{{pluResPath}}img/icon/{{item.icon}}.png" />
<div class="title">
<div class="text">{{@item.title}}</div>
<div class="dec">{{item.desc}}</div>
</div>
</div>
{{/each}}
</div>
</div>
{{/each}}
<div class="logo">Created By Yunzai-Bot & R-Plugin</div>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" href="{{pluResPath}}html/help/help.css" />
<link rel="preload" href="{{resPath}}font/tttgbnumber.ttf" as="font" />
<link rel="preload" href="{{pluResPath}}img/bg.jpeg" as="image" />
<link rel="preload" href="{{pluResPath}}img/rank/top.png" as="image" />
<link rel="shortcut icon" href="#" />
</head>
{{@headStyle}}
<body>
<div class="container" id="container">
<div class="head_box">
<div class="id_text">R-Plugin</div>
<h2 class="day_text">使用说明-当前版本v{{version}}</h2>
<img class="genshin_logo" src="{{pluResPath}}img/rank/top.png" />
</div>
</body>
{{each helpData val}}
<div class="data_box">
<div class="tab_lable">
{{val.group}}{{val.disable ? ' - 已禁用' : ''}}
</div>
<div class="list">
{{each val.list item}}
<div class="item">
<img class="icon" src="{{pluResPath}}img/icon/{{item.icon}}.png" />
<div class="title">
<div class="text">{{@item.title}}</div>
<div class="dec">{{item.desc}}</div>
</div>
</div>
{{/each}}
</div>
</div>
{{/each}}
<div class="logo">Created By Yunzai-Bot & R-Plugin</div>
</div>
</body>
</html>