Skip to content

Commit

Permalink
YEAR BUG FIXED in MRTG-poller !!!!
Browse files Browse the repository at this point in the history
  • Loading branch information
harp077 committed May 4, 2023
1 parent a6aa341 commit 63f7973
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<dependency>
<groupId>org.snmp4j</groupId>
<artifactId>snmp4j</artifactId>
<version>2.8.14</version>
<version>2.8.18</version>
</dependency>
<!--
<dependency>
Expand Down Expand Up @@ -78,7 +78,7 @@
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.8.0</version>
<version>3.9.0</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/my/harp07/PjFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class PjFrame extends javax.swing.JFrame {
public static String currentLAF = "com.jtattoo.plaf.mint.MintLookAndFeel";
public static String currentTheme = "lib/themes/Default.theme";
public static List<String> tinyTemes = new ArrayList<>();
public static String zagolovok = "Pure Java Network Tools, v1.0.83, build 07-11-2022";
public static String zagolovok = "Pure Java Network Tools, v1.0.84, build 04-05-2023";

public PjFrame() {
initComponents();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/jrobin/mrtg/MrtgConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public interface MrtgConstants {
int POOL_CAPACITY = 100;

// graph dimensions
int GRAPH_WIDTH = 502, GRAPH_HEIGHT = 234;
int GRAPH_WIDTH = 512, GRAPH_HEIGHT = 244;

// should we remove a RRD file if link is removed from the client
boolean REMOVE_RRD_FOR_DEACTIVATED_LINK = true;
Expand Down Expand Up @@ -183,12 +183,12 @@ public interface MrtgConstants {
+ " <area> \n"
+ " <datasource>out8</datasource> \n"
+ " <color>#00FF00</color> \n"
+ " <legend>output traffic</legend> \n"
+ " <legend> : output traffic@l</legend> \n"
+ " </area> \n"
+ " <line> \n"
+ " <datasource>in8</datasource> \n"
+ " <color>#0000FF</color> \n"
+ " <legend>input traffic@l</legend> \n"
+ " <legend> : input traffic@l</legend> \n"
+ " </line> \n"
+ " <gprint> \n"
+ " <datasource>out8</datasource> \n"
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/org/jrobin/mrtg/client/GraphFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public class GraphFrame extends JFrame {
//TYPE_YEARLY = 5,
TYPE_CUSTOM = 6;

static int START_YEAR = 2022, END_YEAR = 2032;
// YEAR BUG FIXED !!!!
static int START_YEAR = Year.now().getValue() - 1; //2022;
static int END_YEAR = Year.now().getValue() + 1;//2032;

static Dimension GRAPH_SIZE = new Dimension(680, 480);

Expand Down Expand Up @@ -445,7 +447,8 @@ private GregorianCalendar getDate(boolean isEnd) {
int hour = hourCombo.getSelectedIndex();
int day = dayCombo.getSelectedIndex() + 1;
int month = monthCombo.getSelectedIndex();
int year = yearCombo.getSelectedIndex() + START_YEAR;
// YEAR BUG FIXED !!!!
int year = yearCombo.getSelectedIndex() + Year.now().getValue();
//System.out.println(year);
//int year = Year.now().getValue();
//int year = Calendar.getInstance().get(Calendar.YEAR);
Expand All @@ -472,7 +475,8 @@ private void fillYears(JComboBox combo) {
for (int i = START_YEAR; i <= END_YEAR; i++) {
combo.insertItemAt("" + i, i - START_YEAR);
}
combo.setSelectedIndex(0);
// YEAR BUG FIXED !!!!
combo.setSelectedIndex(1);
}

private void fillHours(JComboBox combo) {
Expand Down

0 comments on commit 63f7973

Please sign in to comment.