Skip to content

Commit

Permalink
fix: swing打包错误
Browse files Browse the repository at this point in the history
  • Loading branch information
renfei committed Sep 24, 2024
1 parent ee0ad6c commit e47c339
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 28 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>net.renfei</groupId>
<artifactId>Indexing</artifactId>
<version>1.0.3</version>
<version>1.0.4</version>
<name>Indexing</name>
<url>https://www.renfei.net/kitbox/indexing</url>
<description>Indexing - 搜索引擎推送工具 - SEO 工具箱</description>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/renfei/indexing/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/
public class Application {
public static final MainWindow MAIN_WINDOW = new MainWindow();
public static final String VERSION = "1.0.3";
public static final String VERSION = "1.0.4";
public static void main(String[] args) {
javax.swing.JFrame frame = new javax.swing.JFrame("Indexing - 搜索引擎推送工具 - SEO 工具箱");
frame.setContentPane(MAIN_WINDOW.mainPanel);
Expand Down
61 changes: 35 additions & 26 deletions src/main/java/net/renfei/indexing/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,35 +50,44 @@ public void init() {
urlsScroPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
logsScroPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
MainWindow mainWindow = this;
execButton.addActionListener(e -> {
setLog("开始执行");
Thread execService = new Thread(new ExecService(mainWindow), "ExecService");
execService.start();
execButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setLog("开始执行");
Thread execService = new Thread(new ExecService(mainWindow), "ExecService");
execService.start();
}
});
googleJson.addActionListener(e -> {
JFileChooser fc = new JFileChooser("/");
int val = fc.showOpenDialog(null);
if (val == JFileChooser.APPROVE_OPTION) {
googleJson.setText(fc.getSelectedFile().getPath());
} else {
googleJson.setText("点击选择JSON文件");
googleJson.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JFileChooser fc = new JFileChooser("/");
int val = fc.showOpenDialog(null);
if (val == JFileChooser.APPROVE_OPTION) {
googleJson.setText(fc.getSelectedFile().getPath());
} else {
googleJson.setText("点击选择JSON文件");
}
}
});
extractSitemapButtonButton.addActionListener(e -> {
int opt = JOptionPane.showConfirmDialog(extractSitemapButtonButton,
"点击确认将从网站地图文件(sitemap.xml)中提取链接,但是请注意:\n\n" +
"Indexing 接口的本意是:新内容产生时,及时通知搜索引擎爬取,确保新内容的及时收录。\n" +
"网站地图包含了全站连接,其中包括陈旧的内容,所以会产生以下问题:\n\n" +
"1.Indexing 接口滥用,因为提交的并不是新产生的内容,包含大量陈旧可能违反搜索引擎的用户使用协议,可能导致接口权限被收回\n" +
"2.全站链接数量过大,部分接口每天每月有使用限额,一口气提交会导致接口使用额度耗尽\n\n" +
"请知晓以上说明,自行合理的使用 API。",
"从站点地图中提取链接",
JOptionPane.YES_NO_OPTION, WARNING_MESSAGE);
if (opt == JOptionPane.YES_OPTION) {
//确认继续操作
setLog("从站点地图中提取链接");
Thread execService = new Thread(new ExtractSitemapService(mainWindow), "ExtractSitemapService");
execService.start();
extractSitemapButtonButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
int opt = JOptionPane.showConfirmDialog(extractSitemapButtonButton,
"点击确认将从网站地图文件(sitemap.xml)中提取链接,但是请注意:\n\n" +
"Indexing 接口的本意是:新内容产生时,及时通知搜索引擎爬取,确保新内容的及时收录。\n" +
"网站地图包含了全站连接,其中包括陈旧的内容,所以会产生以下问题:\n\n" +
"1.Indexing 接口滥用,因为提交的并不是新产生的内容,包含大量陈旧可能违反搜索引擎的用户使用协议,可能导致接口权限被收回\n" +
"2.全站链接数量过大,部分接口每天每月有使用限额,一口气提交会导致接口使用额度耗尽\n\n" +
"请知晓以上说明,自行合理的使用 API。",
"从站点地图中提取链接",
JOptionPane.YES_NO_OPTION, WARNING_MESSAGE);
if (opt == JOptionPane.YES_OPTION) {
//确认继续操作
setLog("从站点地图中提取链接");
Thread execService = new Thread(new ExtractSitemapService(mainWindow), "ExtractSitemapService");
execService.start();
}
}
});
ConfigVO configVO = ConfigFileService.getConfig();
Expand Down

0 comments on commit e47c339

Please sign in to comment.