Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
V
VISPA web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
84
Issues
84
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3pia
VISPA
VISPA web
Commits
5831c1c0
Commit
5831c1c0
authored
Jun 19, 2018
by
Benjamin Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workspace: fixed auto_connect handling
parent
caf19fd5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
20 deletions
+23
-20
vispa/controller/ajax.py
vispa/controller/ajax.py
+10
-0
vispa/static/js/login.js
vispa/static/js/login.js
+0
-3
vispa/static/js/password.js
vispa/static/js/password.js
+0
-5
vispa/static/js/workspace.js
vispa/static/js/workspace.js
+13
-12
No files found.
vispa/controller/ajax.py
View file @
5831c1c0
...
...
@@ -38,6 +38,8 @@ class AjaxController(AbstractController):
cherrypy
.
session
[
"user_id"
]
=
user
.
id
cherrypy
.
session
[
"user_name"
]
=
user
.
name
self
.
autoconnectworkspace
(
user
,
password
)
return
{
"userId"
:
user
.
id
,
"sessionId"
:
cherrypy
.
session
.
id
}
@
cherrypy
.
expose
...
...
@@ -78,6 +80,7 @@ class AjaxController(AbstractController):
if
user
.
active
():
cherrypy
.
session
[
"user_id"
]
=
unicode
(
user
.
id
)
cherrypy
.
session
[
"user_name"
]
=
user
.
name
self
.
autoconnectworkspace
(
user
,
password
)
# json
@
cherrypy
.
expose
...
...
@@ -187,6 +190,13 @@ class AjaxController(AbstractController):
vispa
.
workspace
.
connect
(
workspace
,
user
,
db
,
password
)
def
autoconnectworkspace
(
self
,
user
,
password
):
db
=
cherrypy
.
request
.
db
for
ws
in
Workspace
.
get_user_workspaces
(
db
,
user
):
if
ws
.
auto_connect
:
vispa
.
workspace
.
connect
(
ws
,
user
,
db
,
password
)
@
cherrypy
.
expose
@
cherrypy
.
tools
.
method
(
accept
=
"POST"
)
def
disconnectworkspace
(
self
,
wid
):
...
...
vispa/static/js/login.js
View file @
5831c1c0
...
...
@@ -69,9 +69,6 @@ define([
$
(
"
#login-alert
"
).
fadeIn
(
100
).
render
({
alert
:
err
.
message
});
$
(
"
#login-name
"
).
focus
();
}
else
{
var
d
=
new
Date
();
d
.
setTime
(
d
.
getTime
()
+
60
e3
);
$
.
cookie
(
"
tmpPass
"
,
pass
,
{
expires
:
d
});
window
.
location
.
href
=
self
.
dynamicURL
(
location
.
search
);
}
});
...
...
vispa/static/js/password.js
View file @
5831c1c0
...
...
@@ -72,11 +72,6 @@ define([
},
});
}
else
{
var
d
=
new
Date
();
d
.
setTime
(
d
.
getTime
()
+
30
e3
);
$
.
cookie
(
"
tmpPass
"
,
pass1
,
{
expires
:
d
});
window
.
location
.
href
=
self
.
dynamicURL
(
"
/
"
);
}
});
...
...
vispa/static/js/workspace.js
View file @
5831c1c0
...
...
@@ -68,8 +68,19 @@ define([
id
:
this
.
id
,
};
Vue
.
set
(
this
.
_class
.
_members
.
_vueData
.
workspaces
,
this
.
id
,
this
.
_vueData
);
this
.
_setState
(
config
.
connection_status
||
"
disconnected
"
);
this
.
on
(
"
stateChanged
"
,
function
()
{
if
(
this
.
_passwordDialog
)
{
this
.
_passwordDialog
.
abort
();
}
if
(
this
.
state
===
"
connected
"
)
{
var
m
=
this
.
_class
.
_members
;
if
(
m
.
current
===
null
)
m
.
current
=
this
.
id
;
}
});
this
.
_setState
(
config
.
connection_status
||
"
disconnected
"
);
// create listeners
var
connectWithPass
=
function
(
type
)
{
this
.
emit
(
"
disconnected
"
);
...
...
@@ -90,12 +101,6 @@ define([
this
.
on
(
"
password_required
"
,
connectWithPass
.
bind
(
this
,
"
password
"
));
this
.
on
(
"
passphrase_required
"
,
connectWithPass
.
bind
(
this
,
"
SSH key passphrase
"
));
this
.
on
(
"
stateChanged
"
,
function
()
{
if
(
this
.
_passwordDialog
)
{
this
.
_passwordDialog
.
abort
();
}
});
this
.
on
(
"
connecting
"
,
function
()
{
this
.
_setState
(
"
connecting
"
);
});
...
...
@@ -103,9 +108,6 @@ define([
this
.
on
(
"
connected
"
,
function
()
{
this
.
_setState
(
"
connected
"
);
this
.
_finishConnect
(
null
);
var
m
=
this
.
_class
.
_members
;
if
(
m
.
current
===
null
)
m
.
current
=
this
.
id
;
});
this
.
on
(
"
disconnecting
"
,
function
()
{
...
...
@@ -239,8 +241,7 @@ define([
}
if
(
this
.
_state
==
"
disconnected
"
&&
!
this
.
_passwordDialog
)
{
this
.
_connect
(
password
||
$
.
cookie
(
"
tmpPass
"
)
||
null
);
$
.
removeCookie
(
"
tmpPass
"
);
this
.
_connect
(
password
||
null
);
}
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment