Commit graph

876 commits

Author SHA1 Message Date
hinto-janaiyo
d63f7a04e9 v1.0.1 2022-12-31 10:03:52 -05:00
hinto-janaiyo
166eda0abb main: update absolute paths before starting processes
Some situations won't update the path and so starting processes
didn't do anything and failed, this makes sure we have a valid
path before starting.
2022-12-30 19:29:30 -05:00
hinto-janaiyo
cfbe054560 Status Submenu: Add [Status/P2Pool] UI and data 2022-12-30 19:22:43 -05:00
hinto-janaiyo
b4253550ac Status Submenu: add Unix [750] perms for Gupax data folder 2022-12-30 09:39:03 -05:00
hinto-janaiyo
25d9dda7ea main: properly show "Okay|Panic" after initial disk error
When Gupax can't read disk files at startup, it will [Error],
with an option to reset the state file, the user is given two
options [Yes] or [No].

Gupax's global error screen system ignores new errors from
overriding the current IF the current is a [Panic]. This makes
sure the worst errors stay on screen.

This also means after clicking [Yes], it will get ignored and the
screen won't change. So, allow for certain buttons to pass through.

I should probably re-make this whole global error screen system,
it's pretty much a global variable anyone can mutate randomly.
2022-12-29 17:23:49 -05:00
hinto-janaiyo
aa3733c0a7 Status Submenu: add basic [PayoutView] GUI <-> API UI 2022-12-29 17:03:29 -05:00
hinto-janaiyo
c086e815ec Submenu Status: clean up types, funcs, etc
General cleanup and optimizations. Some functions are fixed,
some were turned into [const fn], and other small stuff like
[AtomicUnit] using a [u64] instead of a [u128]
2022-12-29 12:12:12 -05:00
hinto-janaiyo
f6472367ac Submenu Status: make regex more precise 2022-12-28 22:46:52 -05:00
hinto-janaiyo
c1e3a674f4 Status Submenu: add macros!()
Writing [a.lock().unwrap().b.lock().unwrap()] sucks, so these are
some macros that are for common situations. This commit also has
a [sed] replace on all previous code that _could_ have been a macro,
which they all are now.

Hopefully nothing breaks :D
2022-12-28 22:03:45 -05:00
hinto-janaiyo
fca5801ef0 Status Submenu: separate [Regex], [AtomicUnit], [PayoutOrd]
This fixes some funcs, tests and separates some structs into separate files.
2022-12-28 16:04:26 -05:00
hinto-janaiyo
1a780226d3 Status Submenu: add [PayoutOrd] parse & update from log 2022-12-27 19:47:36 -05:00
hinto-janaiyo
34d9e0f61b Status Submenu: add [PayoutOrd] struct, impl, tests 2022-12-27 17:27:10 -05:00
hinto-janaiyo
4eba2c7b83 Status Submenu: add submenu UI to [Status] tab 2022-12-27 16:29:12 -05:00
hinto-janaiyo
9b0215dba8 Status Submenu: add [AtomicUnit] to [helper.rs] 2022-12-27 16:28:43 -05:00
hinto-janaiyo
454096cc18 Status Submenu: add [Status] to [disk::State] 2022-12-27 12:58:46 -05:00
hinto-janaiyo
28a68bd746 Status Submenu: add [user_p2pool_percent] & [user_monero_percent]
user_p2pool_percent = The percent of hashrate the user accounts for
relative to all of P2Pool's hashrate.

user_monero_percent = The percent of hashrate the user accounts for
relative to all of Monero's hashrate.
2022-12-27 11:15:14 -05:00
hinto-janaiyo
78964153ed Status Submenu: add new API reads in P2Pool watchdog loop
This adds all necessary functions/conversions/serde/tests for the
new APIs. It also includes the actual reads inside the watchdog loop.

Every loop, [tick] will increment by 1. At [60], the watchdog
will attempt to read and parse the [network] & [pool] APIs.
Since the loop is [900ms], this means this will occur around
every 54 seconds. [tick] gets reset upon successful read/parsing.
2022-12-27 09:38:02 -05:00
hinto-janaiyo
260f5edd96 Status Submenu: add [GupaxP2poolApi] to [disk.rs], add to [App] 2022-12-26 17:37:45 -05:00
hinto-janaiyo
9dc021cee7 Status Submenu: add tests for p2pool api serde 2022-12-26 14:22:05 -05:00
hinto-janaiyo
55df699a68 Status Submenu: separate [Human*] from helper into [human.rs] 2022-12-26 14:02:27 -05:00
hinto-janaiyo
e389385da6 Status Submenu: add serde for p2pools [local/network/pool] API 2022-12-26 13:59:03 -05:00
hinto-janaiyo
cb297989d7 Status Submenu: fix [Result] collision with [std::result::Result]
monerod's json-rpc response field is [result],
which collides with Rust's [Result], oops.
2022-12-25 13:30:27 -05:00
hinto-janaiyo
f492acb437 Status Submenu: add matching structs for monerod's [get_info] 2022-12-25 11:22:31 -05:00
hinto-janaiyo
e52d0ef7e0 update: be more lenient on new binary filename match
Instead of a single "true" filename when walking dirs searching
for the newly downloaded (Gupax|P2Pool|XMRig), allow for multiple
valid names as long as they _seem_ correct AND are files, e.g:

GUPAX|Gupax|gupax (.exe)
P2POOL|P2Pool|P2pool|p2pool (.exe)
XMRIG|XMRig|Xmrig|xmrig (.exe)

If the packaging naming schemes change for any of these,
the update code will be able to actually handle it.
2022-12-24 10:44:12 -05:00
hinto-janaiyo
e9790ec437 readme: add local monero node guide 2022-12-23 23:42:58 -05:00
hinto-janaiyo
daca770a96 status: enable p2pool/xmrig "Image" stats
These couldn't be fit in before since there wasn't enough space.
They still can't all fit in, but the most important ones can be
after adjusting the font sizes and height spacing.
2022-12-23 14:06:25 -05:00
hinto-janaiyo
590a2ef82d p2pool/xmrig: red/green [Start] on errors with solution in tooltip 2022-12-23 11:41:43 -05:00
hinto-janaiyo
e08ec6b776 main: add more info to debug screen 2022-12-23 09:44:20 -05:00
hinto-janaiyo
ef131546e4 app: change max frame size to 4k (3840×2160)
If the user fullscreens, restricting to the 4:3 aspect ratio
doesn't make sense, so change the test for only the default/min.

Max is 4k since... who owns 8k monitors :D
2022-12-22 22:21:05 -05:00
hinto-janaiyo
e91405abbd p2pool: fix custom node selection sometimes using old values 2022-12-22 22:00:57 -05:00
hinto-janaiyo
b9f253359e gupax: rearrange [Advanced] UI, add underscored labels 2022-12-22 21:57:49 -05:00
hinto-janaiyo
014cd19d83 status: show 7 floating point for p2pool stats 2022-12-22 21:55:28 -05:00
hinto-janaiyo
36a1a4ca4d macos: warn user if gupax is in [/private] directory
macOS moves "dangerous" applications into a read-only [/private]
filesystem. This messes up with the updater and default P2Pool and
XMRig paths.

If [/private] is detected, show a panic screen upon Gupax startup
telling the user to move it to [/Applications]. This _seems_ to
make macOS relax a little (after an arbitrary amount of time...)
2022-12-22 11:56:25 -05:00
hinto-janaiyo
8bea2a4b47 prepare v1.0.1 2022-12-21 11:06:11 -05:00
hinto-janaiyo
bc5bec875c v1.0.0
Includes some small fixes:

- [localhost] will always be changed to [127.0.0.1] in the case
  of XMRig (it doesn't understand localhost by itself)

- P2Pool/XMRig API path now checks for a [/] or [\]
  and correctly applies the endpoint, e.g:
  BASEPATH = "/home/hinto/p2pool"
  ENDPOINT = "local/stats"
  if BASEPATH doesn't end with '/' { BASEPATH.push('/') }
  API_PATH = BASEPATH + ENDPOINT ("/home/hinto/p2pool/local/stats")

- P2Pool payout line got changed in: be18ad4177
  The regex is now a more generic: [payout of [0-9].[0-9]+ XMR]
2022-12-19 18:54:46 -05:00
hinto-janaiyo
2d4a62aa01 main: add [d] debug info screen 2022-12-19 00:00:06 -05:00
hinto-janaiyo
9c6043ea2e helper: reset [Pub*Api] if restarting process 2022-12-18 20:47:23 -05:00
hinto-janaiyo
57fcc8fdeb Update [/external] 2022-12-18 13:57:50 -05:00
hinto-janaiyo
8f39a3238f helper: fix p2pool's api combine, add #[test], add [debug!()] 2022-12-18 12:15:42 -05:00
hinto-janaiyo
ea394429fc linux: add [--features distro] build flag 2022-12-18 10:22:32 -05:00
hinto-janaiyo
aa4f179dc2 helper: add [HumanTime] & [HumanNumber] #[test]s 2022-12-17 20:51:50 -05:00
hinto-janaiyo
83a7dab570 Add #[test]s, fix [State::merge()], fix [quit_twice] 2022-12-17 17:18:06 -05:00
hinto-janaiyo
c18cbd2f4f add [License] to README.md 2022-12-17 14:12:04 -05:00
hinto-janaiyo
682cb3f71a main: fix [About] spacing 2022-12-17 13:42:04 -05:00
hinto-janaiyo
9881b5bf31 update: misc cleanups 2022-12-17 13:35:13 -05:00
hinto-janaiyo
e3df61b53e main: quit if [ALT+F4] on [ask_before_quit], add [save_before_quit]
If user clicked the [X] or [ALT+F4] while on the [ask_before_quit]
screen, it'll actually exit now.

The [save_before_quit] option actually... saves before quitting now.
No cloning since we're exiting and no [ErrorState] setting on errors.
The console logs will show if a save error happens.
2022-12-17 11:00:32 -05:00
hinto-janaiyo
9128ed7181 helper: fix GUI log reset message 2022-12-17 09:52:33 -05:00
hinto-janaiyo
c2935c00c1 p2pool: add [Select random node] and [<- Last] & [Next ->] UI 2022-12-16 23:19:33 -05:00
hinto-janaiyo
e0ca8c1e1b disk: fix serializing quotes in strings 2022-12-16 22:38:46 -05:00
hinto-janaiyo
bc9a6fc34d disk: handle some [.unwrap()]s correctly 2022-12-16 19:16:16 -05:00