Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
VUE_APP_CLIENT_ID=q2w45itLPXzlApDZyLgsoDGLO3HAArySZeQaQt40
VUE_APP_REDIRECT_URI=https://readerbench.com/authorized
VUE_APP_READERBENCH_API_BASE_URL=https://readerbench.com/api/v2
VUE_APP_READERBENCH_API_LOGIN_URL=${VUE_APP_READERBENCH_API_BASE_URL}/accounts/login/?client_id=${VUE_APP_CLIENT_ID}&redirect_uri=${VUE_APP_REDIRECT_URI}
VUE_APP_READERBENCH_API_LOGOUT_URL=${VUE_APP_READERBENCH_API_BASE_URL}/accounts/logout
VUE_APP_READERBENCH_API_SIGNUP_URL=${VUE_APP_READERBENCH_API_BASE_URL}/accounts/signup/?client_id=${VUE_APP_CLIENT_ID}&redirect_uri=${VUE_APP_REDIRECT_URI}
VUE_APP_READERBENCH_API_TOKEN_ENDPOINT=/oauth2/token/
VUE_APP_READERBENCH_API_USER_DETAILS_ENDPOINT=/users/me
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# readerbench-vue

### Local development

```
Please create a **.env.development.local** or **.env.local** file and overwrite the variables from .env to suit the local environment
```

## Project setup
```
npm install
Expand Down Expand Up @@ -31,4 +37,4 @@ npm run lint
```

### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).
See [Configuration Reference](https://cli.vuejs.org/config/).
8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"core-js": "^3.8.3",
"dotenv": "^16.0.3",
"echarts": "^5.4.0",
"js-sha256": "^0.11.0",
"json-as-xlsx": "^2.5.4",
"lodash": "^4.17.21",
"primeicons": "^6.0.1",
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<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.svg">
<link rel='icon' href="<%= BASE_URL %>favicon.svg?v=2">
<title>ReaderBench</title>
</head>
<body>
Expand Down
586 changes: 352 additions & 234 deletions src/components/partials/Nav.vue

Large diffs are not rendered by default.

37 changes: 25 additions & 12 deletions src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ const routes: Array<RouteRecordRaw> = [
{
path: '/models',
name: 'models',
component: () => import('../views/ModelsView.vue')
component: () => import('../views/ModelsView.vue'),
meta: {
requiresAuth: true,
},
},
{
path: '/services',
Expand All @@ -25,14 +28,9 @@ const routes: Array<RouteRecordRaw> = [
component: () => import('../views/People.vue')
},
{
path: '/login',
name: 'login',
component: () => import('@/views/Login.vue')
},
{
path: '/sign-up',
name: 'sign-up',
component: () => import('@/views/SignUp.vue')
path: '/authorized',
name: 'authorized',
component: () => import('@/views/Authorized.vue')
},
{
path: '/projects',
Expand Down Expand Up @@ -69,21 +67,33 @@ const routes: Array<RouteRecordRaw> = [
path: '/datasets',
name: 'datasets',
component: () => import('@/views/DatasetsView.vue'),
meta: {
requiresAuth: true,
}
},
{
path: '/datasets/:dataset_id',
name: 'dataset',
component: () => import('@/views/DatasetView.vue')
component: () => import('@/views/DatasetView.vue'),
meta: {
requiresAuth: true,
},
},
{
path: '/processing-queue',
name: 'processingqueue',
component: () => import('@/views/ProcessingQueueView.vue'),
meta: {
requiresAuth: true,
},
},
{
path: '/profile',
name: 'userprofileView',
component: () => import('@/views/UserProfileView.vue'),
meta: {
requiresAuth: true,
},
},
{
path: '/services/stt',
Expand All @@ -105,6 +115,9 @@ const routes: Array<RouteRecordRaw> = [
path: '/models/:id/prediction',
name: 'modelpredictionview',
component: () => import('@/views/ModelPredictionView.vue'),
meta: {
requiresAuth: true,
},
}
]

Expand All @@ -115,13 +128,13 @@ const router = createRouter({

router.beforeEach((to, from, next) => {
const route: RouteRecordNormalized = first(to.matched);

if (!isNil(route)) {
if (route.meta.requiresAuth && !auth.isAuthenticated()) {
const location: RouteLocationRaw = {
name: 'login',
name: 'home',
query: {
redirect: encodeURIComponent(to.fullPath),
sessionExpired: 'true'
}
};
return next(location);
Expand Down
Loading