Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e2447648
authored
Jan 01, 2026
by
Szeberényi Imre
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.ik.bme.hu/circle/cloud
parents
4da7b486
27f8bc06
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
120 additions
and
41 deletions
+120
-41
circle/circle/settings/base.py
+0
-1
circle/dashboard/static/dashboard/activity.js
+86
-40
circle/dashboard/static/dashboard/dashboard.js
+34
-0
No files found.
circle/circle/settings/base.py
View file @
e2447648
...
@@ -535,7 +535,6 @@ if get_env_variable('DJANGO_SAML', 'FALSE') == 'TRUE':
...
@@ -535,7 +535,6 @@ if get_env_variable('DJANGO_SAML', 'FALSE') == 'TRUE':
SESSION_EXPIRE_AT_BROWSER_CLOSE
=
True
SESSION_EXPIRE_AT_BROWSER_CLOSE
=
True
LOGIN_REDIRECT_URL
=
"/"
LOGIN_REDIRECT_URL
=
"/"
AGENT_DIR
=
get_env_variable
(
AGENT_DIR
=
get_env_variable
(
...
...
circle/dashboard/static/dashboard/activity.js
View file @
e2447648
...
@@ -27,83 +27,129 @@ $(function() {
...
@@ -27,83 +27,129 @@ $(function() {
return
false
;
return
false
;
});
});
function
initAutocompleteSelect2
(
$root
)
{
$root
.
find
(
'select[data-autocomplete-light-function="select2"]'
).
each
(
function
()
{
var
$el
=
$
(
this
);
// már initelve?
if
(
$el
.
hasClass
(
'select2-hidden-accessible'
))
return
;
var
url
=
$el
.
data
(
'autocomplete-light-url'
);
var
placeholder
=
$el
.
data
(
'placeholder'
)
||
''
;
$el
.
select2
({
dropdownParent
:
$root
,
// bootstrap modal fókusz miatt
width
:
'resolve'
,
placeholder
:
placeholder
,
allowClear
:
true
,
ajax
:
{
url
:
url
,
dataType
:
'json'
,
delay
:
250
,
data
:
function
(
params
)
{
return
{
q
:
params
.
term
,
page
:
params
.
page
||
1
};
},
processResults
:
function
(
data
)
{
// DAL autocomplete view tipikusan már {results: [...], pagination: {more: ...}}
return
data
;
}
},
// data-html="true" miatt: hagyjuk az HTML-t renderelődni
escapeMarkup
:
function
(
m
)
{
return
m
;
}
});
});
}
function
showConfirmationModal
(
data
)
{
// ha valamiért bent maradt egy régi modal, takarítsuk (örökölt kódnál előfordul)
$
(
'#confirmation-modal'
).
remove
();
$
(
'body'
).
append
(
data
);
var
$modal
=
$
(
'#confirmation-modal'
);
$modal
.
modal
(
'show'
);
initAutocompleteSelect2
(
$modal
);
// egyszer fusson csak
$modal
.
one
(
'hidden.bs.modal'
,
function
()
{
$modal
.
remove
();
});
return
$modal
;
}
/* operations */
/* operations */
$
(
'#ops, #vm-details-resources-disk, #vm-details-renew-op, #vm-details-pw-reset, #vm-details-add-interface, .operation-wrapper'
).
on
(
'click'
,
'.operation'
,
function
(
e
)
{
$
(
'#ops, #vm-details-resources-disk, #vm-details-renew-op, #vm-details-pw-reset, #vm-details-add-interface, .operation-wrapper'
)
var
icon
=
$
(
this
).
children
(
"i"
).
addClass
(
'fa-spinner fa-spin'
);
.
on
(
'click'
,
'.operation'
,
function
(
e
)
{
e
.
preventDefault
();
var
$icon
=
$
(
this
).
children
(
"i"
).
addClass
(
'fa-spinner fa-spin'
);
$
.
ajax
({
$
.
ajax
({
type
:
'GET'
,
type
:
'GET'
,
url
:
$
(
this
).
attr
(
'href'
),
url
:
$
(
this
).
attr
(
'href'
),
success
:
function
(
data
)
{
success
:
function
(
data
)
{
icon
.
removeClass
(
"fa-spinner fa-spin"
);
$icon
.
removeClass
(
"fa-spinner fa-spin"
);
$
(
'body'
).
append
(
data
);
$
(
'#confirmation-modal'
).
modal
(
'show'
);
var
$modal
=
showConfirmationModal
(
data
);
$
(
'#confirmation-modal'
).
on
(
'hidden.bs.modal'
,
function
()
{
$
(
'#confirmation-modal'
).
remove
();
});
$
(
'#vm-migrate-node-list li input:checked'
).
closest
(
'li'
).
addClass
(
'panel-primary'
);
// megmaradt a korábbi, specifikus UI tweak
$modal
.
find
(
'#vm-migrate-node-list li input:checked'
).
closest
(
'li'
).
addClass
(
'panel-primary'
);
},
error
:
function
()
{
$icon
.
removeClass
(
"fa-spinner fa-spin"
);
}
}
});
});
e
.
preventDefault
();
});
});
/* if the operation fails show the modal again */
/* if the operation fails show the modal again */
$
(
"body"
).
on
(
"click"
,
"#confirmation-modal #op-form-send"
,
function
()
{
$
(
"body"
).
on
(
"submit"
,
"#confirmation-modal form"
,
function
(
e
)
{
var
url
=
$
(
this
).
closest
(
"form"
).
prop
(
"action"
);
e
.
preventDefault
()
var
$form
=
$
(
this
);
var
url
=
$form
.
attr
(
"action"
);
$
.
ajax
({
$
.
ajax
({
url
:
url
,
url
:
url
,
headers
:
{
"X-CSRFToken"
:
getCookie
(
'csrftoken'
)
},
headers
:
{
"X-CSRFToken"
:
getCookie
(
'csrftoken'
)
},
type
:
'POST'
,
type
:
'POST'
,
data
:
$
(
this
).
closest
(
'form'
)
.
serialize
(),
data
:
$
form
.
serialize
(),
success
:
function
(
data
,
textStatus
,
xhr
)
{
success
:
function
(
data
)
{
/
* hide the modal we just submitted */
/
/ mindig zárjuk le az aktuális modalt
$
(
'#confirmation-modal'
).
modal
(
"hide"
);
$
(
'#confirmation-modal'
).
modal
(
"hide"
);
/* if it was successful trigger a click event on activity, this will
if
(
data
.
success
)
{
* - go to that tab
* - starts refreshing the activity
*/
if
(
data
.
success
)
{
$
(
'a[href="#activity"]'
).
trigger
(
"click"
);
$
(
'a[href="#activity"]'
).
trigger
(
"click"
);
if
(
data
.
with_reload
)
{
// when the activity check stops the page will reload
if
(
data
.
with_reload
)
{
reload_vm_detail
=
true
;
reload_vm_detail
=
true
;
}
}
/* if there are messages display them */
if
(
data
.
messages
&&
data
.
messages
.
length
>
0
)
{
if
(
data
.
messages
&&
data
.
messages
.
length
>
0
)
{
addMessage
(
data
.
messages
.
join
(
"<br />"
),
data
.
success
?
"success"
:
"danger"
);
addMessage
(
data
.
messages
.
join
(
"<br />"
),
data
.
success
?
"success"
:
"danger"
);
}
}
}
}
else
{
else
{
// a bezárás után nyissuk meg az új (hibás) modalt
/* if the post was not successful wait for the modal to disappear
$
(
'#confirmation-modal'
).
one
(
'hidden.bs.modal'
,
function
()
{
* then append the new modal
showConfirmationModal
(
data
);
*/
$
(
'#confirmation-modal'
).
on
(
'hidden.bs.modal'
,
function
()
{
$
(
'body'
).
append
(
data
);
$
(
'#confirmation-modal'
).
modal
(
'show'
);
$
(
'#confirmation-modal'
).
on
(
'hidden.bs.modal'
,
function
()
{
$
(
'#confirmation-modal'
).
remove
();
});
});
});
}
}
},
},
error
:
function
(
xhr
,
textStatus
,
erro
r
)
{
error
:
function
(
xh
r
)
{
$
(
'#confirmation-modal'
).
modal
(
"hide"
);
$
(
'#confirmation-modal'
).
modal
(
"hide"
);
if
(
xhr
.
status
==
500
)
{
if
(
xhr
.
status
==
=
500
)
{
addMessage
(
"500 Internal Server Error"
,
"danger"
);
addMessage
(
"500 Internal Server Error"
,
"danger"
);
}
else
{
}
else
{
addMessage
(
xhr
.
status
+
" Unknown Error"
,
"danger"
);
addMessage
(
xhr
.
status
+
" Unknown Error"
,
"danger"
);
}
}
}
}
});
});
return
false
;
return
false
;
});
});
function
decideActivityRefresh
()
{
function
decideActivityRefresh
()
{
var
check
=
false
;
var
check
=
false
;
/* if something is still spinning */
/* if something is still spinning */
...
...
circle/dashboard/static/dashboard/dashboard.js
View file @
e2447648
...
@@ -29,6 +29,39 @@ $(function () {
...
@@ -29,6 +29,39 @@ $(function () {
return
false
;
return
false
;
});
});
function
initAutocompleteSelect2
(
$root
)
{
$root
.
find
(
'select[data-autocomplete-light-function="select2"]'
).
each
(
function
()
{
var
$el
=
$
(
this
);
// már initelve?
if
(
$el
.
hasClass
(
'select2-hidden-accessible'
))
return
;
var
url
=
$el
.
data
(
'autocomplete-light-url'
);
var
placeholder
=
$el
.
data
(
'placeholder'
)
||
''
;
$el
.
select2
({
dropdownParent
:
$root
,
// bootstrap modal fókusz miatt
width
:
'resolve'
,
placeholder
:
placeholder
,
allowClear
:
true
,
ajax
:
{
url
:
url
,
dataType
:
'json'
,
delay
:
250
,
data
:
function
(
params
)
{
return
{
q
:
params
.
term
,
page
:
params
.
page
||
1
};
},
processResults
:
function
(
data
)
{
// DAL autocomplete view tipikusan már {results: [...], pagination: {more: ...}}
return
data
;
}
},
// data-html="true" miatt: hagyjuk az HTML-t renderelődni
escapeMarkup
:
function
(
m
)
{
return
m
;
}
});
});
}
$
(
'.group-create, .group-import, .group-export, .node-create, .tx-tpl-ownership, .group-delete, .node-delete, .disk-remove, .template-delete, .delete-from-group, .group-remove-all-btn, .lease-delete'
).
click
(
function
(
e
)
{
$
(
'.group-create, .group-import, .group-export, .node-create, .tx-tpl-ownership, .group-delete, .node-delete, .disk-remove, .template-delete, .delete-from-group, .group-remove-all-btn, .lease-delete'
).
click
(
function
(
e
)
{
$
.
ajax
({
$
.
ajax
({
type
:
'GET'
,
type
:
'GET'
,
...
@@ -37,6 +70,7 @@ $(function () {
...
@@ -37,6 +70,7 @@ $(function () {
$
(
'body'
).
append
(
data
);
$
(
'body'
).
append
(
data
);
var
modal
=
$
(
'#confirmation-modal'
);
var
modal
=
$
(
'#confirmation-modal'
);
modal
.
modal
(
'show'
);
modal
.
modal
(
'show'
);
initAutocompleteSelect2
(
modal
);
modal
.
on
(
'hidden.bs.modal'
,
function
()
{
modal
.
on
(
'hidden.bs.modal'
,
function
()
{
modal
.
remove
();
modal
.
remove
();
});
});
...
...
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