diff options
author | James Moger <james.moger@gitblit.com> | 2012-11-29 17:25:35 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2012-11-29 17:25:35 -0500 |
commit | 6e991161d6d4db5aeda66c2d99d469d5069180bc (patch) | |
tree | f5a2e4f0918d384c1742bcaeccb6b1d13452e0b3 | |
parent | 86a9855288ef73380a5de613a45052bb7cda7a0a (diff) | |
download | gitblit-6e991161d6d4db5aeda66c2d99d469d5069180bc.tar.gz gitblit-6e991161d6d4db5aeda66c2d99d469d5069180bc.zip |
View Log button for GCA
-rw-r--r-- | build.xml | 1 | ||||
-rw-r--r-- | resources/script_16x16.png | bin | 0 -> 626 bytes | |||
-rw-r--r-- | src/com/gitblit/authority/GitblitAuthority.java | 20 |
3 files changed, 21 insertions, 0 deletions
@@ -767,6 +767,7 @@ <resource file="${basedir}/resources/settings_32x32.png" />
<resource file="${basedir}/resources/search-icon.png" />
<resource file="${basedir}/resources/mail_16x16.png" />
+ <resource file="${basedir}/resources/script_16x16.png" />
<resource file="${basedir}/resources/blank.png" />
<resource file="${basedir}/resources/bullet_green.png" />
<resource file="${basedir}/resources/bullet_orange.png" />
diff --git a/resources/script_16x16.png b/resources/script_16x16.png Binary files differnew file mode 100644 index 00000000..ec93a22f --- /dev/null +++ b/resources/script_16x16.png diff --git a/src/com/gitblit/authority/GitblitAuthority.java b/src/com/gitblit/authority/GitblitAuthority.java index 5ee6af59..ed942e58 100644 --- a/src/com/gitblit/authority/GitblitAuthority.java +++ b/src/com/gitblit/authority/GitblitAuthority.java @@ -67,6 +67,7 @@ import javax.swing.JPasswordField; import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
import javax.swing.JTable;
+import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.RowFilter;
import javax.swing.SwingConstants;
@@ -92,6 +93,7 @@ import com.gitblit.client.HeaderPanel; import com.gitblit.client.Translation;
import com.gitblit.models.UserModel;
import com.gitblit.utils.ArrayUtils;
+import com.gitblit.utils.FileUtils;
import com.gitblit.utils.StringUtils;
import com.gitblit.utils.TimeUtils;
import com.gitblit.utils.X509Utils;
@@ -681,6 +683,23 @@ public class GitblitAuthority extends JFrame implements X509Log { }
});
+ JButton logButton = new JButton(new ImageIcon(getClass().getResource("/script_16x16.png")));
+ logButton.setFocusable(false);
+ logButton.setToolTipText(Translation.get("gb.log"));
+ logButton.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ File log = new File(folder, X509Utils.CERTS + File.separator + "log.txt");
+ if (log.exists()) {
+ String content = FileUtils.readContent(log, "\n");
+ JTextArea textarea = new JTextArea(content);
+ JScrollPane scrollPane = new JScrollPane(textarea);
+ scrollPane.setPreferredSize(new Dimension(700, 400));
+ JOptionPane.showMessageDialog(GitblitAuthority.this, scrollPane, log.getAbsolutePath(), JOptionPane.INFORMATION_MESSAGE);
+ }
+ }
+ });
+
final JTextField filterTextfield = new JTextField(15);
filterTextfield.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@@ -697,6 +716,7 @@ public class GitblitAuthority extends JFrame implements X509Log { buttonControls.add(certificateDefaultsButton);
buttonControls.add(newSSLCertificate);
buttonControls.add(emailBundle);
+ buttonControls.add(logButton);
JPanel userControls = new JPanel(new FlowLayout(FlowLayout.RIGHT, Utils.MARGIN, Utils.MARGIN));
userControls.add(new JLabel(Translation.get("gb.filter")));
|