Simon Michael
aa47d8ddc9
web: fix add form completions ( fixes #1156 )
...
It seems like show (toJSON "a") used to give "\"a\"" instead of
"String \"a\"". I haven't found the root cause, it's possible
that this fix won't work if built with older libs.
2019-12-27 17:21:50 -08:00
Simon Michael
46d516e7a3
move JSON instances from hledger-web to hledger-lib
2019-12-16 17:17:00 -08:00
Simon Michael
b7bea5698e
web: drop old dependency on json ( #1190 )
2019-12-03 08:41:44 -08:00
Simon Michael
ac5652b7cc
;web: fix redundant import warnings with ghc 8.8
2019-11-29 07:02:52 -08:00
Mykola Orliuk
5287fe671b
;all: hide RawOpts internals
...
This way we can ensure we always use only functions from RawOptions.
2019-11-18 17:38:39 -08:00
Mykola Orliuk
8991419c68
;all: drop dummy decodeRawOpts
2019-11-18 17:38:39 -08:00
Alejandro García Montoro
4efd0242da
web: Modify the --cors option to require a specific origin
...
- Modified the cors option to require a String
- Moved the logic to build the cors policy to WebOptions.hs
- Specify the --cors "*" example in the cors option help
- Added utf8-string dependency to convert a String into a ByteString
2019-10-07 14:54:18 -10:00
Alejandro García Montoro
e96dfe832f
web: Allow CORS to be enabled in hledger-web
...
Add a --cors option to the CLI to enable simple cross-origin requests
2019-10-07 14:54:18 -10:00
Simon Michael
4db14ef70f
;api: another round of hledger-api purging; fix the build
2019-09-11 14:49:22 -07:00
Simon Michael
e70c7123b7
web: ?sidebar= hides the sidebar, like ?sidebar=0
2019-08-17 17:17:30 +01:00
Simon Michael
ef1bd24edc
web: don't disable /add PUT with --serve-api, that's considered API
2019-08-17 17:17:30 +01:00
Simon Michael
a154ea72c0
web: with --serve-api, also disable the header/sidebar HTML
2019-08-17 17:17:30 +01:00
Simon Michael
c3da82043b
web: --serve-api disables server-side UI; startup logging cleanups
2019-08-16 23:55:56 -07:00
Caleb Maclennan
11d9e5eb6a
code: Strip extraneous trailing whitespace from Haskell sources
2019-07-15 16:40:49 +01:00
Simon Michael
6a62bd6437
web, api: update for MarketPrice/PriceDirective change
2019-06-13 15:50:01 -07:00
Simon Michael
adb6ee40eb
lib: clarify price types ( #131 )
...
dropped journalPrices
renamed Price to AmountPrice, AKA "transaction price"
renamed MarketPrice to PriceDirective.
added new MarketPrice (more pure form of PriceDirective without the amount style information)
Prices is now a more efficient data structure, but not used yet.
2019-06-13 15:50:01 -07:00
Henning Thielemann
1fa4419cd1
web: register page: clip linked accounts to 40 characters
...
This was the behaviour before adding the links.
2019-06-13 10:12:44 -07:00
Henning Thielemann
adbdbf002c
web: avoid spaces before commas in register account links
2019-06-13 10:12:44 -07:00
Henning Thielemann
ac96bcfdf0
web: add links to accounts in register transactions
2019-06-13 10:12:44 -07:00
Simon Michael
faf85d91e3
cli: restore --aux-date and --effective as --date2 aliases ( #1034 )
...
These Ledger-ish spellings were dropped over the years, to improve
--help's layout. Now they work again, but are considered hidden flags
so --help doesn't show them automatically (but I decided to mention
them manually in --date2's description).
2019-06-02 08:48:41 -07:00
Simon Michael
7ef3ddd1e6
web: fix build breakage
2019-05-23 22:25:28 -07:00
Simon Michael
20bc386b80
restore TransactionsReport
...
hledger-web's register chart uses it, I didn't see it
because it's called from a hamlet template.
2019-05-23 22:15:40 -07:00
Simon Michael
54c1529638
lib: drop TransactionsReport, BalanceHistoryReport
...
They seem unused.
2019-05-23 21:55:19 -07:00
Simon Michael
7c14e10858
web: /accounts: return all accounts, not just top-level ones ( #985 )
...
Accounts are returned as a flat list, in tree order, with asubs fields
empty.
2019-03-09 15:47:06 -08:00
Simon Michael
92fb24b1af
web: note some Account JSON issues ( #985 )
...
[ci skip]
2019-03-09 15:28:30 -08:00
Simon Michael
16157bc711
lib, web: tweaks to keep building with GHC 7
2019-03-01 15:07:17 -08:00
Jakub Zárybnický
6becbc78f3
cli, web, ui: Replace withJournalDo* variants
2019-03-01 05:42:30 -08:00
Simon Michael
8cf39e55e0
web: more Decimal FromJSON notes
...
[ci skip]
2019-02-21 17:13:47 -08:00
Simon Michael
115643a024
web: silence one more pesky warning
2019-02-20 20:45:09 -08:00
Simon Michael
0bc16d4af6
lib, cli, web: rename porigin -> poriginal
2019-02-20 20:23:54 -08:00
Simon Michael
2dc716cdb4
web: support adding new transactions via JSON PUT ( #316 )
...
A single transaction can be added by PUT to /add.
(I read that PUT, not POST, should be used to create;
perhaps the web add form should also use PUT ?)
As with the web form, the `add` capability is required (and enabled by
default).
Here's how to test with curl:
$ curl -s http://127.0.0.1:5000/add -X PUT -H 'Content-Type: application/json' --data-binary @in.json; echo
New readJsonFile/writeJsonFile helpers in Hledger.Web.Json
are handy for generating test data. Eg:
>>> writeJsonFile "in.json" (head $ jtxns samplejournal)
2019-02-20 20:23:51 -08:00
Simon Michael
b46212ae50
web: better ToJSON instances, new FromJSON instances, utilities ( #316 )
2019-02-20 20:23:45 -08:00
Jakub Zárybnický
861baadb2b
web: Re-add 'balanced transaction' validation to add form
2019-02-20 14:57:04 -08:00
Simon Michael
7e0b74d431
web: fix warnings
2019-02-19 07:29:08 -08:00
Simon Michael
afd7931ca0
web: add the same 6 JSON routes as in hledger-api ( #316 )
2019-02-18 23:57:58 -08:00
Simon Michael
34c43489f8
web: document --capabilities/--capabilities-header, editing
...
[ci skip]
2019-02-18 14:40:14 -08:00
Simon Michael
10b45c75aa
web: fix tooltips showing transactions ( fixes #927 )
2019-02-18 07:55:29 -08:00
Alex Chen
3d2584d869
lib: switch to megaparsec 7
2018-09-30 20:15:12 -06:00
Simon Michael
0f83fb91c1
ui, web: fix build after tests cleanup
2018-09-03 08:43:57 -07:00
Simon Michael
cd67f8ea68
tests: clear out old boilerplate
2018-08-31 18:12:17 -07:00
Simon Michael
d778a92561
tests: export HUnit/EasyTest from Hledger.Utils.Test; more helpers
2018-08-18 15:19:59 +01:00
Simon Michael
1e0a7ec8f1
remove some unneeded CPP pragmas
2018-08-02 08:25:49 +01:00
Jakub Zárybnický
466558968b
web: Fix compilation errors for all 'stack.yaml's
2018-06-25 12:00:18 +02:00
Jakub Zárybnický
8d1ee38627
web: Add missing capability guards to /manage and /download
2018-06-24 23:17:56 +02:00
Jakub Zárybnický
483283ec43
web: Add capabilities guards and conditional widget rendering
2018-06-24 16:25:22 +02:00
Jakub Zárybnický
e8668e2a5c
web: Conform layout to the rest of hledger-* packages
2018-06-24 14:18:06 +02:00
Jakub Zárybnický
9beec88727
web: Move sources to src/ subdirectory
2018-06-24 14:13:04 +02:00
Jakub Zárybnický
50e97e05fd
web: Clean up imports
2018-06-24 14:13:03 +02:00
Simon Michael
6a96683691
web: make --auto and multiple -f options work again
...
I think we lost one or both of these at the time of ecf49b1e .
2018-06-20 00:26:37 -07:00
Simon Michael
061aad0431
remove some CPP that's obsolete since we require base 4.8+
2018-06-04 17:33:21 -07:00
Dmitry Astapov
d82370d10b
lib, app, web: remove differences between command line and journal file aliases
2018-04-17 16:09:11 -07:00
Dmitry Astapov
f6ec26e321
lib, app, web, ui: rename readJournalFile[s]WithOpts to readJournalFile, same for tryReader[s]WithOpts
2018-04-17 15:25:02 -07:00
Dmitry Astapov
37607beaea
lib, app, web: use readJournalFileWithOpts instead of readJournalFile whenever possible
2018-04-17 14:33:32 -07:00
Dmitry Astapov
ecf49b1e4b
lib: auto postings generated before amount inference and balance checks ( #729 )
2018-04-17 14:33:32 -07:00
Simon Michael
f8e781462d
ui, web: use/support new -V, --forecast, --auto
2017-12-29 16:53:37 -08:00
Simon Michael
e5f794d2cb
cli,ui,web: a @FILE argument reads flags & args from FILE, one per line
2017-09-30 06:49:31 -10:00
Simon Michael
fead7c5138
cli, ui, web: make -NUM a shortcut for --depth NUM
2017-09-22 16:14:30 -10:00
Jakub Zárybnický
13a6584440
ui, web: Enable --pivot and --anon in ui and web ( #474 )
2017-09-04 20:45:31 -07:00
Simon Michael
7e896572a7
make --help and -h the same, drop --man and --info for now ( #579 )
2017-07-07 02:08:34 +01:00
Simon Michael
b402fc7e7d
lib: optserror -> usageError, consolidate with other error functions ( #529 )
2017-03-29 08:00:51 -07:00
Simon Michael
1bcc091a44
web: add --host, rename --server to --serve ( #429 )
...
This came up in the context of Docker, but it seems it wasn't possible
for hledger-web to serve remote clients directly (without a proxy)
because of 127.0.0.1 being hardcoded ? Now that can be
changed with --host=IPADDR. The default base url also
uses this address, rather than "localhost" being hardcoded.
Also, the --server flag sounded too close in meaning to --host so
I've renamed it to --serve. The old spelling is still accepted,
at least through the next major release I suppose.
2016-11-21 07:38:58 -08:00
Simon Michael
b7071dee84
lib: use Data.Default directly, not via cmdargs
2016-07-29 10:15:48 -07:00
Simon Michael
739c8dc4cc
web: preserve initial query when journal changes ( #314 )
...
The initial query specified by command line arguments is now preserved
when the journal is reloaded. This does not appear in the web UI, it's
like an invisible extra filter.
2016-04-28 21:48:30 -07:00
Simon Michael
df1040014e
web: exit if an instance is already running ( #226 )
...
Also
- pause for 0.1s before opening the browser, to ensure the app is ready
- don't open a browser if the app fails to start
- terminate the server thread more carefully on exit, may resolve some
lingering background thread issues eg on windows
2016-04-22 11:21:33 -07:00
Simon Michael
42c12fe631
cli, ui, web, api: --info, --man, info & man cmds
2016-04-19 19:21:29 -07:00
Simon Michael
f9362707b6
ui, web, api: fix -h, --help
2016-04-18 16:43:51 -07:00
Simon Michael
b4a72da355
web: fix stack ghci duplicate main error
2016-04-18 15:26:54 -07:00
Simon Michael
6fb76d979f
web: fix typo in "-f -" warning
2016-01-25 09:07:37 -08:00
Simon Michael
09430f09da
web: fix --file-url option ( #285 )
...
Finish the rename begun by 3fb5e25 .
2015-09-28 10:06:36 -10:00
Simon Michael
2c3f1b672e
web: disallow -f- which doesn't work ( fixes #202 )
...
hledger-web -f- gives
[Error#yesod-core] <stdin>: hGetContents: illegal operation (handle is closed)
and I can't see why. Just disallow it.
2015-09-27 08:17:12 -10:00
Simon Michael
3fa3926ee9
web: clarify which libs we are calling to start up
2015-09-27 08:16:30 -10:00
Simon Michael
74512814ec
cli/ui/web: rename X.Options modules to X.XOptions
...
Make these modules' names more like the heavily-used types they
define (CliOpts, UIOpts, WebOpts). This is consistent with
RawOptions and ReportOptions, and helps with code navigation.
2015-08-28 12:43:51 -07:00
Simon Michael
f3dd5eb830
fix options breakage with GHC < 7.10
2015-08-28 11:17:49 -07:00
Simon Michael
2af8d7598e
cli, web: fix options breakage
2015-08-28 10:49:43 -07:00
Simon Michael
0de0f6ab01
group related imports
2015-06-04 09:45:43 -07:00
Simon Michael
bb8918a709
web: fix build breakage from #165 ( fixes #268 )
2015-06-04 09:44:58 -07:00
Simon Michael
83209b862c
tools: fix overuse of -XCPP breaking make test etc.
2015-04-07 19:28:57 -07:00
Simon Michael
ebba1b09f2
web: fix more ghc 7.10 import warnings ( #239 )
2015-04-07 18:49:33 -07:00
Simon Michael
b0d71e3ccc
web: declare a bunch of language pragmas
...
Makes the code more declarative, and makes building without cabal easier.
2015-04-07 18:35:41 -07:00
gwern
d1618aaca8
strip trailing whitespace from all Haskell files
2014-10-14 18:48:24 -07:00
Simon Michael
f30deee197
web: fix compilation after recent lib changes
2014-07-03 09:37:02 -07:00
Simon Michael
702f900ec0
web: fix warnings
2014-05-23 09:02:20 -07:00
Ryan Desfosses
b60da51386
made the following changes to resolve deprecated warnings:
...
replaced hamletToRepHtml with giveUrlRenderer
updated type RepHtml to Html
replaced settingsPort with setPort
2014-05-21 07:30:54 -04:00
Simon Michael
e6a1339370
cli: options help polish
2014-05-01 07:22:44 -07:00
Simon Michael
3fb5e25fd4
web: rename --static-root to --file-url
2014-04-30 08:48:23 -07:00
Simon Michael
a9c83f0ce1
web: add Peter Simons' patch fixing Data.Conduit.Network HostIPv4 error ( #171 )
...
(cherry picked from commit 993cae3a74eaa42b720fe51744e5459fd5a4eaa9)
Conflicts:
hledger-web/Hledger/Web/Main.hs
2014-04-17 12:35:42 -07:00
Xinruo Sun
0275485bf9
web: add a --static-root option to customize static files root
2013-12-15 12:20:07 +08:00
Simon Michael
02fea186a3
web: fix debug option breakage in Main
2013-12-08 19:48:51 -08:00
Simon Michael
a66a715eeb
command line options API updates, possibly fixing hledger-web build
2013-09-22 22:31:06 -07:00
Simon Michael
080eb866ec
web: clean up language extensions a bit, make autoweb works again
2013-06-04 18:23:55 -07:00
Simon Michael
c744451dfa
web: loosen "starting web browser" message for servers
2013-06-01 11:40:00 -07:00
Simon Michael
8873ffbe77
web: fix auto-exit in local mode, clarify startup messages
2013-05-01 12:02:47 -07:00
Simon Michael
c9b6dd8819
web: --server flag re-enables long-running, request-logging mode; output cleanups
2013-05-01 07:23:59 -07:00
Simon Michael
0a47715b17
web: also launch a browser at startup; auto-terminate after 2m or on enter
...
We're now using the wai-handler-launch middleware. This injects a
script in each page that pings the server repeatedly, and terminates
the server if it gets no pings (ie there are no browser tabs
displaying the app) for two minutes. The server can also be easily
terminated at the console by pressing enter, yesod devel style.
2013-04-20 20:02:50 -07:00
Simon Michael
0a77eba02e
web: try using wai-launch-handler.. not working yet
2013-04-20 10:03:15 -07:00
Simon Michael
d5e575c862
web: remove io-storage
2013-04-09 12:53:21 -07:00
Simon Michael
0df4a235af
web: set up journal for yesod devel, store it in App ( fixes #101 )
...
The web app's journal state is now kept in the yesod App as an IORef,
instead of using io-storage.
yesod devel now works; it uses the journal file specified by
$LEDGER_FILE, or ~/.hledger.journal.
web: update journal state handling, fix yesod devel - WIP
2013-04-09 12:41:22 -07:00
Simon Michael
3d33673b25
web: obey command-line query options at startup again
2012-11-15 17:53:10 +00:00
Simon Michael
cfbd8bb956
web: update for yesod 1.1.3
...
Build with latest yesod. Also reorganise to conform more closely with
yesod's standard scaffold layout to reduce upgrade effort.
2012-11-15 17:48:48 +00:00
Simon Michael
f441bbd946
web: add missing CPP pragma
2012-10-13 14:57:42 +00:00