Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPS Observation App DEPRECATED
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPS Observation App DEPRECATED
Commits
37acc12d
Commit
37acc12d
authored
3 years ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Bugfix: VOAPP-89
parent
b48adb56
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/App.vue
+4
-6
4 additions, 6 deletions
src/App.vue
src/components/LoginSystem.vue
+18
-14
18 additions, 14 deletions
src/components/LoginSystem.vue
src/components/Welcome.vue
+2
-3
2 additions, 3 deletions
src/components/Welcome.vue
src/main.js
+4
-2
4 additions, 2 deletions
src/main.js
with
28 additions
and
25 deletions
src/App.vue
+
4
−
6
View file @
37acc12d
...
@@ -43,13 +43,11 @@ export default {
...
@@ -43,13 +43,11 @@ export default {
},
},
methods
:
{
methods
:
{
},
},
mounted
(){
beforeMount
(){
/*let userUUID = localStorage.getItem(CommonUtil.CONST_STORAGE_UUID);
let
userUUID
=
localStorage
.
getItem
(
CommonUtil
.
CONST_STORAGE_UUID
);
console.info("Checking UUID on start: " + userUUID);
this
.
$root
.
sharedState
.
uuid
=
userUUID
;
this.$root.sharedState.uuid = userUUID;*/
}
}
}
}
</
script
>
</
script
>
...
...
This diff is collapsed.
Click to expand it.
src/components/LoginSystem.vue
+
18
−
14
View file @
37acc12d
...
@@ -109,19 +109,19 @@ export default {
...
@@ -109,19 +109,19 @@ export default {
/** Get user details from local storage */
/** Get user details from local storage */
getUserFromStorage
()
{
getUserFromStorage
()
{
let
strUser
=
localStorage
.
getItem
(
CommonUtil
.
CONST_STORAGE_USER_DETAIL
);
let
strUser
=
localStorage
.
getItem
(
CommonUtil
.
CONST_STORAGE_USER_DETAIL
);
if
(
strUser
&&
strUser
!=
'
undefined
'
)
if
(
strUser
&&
strUser
!=
'
undefined
'
)
{
{
let
user
=
JSON
.
parse
(
strUser
);
let
user
=
JSON
.
parse
(
strUser
);
this
.
appUser
=
user
;
//This user will require in Sync process
this
.
appUser
=
user
;
//This user will require in Sync process
this
.
$root
.
sharedState
.
uuid
=
user
.
userUuid
;
this
.
$root
.
sharedState
.
uuid
=
user
.
userUuid
;
this
.
$root
.
sharedState
.
user
.
firstName
=
user
.
firstName
;
this
.
$root
.
sharedState
.
user
.
firstName
=
user
.
firstName
;
this
.
$root
.
sharedState
.
user
.
lastName
=
user
.
lastName
;
this
.
$root
.
sharedState
.
user
.
lastName
=
user
.
lastName
;
this
.
userLoggedInName
=
this
.
$root
.
sharedState
.
user
.
firstName
+
"
"
+
this
.
$root
.
sharedState
.
user
.
lastName
;
this
.
userLoggedInName
=
this
.
$root
.
sharedState
.
user
.
firstName
+
"
"
+
this
.
$root
.
sharedState
.
user
.
lastName
;
}
}
/** Firing event to parent (main.js) */
/** Firing event to parent (main.js) */
//this.$emit(CommonUtil.CONST_EVENT_LOGIN_USER_DETAIL,user.userUuid, user.firstName,user.lastName);
//this.$emit(CommonUtil.CONST_EVENT_LOGIN_USER_DETAIL,user.userUuid, user.firstName,user.lastName);
},
},
/** Check uuid first */
/** Check uuid first */
...
@@ -137,7 +137,7 @@ export default {
...
@@ -137,7 +137,7 @@ export default {
headers
:
jsonHeader
,
headers
:
jsonHeader
,
}).
then
((
response
)
=>
{
}).
then
((
response
)
=>
{
if
(
response
.
status
!=
200
||
response
.
status
!=
201
)
{
if
(
response
.
status
!=
200
&&
response
.
status
!=
201
)
{
this
.
$root
.
sharedState
.
uuid
=
''
;
this
.
$root
.
sharedState
.
uuid
=
''
;
}
else
{
}
else
{
...
@@ -218,6 +218,10 @@ export default {
...
@@ -218,6 +218,10 @@ export default {
// Setting the UUID causes the App.vue component to use observationlist as template
// Setting the UUID causes the App.vue component to use observationlist as template
// So there's no need to navigate manually
// So there's no need to navigate manually
localStorage
.
setItem
(
CommonUtil
.
CONST_STORAGE_UUID
,
uuid
);
localStorage
.
setItem
(
CommonUtil
.
CONST_STORAGE_UUID
,
uuid
);
if
(
this
.
$router
.
currentRoute
.
path
!=
"
/
"
)
{
this
.
$router
.
push
(
'
/
'
)
}
}
}
}
}
);
// END inner fetch
);
// END inner fetch
...
...
This diff is collapsed.
Click to expand it.
src/components/Welcome.vue
+
2
−
3
View file @
37acc12d
...
@@ -44,15 +44,14 @@ export default ({
...
@@ -44,15 +44,14 @@ export default ({
data
()
data
()
{
{
return
{
return
{
isMounted
:
false
,
uuid
:
''
,
}
}
},
},
methods
:
{
methods
:
{
},
},
mounted
()
{
mounted
()
{
this
.
isMounted
=
true
;
//
this.isMounted = true;
//this.uuid = localStorage.getItem(localStorage.removeItem(CommonUtil.CONST_STORAGE_UUID));
//this.uuid = localStorage.getItem(localStorage.removeItem(CommonUtil.CONST_STORAGE_UUID));
//console.log('uuid : '+this.uuid);
//console.log('uuid : '+this.uuid);
...
...
This diff is collapsed.
Click to expand it.
src/main.js
+
4
−
2
View file @
37acc12d
...
@@ -37,16 +37,18 @@ const init = () => {
...
@@ -37,16 +37,18 @@ const init = () => {
},
},
i18n
,
i18n
,
created
()
{
created
()
{
console
.
info
(
"
Vue is ready
"
);
console
.
info
(
"
Vue is ready
"
);
console
.
info
(
"
User's preferred language is
"
+
navigator
.
language
);
console
.
info
(
"
User's preferred language is
"
+
navigator
.
language
);
// Are we logged in already?
}
}
});
});
};
};
/**
/**
*
Hope this works. It's for a
dding router functionality to the menu,
*
A
dding router functionality to the menu,
* which is outside the main app
* which is outside the main app
*/
*/
new
Vue
({
new
Vue
({
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment