Commit df9ef230 authored by ibuler's avatar ibuler

[Update] 去掉asset permission中不用的代码

parent ec0bdcce
...@@ -607,7 +607,6 @@ SWAGGER_SETTINGS = { ...@@ -607,7 +607,6 @@ SWAGGER_SETTINGS = {
'in': 'header' 'in': 'header'
} }
}, },
'DEFAULT_API_URL': 'http://www.fit2cloud.com'
} }
......
...@@ -112,23 +112,6 @@ var dateOptions = { ...@@ -112,23 +112,6 @@ var dateOptions = {
}; };
var api_action = "{{ api_action }}"; var api_action = "{{ api_action }}";
function onAssetModalConfirm(table) {
var assets = assetModalTable.selected;
var options = [];
$('#id_assets option').each(function (i, v) {
options.push(v.value)
});
assetModalTable.selected_rows.forEach(function (i) {
var name = i.hostname + '(' + i.ip + ')';
var option = new Option(name, i.id, false, true);
if (options.indexOf(i.id) === -1) {
$('#id_assets').append(option).trigger('change');
}
});
$('#id_assets').val(assets).trigger('change');
}
$(document).ready(function () { $(document).ready(function () {
$('.select2').select2({ $('.select2').select2({
closeOnSelect: false closeOnSelect: false
...@@ -139,13 +122,6 @@ $(document).ready(function () { ...@@ -139,13 +122,6 @@ $(document).ready(function () {
$('#date_start').daterangepicker(dateOptions); $('#date_start').daterangepicker(dateOptions);
$('#date_expired').daterangepicker(dateOptions); $('#date_expired').daterangepicker(dateOptions);
var modalOption = {
onModalConfirm: onAssetModalConfirm,
onAssetTableDone: function (modalTable) {
syncSelectedAssetsToModalTable(modalTable)
},
};
setAssetModalOptions(modalOption);
$("#id_assets").parent().find(".select2-selection").on('click', function (e) { $("#id_assets").parent().find(".select2-selection").on('click', function (e) {
if ($(e.target).attr('class') !== 'select2-selection__choice__remove'){ if ($(e.target).attr('class') !== 'select2-selection__choice__remove'){
e.preventDefault(); e.preventDefault();
...@@ -154,25 +130,6 @@ $(document).ready(function () { ...@@ -154,25 +130,6 @@ $(document).ready(function () {
} }
}) })
}) })
.on('click', '#btn_asset_modal_confirm', function () {
var assets = assetModalTable.selected;
var options = [];
$('#id_assets option').each(function (i, v) {
options.push(v.value)
});
assetModalTable.selected_rows.forEach(function (i) {
var name = i.hostname + '(' + i.ip + ')';
var option = new Option(name, i.id, false, true);
if (options.indexOf(i.id) === -1) {
$('#id_assets').append(option).trigger('change');
}
});
$('#id_assets').val(assets).trigger('change');
$("#asset_list_modal").modal('hide');
})
.on("submit", "form", function (evt) { .on("submit", "form", function (evt) {
evt.preventDefault(); evt.preventDefault();
var the_url = '{% url 'api-perms:asset-permission-list' %}'; var the_url = '{% url 'api-perms:asset-permission-list' %}';
......
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 to comment