]> source.dussan.org Git - gitblit.git/commitdiff
View Log button for GCA
authorJames Moger <james.moger@gitblit.com>
Thu, 29 Nov 2012 22:25:35 +0000 (17:25 -0500)
committerJames Moger <james.moger@gitblit.com>
Thu, 29 Nov 2012 22:25:35 +0000 (17:25 -0500)
build.xml
resources/script_16x16.png [new file with mode: 0644]
src/com/gitblit/authority/GitblitAuthority.java

index 59d79b5a3df2cee5d0e585c739b333ce1157968f..080c91b6cd3138fbc089a42a0c7877616e3e3273 100644 (file)
--- a/build.xml
+++ b/build.xml
                        <resource file="${basedir}/resources/settings_32x32.png" />\r
                        <resource file="${basedir}/resources/search-icon.png" />\r
                        <resource file="${basedir}/resources/mail_16x16.png" />\r
+                       <resource file="${basedir}/resources/script_16x16.png" />\r
                        <resource file="${basedir}/resources/blank.png" />\r
                        <resource file="${basedir}/resources/bullet_green.png" />\r
                        <resource file="${basedir}/resources/bullet_orange.png" />\r
diff --git a/resources/script_16x16.png b/resources/script_16x16.png
new file mode 100644 (file)
index 0000000..ec93a22
Binary files /dev/null and b/resources/script_16x16.png differ
index 5ee6af593eb40a3a4ca4105b9f8435fbe7579b79..ed942e58f760e8e60d3d9ec793bc6faea7b79713 100644 (file)
@@ -67,6 +67,7 @@ import javax.swing.JPasswordField;
 import javax.swing.JScrollPane;\r
 import javax.swing.JSplitPane;\r
 import javax.swing.JTable;\r
+import javax.swing.JTextArea;\r
 import javax.swing.JTextField;\r
 import javax.swing.RowFilter;\r
 import javax.swing.SwingConstants;\r
@@ -92,6 +93,7 @@ import com.gitblit.client.HeaderPanel;
 import com.gitblit.client.Translation;\r
 import com.gitblit.models.UserModel;\r
 import com.gitblit.utils.ArrayUtils;\r
+import com.gitblit.utils.FileUtils;\r
 import com.gitblit.utils.StringUtils;\r
 import com.gitblit.utils.TimeUtils;\r
 import com.gitblit.utils.X509Utils;\r
@@ -681,6 +683,23 @@ public class GitblitAuthority extends JFrame implements X509Log {
                        }\r
                });\r
                \r
+               JButton logButton = new JButton(new ImageIcon(getClass().getResource("/script_16x16.png")));\r
+               logButton.setFocusable(false);\r
+               logButton.setToolTipText(Translation.get("gb.log"));            \r
+               logButton.addActionListener(new ActionListener() {\r
+                       @Override\r
+                       public void actionPerformed(ActionEvent e) {\r
+                               File log = new File(folder, X509Utils.CERTS + File.separator + "log.txt");\r
+                               if (log.exists()) {\r
+                                       String content = FileUtils.readContent(log,  "\n");\r
+                                       JTextArea textarea = new JTextArea(content);\r
+                                       JScrollPane scrollPane = new JScrollPane(textarea);\r
+                                       scrollPane.setPreferredSize(new Dimension(700, 400));\r
+                                       JOptionPane.showMessageDialog(GitblitAuthority.this, scrollPane, log.getAbsolutePath(), JOptionPane.INFORMATION_MESSAGE);\r
+                               }\r
+                       }\r
+               });\r
+               \r
                final JTextField filterTextfield = new JTextField(15);\r
                filterTextfield.addActionListener(new ActionListener() {\r
                        public void actionPerformed(ActionEvent e) {\r
@@ -697,6 +716,7 @@ public class GitblitAuthority extends JFrame implements X509Log {
                buttonControls.add(certificateDefaultsButton);\r
                buttonControls.add(newSSLCertificate);\r
                buttonControls.add(emailBundle);\r
+               buttonControls.add(logButton);\r
 \r
                JPanel userControls = new JPanel(new FlowLayout(FlowLayout.RIGHT, Utils.MARGIN, Utils.MARGIN));\r
                userControls.add(new JLabel(Translation.get("gb.filter")));\r