|
1827 | 1827 | notification: { |
1828 | 1828 | poll: pollAsyncJobResult |
1829 | 1829 | } |
1830 | | - }, |
1831 | | - enable: { |
1832 | | - label: 'label.action.enable.physical.network', |
1833 | | - messages: { |
1834 | | - confirm: function(args) { |
1835 | | - return 'message.action.enable.physical.network'; |
1836 | | - }, |
1837 | | - notification: function(args) { |
1838 | | - return 'label.action.enable.physical.network'; |
1839 | | - } |
1840 | | - }, |
1841 | | - action: function(args) { |
1842 | | - $.ajax({ |
1843 | | - url: createURL('updatePhysicalNetwork'), |
1844 | | - data: { |
1845 | | - id: args.context.physicalNetworks[0].id, |
1846 | | - state: 'Enabled' |
1847 | | - }, |
1848 | | - success: function(json) { |
1849 | | - args.response.success({ |
1850 | | - _custom: { |
1851 | | - jobId: json.updatephysicalnetworkresponse.jobid, |
1852 | | - getUpdatedItem: function(json) { |
1853 | | - return { |
1854 | | - state: 'Enabled' |
1855 | | - }; |
1856 | | - }, |
1857 | | - getActionFilter: function() { |
1858 | | - return cloudStack.actionFilter.physicalNetwork; |
1859 | | - } |
1860 | | - } |
1861 | | - }); |
1862 | | - }, |
1863 | | - error: function(json) { args.response.error(parseXMLHttpResponse(json)); } |
1864 | | - }); |
1865 | | - }, |
1866 | | - notification: { poll: pollAsyncJobResult } |
1867 | | - }, |
1868 | | - disable: { |
1869 | | - label: 'label.action.disable.physical.network', |
1870 | | - messages: { |
1871 | | - confirm: function(args) { |
1872 | | - return 'message.action.disable.physical.network'; |
1873 | | - }, |
1874 | | - notification: function(args) { |
1875 | | - return 'label.action.disable.physical.network'; |
1876 | | - } |
1877 | | - }, |
1878 | | - action: function(args) { |
1879 | | - $.ajax({ |
1880 | | - url: createURL('updatePhysicalNetwork'), |
1881 | | - data: { |
1882 | | - id: args.context.physicalNetworks[0].id, |
1883 | | - state: 'Disabled' |
1884 | | - }, |
1885 | | - success: function(json) { |
1886 | | - args.response.success({ |
1887 | | - _custom: { |
1888 | | - jobId: json.updatephysicalnetworkresponse.jobid, |
1889 | | - getUpdatedItem: function(json) { |
1890 | | - return { |
1891 | | - state: 'Disabled' |
1892 | | - }; |
1893 | | - }, |
1894 | | - getActionFilter: function() { |
1895 | | - return cloudStack.actionFilter.physicalNetwork; |
1896 | | - } |
1897 | | - } |
1898 | | - }); |
1899 | | - }, |
1900 | | - error: function(json) { args.response.error(parseXMLHttpResponse(json)); } |
1901 | | - }); |
1902 | | - }, |
1903 | | - notification: { poll: pollAsyncJobResult } |
1904 | | - } |
| 1830 | + } |
1905 | 1831 | } |
1906 | 1832 | }, |
1907 | 1833 | dataProvider: function(args) { |
|
9311 | 9237 | cloudStack.actionFilter.physicalNetwork = function(args) { |
9312 | 9238 | var state = args.context.item.state; |
9313 | 9239 |
|
9314 | | - if (state == 'Enabled') { |
9315 | | - return ['disable', 'remove']; |
9316 | | - } else if (state == 'Disabled') { |
9317 | | - return ['enable', 'remove']; |
| 9240 | + if (state != 'Destroyed') { |
| 9241 | + return ['remove']; |
9318 | 9242 | } |
9319 | | - |
| 9243 | + |
9320 | 9244 | return []; |
9321 | 9245 | }; |
9322 | 9246 | })($, cloudStack); |
0 commit comments