foreman_hosts 1.0.5 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +1 -117
- data/app/assets/javascripts/application.js +2 -0
- data/app/assets/javascripts/jquery.battatech.excelexport.js +180 -0
- data/app/controllers/foreman_hosts/syhostmodeldetails_controller.rb +83 -0
- data/app/controllers/foreman_hosts/syhostmodels_controller.rb +83 -0
- data/app/models/foreman_hosts/syhostmodel.rb +8 -0
- data/app/models/foreman_hosts/syhostmodeldetail.rb +5 -0
- data/app/views/foreman_hosts/hosts/report_index.html.erb +188 -3
- data/app/views/foreman_hosts/syhostmodeldetails/_form.html.erb +29 -0
- data/app/views/foreman_hosts/syhostmodeldetails/_list.html.erb +43 -0
- data/app/views/foreman_hosts/syhostmodeldetails/_sygroup.html.erb +3 -0
- data/app/views/foreman_hosts/syhostmodeldetails/_sygroup_td.html.erb +7 -0
- data/app/views/foreman_hosts/syhostmodeldetails/create.js.erb +2 -0
- data/app/views/foreman_hosts/syhostmodeldetails/destroy.js.erb +1 -0
- data/app/views/foreman_hosts/syhostmodeldetails/edit.html.erb +1 -0
- data/app/views/foreman_hosts/syhostmodeldetails/edit.js.erb +3 -0
- data/app/views/foreman_hosts/syhostmodeldetails/index.html.erb +5 -0
- data/app/views/foreman_hosts/syhostmodeldetails/new.html.erb +1 -0
- data/app/views/foreman_hosts/syhostmodeldetails/new.js.erb +3 -0
- data/app/views/foreman_hosts/syhostmodeldetails/show.html.erb +28 -0
- data/app/views/foreman_hosts/syhostmodeldetails/update.js.erb +3 -0
- data/app/views/foreman_hosts/syhostmodels/_form.html.erb +30 -0
- data/app/views/foreman_hosts/syhostmodels/_list.html.erb +41 -0
- data/app/views/foreman_hosts/syhostmodels/_report.html.erb +258 -0
- data/app/views/foreman_hosts/syhostmodels/_sub.html.erb +37 -0
- data/app/views/foreman_hosts/syhostmodels/edit.html.erb +1 -0
- data/app/views/foreman_hosts/syhostmodels/index.html.erb +5 -0
- data/app/views/foreman_hosts/syhostmodels/new.html.erb +1 -0
- data/app/views/foreman_hosts/syhostmodels/show.html.erb +72 -0
- data/config/routes.rb +6 -3
- data/db/migrate/20151015022411_create_syhostmodels.rb +10 -0
- data/db/migrate/20151015050239_create_syhostmodeldetails.rb +13 -0
- data/lib/foreman_hosts/engine.rb +9 -10
- data/lib/foreman_hosts/version.rb +1 -1
- metadata +47 -3
- data/app/models/concerns/foreman_hosts/host_extensions.rb +0 -19
    
        data/README.md
    CHANGED
    
    | @@ -1,120 +1,4 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
             | 
| 3 | 
            -
            actionmailer (3.2.8)
         | 
| 4 | 
            -
            actionpack (3.2.8)
         | 
| 5 | 
            -
            activemodel (3.2.8)
         | 
| 6 | 
            -
            activerecord (3.2.8)
         | 
| 7 | 
            -
            activeresource (3.2.8)
         | 
| 8 | 
            -
            activesupport (4.2.4, 3.2.8)
         | 
| 9 | 
            -
            ancestry (2.0.0)
         | 
| 10 | 
            -
            apipie-rails (0.2.6)
         | 
| 11 | 
            -
            arel (3.0.2)
         | 
| 12 | 
            -
            audited (3.0.0)
         | 
| 13 | 
            -
            audited-activerecord (3.0.0)
         | 
| 14 | 
            -
            bigdecimal (1.1.0)
         | 
| 15 | 
            -
            builder (3.0.0)
         | 
| 16 | 
            -
            bundler (1.3.5)
         | 
| 17 | 
            -
            bundler_ext (0.3.0)
         | 
| 18 | 
            -
            coffee-rails (3.2.2)
         | 
| 19 | 
            -
            coffee-script (2.2.0)
         | 
| 20 | 
            -
            coffee-script-source (1.3.3)
         | 
| 21 | 
            -
            colorize (0.7.7)
         | 
| 22 | 
            -
            deep_cloneable (2.0.2)
         | 
| 23 | 
            -
            deface (1.0.1)
         | 
| 24 | 
            -
            diff-lcs (1.1.3)
         | 
| 25 | 
            -
            erubis (2.7.0)
         | 
| 26 | 
            -
            execjs (1.4.0)
         | 
| 27 | 
            -
            fast_gettext (0.9.2)
         | 
| 28 | 
            -
            foreigner (1.7.1)
         | 
| 29 | 
            -
            foreman-hosts (0.0.1)
         | 
| 30 | 
            -
            foreman_setup (3.0.1)
         | 
| 31 | 
            -
            friendly_id (4.0.10.1)
         | 
| 32 | 
            -
            gettext_i18n_rails (1.2.1)
         | 
| 33 | 
            -
            hike (1.2.1)
         | 
| 34 | 
            -
            i18n (0.7.0, 0.6.0)
         | 
| 35 | 
            -
            io-console (0.3)
         | 
| 36 | 
            -
            journey (1.0.4)
         | 
| 37 | 
            -
            json (1.8.3, 1.5.5)
         | 
| 38 | 
            -
            ldap_fluff (0.3.5)
         | 
| 39 | 
            -
            little-plugger (1.1.3)
         | 
| 40 | 
            -
            logging (1.8.2)
         | 
| 41 | 
            -
            loofah (2.0.3)
         | 
| 42 | 
            -
            mail (2.4.4)
         | 
| 43 | 
            -
            mime-types (1.19)
         | 
| 44 | 
            -
            mini_portile (0.6.2)
         | 
| 45 | 
            -
            minitest (5.8.1, 2.5.1)
         | 
| 46 | 
            -
            multi_json (1.10.1)
         | 
| 47 | 
            -
            net-http-persistent (2.7)
         | 
| 48 | 
            -
            net-ldap (0.11)
         | 
| 49 | 
            -
            netrc (0.7.7)
         | 
| 50 | 
            -
            nokogiri (1.6.6.2)
         | 
| 51 | 
            -
            oauth (0.4.7)
         | 
| 52 | 
            -
            passenger (4.0.18)
         | 
| 53 | 
            -
            pg (0.12.2)
         | 
| 54 | 
            -
            polyglot (0.3.3)
         | 
| 55 | 
            -
            rabl (0.11.6)
         | 
| 56 | 
            -
            rack (1.6.4, 1.4.1)
         | 
| 57 | 
            -
            rack-cache (1.2)
         | 
| 58 | 
            -
            rack-jsonp (1.3.1)
         | 
| 59 | 
            -
            rack-ssl (1.3.2)
         | 
| 60 | 
            -
            rack-test (0.6.3, 0.6.1)
         | 
| 61 | 
            -
            rails (3.2.8)
         | 
| 62 | 
            -
            railties (3.2.8)
         | 
| 63 | 
            -
            rake (0.9.2.2)
         | 
| 64 | 
            -
            rdoc (3.9.5)
         | 
| 65 | 
            -
            rest-client (1.6.7)
         | 
| 66 | 
            -
            ruby2ruby (2.1.3)
         | 
| 67 | 
            -
            ruby_parser (3.6.3)
         | 
| 68 | 
            -
            safemode (1.2.2)
         | 
| 69 | 
            -
            scoped_search (3.2.1)
         | 
| 70 | 
            -
            secure_headers (1.4.1)
         | 
| 71 | 
            -
            sexp_processor (4.4.4)
         | 
| 72 | 
            -
            sprockets (2.12.3)
         | 
| 73 | 
            -
            thor (0.18.1)
         | 
| 74 | 
            -
            thread_safe (0.3.5)
         | 
| 75 | 
            -
            tilt (1.3.3)
         | 
| 76 | 
            -
            treetop (1.4.10)
         | 
| 77 | 
            -
            turbolinks (2.5.3)
         | 
| 78 | 
            -
            tzinfo (1.2.2, 0.3.33)
         | 
| 79 | 
            -
            validates_lengths_from_database (0.4.0)
         | 
| 80 | 
            -
            will_paginate (3.0.2)
         | 
| 81 | 
            -
             | 
| 82 | 
            -
             | 
| 83 | 
            -
            ============================================================================
         | 
| 84 | 
            -
            Fetching: mini_portile-0.6.2.gem (100%)
         | 
| 85 | 
            -
            Fetching: nokogiri-1.6.6.2.gem (100%)
         | 
| 86 | 
            -
            Building native extensions.  This could take a while...
         | 
| 87 | 
            -
            Fetching: colorize-0.7.7.gem (100%)
         | 
| 88 | 
            -
            Fetching: deface-1.0.1.gem (100%)
         | 
| 89 | 
            -
            Fetching: foreman-hosts-0.0.1.gem (100%)
         | 
| 90 | 
            -
            Fetching: i18n-0.7.0.gem (100%)
         | 
| 91 | 
            -
            Fetching: json-1.8.3.gem (100%)
         | 
| 92 | 
            -
            Building native extensions.  This could take a while...
         | 
| 93 | 
            -
            Fetching: thread_safe-0.3.5.gem (100%)
         | 
| 94 | 
            -
            Fetching: tzinfo-1.2.2.gem (100%)
         | 
| 95 | 
            -
            Fetching: minitest-5.8.1.gem (100%)
         | 
| 96 | 
            -
            Fetching: activesupport-4.2.4.gem (100%)
         | 
| 97 | 
            -
            Fetching: rack-1.6.4.gem (100%)
         | 
| 98 | 
            -
            Fetching: rack-test-0.6.3.gem (100%)
         | 
| 99 | 
            -
            Fetching: loofah-2.0.3.gem (100%)
         | 
| 100 | 
            -
            Fetching: rails-html-sanitizer-1.0.2.gem (100%)
         | 
| 101 | 
            -
            Fetching: rails-deprecated_sanitizer-1.0.3.gem (100%)
         | 
| 102 | 
            -
            Fetching: rails-dom-testing-1.0.7.gem (100%)
         | 
| 103 | 
            -
            Fetching: builder-3.2.2.gem (100%)
         | 
| 104 | 
            -
            Fetching: actionview-4.2.4.gem (100%)
         | 
| 105 | 
            -
            Fetching: actionpack-4.2.4.gem (100%)
         | 
| 106 | 
            -
            Fetching: activemodel-4.2.4.gem (100%)
         | 
| 107 | 
            -
            Fetching: arel-6.0.3.gem (100%)
         | 
| 108 | 
            -
            Fetching: activerecord-4.2.4.gem (100%)
         | 
| 109 | 
            -
            Fetching: globalid-0.3.6.gem (100%)
         | 
| 110 | 
            -
            Fetching: activejob-4.2.4.gem (100%)
         | 
| 111 | 
            -
            Fetching: mail-2.6.3.gem (100%)
         | 
| 112 | 
            -
            Fetching: actionmailer-4.2.4.gem (100%)
         | 
| 113 | 
            -
            Fetching: railties-4.2.4.gem (100%)
         | 
| 114 | 
            -
            Fetching: sprockets-rails-2.3.3.gem (100%)
         | 
| 115 | 
            -
             | 
| 116 | 
            -
             | 
| 117 | 
            -
             | 
| 1 | 
            +
            # 导出host信息,可默认导出所有主机的所有信息,也可以通过定制模板导出主机信息
         | 
| 118 2 | 
             
            # ForemanHosts
         | 
| 119 3 |  | 
| 120 4 | 
             
            *Introdction here*
         | 
| @@ -0,0 +1,180 @@ | |
| 1 | 
            +
            /*
         | 
| 2 | 
            +
             * jQuery Client Side Excel Export Plugin Library
         | 
| 3 | 
            +
             * http://www.battatech.com/
         | 
| 4 | 
            +
             *
         | 
| 5 | 
            +
             * Copyright (c) 2013 Batta Tech Private Limited
         | 
| 6 | 
            +
             * Licensed under https://github.com/battatech/battatech_excelexport/blob/master/LICENSE.txt
         | 
| 7 | 
            +
             */
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            (function ($) {
         | 
| 10 | 
            +
                var $defaults = {
         | 
| 11 | 
            +
                    containerid: null
         | 
| 12 | 
            +
                    , datatype: 'table'
         | 
| 13 | 
            +
                    , dataset: null
         | 
| 14 | 
            +
                    , columns: null
         | 
| 15 | 
            +
                    , returnUri: false
         | 
| 16 | 
            +
                    , worksheetName: "Sheet1"
         | 
| 17 | 
            +
                    , encoding: "utf-8"
         | 
| 18 | 
            +
                };
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                var $settings = $defaults;
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                $.fn.battatech_excelexport = function (options) {
         | 
| 23 | 
            +
                    $settings = $.extend({}, $defaults, options);
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                    var gridData = [];
         | 
| 26 | 
            +
                    var excelData;
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                    return Initialize();
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                    function Initialize() {
         | 
| 31 | 
            +
                        var type = $settings.datatype.toLowerCase();
         | 
| 32 | 
            +
             | 
| 33 | 
            +
                        BuildDataStructure(type);
         | 
| 34 | 
            +
             | 
| 35 | 
            +
                        switch (type) {
         | 
| 36 | 
            +
                            case 'table':
         | 
| 37 | 
            +
                                excelData = Export(ConvertFromTable());
         | 
| 38 | 
            +
                                break;
         | 
| 39 | 
            +
                            case 'json':
         | 
| 40 | 
            +
                                excelData = Export(ConvertDataStructureToTable());
         | 
| 41 | 
            +
                                break;
         | 
| 42 | 
            +
                            case 'xml':
         | 
| 43 | 
            +
                                excelData = Export(ConvertDataStructureToTable());
         | 
| 44 | 
            +
                                break;
         | 
| 45 | 
            +
                            case 'jqgrid':
         | 
| 46 | 
            +
                                excelData = Export(ConvertDataStructureToTable());
         | 
| 47 | 
            +
                                break;
         | 
| 48 | 
            +
                        }
         | 
| 49 | 
            +
             | 
| 50 | 
            +
                        if ($settings.returnUri) {
         | 
| 51 | 
            +
                            return excelData;
         | 
| 52 | 
            +
                        }
         | 
| 53 | 
            +
                        else {
         | 
| 54 | 
            +
                            window.open(excelData);
         | 
| 55 | 
            +
                        }
         | 
| 56 | 
            +
                    }
         | 
| 57 | 
            +
             | 
| 58 | 
            +
                    function BuildDataStructure(type) {
         | 
| 59 | 
            +
                        switch (type) {
         | 
| 60 | 
            +
                            case 'table':
         | 
| 61 | 
            +
                                break;
         | 
| 62 | 
            +
                            case 'json':
         | 
| 63 | 
            +
                                gridData = $settings.dataset;
         | 
| 64 | 
            +
                                break;
         | 
| 65 | 
            +
                            case 'xml':
         | 
| 66 | 
            +
                                $($settings.dataset).find("row").each(function (key, value) {
         | 
| 67 | 
            +
                                    var item = {};
         | 
| 68 | 
            +
             | 
| 69 | 
            +
                                    if (this.attributes != null && this.attributes.length > 0) {
         | 
| 70 | 
            +
                                        $(this.attributes).each(function () {
         | 
| 71 | 
            +
                                            item[this.name] = this.value;
         | 
| 72 | 
            +
                                        });
         | 
| 73 | 
            +
             | 
| 74 | 
            +
                                        gridData.push(item);
         | 
| 75 | 
            +
                                    }
         | 
| 76 | 
            +
                                });
         | 
| 77 | 
            +
                                break;
         | 
| 78 | 
            +
                            case 'jqgrid':
         | 
| 79 | 
            +
                                $($settings.dataset).find("rows > row").each(function (key, value) {
         | 
| 80 | 
            +
                                    var item = {};
         | 
| 81 | 
            +
             | 
| 82 | 
            +
                                    if (this.children != null && this.children.length > 0) {
         | 
| 83 | 
            +
                                        $(this.children).each(function () {
         | 
| 84 | 
            +
                                            item[this.tagName] = $(this).text();
         | 
| 85 | 
            +
                                        });
         | 
| 86 | 
            +
             | 
| 87 | 
            +
                                        gridData.push(item);
         | 
| 88 | 
            +
                                    }
         | 
| 89 | 
            +
                                });
         | 
| 90 | 
            +
                                break;
         | 
| 91 | 
            +
                        }
         | 
| 92 | 
            +
                    }
         | 
| 93 | 
            +
             | 
| 94 | 
            +
                    function ConvertFromTable() {
         | 
| 95 | 
            +
                        var result = $('<div>').append($('#' + $settings.containerid).clone()).html();
         | 
| 96 | 
            +
                        return result;
         | 
| 97 | 
            +
                    }
         | 
| 98 | 
            +
             | 
| 99 | 
            +
                    function ConvertDataStructureToTable() {
         | 
| 100 | 
            +
                        var result = "<table>";
         | 
| 101 | 
            +
             | 
| 102 | 
            +
                        result += "<thead><tr>";
         | 
| 103 | 
            +
                        $($settings.columns).each(function (key, value) {
         | 
| 104 | 
            +
                            if (this.ishidden != true) {
         | 
| 105 | 
            +
                                result += "<th";
         | 
| 106 | 
            +
                                if (this.width != null) {
         | 
| 107 | 
            +
                                    result += " style='width: " + this.width + "'";
         | 
| 108 | 
            +
                                }
         | 
| 109 | 
            +
                                result += ">";
         | 
| 110 | 
            +
                                result += this.headertext;
         | 
| 111 | 
            +
                                result += "</th>";
         | 
| 112 | 
            +
                            }
         | 
| 113 | 
            +
                        });
         | 
| 114 | 
            +
                        result += "</tr></thead>";
         | 
| 115 | 
            +
             | 
| 116 | 
            +
                        result += "<tbody>";
         | 
| 117 | 
            +
                        $(gridData).each(function (key, value) {
         | 
| 118 | 
            +
                            result += "<tr>";
         | 
| 119 | 
            +
                            $($settings.columns).each(function (k, v) {
         | 
| 120 | 
            +
                                if (value.hasOwnProperty(this.datafield)) {
         | 
| 121 | 
            +
                                    if (this.ishidden != true) {
         | 
| 122 | 
            +
                                        result += "<td";
         | 
| 123 | 
            +
                                        if (this.width != null) {
         | 
| 124 | 
            +
                                            result += " style='width: " + this.width + "'";
         | 
| 125 | 
            +
                                        }
         | 
| 126 | 
            +
                                        result += ">";
         | 
| 127 | 
            +
                                        result += value[this.datafield];
         | 
| 128 | 
            +
                                        result += "</td>";
         | 
| 129 | 
            +
                                    }
         | 
| 130 | 
            +
                                }
         | 
| 131 | 
            +
                            });
         | 
| 132 | 
            +
                            result += "</tr>";
         | 
| 133 | 
            +
                        });
         | 
| 134 | 
            +
                        result += "</tbody>";
         | 
| 135 | 
            +
             | 
| 136 | 
            +
                        result += "</table>";
         | 
| 137 | 
            +
                        return result;
         | 
| 138 | 
            +
                    }
         | 
| 139 | 
            +
             | 
| 140 | 
            +
                    function Export(htmltable) {
         | 
| 141 | 
            +
                        var excelFile = "<html xmlns:o='urn:schemas-microsoft-com:office:office' xmlns:x='urn:schemas-microsoft-com:office:excel' xmlns='http://www.w3.org/TR/REC-html40'>";
         | 
| 142 | 
            +
                        excelFile += "<head>";
         | 
| 143 | 
            +
                        excelFile += '<meta http-equiv="Content-type" content="text/html;charset=' + $defaults.encoding + '" />';
         | 
| 144 | 
            +
                        excelFile += "<!--[if gte mso 9]>";
         | 
| 145 | 
            +
                        excelFile += "<xml>";
         | 
| 146 | 
            +
                        excelFile += "<x:ExcelWorkbook>";
         | 
| 147 | 
            +
                        excelFile += "<x:ExcelWorksheets>";
         | 
| 148 | 
            +
                        excelFile += "<x:ExcelWorksheet>";
         | 
| 149 | 
            +
                        excelFile += "<x:Name>";
         | 
| 150 | 
            +
                        excelFile += "{worksheet}";
         | 
| 151 | 
            +
                        excelFile += "</x:Name>";
         | 
| 152 | 
            +
                        excelFile += "<x:WorksheetOptions>";
         | 
| 153 | 
            +
                        excelFile += "<x:DisplayGridlines/>";
         | 
| 154 | 
            +
                        excelFile += "</x:WorksheetOptions>";
         | 
| 155 | 
            +
                        excelFile += "</x:ExcelWorksheet>";
         | 
| 156 | 
            +
                        excelFile += "</x:ExcelWorksheets>";
         | 
| 157 | 
            +
                        excelFile += "</x:ExcelWorkbook>";
         | 
| 158 | 
            +
                        excelFile += "</xml>";
         | 
| 159 | 
            +
                        excelFile += "<![endif]-->";
         | 
| 160 | 
            +
                        excelFile += "</head>";
         | 
| 161 | 
            +
                        excelFile += "<body>";
         | 
| 162 | 
            +
                        excelFile += htmltable.replace(/"/g, '\'');
         | 
| 163 | 
            +
                        excelFile += "</body>";
         | 
| 164 | 
            +
                        excelFile += "</html>";
         | 
| 165 | 
            +
             | 
| 166 | 
            +
                        var uri = "data:application/vnd.ms-excel;base64,";
         | 
| 167 | 
            +
                        var ctx = { worksheet: $settings.worksheetName, table: htmltable };
         | 
| 168 | 
            +
             | 
| 169 | 
            +
                        return (uri + base64(format(excelFile, ctx)));
         | 
| 170 | 
            +
                    }
         | 
| 171 | 
            +
             | 
| 172 | 
            +
                    function base64(s) {
         | 
| 173 | 
            +
                        return window.btoa(unescape(encodeURIComponent(s)));
         | 
| 174 | 
            +
                    }
         | 
| 175 | 
            +
             | 
| 176 | 
            +
                    function format(s, c) {
         | 
| 177 | 
            +
                        return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; });
         | 
| 178 | 
            +
                    }
         | 
| 179 | 
            +
                };
         | 
| 180 | 
            +
            })(jQuery);
         | 
| @@ -0,0 +1,83 @@ | |
| 1 | 
            +
            class ForemanHosts::SyhostmodeldetailsController < ApplicationController
         | 
| 2 | 
            +
              # GET /syhostmodeldetails
         | 
| 3 | 
            +
              # GET /syhostmodeldetails.json
         | 
| 4 | 
            +
              def index
         | 
| 5 | 
            +
                @syhostmodeldetails = ForemanHosts::Syhostmodeldetail.all.paginate(:page => params[:page])
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                respond_to do |format|
         | 
| 8 | 
            +
                  format.html # index.html.erb
         | 
| 9 | 
            +
                  format.json { render json: @syhostmodeldetails }
         | 
| 10 | 
            +
                end
         | 
| 11 | 
            +
              end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              # GET /syhostmodeldetails/1
         | 
| 14 | 
            +
              # GET /syhostmodeldetails/1.json
         | 
| 15 | 
            +
              def show
         | 
| 16 | 
            +
                @syhostmodeldetail = ForemanHosts::Syhostmodeldetail.find(params[:id])
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                respond_to do |format|
         | 
| 19 | 
            +
                  format.html # show.html.erb
         | 
| 20 | 
            +
                  format.json { render json: @syhostmodeldetail }
         | 
| 21 | 
            +
                end
         | 
| 22 | 
            +
              end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
              # GET /syhostmodeldetails/new
         | 
| 25 | 
            +
              # GET /syhostmodeldetails/new.json
         | 
| 26 | 
            +
              def new
         | 
| 27 | 
            +
                @syhostmodeldetail = ForemanHosts::Syhostmodeldetail.new
         | 
| 28 | 
            +
                respond_to do |format|
         | 
| 29 | 
            +
                  format.html # new.html.erb
         | 
| 30 | 
            +
                  format.json { render json: @syhostmodeldetail }
         | 
| 31 | 
            +
                end
         | 
| 32 | 
            +
              end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
              # GET /syhostmodeldetails/1/edit
         | 
| 35 | 
            +
              def edit
         | 
| 36 | 
            +
                @syhostmodeldetail = ForemanHosts::Syhostmodeldetail.find(params[:id])
         | 
| 37 | 
            +
              end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
              # POST /syhostmodeldetails
         | 
| 40 | 
            +
              # POST /syhostmodeldetails.json
         | 
| 41 | 
            +
              def create
         | 
| 42 | 
            +
                @syhostmodeldetail = ForemanHosts::Syhostmodeldetail.new(params[:foreman_hosts_syhostmodeldetail])
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                respond_to do |format|
         | 
| 45 | 
            +
                  if @syhostmodeldetail.save
         | 
| 46 | 
            +
                    format.html { redirect_to @syhostmodeldetail, notice: 'syhostmodeldetail was successfully created.' }
         | 
| 47 | 
            +
                    format.json { render json: @syhostmodeldetail, status: :created, location: @syhostmodeldetail }
         | 
| 48 | 
            +
                  else
         | 
| 49 | 
            +
                            format.html { render action: "new" }
         | 
| 50 | 
            +
                    format.json { render json: @syhostmodeldetail.errors, status: :unprocessable_entity }
         | 
| 51 | 
            +
                  end
         | 
| 52 | 
            +
                end
         | 
| 53 | 
            +
              end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
              # PUT /syhostmodeldetails/1
         | 
| 56 | 
            +
              # PUT /syhostmodeldetails/1.json
         | 
| 57 | 
            +
              def update
         | 
| 58 | 
            +
                @syhostmodeldetail = ForemanHosts::Syhostmodeldetail.find(params[:id])
         | 
| 59 | 
            +
             | 
| 60 | 
            +
                respond_to do |format|
         | 
| 61 | 
            +
                  if @syhostmodeldetail.update_attributes(params[:foreman_hosts_syhostmodeldetail])
         | 
| 62 | 
            +
                    format.html { redirect_to @syhostmodeldetail, notice: 'syhostmodeldetail was successfully updated.' }
         | 
| 63 | 
            +
                    format.json { head :no_content }
         | 
| 64 | 
            +
                  else
         | 
| 65 | 
            +
                    format.html { render action: "edit" }
         | 
| 66 | 
            +
                    format.json { render json: @syhostmodeldetail.errors, status: :unprocessable_entity }
         | 
| 67 | 
            +
                  end
         | 
| 68 | 
            +
                end
         | 
| 69 | 
            +
              end
         | 
| 70 | 
            +
             | 
| 71 | 
            +
              # DELETE /syhostmodeldetails/1
         | 
| 72 | 
            +
              # DELETE /syhostmodeldetails/1.json
         | 
| 73 | 
            +
              def destroy
         | 
| 74 | 
            +
                @syhostmodeldetail = ForemanHosts::Syhostmodeldetail.find(params[:id])
         | 
| 75 | 
            +
                @syhostmodeldetail.destroy
         | 
| 76 | 
            +
                respond_to do |format|
         | 
| 77 | 
            +
                  format.html { redirect_to foreman_hosts_syhostmodeldetails_url }
         | 
| 78 | 
            +
                  format.json { head :no_content }
         | 
| 79 | 
            +
                end
         | 
| 80 | 
            +
             | 
| 81 | 
            +
             | 
| 82 | 
            +
              end
         | 
| 83 | 
            +
            end
         | 
| @@ -0,0 +1,83 @@ | |
| 1 | 
            +
            class ForemanHosts::SyhostmodelsController < ApplicationController
         | 
| 2 | 
            +
              # GET /syhostmodels
         | 
| 3 | 
            +
              # GET /syhostmodels.json
         | 
| 4 | 
            +
              def index
         | 
| 5 | 
            +
                @syhostmodels = ForemanHosts::Syhostmodel.all.paginate(:page => params[:page])
         | 
| 6 | 
            +
             | 
| 7 | 
            +
                respond_to do |format|
         | 
| 8 | 
            +
                  format.html # index.html.erb
         | 
| 9 | 
            +
                  format.json { render json: @syhostmodels }
         | 
| 10 | 
            +
                end
         | 
| 11 | 
            +
              end
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              # GET /syhostmodels/1
         | 
| 14 | 
            +
              # GET /syhostmodels/1.json
         | 
| 15 | 
            +
              def show
         | 
| 16 | 
            +
                @syhostmodel = ForemanHosts::Syhostmodel.find(params[:id])
         | 
| 17 | 
            +
             | 
| 18 | 
            +
                respond_to do |format|
         | 
| 19 | 
            +
                  format.html # show.html.erb
         | 
| 20 | 
            +
                  format.json { render json: @syhostmodel }
         | 
| 21 | 
            +
                end
         | 
| 22 | 
            +
              end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
              # GET /syhostmodels/new
         | 
| 25 | 
            +
              # GET /syhostmodels/new.json
         | 
| 26 | 
            +
              def new
         | 
| 27 | 
            +
                @syhostmodel = ForemanHosts::Syhostmodel.new
         | 
| 28 | 
            +
                respond_to do |format|
         | 
| 29 | 
            +
                  format.html # new.html.erb
         | 
| 30 | 
            +
                  format.json { render json: @syhostmodel }
         | 
| 31 | 
            +
                end
         | 
| 32 | 
            +
              end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
              # GET /syhostmodels/1/edit
         | 
| 35 | 
            +
              def edit
         | 
| 36 | 
            +
                @syhostmodel = ForemanHosts::Syhostmodel.find(params[:id])
         | 
| 37 | 
            +
              end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
              # POST /syhostmodels
         | 
| 40 | 
            +
              # POST /syhostmodels.json
         | 
| 41 | 
            +
              def create
         | 
| 42 | 
            +
                @syhostmodel = ForemanHosts::Syhostmodel.new(params[:foreman_hosts_syhostmodel])
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                respond_to do |format|
         | 
| 45 | 
            +
                  if @syhostmodel.save
         | 
| 46 | 
            +
                    format.html { redirect_to @syhostmodel, notice: 'syhostmodel was successfully created.' }
         | 
| 47 | 
            +
                    format.json { render json: @syhostmodel, status: :created, location: @syhostmodel }
         | 
| 48 | 
            +
                  else
         | 
| 49 | 
            +
                            format.html { render action: "new" }
         | 
| 50 | 
            +
                    format.json { render json: @syhostmodel.errors, status: :unprocessable_entity }
         | 
| 51 | 
            +
                  end
         | 
| 52 | 
            +
                end
         | 
| 53 | 
            +
              end
         | 
| 54 | 
            +
             | 
| 55 | 
            +
              # PUT /syhostmodels/1
         | 
| 56 | 
            +
              # PUT /syhostmodels/1.json
         | 
| 57 | 
            +
              def update
         | 
| 58 | 
            +
                @syhostmodel = ForemanHosts::Syhostmodel.find(params[:id])
         | 
| 59 | 
            +
             | 
| 60 | 
            +
                respond_to do |format|
         | 
| 61 | 
            +
                  if @syhostmodel.update_attributes(params[:foreman_hosts_syhostmodel])
         | 
| 62 | 
            +
                    format.html { redirect_to @syhostmodel, notice: 'syhostmodel was successfully updated.' }
         | 
| 63 | 
            +
                    format.json { head :no_content }
         | 
| 64 | 
            +
                  else
         | 
| 65 | 
            +
                    format.html { render action: "edit" }
         | 
| 66 | 
            +
                    format.json { render json: @syhostmodel.errors, status: :unprocessable_entity }
         | 
| 67 | 
            +
                  end
         | 
| 68 | 
            +
                end
         | 
| 69 | 
            +
              end
         | 
| 70 | 
            +
             | 
| 71 | 
            +
              # DELETE /syhostmodels/1
         | 
| 72 | 
            +
              # DELETE /syhostmodels/1.json
         | 
| 73 | 
            +
              def destroy
         | 
| 74 | 
            +
                @syhostmodel = ForemanHosts::Syhostmodel.find(params[:id])
         | 
| 75 | 
            +
                @syhostmodel.destroy
         | 
| 76 | 
            +
                respond_to do |format|
         | 
| 77 | 
            +
                  format.html { redirect_to foreman_hosts_syhostmodels_url }
         | 
| 78 | 
            +
                  format.json { head :no_content }
         | 
| 79 | 
            +
                end
         | 
| 80 | 
            +
             | 
| 81 | 
            +
             | 
| 82 | 
            +
              end
         | 
| 83 | 
            +
            end
         |