Skip to content

Commit

Permalink
Stacking UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pzanna committed May 7, 2017
1 parent a1a2eff commit edfb8b6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
2 changes: 0 additions & 2 deletions ZodiacFX/src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,6 @@ void command_config(char *command, char *param1, char *param2, char *param3)
} else {
printf(" Force OpenFlow version: Disabled\r\n");
}
if (masterselect == true) printf(" Stacking Select: SLAVE\r\n");
if (masterselect == false) printf(" Stacking Select: MASTER\r\n");
if (stackenabled == true) printf(" Stacking Status: Enabled\r\n");
if (stackenabled == false) printf(" Stacking Status: Disabled\r\n");
if (Zodiac_Config.ethtype_filter == 1) printf(" EtherType Filtering: Enabled\r\n");
Expand Down
22 changes: 20 additions & 2 deletions ZodiacFX/src/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ static bool restart_required = false; // Track if any configuration changes are
static bool file_upload = false; // Multi-part firmware file upload flag
static bool post_pending = false;

extern bool stackenabled;

static err_t http_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err);
static err_t http_accept(void *arg, struct tcp_pcb *pcb, err_t err);
void http_send(char *buffer, struct tcp_pcb *pcb, bool out);
Expand Down Expand Up @@ -2083,6 +2085,8 @@ static uint8_t interfaceCreate_Home(void)
int hr = (totaltime/2)/3600;
int t = (totaltime/2)%3600;
int min = t/60;



sprintf(shared_buffer, http_header);

Expand All @@ -2094,7 +2098,7 @@ static uint8_t interfaceCreate_Home(void)
"<style>"\
);
snprintf(shared_buffer+strlen(shared_buffer), SHARED_BUFFER_LEN-strlen(shared_buffer), html_style_body);
if( snprintf(shared_buffer+strlen(shared_buffer), SHARED_BUFFER_LEN-strlen(shared_buffer),\
snprintf(shared_buffer+strlen(shared_buffer), SHARED_BUFFER_LEN-strlen(shared_buffer),\
"</style>"\
"</head>"\
"<body>"\
Expand All @@ -2103,7 +2107,21 @@ static uint8_t interfaceCreate_Home(void)
"CPU UID: %d-%d-%d-%d<br>"\
"Firmware Version: %s<br>"\
"CPU Temp: %d C<br>"\
"Uptime: %02d:%02d"\
"Uptime: %02d:%02d<br>"\
);
if(stackenabled == true)
{
snprintf(shared_buffer+strlen(shared_buffer), SHARED_BUFFER_LEN-strlen(shared_buffer),\
"Stacking: enabled"
);
}
else
{
snprintf(shared_buffer+strlen(shared_buffer), SHARED_BUFFER_LEN-strlen(shared_buffer),\
"Stacking: disabled"
);
}
if( snprintf(shared_buffer+strlen(shared_buffer), SHARED_BUFFER_LEN-strlen(shared_buffer),\
"</p>"\
"<form action=\"btn_default\" method=\"post\" onsubmit=\"return confirm('Zodiac FX will be reset to factory settings. Do you wish to proceed?');\">"\
"<button name=\"btn\" value=\"btn_default\">Factory Reset</button>"\
Expand Down

0 comments on commit edfb8b6

Please sign in to comment.