webui: expose pool port

This commit is contained in:
Jethro Grassie 2018-08-18 09:32:29 -04:00
parent 538994b2d0
commit 6600567377
No known key found for this signature in database
GPG Key ID: DE8ED755616565BB
4 changed files with 9 additions and 0 deletions

View File

@ -2424,6 +2424,7 @@ int main(int argc, char **argv)
uic.port = config.webui_port;
uic.pool_stats = &pool_stats;
uic.pool_fee = config.pool_fee;
uic.pool_port = config.pool_port;
uic.payment_threshold = config.payment_threshold;
start_web_ui(&uic);

View File

@ -26,6 +26,7 @@
<tr><td>Last block found: </td><td>{{LAST_BLOCK_FOUND}}</td></tr>
<tr><td>Payment threshold: </td><td>{{PAYMENT_THRESHOLD}}</td></tr>
<tr><td>Pool fee: </td><td>{{POOL_FEE}}</td></tr>
<tr><td>Pool port: </td><td>{{POOL_PORT}}</td></tr>
<tr><td>Miners connected: </td><td>{{MINERS_CONNECTED}}</td></tr>
<tr class="wallet"><td>Your HR: </td><td>{{MINER_HASHRATE}}</td></tr>
<tr class="wallet"><td>Balance due: </td><td>{{MINER_BALANCE_DUE}}</td></tr>

View File

@ -65,6 +65,7 @@ static char MINER_HASHRATE[] = "{{MINER_HASHRATE}}";
static char POOL_BLOCKS_FOUND[] = "{{POOL_BLOCKS_FOUND}}";
static char PAYMENT_THRESHOLD[] = "{{PAYMENT_THRESHOLD}}";
static char POOL_FEE[] = "{{POOL_FEE}}";
static char POOL_PORT[] = "{{POOL_PORT}}";
static char MINER_BALANCE_DUE[] = "{{MINER_BALANCE_DUE}}";
@ -144,6 +145,11 @@ answer_to_connection (void *cls, struct MHD_Connection *connection,
sprintf(temp, "%.2f", context->pool_fee);
memcpy(p, temp, strlen(temp));
sprintf(temp, "%d", context->pool_port);
p = strstr(page_buffer, POOL_PORT);
memset(p, ' ', strlen(POOL_PORT));
memcpy(p, temp, strlen(temp));
const char *wa = MHD_lookup_connection_value(connection, MHD_COOKIE_KIND, "wa");
if (wa != NULL)
{

View File

@ -49,6 +49,7 @@ typedef struct wui_context_t
pool_stats_t *pool_stats;
float pool_fee;
float payment_threshold;
uint32_t pool_port;
} wui_context_t;
int start_web_ui(wui_context_t *context);