🐞 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"; const pluginName = "rconsole-plugin";
let command = ""; let command = `git -C ./plugins/${pluginName}/ pull --no-rebase`;
if (isForce) { if (isForce) {
command = `git checkout . && git -C ./plugins/${pluginName}/ pull --no-rebase`; command = `git reset --hard origin/master && ${command}`;
} else {
command = `git -C ./plugins/${pluginName}/ pull --no-rebase`;
} }
this.oldCommitId = await this.getCommitId(pluginName); this.oldCommitId = await this.getCommitId(pluginName);
await e.reply("正在执行更新操作,请稍等"); await e.reply("正在执行更新操作,请稍等");

View File

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

View File

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

View File

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