Compare commits
1 Commits
feat/curre
...
contributi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acba47fede |
26
README.md
26
README.md
@@ -35,6 +35,7 @@
|
|||||||
- [Built With](#built-with)
|
- [Built With](#built-with)
|
||||||
- [Features](#features)
|
- [Features](#features)
|
||||||
- [Installation](#installation)
|
- [Installation](#installation)
|
||||||
|
- [Contributing](#contributing)
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
- [Roadmap](#roadmap)
|
- [Roadmap](#roadmap)
|
||||||
- [Contact](#contact)
|
- [Contact](#contact)
|
||||||
@@ -157,6 +158,31 @@ Once done you will be taken to the login page.
|
|||||||
|
|
||||||
Go through the settings page once and change relevant settings before you start adding vehicles and expenses.
|
Go through the settings page once and change relevant settings before you start adding vehicles and expenses.
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
### Dev Setup
|
||||||
|
|
||||||
|
If you want to contribute to the project you need to set it up
|
||||||
|
for development first.
|
||||||
|
|
||||||
|
Fork and clone the project. Once you have it on your own machine,
|
||||||
|
open up a terminal and navigate to the `server/` directory.
|
||||||
|
|
||||||
|
In the `server/` directory run the command `go run main.go`.
|
||||||
|
After some initial
|
||||||
|
setup, the server should be listening on at port `3000`.
|
||||||
|
|
||||||
|
Next, open a new terminal. Navigate to the `ui/` directory and run `npm install`.
|
||||||
|
This will install all the dependencies for the frontend.
|
||||||
|
After the command is done running, run `npm run dev`. After some output, the
|
||||||
|
frontend should be accessible at `http://localhost:8080`.
|
||||||
|
|
||||||
|
If you are sent straight to the login screen, try closing the page and opening
|
||||||
|
it again. You should be greeted with a setup wizard the first time you run the
|
||||||
|
project.
|
||||||
|
|
||||||
|
Now, simply follow the instructions in order to set up your fresh install.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
Distributed under the GPL-3.0 License. See `LICENSE` for more information.
|
Distributed under the GPL-3.0 License. See `LICENSE` for more information.
|
||||||
|
|||||||
@@ -21,27 +21,13 @@ export default {
|
|||||||
email: '',
|
email: '',
|
||||||
password: '',
|
password: '',
|
||||||
distanceUnit: 1,
|
distanceUnit: 1,
|
||||||
currency: '',
|
currency: 'INR',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters('auth', ['isInitialized']),
|
...mapGetters('auth', ['isInitialized']),
|
||||||
...mapState('vehicles', ['currencyMasters', 'distanceUnitMasters']),
|
...mapState('vehicles', ['currencyMasters', 'distanceUnitMasters']),
|
||||||
filteredCurrencyMasters() {
|
|
||||||
return this.currencyMasters.filter((option) => {
|
|
||||||
return (
|
|
||||||
option.namePlural
|
|
||||||
.toString()
|
|
||||||
.toLowerCase()
|
|
||||||
.indexOf(this.registerModel.currency.toLowerCase()) >= 0 ||
|
|
||||||
option.code
|
|
||||||
.toString()
|
|
||||||
.toLowerCase()
|
|
||||||
.indexOf(this.registerModel.currency.toLowerCase()) >= 0
|
|
||||||
)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
store.dispatch('vehicles/fetchMasters').then((data) => {})
|
store.dispatch('vehicles/fetchMasters').then((data) => {})
|
||||||
@@ -153,9 +139,6 @@ export default {
|
|||||||
})
|
})
|
||||||
.finally(() => (this.isWorking = false))
|
.finally(() => (this.isWorking = false))
|
||||||
},
|
},
|
||||||
formatCurrency(option) {
|
|
||||||
return `${option.namePlural} (${option.code})`
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -165,10 +148,15 @@ export default {
|
|||||||
<div v-if="!migrationMode" class="box">
|
<div v-if="!migrationMode" class="box">
|
||||||
<h1 class="title">Migrate from Clarkson</h1>
|
<h1 class="title">Migrate from Clarkson</h1>
|
||||||
<p>
|
<p>
|
||||||
If you have an existing Clarkson deployment and you want to migrate your data from that, press the following button.
|
If you have an existing Clarkson deployment and you want to migrate your data from that,
|
||||||
|
press the following button.
|
||||||
</p>
|
</p>
|
||||||
<br />
|
<br />
|
||||||
<b-field> <b-button type="is-primary" @click="migrationMode = 'clarkson'">Migrate from Clarkson</b-button></b-field>
|
<b-field>
|
||||||
|
<b-button type="is-primary" @click="migrationMode = 'clarkson'"
|
||||||
|
>Migrate from Clarkson</b-button
|
||||||
|
></b-field
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!migrationMode" class="box">
|
<div v-if="!migrationMode" class="box">
|
||||||
<h1 class="title">Fresh Install</h1>
|
<h1 class="title">Fresh Install</h1>
|
||||||
@@ -182,12 +170,21 @@ export default {
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="migrationMode === 'clarkson'" class="box content">
|
<div v-if="migrationMode === 'clarkson'" class="box content">
|
||||||
<h1 class="title">Migrate from Clarkson</h1>
|
<h1 class="title">Migrate from Clarkson</h1>
|
||||||
<p>You need to make sure that this deployment of Hammond can access the MySQL database used by Clarkson.</p>
|
|
||||||
<p>If that is not directly possible, you can make a copy of that database somewhere accessible from this instance.</p>
|
|
||||||
<p>Once that is done, enter the connection string to the MySQL instance in the following format.</p>
|
|
||||||
<p
|
<p
|
||||||
>All the users imported from Clarkson will have their username as their email in Clarkson database and pasword set to
|
>You need to make sure that this deployment of Hammond can access the MySQL database used by
|
||||||
<span class="" style="font-weight:bold">hammond</span></p
|
Clarkson.</p
|
||||||
|
>
|
||||||
|
<p
|
||||||
|
>If that is not directly possible, you can make a copy of that database somewhere accessible
|
||||||
|
from this instance.</p
|
||||||
|
>
|
||||||
|
<p
|
||||||
|
>Once that is done, enter the connection string to the MySQL instance in the following
|
||||||
|
format.</p
|
||||||
|
>
|
||||||
|
<p
|
||||||
|
>All the users imported from Clarkson will have their username as their email in Clarkson
|
||||||
|
database and pasword set to <span class="" style="font-weight:bold">hammond</span></p
|
||||||
>
|
>
|
||||||
<code>
|
<code>
|
||||||
user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local
|
user:pass@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local
|
||||||
@@ -203,8 +200,15 @@ export default {
|
|||||||
</b-field>
|
</b-field>
|
||||||
|
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<b-button v-if="!testSuccess" type="is-primary" :disabled="isWorking" @click="testConnection">Test Connection</b-button
|
<b-button
|
||||||
><b-button v-if="testSuccess" type="is-success" :disabled="isWorking" @click="migrate">Migrate</b-button>
|
v-if="!testSuccess"
|
||||||
|
type="is-primary"
|
||||||
|
:disabled="isWorking"
|
||||||
|
@click="testConnection"
|
||||||
|
>Test Connection</b-button
|
||||||
|
><b-button v-if="testSuccess" type="is-success" :disabled="isWorking" @click="migrate"
|
||||||
|
>Migrate</b-button
|
||||||
|
>
|
||||||
<b-button type="is-danger is-light" @click="resetMigrationMode">Cancel</b-button>
|
<b-button type="is-danger is-light" @click="resetMigrationMode">Cancel</b-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -218,22 +222,28 @@ export default {
|
|||||||
<b-input v-model="registerModel.email" type="email" required></b-input>
|
<b-input v-model="registerModel.email" type="email" required></b-input>
|
||||||
</b-field>
|
</b-field>
|
||||||
<b-field label="Your Password">
|
<b-field label="Your Password">
|
||||||
<b-input v-model="registerModel.password" type="password" required minlength="8" password-reveal></b-input>
|
<b-input
|
||||||
|
v-model="registerModel.password"
|
||||||
|
type="password"
|
||||||
|
required
|
||||||
|
minlength="8"
|
||||||
|
password-reveal
|
||||||
|
></b-input>
|
||||||
</b-field>
|
</b-field>
|
||||||
<b-field label="Currency">
|
<b-field label="Currency">
|
||||||
<b-autocomplete
|
<b-select v-model="registerModel.currency" placeholder="Currency" required expanded>
|
||||||
v-model="registerModel.currency"
|
<option v-for="option in currencyMasters" :key="option.code" :value="option.code">
|
||||||
:custom-formatter="formatCurrency"
|
{{ `${option.namePlural} (${option.code})` }}
|
||||||
placeholder="Currency"
|
</option>
|
||||||
:data="filteredCurrencyMasters"
|
</b-select>
|
||||||
:keep-first="true"
|
|
||||||
:open-on-focus="true"
|
|
||||||
required
|
|
||||||
@select="(option) => (selected = option)"
|
|
||||||
></b-autocomplete>
|
|
||||||
</b-field>
|
</b-field>
|
||||||
<b-field label="Distance Unit">
|
<b-field label="Distance Unit">
|
||||||
<b-select v-model.number="registerModel.distanceUnit" placeholder="Distance Unit" required expanded>
|
<b-select
|
||||||
|
v-model.number="registerModel.distanceUnit"
|
||||||
|
placeholder="Distance Unit"
|
||||||
|
required
|
||||||
|
expanded
|
||||||
|
>
|
||||||
<option v-for="(option, key) in distanceUnitMasters" :key="key" :value="key">
|
<option v-for="(option, key) in distanceUnitMasters" :key="key" :value="key">
|
||||||
{{ `${option.long} (${option.short})` }}
|
{{ `${option.long} (${option.short})` }}
|
||||||
</option>
|
</option>
|
||||||
|
|||||||
@@ -44,20 +44,6 @@ export default {
|
|||||||
|
|
||||||
return this.changePassModel.new === this.changePassModel.renew
|
return this.changePassModel.new === this.changePassModel.renew
|
||||||
},
|
},
|
||||||
filteredCurrencyMasters() {
|
|
||||||
return this.currencyMasters.filter((option) => {
|
|
||||||
return (
|
|
||||||
option.namePlural
|
|
||||||
.toString()
|
|
||||||
.toLowerCase()
|
|
||||||
.indexOf(this.settingsModel.currency.toLowerCase()) >= 0 ||
|
|
||||||
option.code
|
|
||||||
.toString()
|
|
||||||
.toLowerCase()
|
|
||||||
.indexOf(this.settingsModel.currency.toLowerCase()) >= 0
|
|
||||||
)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changePassword() {
|
changePassword() {
|
||||||
@@ -123,9 +109,6 @@ export default {
|
|||||||
this.tryingToSave = false
|
this.tryingToSave = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
formatCurrency(option) {
|
|
||||||
return `${option.namePlural} (${option.code})`
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -140,16 +123,11 @@ export default {
|
|||||||
These will be used as default values whenever you create a new fillup or expense.
|
These will be used as default values whenever you create a new fillup or expense.
|
||||||
</h1>
|
</h1>
|
||||||
<b-field label="Currency">
|
<b-field label="Currency">
|
||||||
<b-autocomplete
|
<b-select v-model="settingsModel.currency" placeholder="Currency" required expanded>
|
||||||
v-model="settingsModel.currency"
|
<option v-for="option in currencyMasters" :key="option.code" :value="option.code">
|
||||||
:custom-formatter="formatCurrency"
|
{{ `${option.namePlural} (${option.code})` }}
|
||||||
placeholder="Currency"
|
</option>
|
||||||
:data="filteredCurrencyMasters"
|
</b-select>
|
||||||
:keep-first="true"
|
|
||||||
:open-on-focus="true"
|
|
||||||
required
|
|
||||||
@select="(option) => (selected = option)"
|
|
||||||
></b-autocomplete>
|
|
||||||
</b-field>
|
</b-field>
|
||||||
<b-field label="Distance Unit">
|
<b-field label="Distance Unit">
|
||||||
<b-select v-model.number="settingsModel.distanceUnit" placeholder="Distance Unit" required expanded>
|
<b-select v-model.number="settingsModel.distanceUnit" placeholder="Distance Unit" required expanded>
|
||||||
|
|||||||
Reference in New Issue
Block a user