Compare commits

..

5 Commits

Author SHA1 Message Date
Corentin Thomasset
85ef199145 1.2.0 2020-06-08 19:13:22 +02:00
Corentin Thomasset
908994acea chore: updated CHANGELOG.md
Signed-off-by: Corentin Thomasset <corentin.thomasset74@gmail.com>
2020-06-08 19:11:50 +02:00
Corentin Thomasset
e7c589a033 feat: can generate multiple uuids
Signed-off-by: Corentin Thomasset <corentin.thomasset74@gmail.com>
2020-06-08 19:10:36 +02:00
Corentin Thomasset
625b43e436 refactor: removed 404 page from tools roadmap
Signed-off-by: Corentin Thomasset <corentin.thomasset74@gmail.com>
2020-06-08 15:05:50 +02:00
dependabot[bot]
a970df5c02 chore(deps): bump websocket-extensions from 0.1.3 to 0.1.4
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-06-08 15:03:58 +02:00
5 changed files with 11 additions and 40 deletions

View File

@@ -3,10 +3,6 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Next
- [fix] [UuidGenerator] added quantity validation rules
- [refactor] better isInt checker
## 1.2.0
- [feat] [UuidGenerator] can generate multiple uuids

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "it-tools",
"version": "1.2.1",
"version": "1.2.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -1,7 +1,7 @@
{
"name": "it-tools",
"description": "",
"version": "1.2.1",
"version": "1.2.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",

View File

@@ -3,18 +3,8 @@
<v-card-title>Uuid v4 generator</v-card-title>
<v-card-text>
<v-text-field
outlined
v-model="quantity"
ref="quantity"
type="number"
label="Quantity"
dense
class="quantity"
:rules="rules.quantity"
/>
<v-textarea outlined v-model="token" class="centered-input" :rows="quantity <= 10 ? quantity : 10"
readonly/>
<v-text-field outlined v-model="quantity" type="number" label="Quantity" dense class="quantity"/>
<v-textarea outlined v-model="token" class="centered-input" :rows="quantity <= 10 ? quantity : 10" readonly/>
<div class="text-center">
<v-btn @click="refreshBool = !refreshBool" depressed class="mr-4">Refresh</v-btn>
@@ -25,7 +15,7 @@
</template>
<script>
import {copyToClipboard, isInt} from "../../utils/helpers";
import {copyToClipboard} from "../../utils/helpers";
const noop = () => {
};
@@ -36,19 +26,8 @@
name: "UuidGenerator",
data: () => ({
refreshBool: true,
quantity: 1,
rules: {
quantity: [
v => !!v || 'Quantity is required',
v => (v > 0 && v <= 50 ) || 'Quantity should be > 0 and <= 50',
v => isInt(v) || 'Quantity should be an integer'
]
},
isMounted:false
quantity: 1
}),
mounted() {
this.isMounted = true;
},
methods: {
copyToken() {
copyToClipboard(this.token);
@@ -57,25 +36,21 @@
},
computed: {
token() {
if (this.isMounted && this.$refs.quantity.validate()) {
if (this.refreshBool) noop(); // To force recomputation
if (this.refreshBool) noop(); // To force recomputation
return Array.from({length: this.quantity}, generateUuid).join('\n');
} else {
return '';
}
return Array.from({length: this.quantity}, generateUuid).join('\n');
}
}
}
</script>
<style scoped lang="less">
.quantity {
.quantity{
width: 100px;
margin: auto;
text-align: center;
::v-deep input {
::v-deep input{
text-align: center;
}
}

View File

@@ -25,7 +25,7 @@ const formatBytes = (bytes, decimals = 2) => {
}
const isInt = (value) => {
return Number.isInteger(value);
return !isNaN(value) && ((x) => (x | 0) === x)(parseFloat(value))
}
export {