Commit 87cf344b by Kálmán Viktor

dashboard: check for resource/disk perms in vm tour

skip steps if the user doesn't have any
parent 542ebeb1
...@@ -53,7 +53,7 @@ function get_steps() { ...@@ -53,7 +53,7 @@ function get_steps() {
steps = [ steps = [
{ {
element: document.querySelector("#vm-details-start-template-tour"), element: document.querySelector("#vm-details-start-template-tour"),
intro: "<p>" + gettext("Welcome to the template tutorial. In this quick tour, we gonna show you how to do the steps described above.") + "</p>" + intro: "<p>" + gettext("Welcome to the template tutorial. In this quick tour, we are going to show you how to do the steps described above.") + "</p>" +
"<p>" + gettext('For the next tour step press the "Next" button or the right arrow (or "Back" button/left arrow for the previous step).') + "</p>" "<p>" + gettext('For the next tour step press the "Next" button or the right arrow (or "Back" button/left arrow for the previous step).') + "</p>"
}, },
{ {
...@@ -70,8 +70,12 @@ function get_steps() { ...@@ -70,8 +70,12 @@ function get_steps() {
}, },
{ {
element: document.querySelector('a[href="#resources"]'), element: document.querySelector('a[href="#resources"]'),
intro: gettext("On the resources tab you can edit the CPU/RAM options and add/remove disks."), intro: gettext("On the resources tab you can edit the CPU/RAM options and add/remove disks if you have required permissions."),
}, }
];
if($("#vm-details-resources-save").length) {
steps.push(
{ {
element: document.querySelector('#vm-details-resources-form'), element: document.querySelector('#vm-details-resources-form'),
intro: '<p><strong>' + gettext("CPU priority") + ":</strong> " + intro: '<p><strong>' + gettext("CPU priority") + ":</strong> " +
...@@ -81,12 +85,21 @@ function get_steps() { ...@@ -81,12 +85,21 @@ function get_steps() {
"<p><strong>" + gettext("RAM amount") + ":</strong> " + "<p><strong>" + gettext("RAM amount") + ":</strong> " +
gettext("amount of RAM.") + "</p>", gettext("amount of RAM.") + "</p>",
position: "top", position: "top",
}, }
);
}
if($(".operation-create_disk").length || $(".operation-download_disk").length) {
steps.push(
{ {
element: document.querySelector('#vm-details-resources-disk'), element: document.querySelector('#vm-details-resources-disk'),
intro: gettext("You can add empty disks, download new ones and remove existing ones here."), intro: gettext("You can add empty disks, download new ones and remove existing ones here."),
position: "top", position: "top",
}, }
);
}
steps.push(
{ {
element: document.querySelector('a[href="#network"]'), element: document.querySelector('a[href="#network"]'),
intro: gettext('You can add new network interfaces or remove existing ones here.'), intro: gettext('You can add new network interfaces or remove existing ones here.'),
...@@ -110,7 +123,7 @@ function get_steps() { ...@@ -110,7 +123,7 @@ function get_steps() {
{ {
element: document.querySelector(".alert-new-template"), element: document.querySelector(".alert-new-template"),
intro: gettext("This is the last message, if something is not clear you can do the the tour again."), intro: gettext("This is the last message, if something is not clear you can do the the tour again."),
}, }
]; );
return steps; return steps;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment