mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 02:47:36 -02:30
Cleans up feature set for 3.3
This removes the experimental features that were not selected for 3.3 release. * Removes dpath requirement * Removes generated action_plugins * Removes network UI v1 api * Removes unused network management commands * Removes network UI CLI client * Removes templates * Removes unused DataBinding models * Removes obsolete test * Removes unused admin and tests * Removes experimental UndoPersistence, RedoPersistence, and auto-layout functions * Removes API endpoints for network visualization * Removes unused consumer routes * Removes group, site, and rack features for 3.3 * Removes unused tables controller * Removes undo/redo * Removes group code and scale checks
This commit is contained in:
@@ -447,287 +447,6 @@ ContextMenuButton.prototype.is_selected = function (x, y) {
|
||||
};
|
||||
|
||||
|
||||
function Group(id, name, type, x1, y1, x2, y2, selected) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.x1 = x1;
|
||||
this.y1 = y1;
|
||||
this.x2 = x2;
|
||||
this.y2 = y2;
|
||||
this.selected = selected;
|
||||
this.moving = false;
|
||||
this.highlighted = false;
|
||||
this.fsm = null;
|
||||
this.selected_corner = null;
|
||||
this.devices = [];
|
||||
this.links = [];
|
||||
this.groups = [];
|
||||
this.streams = [];
|
||||
this.group_id = 0;
|
||||
this.icon_size = type === 'site' ? 500 : 100;
|
||||
this.template = false;
|
||||
this.variables = {};
|
||||
this.sequences = {};
|
||||
}
|
||||
exports.Group = Group;
|
||||
|
||||
Group.prototype.compile_variables = function () {
|
||||
|
||||
var variables = JSON.parse(JSON.stringify(this.variables));
|
||||
return variables;
|
||||
};
|
||||
|
||||
Group.prototype.toJSON = function () {
|
||||
|
||||
return {id: this.id,
|
||||
name: this.name,
|
||||
type: this.type,
|
||||
x1: this.x1,
|
||||
y1: this.y1,
|
||||
x2: this.x2,
|
||||
y2: this.y2,
|
||||
devices: this.devices,
|
||||
links: this.links,
|
||||
streams: this.streams,
|
||||
groups: this.groups};
|
||||
};
|
||||
|
||||
|
||||
Group.prototype.update_hightlighted = function (x, y) {
|
||||
|
||||
this.highlighted = this.is_highlighted(x, y);
|
||||
};
|
||||
|
||||
Group.prototype.is_highlighted = function (x, y) {
|
||||
|
||||
return (x > this.left_extent() &&
|
||||
x < this.right_extent() &&
|
||||
y > this.top_extent() &&
|
||||
y < this.bottom_extent());
|
||||
|
||||
};
|
||||
|
||||
Group.prototype.is_icon_selected = function (x, y) {
|
||||
|
||||
return ((x > this.left_extent() &&
|
||||
x < this.right_extent() &&
|
||||
y > this.top_extent() &&
|
||||
y < this.bottom_extent()) ||
|
||||
(x > this.centerX() - this.icon_size &&
|
||||
x < this.centerX() + this.icon_size &&
|
||||
y > this.centerY() - this.icon_size &&
|
||||
y < this.centerY() + this.icon_size));
|
||||
|
||||
};
|
||||
|
||||
var TOP_LEFT = 0;
|
||||
exports.TOP_LEFT = TOP_LEFT;
|
||||
var TOP_RIGHT = 1;
|
||||
exports.TOP_RIGHT = TOP_RIGHT;
|
||||
var BOTTOM_LEFT = 2;
|
||||
exports.BOTTOM_LEFT = BOTTOM_LEFT;
|
||||
var BOTTOM_RIGHT = 3;
|
||||
exports.BOTTOM_RIGHT = BOTTOM_RIGHT;
|
||||
|
||||
Group.prototype.has_corner_selected = function (x, y) {
|
||||
|
||||
if (x > this.left_extent() &&
|
||||
x < this.left_extent() + 10 &&
|
||||
y > this.top_extent() &&
|
||||
y < this.top_extent() + 10) {
|
||||
return true;
|
||||
}
|
||||
if (x > this.left_extent() &&
|
||||
x < this.left_extent() + 10 &&
|
||||
y > this.bottom_extent() - 10 &&
|
||||
y < this.bottom_extent()) {
|
||||
return true;
|
||||
}
|
||||
if (x > this.right_extent() - 10 &&
|
||||
x < this.right_extent() &&
|
||||
y > this.bottom_extent() - 10 &&
|
||||
y < this.bottom_extent()) {
|
||||
return true;
|
||||
}
|
||||
if (x > this.right_extent() - 10 &&
|
||||
x < this.right_extent() &&
|
||||
y > this.top_extent() &&
|
||||
y < this.top_extent() + 10) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
Group.prototype.select_corner = function (x, y) {
|
||||
|
||||
var corners = [[util.distance(this.x1, this.y1, x, y), TOP_LEFT],
|
||||
[util.distance(this.x2, this.y2, x, y), BOTTOM_RIGHT],
|
||||
[util.distance(this.x1, this.y2, x, y), BOTTOM_LEFT],
|
||||
[util.distance(this.x2, this.y1, x, y), TOP_RIGHT]];
|
||||
|
||||
corners.sort(function(a, b) {
|
||||
return a[0] - b[0];
|
||||
});
|
||||
|
||||
if (corners[0][0] > 30) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return corners[0][1];
|
||||
};
|
||||
|
||||
Group.prototype.is_selected = function (x, y) {
|
||||
|
||||
if (util.pDistance(x,
|
||||
y,
|
||||
this.left_extent(),
|
||||
this.top_extent(),
|
||||
this.left_extent(),
|
||||
this.bottom_extent()) < 10) {
|
||||
return true;
|
||||
}
|
||||
if (util.pDistance(x,
|
||||
y,
|
||||
this.left_extent(),
|
||||
this.top_extent(),
|
||||
this.right_extent(),
|
||||
this.top_extent()) < 10) {
|
||||
return true;
|
||||
}
|
||||
if (util.pDistance(x,
|
||||
y,
|
||||
this.left_extent(),
|
||||
this.top_extent(),
|
||||
this.right_extent(),
|
||||
this.top_extent()) < 40 && y > this.top_extent()) {
|
||||
return true;
|
||||
}
|
||||
if (util.pDistance(x,
|
||||
y,
|
||||
this.right_extent(),
|
||||
this.bottom_extent(),
|
||||
this.right_extent(),
|
||||
this.top_extent()) < 10) {
|
||||
return true;
|
||||
}
|
||||
if (util.pDistance(x,
|
||||
y,
|
||||
this.right_extent(),
|
||||
this.bottom_extent(),
|
||||
this.left_extent(),
|
||||
this.bottom_extent()) < 10) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
Group.prototype.width = function (scaledX) {
|
||||
var x2 = this.x2 !== null ? this.x2 : scaledX;
|
||||
return Math.abs(this.x1 - x2);
|
||||
};
|
||||
|
||||
Group.prototype.height = function (scaledY) {
|
||||
var y2 = this.y2 !== null ? this.y2 : scaledY;
|
||||
return Math.abs(this.y1 - y2);
|
||||
};
|
||||
|
||||
Group.prototype.top_extent = function (scaledY) {
|
||||
var y2 = this.y2 !== null ? this.y2 : scaledY;
|
||||
return (this.y1 < y2? this.y1 : y2);
|
||||
};
|
||||
|
||||
Group.prototype.left_extent = function (scaledX) {
|
||||
var x2 = this.x2 !== null ? this.x2 : scaledX;
|
||||
return (this.x1 < x2? this.x1 : x2);
|
||||
};
|
||||
|
||||
Group.prototype.bottom_extent = function (scaledY) {
|
||||
var y2 = this.y2 !== null ? this.y2 : scaledY;
|
||||
return (this.y1 > y2? this.y1 : y2);
|
||||
};
|
||||
|
||||
Group.prototype.right_extent = function (scaledX) {
|
||||
var x2 = this.x2 !== null ? this.x2 : scaledX;
|
||||
return (this.x1 > x2? this.x1 : x2);
|
||||
};
|
||||
|
||||
Group.prototype.centerX = function (scaledX) {
|
||||
return (this.right_extent(scaledX) + this.left_extent(scaledX)) / 2;
|
||||
};
|
||||
|
||||
Group.prototype.centerY = function (scaledY) {
|
||||
return (this.bottom_extent(scaledY) + this.top_extent(scaledY)) / 2;
|
||||
};
|
||||
|
||||
Group.prototype.update_membership = function (devices, groups) {
|
||||
var i = 0;
|
||||
var y1 = this.top_extent();
|
||||
var x1 = this.left_extent();
|
||||
var y2 = this.bottom_extent();
|
||||
var x2 = this.right_extent();
|
||||
var old_devices = this.devices;
|
||||
var new_devices = [];
|
||||
var removed_devices = old_devices.slice();
|
||||
var device_ids = [];
|
||||
var index = -1;
|
||||
this.devices = [];
|
||||
for (i = 0; i < devices.length; i++) {
|
||||
if (devices[i].x > x1 &&
|
||||
devices[i].y > y1 &&
|
||||
devices[i].x < x2 &&
|
||||
devices[i].y < y2) {
|
||||
devices[i].in_group = true;
|
||||
this.devices.push(devices[i]);
|
||||
device_ids.push(devices[i].id);
|
||||
index = removed_devices.indexOf(devices[i]);
|
||||
if (index !== -1) {
|
||||
removed_devices.splice(index, 1);
|
||||
} else {
|
||||
new_devices.push(devices[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
var old_groups = this.groups;
|
||||
this.groups = [];
|
||||
var group_ids = [];
|
||||
for (i = 0; i < groups.length; i++) {
|
||||
if (groups[i].left_extent() > x1 &&
|
||||
groups[i].top_extent() > y1 &&
|
||||
groups[i].right_extent() < x2 &&
|
||||
groups[i].bottom_extent() < y2) {
|
||||
this.groups.push(groups[i]);
|
||||
group_ids.push(groups[i].id);
|
||||
}
|
||||
}
|
||||
return [old_devices, this.devices, device_ids, old_groups, this.groups, group_ids, new_devices, removed_devices];
|
||||
};
|
||||
|
||||
Group.prototype.is_in_breadcrumb = function(viewport){
|
||||
var groupY1 = this.top_extent();
|
||||
var groupX1 = this.left_extent();
|
||||
var groupY2 = this.bottom_extent();
|
||||
var groupX2 = this.right_extent();
|
||||
|
||||
var viewportY1 = viewport.top_extent();
|
||||
var viewportX1 = viewport.left_extent();
|
||||
var viewportY2 = viewport.bottom_extent();
|
||||
var viewportX2 = viewport.right_extent();
|
||||
|
||||
if (viewportX1 > groupX1 &&
|
||||
viewportY1 > groupY1 &&
|
||||
viewportX2 < groupX2 &&
|
||||
viewportY2 < groupY2) {
|
||||
this.on_screen = true;
|
||||
return true;
|
||||
} else {
|
||||
this.on_screen = false;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
function ToolBox(id, name, type, x, y, width, height) {
|
||||
this.id = id;
|
||||
|
||||
Reference in New Issue
Block a user