mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
VNMC: Refactor ASA1000v as a VNMC subdevice
-Make new provider 'VNMC' instead of 'ASA1000v' -Add helper function to add new VNMC managed devices to module -Make ASA1000v device listing as a view all link under VNMC
This commit is contained in:
parent
2cd70d06b3
commit
9a8bf4a66b
@ -1,93 +0,0 @@
|
||||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
(function($, cloudStack) {
|
||||
cloudStack.modules.asa1000vNetworkProvider = function(module) {
|
||||
module.infrastructure.networkServiceProvider({
|
||||
id: 'ciscoAsa1000v',
|
||||
name: 'Cisco ASA 1000v',
|
||||
state: 'Disabled',
|
||||
listView: {
|
||||
id: 'asa1000vDevices',
|
||||
fields: {
|
||||
name: { label: 'label.name' },
|
||||
ipaddress: { label: 'label.ip.address' },
|
||||
state: { label: 'label.state', indicator: {
|
||||
'Enabled': 'on',
|
||||
'Disabled': 'off'
|
||||
}}
|
||||
},
|
||||
dataProvider: function(args) {
|
||||
args.response.success({
|
||||
data: [
|
||||
{ name: 'device1', ipaddress: '192.168.1.12', state: 'Enabled' },
|
||||
{ name: 'device2', ipaddress: '192.168.1.13', state: 'Disabled' },
|
||||
{ name: 'device3', ipaddress: '192.168.1.14', state: 'Enabled' }
|
||||
]
|
||||
});
|
||||
},
|
||||
|
||||
detailView: {
|
||||
tabs: {
|
||||
details: {
|
||||
title: 'label.details',
|
||||
fields: [
|
||||
{
|
||||
name: { label: 'label.name' }
|
||||
},
|
||||
{
|
||||
ipaddress: { label: 'label.ip.address' },
|
||||
state: { label: 'label.state' }
|
||||
}
|
||||
],
|
||||
dataProvider: function(args) {
|
||||
args.response.success({
|
||||
data: args.context.asa1000vDevices[0]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
detailView: {
|
||||
id: 'asa1000vProvider',
|
||||
label: 'label.netScaler',
|
||||
viewAll: { label: 'label.devices', path: '_zone.asa1000vDevices' },
|
||||
tabs: {
|
||||
details: {
|
||||
title: 'label.details',
|
||||
fields: [
|
||||
{
|
||||
name: { label: 'label.name' }
|
||||
},
|
||||
{
|
||||
state: { label: 'label.state' }
|
||||
}
|
||||
],
|
||||
dataProvider: function(args) {
|
||||
args.response.success({
|
||||
data: {
|
||||
name: 'Cisco ASA 1000v',
|
||||
state: 'Disabled'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery, cloudStack));
|
||||
@ -17,6 +17,7 @@
|
||||
(function($, cloudStack) {
|
||||
cloudStack.modules = [
|
||||
'infrastructure',
|
||||
'asa1000vNetworkProvider'
|
||||
'vnmcNetworkProvider',
|
||||
'vnmcAsa1000v'
|
||||
];
|
||||
}(jQuery, cloudStack));
|
||||
|
||||
44
ui/modules/vnmcAsa1000v/vnmcAsa1000v.js
Normal file
44
ui/modules/vnmcAsa1000v/vnmcAsa1000v.js
Normal file
@ -0,0 +1,44 @@
|
||||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
(function($, cloudStack) {
|
||||
cloudStack.modules.vnmcAsa1000v = function(module) {
|
||||
module.vnmcNetworkProvider.addDevice({
|
||||
id: 'asa1000v',
|
||||
title: 'ASA 1000v',
|
||||
listView: {
|
||||
id: 'asa1000vDevices',
|
||||
fields: {
|
||||
name: { label: 'label.name' },
|
||||
ipaddress: { label: 'label.ip.address' },
|
||||
state: { label: 'label.state', indicator: {
|
||||
'Enabled': 'on',
|
||||
'Disabled': 'off'
|
||||
}}
|
||||
},
|
||||
dataProvider: function(args) {
|
||||
args.response.success({
|
||||
data: [
|
||||
{ name: 'asadevice1', ipaddress: '192.168.1.12', state: 'Enabled' },
|
||||
{ name: 'asadevice2', ipaddress: '192.168.1.13', state: 'Disabled' },
|
||||
{ name: 'asadevice3', ipaddress: '192.168.1.14', state: 'Enabled' }
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}(jQuery, cloudStack));
|
||||
112
ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
Normal file
112
ui/modules/vnmcNetworkProvider/vnmcNetworkProvider.js
Normal file
@ -0,0 +1,112 @@
|
||||
// Licensed to the Apache Software Foundation (ASF) under one
|
||||
// or more contributor license agreements. See the NOTICE file
|
||||
// distributed with this work for additional information
|
||||
// regarding copyright ownership. The ASF licenses this file
|
||||
// to you under the Apache License, Version 2.0 (the
|
||||
// "License"); you may not use this file except in compliance
|
||||
// with the License. You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing,
|
||||
// software distributed under the License is distributed on an
|
||||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
// KIND, either express or implied. See the License for the
|
||||
// specific language governing permissions and limitations
|
||||
// under the License.
|
||||
(function($, cloudStack) {
|
||||
cloudStack.modules.vnmcNetworkProvider = function(module) {
|
||||
var vnmcDeviceViewAll = window._m = [
|
||||
{
|
||||
label: 'VNMC Devices',
|
||||
path: '_zone.vnmcDevices'
|
||||
}
|
||||
];
|
||||
|
||||
var vnmcListView = {
|
||||
id: 'vnmcDevices',
|
||||
fields: {
|
||||
name: { label: 'label.name' },
|
||||
ipaddress: { label: 'label.ip.address' },
|
||||
state: { label: 'label.state', indicator: {
|
||||
'Enabled': 'on',
|
||||
'Disabled': 'off'
|
||||
}}
|
||||
},
|
||||
dataProvider: function(args) {
|
||||
args.response.success({
|
||||
data: [
|
||||
{ name: 'device1', ipaddress: '192.168.1.12', state: 'Enabled' },
|
||||
{ name: 'device2', ipaddress: '192.168.1.13', state: 'Disabled' },
|
||||
{ name: 'device3', ipaddress: '192.168.1.14', state: 'Enabled' }
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
var vnmcProviderDetailView = vnmcListView.detailView = {
|
||||
id: 'vnmcProvider',
|
||||
label: 'VNMC',
|
||||
viewAll: vnmcDeviceViewAll,
|
||||
tabs: {
|
||||
details: {
|
||||
title: 'label.details',
|
||||
fields: [
|
||||
{
|
||||
name: { label: 'label.name' }
|
||||
},
|
||||
{
|
||||
state: { label: 'label.state' }
|
||||
}
|
||||
],
|
||||
dataProvider: function(args) {
|
||||
args.response.success({
|
||||
data: {
|
||||
name: 'VNMC Devices',
|
||||
state: 'Disabled'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var vnmcDeviceDetailView = {
|
||||
tabs: {
|
||||
details: {
|
||||
title: 'label.details',
|
||||
fields: [
|
||||
{
|
||||
name: { label: 'label.name' }
|
||||
},
|
||||
{
|
||||
ipaddress: { label: 'label.ip.address' },
|
||||
state: { label: 'label.state' }
|
||||
}
|
||||
],
|
||||
dataProvider: function(args) {
|
||||
args.response.success({
|
||||
data: args.context.vnmcDevices[0]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.pluginAPI.extend({
|
||||
addDevice: function(device) {
|
||||
cloudStack.sections.system.subsections[device.id] = device;
|
||||
vnmcDeviceViewAll.push({ label: device.title, path: '_zone.' + device.id });
|
||||
}
|
||||
});
|
||||
|
||||
module.infrastructure.networkServiceProvider({
|
||||
id: 'vnmc',
|
||||
name: 'Cisco VNMC',
|
||||
state: 'Disabled',
|
||||
listView: vnmcListView,
|
||||
|
||||
detailView: vnmcProviderDetailView
|
||||
});
|
||||
};
|
||||
}(jQuery, cloudStack));
|
||||
Loading…
x
Reference in New Issue
Block a user