From e2e41697870f8ee71f7c07192450e1a8b486515e Mon Sep 17 00:00:00 2001 From: Alex H Date: Thu, 13 Apr 2023 22:55:09 -0400 Subject: [PATCH] user selects if they track full tank or partial fillup --- ui/src/locales/en.json | 111 +++++++++++++------------ ui/src/router/views/import-generic.vue | 31 +++---- 2 files changed, 74 insertions(+), 68 deletions(-) diff --git a/ui/src/locales/en.json b/ui/src/locales/en.json index f5d4b0a..9e84f4d 100644 --- a/ui/src/locales/en.json +++ b/ui/src/locales/en.json @@ -5,7 +5,7 @@ "thismonth": "This month", "pastxdays": "Past one day | Past {count} days", "pastxmonths": "Past one month | Past {count} months", - "thisyear": "This year", + "thisyear": "This year", "alltime": "All Time", "noattachments": "No Attachments so far", "attachments": "Attachments", @@ -43,15 +43,15 @@ "createnow": "Create Now", "yourvehicles": "Your Vehicles", "menu": { - "quickentries": "Quick Entries", - "logout": "Log out", - "import": "Import", - "home": "Home", - "settings": "Settings", - "admin": "Admin", - "sitesettings": "Site Settings", - "users": "Users", - "login": "Log in" + "quickentries": "Quick Entries", + "logout": "Log out", + "import": "Import", + "home": "Home", + "settings": "Settings", + "admin": "Admin", + "sitesettings": "Site Settings", + "users": "Users", + "login": "Log in" }, "enterusername": "Enter your username", "enterpassword": "Enter your password", @@ -81,34 +81,34 @@ "quantity": "Quantity", "gasstation": "Gas Station", "fuel": { - "petrol": "Petrol", - "diesel": "Diesel", - "cng": "CNG", - "lpg": "LPG", - "electric": "Electric", - "ethanol": "Ethanol" + "petrol": "Petrol", + "diesel": "Diesel", + "cng": "CNG", + "lpg": "LPG", + "electric": "Electric", + "ethanol": "Ethanol" }, "unit": { - "long": { - "litre": "Litre", - "gallon": "Gallon", - "kilowatthour": "Kilowatt Hour", - "kilogram": "Kilogram", - "usgallon": "US Gallon", - "minutes": "Minutes", - "kilometers": "Kilometers", - "miles": "Miles" - }, - "short": { - "litre": "Lt", - "gallon": "Gal", - "kilowatthour": "KwH", - "kilogram": "Kg", - "usgallon": "US Gal", - "minutes": "Mins", - "kilometers": "Km", - "miles": "Mi" - } + "long": { + "litre": "Litre", + "gallon": "Gallon", + "kilowatthour": "Kilowatt Hour", + "kilogram": "Kilogram", + "usgallon": "US Gallon", + "minutes": "Minutes", + "kilometers": "Kilometers", + "miles": "Miles" + }, + "short": { + "litre": "Lt", + "gallon": "Gal", + "kilowatthour": "KwH", + "kilogram": "Kg", + "usgallon": "US Gal", + "minutes": "Mins", + "kilometers": "Km", + "miles": "Mi" + } }, "avgfillupqty": "Avg Fillup Qty", "avgfillupexpense": "Avg Fillup Expense", @@ -117,7 +117,9 @@ "price": "Price", "total": "Total", "fulltank": "Tank Full", + "partialfillup": "Partial Fillup", "getafulltank": "Did you get a full tank?", + "tankpartialfull": "Which do you track?", "by": "By", "expenses": "Expenses", "expensetype": "Expense Type", @@ -182,6 +184,7 @@ "fillingstation": "Filling Station Name", "comments": "Comments", "missfillupbefore": "Did you miss the fillup entry before this one?", + "missedfillup": "Missed Fillup", "fillupdate": "Fillup Date", "fillupsavedsuccessfully": "Fillup Saved Successfully", "expensesavedsuccessfully": "Expense Saved Successfully", @@ -199,25 +202,25 @@ "testconn": "Test Connection", "migrate": "Migrate", "init": { - "migrateclarkson": "Migrate from Clarkson", - "migrateclarksondesc": "If you have an existing Clarkson deployment and you want to migrate your data from that, press the following button.", - "freshinstall": "Fresh Install", - "freshinstalldesc": "If you want a fresh install of Hammond, press the following button.", - "clarkson": { - "desc": "

You need to make sure that this deployment of Hammond can access the MySQL database used by Clarkson.

If that is not directly possible, you can make a copy of that database somewhere accessible from this instance.

Once that is done, enter the connection string to the MySQL instance in the following format.

All the users imported from Clarkson will have their username as their email in Clarkson database and pasword set tohammond

user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local

", - "success": "We have successfully migrated the data from Clarkson. You will be redirected to the login screen shortly where you can login using your existing email and password : hammond" - }, - "fresh": { - "setupadminuser": "Setup Admin Users", - "yourpassword": "Your Password", - "youremail": "Your Email", - "yourname": "Your Name", - "success": "You have been registered successfully. You will be redirected to the login screen shortly where you can login and start using the system." - } + "migrateclarkson": "Migrate from Clarkson", + "migrateclarksondesc": "If you have an existing Clarkson deployment and you want to migrate your data from that, press the following button.", + "freshinstall": "Fresh Install", + "freshinstalldesc": "If you want a fresh install of Hammond, press the following button.", + "clarkson": { + "desc": "

You need to make sure that this deployment of Hammond can access the MySQL database used by Clarkson.

If that is not directly possible, you can make a copy of that database somewhere accessible from this instance.

Once that is done, enter the connection string to the MySQL instance in the following format.

All the users imported from Clarkson will have their username as their email in Clarkson database and pasword set tohammond

user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local

", + "success": "We have successfully migrated the data from Clarkson. You will be redirected to the login screen shortly where you can login using your existing email and password : hammond" + }, + "fresh": { + "setupadminuser": "Setup Admin Users", + "yourpassword": "Your Password", + "youremail": "Your Email", + "yourname": "Your Name", + "success": "You have been registered successfully. You will be redirected to the login screen shortly where you can login and start using the system." + } }, "roles": { - "ADMIN": "ADMIN", - "USER": "USER" + "ADMIN": "ADMIN", + "USER": "USER" }, "profile": "Profile", "processedon": "Processed on", @@ -225,4 +228,4 @@ "disable": "Disable", "confirm": "Go Ahead", "labelforfile": "Label for this file" - } \ No newline at end of file +} \ No newline at end of file diff --git a/ui/src/router/views/import-generic.vue b/ui/src/router/views/import-generic.vue index 3b01d36..8c156cd 100644 --- a/ui/src/router/views/import-generic.vue +++ b/ui/src/router/views/import-generic.vue @@ -14,7 +14,7 @@ export default { user: { type: Object, required: true, - } + }, }, data: function () { return { @@ -38,7 +38,7 @@ export default { fillingStation: null, date: null, fuelSubType: null, - } + }, } }, computed: { @@ -58,7 +58,7 @@ export default { return '' } } - } + }, }, mounted() { this.myVehicles = this.vehicles @@ -76,7 +76,7 @@ export default { Papa.parse(this.file, this.papaConfig) }, importData() { - if (typeof this.fileData[1][this.fillupModel.isTankFull] !== "boolean") { + if (typeof this.fileData[1][this.fillupModel.isTankFull] !== 'boolean') { this.errors.push('The value of Tank Full needs to be a boolean (true,false).') return } @@ -84,11 +84,11 @@ export default { headings: this.fillupModel, data: this.fileData.splice(1, this.fileData.length), fullTankInverted: this.inverted, - vehicleId: this.selectedVehicle.id + vehicleId: this.selectedVehicle.id, } alert(JSON.stringify(content)) }, - } + }, } @@ -109,7 +109,9 @@ export default {
  • {{ $t('importhintvehiclecreated') }}
  • -
  • {{ $t('dontimportagain') }}
  • +
  • {{ $t('dontimportagain') }}
  • @@ -177,8 +179,7 @@ export default { - + - + + {{ $t('fulltank') }} + {{ $t('partialfillup') }} + + - Invert Value - +
    - +

    There was an error logging in to your account.