55 Commits

Author SHA1 Message Date
jholdstock
78cf99bc2c webapi: Use input type "search" for ticket hash.
The "search" input type is functionally the same as "text" but has a nice extra property - most browsers will render it with a "Clear" button to wipe the current input.

Also disable spellchecking on this input.
2023-06-27 14:52:24 +01:00
jholdstock
62803147f0 webapi: Rate limit for admin login requests.
Only allow 3 requests per second. Return "429 Too Many Requests" when this rate is exceeded.
2023-03-15 10:45:54 +00:00
Jamie Holdstock
d00ba70f94
vspd: Fix invalid default config log level. (#371)
* vspd: Fix invalid default config log level.

slog.LevelDebug.String() returns "DBG" which is not valid per the config validation rules specified below. Hard-code "debug" instead.

* Update year.
2023-02-24 09:55:25 -05:00
Jamie Holdstock
da1cb8f916
Enable treasury vote choices. (#319)
This allows both tspend and treasury policies to be set by clients on a per-ticket basis. Preferences can be set when initially registering a ticket with `/payfee`, and can be later updated using `/setvotechoices`.

Any requests which alter treasury/tspend policy will be stored in the database using the existing accountability system.

**Note:** This does not include consistency checking, it will need to be added later when dcrwallet has an RPC to retrieve policies in batches.
2022-02-04 14:14:49 -05:00
ukane-philemon
0b78c9c2da Show altsignaddress req/res in admin UI 2022-01-13 12:40:16 +00:00
jholdstock
ab5aa4dd6d Clarify "setaltsig" terminology.
Stardardize "alt sig"/"alt signature"/"alt signing address" terminology to "alternate signing address".
2021-11-16 14:49:13 +00:00
jholdstock
6acc5be10c Add dcrd to VSP status.
This renames "Voting wallet status" to "VSP status" and it now includes the status of the local dcrd instance. This change impacts both the /admin page of the UI, and the response of the /admin/status API endpoint.
2021-11-16 14:33:39 +00:00
jholdstock
6260e4ee5b Add alternate sign address to ticket search result 2021-11-14 11:00:39 +00:00
jholdstock
4ea25ec327 Extract search results to own template.
Reducing the size and nesting of admin.html.
2021-11-14 11:00:39 +00:00
Jamie Holdstock
c1ba46347e
Be more specific about consensus vote choices. (#278)
* Be more specific about consensus vote choices.

Rather than referring to just "Vote choices", refer specifically to "consensus vote choices".

This will be useful when treasury and tspend vote choices are added, and the distinction becomes more important.

* dnldd suggestion.
2021-07-05 09:16:08 -05:00
Jamie Holdstock
36acb8c04a Vertical ticket search form. 2021-06-15 10:18:25 +08:00
Jamie Holdstock
ab5ee2857f Vertical login form and improve error appearance. 2021-06-15 10:18:25 +08:00
Jamie Holdstock
2b7903f7d5 Add database and logout tabs to admin page.
Buttons to logout and download DB backup are now moved into new tabs. Also the database size is displayed in the database tab.
2021-06-15 10:18:25 +08:00
Jamie Holdstock
fd4f2b2dad Add commas for large ticket counts. 2021-06-15 10:18:25 +08:00
Jamie Holdstock
fc131e926d
Refactor gui cache
* Remove static cfg values from GUI cache.

Theres no need for these values to be copied into the cache when templates could simply access the config struct directly.

This also changes the cache accessor so it returns a copy of the cache rather than a pointer, which removes a potential race.

* Rename and move cache.

Cache code was previous in `homepage.go`, but its used in multiple places and not just on the homepage. Its enough code to go into its own dedicated `cache.go`.
2021-06-12 09:54:53 +08:00
Jamie Holdstock
d1a838bf7f Add vspclosedmsg config.
If vspclosed is set to true, the provided message will be displayed on the webpage and returned by the status API endpoint.
2021-06-10 09:45:22 +08:00
Jamie Holdstock
f4adcfeaf0 Add version to bootstrap.css filename. 2021-06-09 21:25:05 +08:00
Jamie Holdstock
b9d4db40e9 Use vspd version as cache buster for .css files.
This will ensure when VSP admins update to a new version of vspd, web visitors will not use cached old .css files.
2021-06-09 21:25:05 +08:00
Jamie Holdstock
9867f78385
Add network proportion to homepage and /vspinfo (and revoked proportion) (#264)
* Add network proportion to homepage and /vspinfo.

Proportion is calculated using the number of tickets  currently registered with the VSP, divided by the total size of the network ticket pool as reported by `getblockheader`.

The value will only ever be an estimate because:

- it's possible for a single ticket to be added to multiple VSPs.
- vspd does not distinguish between immature and live tickets, whereas `getblockheader` only reports live tickets.
- `getblockheader` is reporting the size of the ticket pool as of the previous block, not the current block.

* xaur suggestions

* Show missed ticket %, not just the raw number.
2021-06-08 08:47:07 -05:00
Jamie Holdstock
dad662b0f0 Display fee in DCR rather than atoms. 2021-06-01 07:17:54 +08:00
Jamie Holdstock
c3eeb1eb5c Block explorer link for commitment address 2021-06-01 07:17:54 +08:00
Jamie Holdstock
a1091015ff Split ticket info into ticket, fee and voting info 2021-06-01 07:17:54 +08:00
Jamie Holdstock
2cdc5a74b5 Split admin page into tabs.
Previously the voting wallet status and the ticket search were stacked on top of eachother, making the page very long and awkward to navigate. This introduces tabbed navigation which allows just one to be displayed at a time.
2021-06-01 07:17:54 +08:00
Jamie Holdstock
7edbd02d4e Use proper background color. 2021-06-01 07:17:54 +08:00
Jamie Holdstock
32c5c7a524 Indent JSON on admin screen. 2021-06-01 07:17:54 +08:00
Jamie Holdstock
851d3137e5 Improve voting wallet status aesthetics. 2021-06-01 07:17:54 +08:00
Jamie Holdstock
b050fc3100
Set and display ticket purchase height (#250)
* Ensure purchase height set for confirmed tickets.

* Show purchase height in admin screen.

Only show purchase height when the ticket is confirmed, because if a ticket is not confirmed, its purchase height is not yet known.
2021-05-14 21:19:01 -05:00
jholdstock
3a97c9214b Show formatted date for fee expiry 2021-05-13 12:16:08 +01:00
jholdstock
b5a65a9e78 Add block explorer links to tx hashes and fee addr 2021-05-13 12:16:08 +01:00
Jamie Holdstock
4810802fa9 Make log rotator params configurable.
Maintaining the dafault max log file size of 10MB, but increasing the default number of retained files from 3 to 20.
2021-05-13 02:20:18 +01:00
jholdstock
825a717ca7 Store records of vote choice changes 2020-09-17 16:05:07 +00:00
jholdstock
f2ae9a81ea Dont underline logo on hover 2020-08-31 17:18:30 +00:00
jholdstock
aa790b28aa Fix colspan on wallet status table. 2020-08-07 17:03:27 +00:00
jholdstock
9d503e67ae Wallet consistency checks & setting ticket outcome 2020-07-28 20:09:23 +00:00
jholdstock
5018d45908 base64 encoding for pubkey on homepage 2020-07-15 13:46:59 +00:00
jholdstock
1c351d02ec Add voting wallet status to admin page 2020-07-09 21:01:20 +00:00
jholdstock
8b049204eb Load fonts.css last 2020-06-25 15:46:27 +00:00
degeri
fdc8f22199
Set autocomplete off for tx search (#143) 2020-06-24 11:02:22 +01:00
jholdstock
892e6c5716 Modernize login and admin pages 2020-06-18 20:18:17 +00:00
jholdstock
03a5ef4fd1 Modernize homepage 2020-06-18 20:18:17 +00:00
jholdstock
600cd7bf9b Use modern logo and colours. 2020-06-18 20:18:17 +00:00
Jamie Holdstock
bfeddd25d1 Download db backup from admin page. 2020-06-12 13:35:43 +00:00
jholdstock
2f7c46e5f8 Misc front end improvements.
- Use bootstrap to improve layout.
- Add warning banners for webserver debug mode and vspd closed.

Admin page:
- Replace listing of all tickets with form to search by ticket hash
2020-06-12 13:35:43 +00:00
jholdstock
4f2766352b Improve handling of fee status.
- Fee tx status is now tracked using a dedicated field, with values none/received/broadcast/confirmed/error.
- Fee tx hex and hash are now both set in /payfee. The absense of txhash is no longer used to determine if a fee tx has been broadcast or not.
- setvotechoices can no longer be called before a fee is received.
- Remove `binding:required` from response types. It has no effect on responses, it is only needed on request types which are validated by gin.
2020-06-09 14:17:43 +00:00
jholdstock
b50615bc6f Add very basic admin page. 2020-06-08 15:24:49 +00:00
jholdstock
fc5749545d Reverse order of addtx and importprivkey 2020-06-04 15:04:39 +00:00
jholdstock
2a476d9589 Validate fee config 2020-06-03 12:43:14 +00:00
Jamie Holdstock
1a507badc2
Multi wallet fix (#83)
* Fix min required check

* Remove duplicated host logging on conn errors.

* Show confirmed tickets on homepage.
2020-05-28 15:01:44 +01:00
Jamie Holdstock
6a100811f4
Enable pool closure (#80)
* Enable pool closure.

* Move homepage to its own file

* Docs and rename status>info
2020-05-28 07:07:33 +01:00
Jamie Holdstock
67dece7041
Rename to vspd. (#75) 2020-05-27 15:59:30 +01:00