Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE3
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
5
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
bdb49d44
authored
Aug 17, 2022
by
Karsa Zoltán István
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
8a65e8d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
47 deletions
+46
-47
circle/dashboard/static/dashboard/vm-details.js
+46
-47
No files found.
circle/dashboard/static/dashboard/vm-details.js
View file @
bdb49d44
var
Websock_native
;
// not sure
$
(
function
()
{
var
meta_data
=
ace
.
edit
(
'ace-meta-data'
,
{
if
(
$
(
"#ace-meta-data"
).
length
&&
$
(
"#ace-user-data"
).
length
)
{
var
meta_data
=
ace
.
edit
(
'ace-meta-data'
,
{
mode
:
"ace/mode/yaml"
,
useWorker
:
false
,
selectionStyle
:
"text"
});
var
textarea_meta
=
$
(
'textarea[name="ci_meta_data"]'
);
meta_data
.
getSession
().
setValue
(
textarea_meta
.
val
())
meta_data
.
getSession
().
on
(
"change"
,
function
()
{
textarea_meta
.
val
(
meta_data
.
getSession
().
getValue
());
});
var
user_data
=
ace
.
edit
(
'ace-user-data'
,
{
mode
:
"ace/mode/yaml"
,
useWorker
:
false
,
selectionStyle
:
"text"
});
var
textarea_user
=
$
(
'textarea[name="ci_user_data"]'
);
user_data
.
getSession
().
setValue
(
textarea_user
.
val
())
user_data
.
getSession
().
on
(
"change"
,
function
()
{
textarea_user
.
val
(
user_data
.
getSession
().
getValue
());
});
meta_data
.
session
.
setTabSize
(
4
);
meta_data
.
session
.
setUseSoftTabs
(
true
);
user_data
.
session
.
setTabSize
(
4
);
user_data
.
session
.
setUseSoftTabs
(
true
);
document
.
getElementById
(
'ace-meta-data'
).
style
.
fontSize
=
'14px'
;
document
.
getElementById
(
'ace-user-data'
).
style
.
fontSize
=
'14px'
;
/* */
$
(
'#vm-details-cidata-save'
).
click
(
function
(
e
)
{
$
.
ajax
({
type
:
'POST'
,
url
:
$
(
this
).
parents
(
"form"
).
prop
(
'action'
),
data
:
$
(
'#resource-cidata-form'
).
serialize
(),
success
:
function
(
data
,
textStatus
,
xhr
)
{
if
(
data
.
success
)
{
$
(
'a[href="#activity"]'
).
trigger
(
"click"
);
}
else
{
addMessage
(
data
.
messages
.
join
(
"<br />"
),
"danger"
);
}
$
(
"#vm-details-resources-save i"
).
removeClass
(
'fa-refresh fa-spin'
).
addClass
(
"fa-floppy-o"
);
},
error
:
function
(
xhr
,
textStatus
,
error
)
{
$
(
"#vm-details-resources-save i"
).
removeClass
(
'fa-refresh fa-spin'
).
addClass
(
"fa-floppy-o"
);
if
(
xhr
.
status
==
500
)
{
addMessage
(
"500 Internal Server Error"
,
"danger"
);
}
else
{
addMessage
(
xhr
.
status
+
" Unknown Error"
,
"danger"
);
}
}
var
textarea_meta
=
$
(
'textarea[name="ci_meta_data"]'
);
meta_data
.
getSession
().
setValue
(
textarea_meta
.
val
())
meta_data
.
getSession
().
on
(
"change"
,
function
()
{
textarea_meta
.
val
(
meta_data
.
getSession
().
getValue
());
});
e
.
preventDefault
()
})
var
user_data
=
ace
.
edit
(
'ace-user-data'
,
{
mode
:
"ace/mode/yaml"
,
useWorker
:
false
,
selectionStyle
:
"text"
});
var
textarea_user
=
$
(
'textarea[name="ci_user_data"]'
);
user_data
.
getSession
().
setValue
(
textarea_user
.
val
())
user_data
.
getSession
().
on
(
"change"
,
function
()
{
textarea_user
.
val
(
user_data
.
getSession
().
getValue
());
});
meta_data
.
session
.
setTabSize
(
4
);
meta_data
.
session
.
setUseSoftTabs
(
true
);
user_data
.
session
.
setTabSize
(
4
);
user_data
.
session
.
setUseSoftTabs
(
true
);
document
.
getElementById
(
'ace-meta-data'
).
style
.
fontSize
=
'14px'
;
document
.
getElementById
(
'ace-user-data'
).
style
.
fontSize
=
'14px'
;
/* */
$
(
'#vm-details-cidata-save'
).
click
(
function
(
e
)
{
$
.
ajax
({
type
:
'POST'
,
url
:
$
(
this
).
parents
(
"form"
).
prop
(
'action'
),
data
:
$
(
'#resource-cidata-form'
).
serialize
(),
success
:
function
(
data
,
textStatus
,
xhr
)
{
if
(
data
.
success
)
{
$
(
'a[href="#activity"]'
).
trigger
(
"click"
);
}
else
{
addMessage
(
data
.
messages
.
join
(
"<br />"
),
"danger"
);
}
$
(
"#vm-details-resources-save i"
).
removeClass
(
'fa-refresh fa-spin'
).
addClass
(
"fa-floppy-o"
);
},
error
:
function
(
xhr
,
textStatus
,
error
)
{
$
(
"#vm-details-resources-save i"
).
removeClass
(
'fa-refresh fa-spin'
).
addClass
(
"fa-floppy-o"
);
if
(
xhr
.
status
==
500
)
{
addMessage
(
"500 Internal Server Error"
,
"danger"
);
}
else
{
addMessage
(
xhr
.
status
+
" Unknown Error"
,
"danger"
);
}
}
});
e
.
preventDefault
()
})
}
/* save resources */
$
(
'#vm-details-resources-save'
).
click
(
function
(
e
)
{
var
error
=
false
;
...
...
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