Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hold Afstand
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
EXSYS2021
da6
Hold Afstand
Commits
cc004989
Commit
cc004989
authored
3 years ago
by
Anders B. Clausen
Browse files
Options
Downloads
Patches
Plain Diff
Extracted sendServerRequest out of 'Home' module
parent
7564d104
No related branches found
No related tags found
2 merge requests
!29
Release of Prototype
,
!12
Added Docker-compose with Python server and nginx - working. /persistence/...
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
website/studerende-dk/src/views/Home.vue
+12
-12
12 additions, 12 deletions
website/studerende-dk/src/views/Home.vue
with
12 additions
and
12 deletions
website/studerende-dk/src/views/Home.vue
+
12
−
12
View file @
cc004989
...
...
@@ -29,6 +29,16 @@ import Feed from "@/components/blocks/Feed";
import
Mail
from
"
@/components/blocks/Mail
"
;
import
Calendar
from
"
@/components/blocks/Calendar
"
;
let
sendServerRequest
=
(
type
,
payload
)
=>
{
const
xhr
=
new
XMLHttpRequest
();
const
url
=
"
/persistence
"
;
xhr
.
open
(
"
GET
"
,
url
+
"
?type=
"
+
type
+
"
&
"
+
payload
);
xhr
.
send
();
return
xhr
;
}
export
default
{
name
:
'
Home
'
,
...
...
@@ -71,21 +81,11 @@ export default {
this
[
side
].
splice
(
row
,
1
);
},
sendServerRequest
(
type
,
payload
)
{
const
xhr
=
new
XMLHttpRequest
();
const
url
=
"
/persistence
"
;
xhr
.
open
(
"
GET
"
,
url
+
"
?type=
"
+
type
+
"
&
"
+
payload
);
xhr
.
send
();
return
xhr
;
},
saveLayout
(
id
)
{
const
type
=
"
save
"
const
payload
=
"
id=
"
+
id
+
"
&
"
+
"
data=
"
+
JSON
.
stringify
(
this
.
$data
);
const
request
=
this
.
sendServerRequest
(
type
,
payload
);
const
request
=
sendServerRequest
(
type
,
payload
);
request
.
onload
=
()
=>
{
const
response
=
request
.
response
;
console
.
log
(
response
);
...
...
@@ -96,7 +96,7 @@ export default {
const
type
=
"
load
"
const
payload
=
"
id=
"
+
id
;
const
request
=
this
.
sendServerRequest
(
type
,
payload
);
const
request
=
sendServerRequest
(
type
,
payload
);
request
.
onload
=
()
=>
{
const
response
=
request
.
response
;
Object
.
assign
(
this
.
$data
,
JSON
.
parse
(
response
));
...
...
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