mirror of
https://github.com/status-im/fathom.git
synced 2025-03-01 03:20:27 +00:00
merge master
This commit is contained in:
commit
2f7f3d7085
13
Makefile
13
Makefile
@ -12,31 +12,30 @@ ENV ?= $(shell export $(cat .env | xargs))
|
||||
all: build
|
||||
|
||||
.PHONY: install
|
||||
install: $(wildcard *.go)
|
||||
install: $(wildcard *.go) $(GOPATH)/bin/packr
|
||||
$(GOPATH)/bin/packr install -v -ldflags '-w $(LDFLAGS)' $(MAIN_PKG)
|
||||
|
||||
.PHONY: build
|
||||
build: $(EXECUTABLE)
|
||||
|
||||
$(EXECUTABLE): $(GO_SOURCES) $(SQL_SOURCES) assets/build $(GOPATH)/bin/packr
|
||||
$(GOPATH)/bin/packr build -v -ldflags '-w $(LDFLAGS)' -o $@ $(MAIN_PKG)
|
||||
$(EXECUTABLE): $(GO_SOURCES) assets/build
|
||||
go build -o $@ $(MAIN_PKG)
|
||||
|
||||
dist: assets/dist build/fathom-linux-amd64
|
||||
|
||||
build/fathom-linux-amd64: $(GOPATH)/bin/packr
|
||||
build/fathom-linux-amd64: $(GOPATH)/bin/packr $(SQL_SOURCES) $(GO_SOURCES) $(JS_SOURCES)
|
||||
GOOS=linux GOARCH=amd64 $(GOPATH)/bin/packr build -v -ldflags '-w $(LDFLAGS)' -o $@ $(MAIN_PKG)
|
||||
|
||||
$(GOPATH)/bin/packr:
|
||||
GOBIN=$(GOPATH)/bin go get github.com/gobuffalo/packr/...
|
||||
|
||||
|
||||
assets/build: $(JS_SOURCES)
|
||||
if [ ! -d "node_modules" ]; then npm install; fi
|
||||
gulp
|
||||
./node_modules/gulp/bin/gulp.js
|
||||
|
||||
assets/dist: $(JS_SOURCES)
|
||||
if [ ! -d "node_modules" ]; then npm install; fi
|
||||
NODE_ENV=production gulp
|
||||
NODE_ENV=production ./node_modules/gulp/bin/gulp.js
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
@ -16,6 +16,7 @@ For getting a development version of Fathom up & running, go through the followi
|
||||
1. Ensure you have [Golang](https://golang.org/doc/install#install) installed properly
|
||||
1. Get code: `git clone git@github.com:usefathom/fathom.git $GOPATH/src/github.com/usefathom/fathom`
|
||||
1. Compile into binary & prepare assets: `make build`
|
||||
1. (Optional) Set your [custom configuration values](https://github.com/usefathom/fathom/wiki/Configuration-file).
|
||||
1. Register your user account: `fathom register --email=<email> --password=<password>`
|
||||
1. Start the webserver: `fathom server` and then visit **http://localhost:8080** to access your analytics dashboard.
|
||||
|
||||
@ -23,7 +24,7 @@ To install and run Fathom in production, [have a look at the installation instru
|
||||
|
||||
#### Tracking snippet
|
||||
|
||||
To start tracking, include the following JavaScript on your site and replace `yourfathom.com` with the URL to your Fathom instance (twice).
|
||||
To start tracking, include the following JavaScript on your site and replace `yourfathom.com` with the URL to your Fathom instance.
|
||||
|
||||
```html
|
||||
<!-- Fathom - simple website analytics - https://github.com/usefathom/fathom -->
|
||||
|
2
assets/src/js/components/Chart.js
vendored
2
assets/src/js/components/Chart.js
vendored
@ -98,7 +98,7 @@ class Chart extends Component {
|
||||
}
|
||||
|
||||
let padding = { top: 12, right: 12, bottom: 24, left: 40 };
|
||||
let height = Math.max( this.base.clientHeight, 240 );
|
||||
let height = 240;
|
||||
let width = this.base.clientWidth;
|
||||
let innerWidth = width - padding.left - padding.right;
|
||||
let innerHeight = height - padding.top - padding.bottom;
|
||||
|
@ -45,19 +45,22 @@ class DatePicker extends Component {
|
||||
let startDate = new Date();
|
||||
startDate.setHours(0);
|
||||
startDate.setMinutes(0);
|
||||
startDate.setSeconds(0);
|
||||
|
||||
let endDate = new Date();
|
||||
endDate.setHours(24);
|
||||
endDate.setMinutes(0);
|
||||
endDate.setHours(23);
|
||||
endDate.setMinutes(59);
|
||||
endDate.setSeconds(59);
|
||||
|
||||
switch(period) {
|
||||
case "week":
|
||||
startDate.setDate(startDate.getDate() - (startDate.getDay() + 6) % 7);
|
||||
endDate.setDate(startDate.getDate() + 7);
|
||||
endDate.setDate(startDate.getDate() + 6);
|
||||
break;
|
||||
case "month":
|
||||
startDate.setDate(1);
|
||||
endDate.setMonth(endDate.getMonth() + 1);
|
||||
endDate.setDate(5); // because every month has date 5... use date-fn here later on
|
||||
endDate.setMonth(startDate.getMonth() + 1);
|
||||
endDate.setDate(0);
|
||||
break;
|
||||
case "year":
|
||||
|
@ -68,8 +68,8 @@ gulp.task('sass', function () {
|
||||
});
|
||||
|
||||
gulp.task('watch', ['default'], function() {
|
||||
gulp.watch(['./assets/js/**/*.js'], ['browserify'] );
|
||||
gulp.watch(['./assets/sass/**/**/*.scss'], ['sass'] );
|
||||
gulp.watch(['./assets/**/*.html'], ['html'] );
|
||||
gulp.watch(['./assets/img/**/*'], ['img'] );
|
||||
gulp.watch(['./assets/src/js/**/*.js'], ['browserify'] );
|
||||
gulp.watch(['./assets/src/sass/**/**/*.scss'], ['sass'] );
|
||||
gulp.watch(['./assets/src/**/*.html'], ['html'] );
|
||||
gulp.watch(['./assets/src/img/**/*'], ['img'] );
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user