This commit is contained in:
Akhil Gupta
2022-04-26 11:54:59 +05:30
8 changed files with 9 additions and 4 deletions

View File

@@ -8,7 +8,7 @@
</a> --> </a> -->
<h1 align="center" style="margin-bottom:0">Hammond</h1> <h1 align="center" style="margin-bottom:0">Hammond</h1>
<p align="center">Current Version - 2021.08.13</p> <p align="center">Current Version - 2021.09.20</p>
<p align="center"> <p align="center">
A self-hosted vehicle expense tracking system with support for multiple users. A self-hosted vehicle expense tracking system with support for multiple users.

View File

@@ -4,7 +4,7 @@ services:
image: akhilrex/hammond image: akhilrex/hammond
container_name: hammond container_name: hammond
environment: environment:
- JWT_SECRET = somethingverystrong - JWT_SECRET=somethingverystrong
volumes: volumes:
- /path/to/config:/config - /path/to/config:/config
- /path/to/data:/assets - /path/to/data:/assets

View File

@@ -64,7 +64,7 @@ type UpdateExpenseRequest struct {
type CreateExpenseRequest struct { type CreateExpenseRequest struct {
VehicleID string `form:"vehicleId" json:"vehicleId" binding:"required"` VehicleID string `form:"vehicleId" json:"vehicleId" binding:"required"`
Amount float32 `form:"amount" json:"amount" binding:"required"` Amount float32 `form:"amount" json:"amount"`
OdoReading int `form:"odoReading" json:"odoReading"` OdoReading int `form:"odoReading" json:"odoReading"`
Comments string `form:"comments" json:"comments" ` Comments string `form:"comments" json:"comments" `

View File

@@ -1,6 +1,7 @@
package service package service
import ( import (
"sort"
"time" "time"
"github.com/akhilrex/hammond/db" "github.com/akhilrex/hammond/db"
@@ -15,6 +16,9 @@ func GetMileageByVehicleId(vehicleId string, since time.Time) (mileage []models.
fillups := make([]db.Fillup, len(*data)) fillups := make([]db.Fillup, len(*data))
copy(fillups, *data) copy(fillups, *data)
sort.Slice(fillups, func(i, j int) bool {
return fillups[i].OdoReading > fillups[j].OdoReading
})
var mileages []models.MileageModel var mileages []models.MileageModel

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

After

Width:  |  Height:  |  Size: 895 B

View File

@@ -5,6 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" /> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="shortcut icon" href="<%= webpackConfig.output.publicPath %>hammond.png" /> <link rel="shortcut icon" href="<%= webpackConfig.output.publicPath %>hammond.png" />
<link rel="apple-touch-icon" href="<%= webpackConfig.output.publicPath %>touch-icon.png" />
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
</head> </head>
<body> <body>

BIN
ui/public/touch-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -181,7 +181,7 @@ export default {
<table class="table is-hoverable"> <table class="table is-hoverable">
<tr> <tr>
<td>Current Version</td> <td>Current Version</td>
<td>2021.08.13</td> <td>2021.09.20</td>
</tr> </tr>
<tr> <tr>
<td>Website</td> <td>Website</td>