-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stanislav Kotykhin
committed
Jun 11, 2021
0 parents
commit 1029b16
Showing
16 changed files
with
12,609 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
.DS_Store | ||
node_modules | ||
/dist | ||
|
||
|
||
# local env files | ||
.env.local | ||
.env.*.local | ||
|
||
# Log files | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# anti-plagiat | ||
|
||
## Project setup | ||
``` | ||
npm install | ||
``` | ||
|
||
### Compiles and hot-reloads for development | ||
``` | ||
npm run serve | ||
``` | ||
|
||
### Compiles and minifies for production | ||
``` | ||
npm run build | ||
``` | ||
|
||
### Lints and fixes files | ||
``` | ||
npm run lint | ||
``` | ||
|
||
### Customize configuration | ||
See [Configuration Reference](https://cli.vuejs.org/config/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
presets: [ | ||
'@vue/cli-plugin-babel/preset' | ||
] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "anti-plagiat", | ||
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"serve": "vue-cli-service serve", | ||
"build": "vue-cli-service build", | ||
"lint": "vue-cli-service lint" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.21.1", | ||
"core-js": "^3.6.5", | ||
"vue": "^2.6.11", | ||
"vue-axios": "^3.2.4", | ||
"vuetify": "^2.4.0" | ||
}, | ||
"devDependencies": { | ||
"@vue/cli-plugin-babel": "~4.5.0", | ||
"@vue/cli-plugin-eslint": "~4.5.0", | ||
"@vue/cli-service": "~4.5.0", | ||
"babel-eslint": "^10.1.0", | ||
"eslint": "^6.7.2", | ||
"eslint-plugin-vue": "^6.2.2", | ||
"sass": "^1.32.0", | ||
"sass-loader": "^10.0.0", | ||
"vue-cli-plugin-vuetify": "~2.4.0", | ||
"vue-template-compiler": "^2.6.11", | ||
"vuetify-loader": "^1.7.0" | ||
}, | ||
"eslintConfig": { | ||
"root": true, | ||
"env": { | ||
"node": true | ||
}, | ||
"extends": [ | ||
"plugin:vue/essential", | ||
"eslint:recommended" | ||
], | ||
"parserOptions": { | ||
"parser": "babel-eslint" | ||
}, | ||
"rules": {} | ||
}, | ||
"browserslist": [ | ||
"> 1%", | ||
"last 2 versions", | ||
"not dead" | ||
] | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> | ||
<title><%= htmlWebpackPlugin.options.title %></title> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css"> | ||
</head> | ||
<body> | ||
<noscript> | ||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> | ||
</noscript> | ||
<div id="app"></div> | ||
<!-- built files will be auto injected --> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<template> | ||
<v-app> | ||
<v-app-bar | ||
app | ||
color="primary" | ||
dark | ||
> | ||
<div class="d-flex align-center"> | ||
<h1>AntiPlagiat</h1> | ||
</div> | ||
</v-app-bar> | ||
<v-main > | ||
<Home/> | ||
</v-main> | ||
</v-app> | ||
</template> | ||
|
||
<script> | ||
import Home from './components/Home'; | ||
export default { | ||
name: 'App', | ||
components: { | ||
Home, | ||
}, | ||
}; | ||
</script> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<div class="my-4 ma-0 text-md-center"> | ||
<div class="text-h4 primary--text darken-2">Uniqueness</div> | ||
<div class="body-1 my-4"> | ||
<strong>Percent: </strong> {{ conclusion.percent }} % | ||
</div> | ||
<div class="body-1 my-4"> | ||
<strong>Time spent: </strong> {{ conclusion.time }} sec | ||
</div> | ||
<div class="body-1 my-4"> | ||
<strong>Conclusion: </strong> {{ conclusion.conclusion }} | ||
</div> | ||
|
||
<v-btn @click="$emit('checkMore')">Check more</v-btn> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: "CheckResults", | ||
props: { | ||
conclusion: {}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
<template> | ||
<v-container class="mt-5"> | ||
<v-row v-if="!isChecked"> | ||
<v-col cols="6"> | ||
<div class="text-subtitle-1 mr-2">Choose texts language:</div> | ||
<v-btn-toggle v-model="form.language" :disabled="isLoading"> | ||
<v-btn :value="languages[0].value"> | ||
<div>{{ languages[0].text }}</div> | ||
</v-btn> | ||
<v-btn :value="languages[1].value"> | ||
<div>{{ languages[1].text }}</div> | ||
</v-btn> | ||
<v-btn :value="languages[2].value"> | ||
<div>{{ languages[2].text }}</div> | ||
</v-btn> | ||
</v-btn-toggle> | ||
</v-col> | ||
<v-col cols="6"> | ||
<div class="text-subtitle-1 mr-2">Choose texts topic:</div> | ||
<v-combobox | ||
solo | ||
v-model="form.topic" | ||
:items="topics" | ||
:disabled="isLoading" | ||
></v-combobox> | ||
</v-col> | ||
</v-row> | ||
<TextChecker | ||
@checkTexts="checkTexts" | ||
:isLoading="isLoading" | ||
v-if="!isChecked" | ||
transition="fade-transition" | ||
/> | ||
<CheckResults | ||
:conclusion="conclusion" | ||
v-else | ||
transition="fade-transition" | ||
@checkMore="reset" | ||
/> | ||
</v-container> | ||
</template> | ||
|
||
<script> | ||
import TextChecker from "@/components/TextChecker"; | ||
import CheckResults from "@/components/CheckResults"; | ||
export default { | ||
name: "Home", | ||
data: () => ({ | ||
form: { | ||
topic: "", | ||
language: "eng", | ||
}, | ||
topics: [ | ||
{ | ||
text: "topic1", | ||
value: "topic1", | ||
}, | ||
{ | ||
text: "topic2", | ||
value: "topic2", | ||
}, | ||
{ | ||
text: "topic3", | ||
value: "topic3", | ||
}, | ||
{ | ||
text: "topic4", | ||
value: "topic4", | ||
}, | ||
], | ||
languages: [ | ||
{ | ||
text: "Ukrainian", | ||
value: "ukr", | ||
}, | ||
{ | ||
text: "English", | ||
value: "eng", | ||
}, | ||
{ | ||
text: "Russian", | ||
value: "rus", | ||
}, | ||
], | ||
isLoading: false, | ||
isChecked: false, | ||
conclusion: { | ||
percent: 0, | ||
time: 0, | ||
conclusion: "yess", | ||
}, | ||
}), | ||
methods: { | ||
checkTexts(tex1, tex2) { | ||
this.form.text1 = tex1; | ||
this.form.text2 = tex2; | ||
this.isLoading = true; | ||
console.log(this.form); | ||
return this.axios | ||
.post("http://127.0.0.1:8000/check", this.form) | ||
.then((response) => { | ||
console.log(response.data); | ||
//parse answer from api | ||
this.conclusion.percent = response.data.percent; | ||
this.conclusion.time = response.data.time; | ||
this.conclusion.conclusion = response.data.conclusion; | ||
this.isChecked = true; | ||
}) | ||
.catch((err) => { | ||
console.log(err); | ||
}) | ||
.finally(() => { | ||
this.isLoading = false; | ||
this.isChecked = true; | ||
}); | ||
}, | ||
initTopics() { | ||
this.isLoading = true; | ||
return this.axios | ||
.get("http://127.0.0.1:8000/topics/" + this.form.language) | ||
.then((response) => { | ||
console.log(response.data); | ||
this.topics = response.data.message; | ||
}) | ||
.catch((err) => { | ||
console.log(err); | ||
}) | ||
.finally(() => { | ||
this.isLoading = false; | ||
}); | ||
}, | ||
reset() { | ||
this.isChecked = false; | ||
}, | ||
}, | ||
mounted() { | ||
this.initTopics(); //uncomment for loading topics on load | ||
}, | ||
watch: { | ||
"form.language": { | ||
handler() { | ||
this.initTopics(); | ||
}, | ||
deep: true, | ||
}, | ||
}, | ||
components: { | ||
CheckResults, | ||
TextChecker, | ||
}, | ||
}; | ||
</script> |
Oops, something went wrong.