koishi-plugin-csss 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export interface Config {
8
8
  showVAC: boolean;
9
9
  showPassword: boolean;
10
10
  generateImage: boolean;
11
+ imageWidth: number;
11
12
  imageHeight: number;
12
13
  fontSize: number;
13
14
  fontFamily: string;
package/lib/index.js CHANGED
@@ -36,6 +36,7 @@ var Config = import_koishi.Schema.object({
36
36
  showVAC: import_koishi.Schema.boolean().default(true).description("是否显示VAC状态"),
37
37
  showPassword: import_koishi.Schema.boolean().default(true).description("是否显示密码保护信息"),
38
38
  generateImage: import_koishi.Schema.boolean().default(true).description("是否生成图片横幅(影响cs和csss命令)"),
39
+ imageWidth: import_koishi.Schema.number().min(600).max(2e3).default(1200).description("图片宽度(像素)"),
39
40
  imageHeight: import_koishi.Schema.number().min(200).max(2500).default(500).description("图片最小高度(像素),实际高度会根据内容自适应"),
40
41
  fontSize: import_koishi.Schema.number().min(12).max(48).default(24).description("字体大小"),
41
42
  fontFamily: import_koishi.Schema.string().default("Microsoft YaHei, sans-serif").description("字体家族"),
@@ -533,7 +534,7 @@ ${textMessage}`;
533
534
  __name(calculateImageHeight, "calculateImageHeight");
534
535
  async function generateServerImage(data, host, port) {
535
536
  const { result } = data;
536
- const width = 1200;
537
+ const width = config.imageWidth;
537
538
  const height = calculateImageHeight(data);
538
539
  const canvas = await ctx.canvas.createCanvas(width, height);
539
540
  const ctx2d = canvas.getContext("2d");
@@ -586,8 +587,8 @@ ${textMessage}`;
586
587
  const failed = results.length - successful;
587
588
  const baseHeight = 200;
588
589
  const serverHeight = 100;
590
+ const width = config.imageWidth;
589
591
  const height = baseHeight + results.length * serverHeight;
590
- const width = 1200;
591
592
  const canvas = await ctx.canvas.createCanvas(width, height);
592
593
  const ctx2d = canvas.getContext("2d");
593
594
  imageUtils.drawBackground(ctx2d, width, height);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-csss",
3
3
  "description": "Check the status of the CS server",
4
- "version": "1.1.4",
4
+ "version": "1.1.5",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [