This commit is contained in:
hackrobot
2024-05-22 20:36:26 +08:00
parent 3d36632dc7
commit e0a1ab50cf
2 changed files with 110 additions and 85 deletions

View File

@@ -194,91 +194,103 @@ export default class MenuBuilder {
buildDefaultTemplate() {
const templateDefault = [
// {
// label: '&File',
// submenu: [
// {
// label: '&Open',
// accelerator: 'Ctrl+O',
// },
// {
// label: '&Close',
// accelerator: 'Ctrl+W',
// click: () => {
// this.mainWindow.close();
// },
// },
// ],
// },
// {
// label: '&View',
// submenu:
// process.env.NODE_ENV === 'development' ||
// process.env.DEBUG_PROD === 'true'
// ? [
// {
// label: '&Reload',
// accelerator: 'Ctrl+R',
// click: () => {
// this.mainWindow.webContents.reload();
// },
// },
// {
// label: 'Toggle &Full Screen',
// accelerator: 'F11',
// click: () => {
// this.mainWindow.setFullScreen(
// !this.mainWindow.isFullScreen(),
// );
// },
// },
// {
// label: 'Toggle &Developer Tools',
// accelerator: 'Alt+Ctrl+I',
// click: () => {
// this.mainWindow.webContents.toggleDevTools();
// },
// },
// ]
// : [
// {
// label: 'Toggle &Full Screen',
// accelerator: 'F11',
// click: () => {
// this.mainWindow.setFullScreen(
// !this.mainWindow.isFullScreen(),
// );
// },
// },
// ],
// },
// {
// label: 'Help',
// submenu: [
// {
// label: 'Learn More',
// click() {
// shell.openExternal('https://electronjs.org');
// },
// },
// {
// label: 'Documentation',
// click() {
// shell.openExternal(
// 'https://github.com/electron/electron/tree/main/docs#readme',
// );
// },
// },
// {
// label: 'Community Discussions',
// click() {
// shell.openExternal('https://www.electronjs.org/community');
// },
// },
// {
// label: 'Search Issues',
// click() {
// shell.openExternal('https://github.com/electron/electron/issues');
// },
// },
// ],
// },
{
label: '&File',
label: '菜单',
submenu: [
{
label: '&Open',
accelerator: 'Ctrl+O',
},
{
label: '&Close',
accelerator: 'Ctrl+W',
click: () => {
this.mainWindow.close();
},
},
],
},
{
label: '&View',
submenu:
process.env.NODE_ENV === 'development' ||
process.env.DEBUG_PROD === 'true'
? [
{
label: '&Reload',
accelerator: 'Ctrl+R',
click: () => {
this.mainWindow.webContents.reload();
},
},
{
label: 'Toggle &Full Screen',
accelerator: 'F11',
click: () => {
this.mainWindow.setFullScreen(
!this.mainWindow.isFullScreen(),
);
},
},
{
label: 'Toggle &Developer Tools',
accelerator: 'Alt+Ctrl+I',
click: () => {
this.mainWindow.webContents.toggleDevTools();
},
},
]
: [
{
label: 'Toggle &Full Screen',
accelerator: 'F11',
click: () => {
this.mainWindow.setFullScreen(
!this.mainWindow.isFullScreen(),
);
},
},
],
},
{
label: 'Help',
submenu: [
{
label: 'Learn More',
label: '公众号: 异度世界',
click() {
shell.openExternal('https://electronjs.org');
},
},
{
label: 'Documentation',
click() {
shell.openExternal(
'https://github.com/electron/electron/tree/main/docs#readme',
);
},
},
{
label: 'Community Discussions',
click() {
shell.openExternal('https://www.electronjs.org/community');
},
},
{
label: 'Search Issues',
click() {
shell.openExternal('https://github.com/electron/electron/issues');
// 打开网址
shell.openExternal('https://www.hackrobot.cn');
},
},
],

View File

@@ -1,6 +1,6 @@
import { Component, useRef } from 'react';
import { Input } from 'antd';
import { Button, Flex } from 'antd';
import { Button, Flex,Modal, Space } from 'antd';
// import Taro from "@tarojs/taro";
// import {
// View,
@@ -182,7 +182,6 @@ renderer.blockquote = function (quote) {
//  
// return `<span style="white-space:pre;" class="blockquote">\t 👉${content}</span><br/> `
return `<div style="white-space:pre;" class="blockquote">\t 👉${content}</div>\n`;
;
};
renderer.table = function (header, body) {
@@ -290,7 +289,6 @@ const Index = () => {
const htmlContent = divRef.current.innerText;
// const htmlContent = divRef.current.textContent;
navigator.clipboard
.writeText(htmlContent)
.then(() => {
@@ -302,11 +300,26 @@ const Index = () => {
}
};
const info = () => {
Modal.info({
title: 'This is a notification message',
content: (
<div>
<p>some messages...some messages...</p>
<p>some messages...some messages...</p>
</div>
),
onOk() {},
});
};
return (
<div className={styles.index}>
<div className={styles.up}>
<div className={styles.upLeft}>
{/* <button onClick={copyToClipboard}>Copy to Clipboardl</button> */}
{/* <Button type="text" danger>
公众号: 异度世界
</Button> */}
</div>
<div className={styles.upRight}>
{/* <button onClick={copyToClipboard}>Copy to Clipboarrd</button> */}