decred / dcrticketbuyer

An automated smart ticket purchaser.
0 stars 7 forks source link

Add HTTP server user interface #1

Closed cjepson closed 8 years ago

cjepson commented 8 years ago

This adds a new user interface to the client. Specifically, it gives charts that show number of tickets purchased, fees prices, ticket prices, and number of tickets in mempool. A sample configuration file was also added. The HTTP server is turned on by setting the port with --httpsvrport.

jcvernaleo commented 8 years ago

I haven't tested extensively, but at least at first pass both the glide stuff and the web UI seem to be OK.

jolan commented 8 years ago

If we eventually want to package it with the other binaries, it would make sense to embed the external files so no external data is needed.

For javascript:

// License for javascript plugin
<script type="text/javascript">
// paste javascript here
</script>

The decred logo can be base64 encoded:

<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFwAAABQCAYAAACULRIjAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAE8AAABPABGA1izwAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAABLrSURBVHic7Zx5cBzVncc/r+eSfGpkO7J8gSWbwxSHIQfhCEdwIEBiyCZsTgp2l9qqrZAl2VRlk2Jri2VrSXaz7IaFrUCywZwhgMHmMOEwhxdYY4gdDDZorBmNJfmSdV+jmel+b/+Y7pnunu6WZGkkkeTr6urR783x+tu//r3v+733s2hoaHgRuIQ/YSrwoialvBHIT3dP/giQV0rdqKXT6Q+B/57u3vwR4K6WlpYmDUDX9VuAzmnu0B8yOqWUtwCEAPr6+kbi8fgQcMW0dusPF99vaWl5HUDYjKGGhoadwGlj+Qal1KT0RAgx+psm8fcqhYDr2J1Kpc4EDICwrcEQQnxXKbXV75PnrzuXy65ehwIkEqUkUgFKIVEopVCAsv4phVQFi1QUzijyuuSXt9zNUP9QYGc/+eUrWXrqGgwFhhIYhjJfFw5pFOxSgZQgpcCQIBUYEgxZajOK7wGphNmuMHSFNCSGVEhdYRhGyWZYZ2m2lduqDu+guvt93+sQQtxkkQ1ODwdg5cqVm4QQ670IiMai3P3EnSysW1AkuHhWEkWB4LKz7X2GUuhS8Mqml3n43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YhTMKMIBBgcHbwfavdqEEFQnnkLqOtLIU70vcPdUeyaTuX1KOz8GTLssdGNoaChfU1NzQAjxFbu9OKHJDZIPz0Hra6XqyDtB/6XGDW1tbRMqgKoExvb/ZUwDGhoaXgMcM1BL7hnhOeiGjsj2+y0Mv5ZMJi+cnp4HY8aFFAtBNaAhfZCIMexXsTDhWspKYsYSHlQDanm1nWwbJlxLWUnMWMLBvwY0INc9KbWUlcSMGzTt8KsBBV/SJ6WWspKY0R4OwTWgLkxaLWUlMaM9HPxrQN2YzFrKSmLGykI3Ghoangc+59P8QiqVunQq+3OsmPEhxYJXDaiJSa+lrCQ+MoQ3NzfvBX7h0XSP2faRwEeGcCivAa1ULWUl8ZEivL29vVsIUdyeJoS4tb29vXs6+zRefKQIB0cNaMVqKf8EFxoaGi5vbGz8/HT341jw/3dL3XzkB47GAAAAAElFTkSuQmCC">

Then the webui directory can default to ~/.dcrticketbuyer/webui and the csv files can be written there.

jcvernaleo commented 8 years ago

@jolan not having the webui folder would be nice for my build/package script but maybe @cjepson should get the basic webui in as is and then do those changes as a seperate PR.

cjepson commented 8 years ago

Yeah, I thought about jamming this into Golang as constants but thought it seemed ugly. Normally the browser would cache the libs and images too, which I'm not sure will happen if they're directly written to the HTML files. I'll think about it. For now it's good to go in.

jcvernaleo commented 8 years ago

@cjepson cool, I'll merge and open an issue for us to consider some form of consolidating those files.