<commit_before><div>
    <div class="view">
        <ol class="breadcrumb">
            <li><a href="#" data-bind="click: function () { $galaxy.transport('stack.list'); }">Stacks</a></li>
            <li data-bind="text: stackTitle"></li>
        </ol>

        <ul id="stack-tabs" class="nav nav-tabs">
            <li class="active"><a href="#detail" class="small-heading" data-toggle="tab">Stack Details</a></li>
            <li><a href="#hosts" class="small-heading" data-toggle="tab" data-bind="visible: editMode() === 'update'">Stack Hosts</a></li>
            <li><a href="#logs" class="small-heading" data-toggle="tab" data-bind="visible: editMode() === 'update'">Stack Logs</a></li>
            <li><a href="#access" class="small-heading" data-toggle="tab" data-bind="visible: editMode() === 'update'">Stack Access Rules</a></li>
        </ul>

        <div class="tab-content">
            <div class="tab-pane active" id="detail">
                <form id="stack-launch-form" role="form">
                    <div class="form-group">
                        <label for="blueprint_title" class=" control-label">Blueprint</label>
                        <input type="text" class="form-control" id="blueprint_title" data-bind="value: blueprintTitle" disabled>
                    </div>

                    <div class="form-group">
                        <label for="stack_title" class=" control-label">Title</label>
                        <input type="text" class="form-control" id="stack_title" placeholder="Stack title">
                    </div>

                    <div class="form-group">
                        <label for="stack_description" class=" control-label">Description</label>
                        <input type="text" class="form-control" id="stack_description" placeholder="Purpose of Stack">
                    </div>

                    <div class="form-group">
                        <label class="control-label" for="stack_namespace">Namespace</label>
                        <input type="text" class="form-control" id="stack_namespace" placeholder="Optionally provide a namespace for this stack">
                    </div>

                    <div class="form-group">
                        <label class="control-label" for="stack_properties_preview">Stack Properties</label>
                        <textarea  
                            class="form-control" 
                            rows="20"
                            id="stack_properties_preview" 
                            data-bind="text: $root.stackPropertiesStringified()"
                            placeholder="The formulas for the selected Blueprint do not contain properties"></textarea>
                    </div>

                    <div class="row">
                        <div class="col-md-3 col-md-offset-9  pull-right">
                            <button class="btn" data-bind="click: cancelChanges">Cancel</button>
                            <button class="btn btn-primary" data-bind="visible: editMode() === 'create', click: $root.provisionStack">Begin Provisioning</button>
                            <button class="btn btn-primary" data-bind="visible: editMode() === 'update', click: $root.updateStack">Save</button>
                        </div>
                    </div>
                </form>
                <div class="row">
                    <hr/>
                </div>
            </div>

            <div class="tab-pane" id="hosts" data-bind="visible: editMode() === 'update'">
                <table id="stack-hosts" class="table table-bordered">
                    <thead>
                        <tr>
                            <th>FQDN</th>
                            <th>State</th>
                            <th>Provider DNS</th>
                            <th>Hostname</th>
                        </tr>
                    </thead>
                    <tbody data-bind="foreach: StackHostStore.collection">
                        <tr>
                            <td data-bind="text: $data.fqdn"></td>
                            <td data-bind="text: $data.state"></td>
                            <td data-bind="text: $data.provider_dns"></td>
                            <td data-bind="text: $data.hostname"></td>
                        </tr>     
                    </tbody>
                </table>
            </div>

            <div class="tab-pane" id="logs" data-bind="visible: editMode() === 'update'">

                <ul class="nav nav-tabs" data-bind="visible: editMode() === 'update'">
                    <li class="active"><a href="#historical" data-toggle="tab">Historical</a></li>
                    <li><a href="#launch" data-toggle="tab">Launch</a></li>
                    <li><a href="#orchestration" data-toggle="tab">Orchestration</a></li>
                    <li><a href="#orchestration-error" data-toggle="tab">Orchestration Error</a></li>
                    <li><a href="#provisioning" data-toggle="tab">Provisioning</a></li>
                    <li><a href="#provisioning-error" data-toggle="tab">Provisioning Error</a></li>
                </ul>

                <div class="tab-content" data-bind="visible: editMode() === 'update'">
                    <div class="tab-pane active" id="historical">
                        <textarea class="form-control"
                               rows="20"
                               id="historical_logs" 
                               data-bind="text: $root.historicalLogText"
                               placeholder="Historical logs will be shown here."></textarea>
                    </div>
                    <div class="tab-pane" id="launch">
                        <textarea class="form-control"
                               rows="20"
                               id="launch_logs" 
                               data-bind="text: $root.launchLogText"
                               placeholder="Launch logs will be shown here."></textarea>
                    </div>
                    <div class="tab-pane" id="orchestration">
                        <textarea class="form-control"
                               rows="20"
                               id="orchestration_logs" 
                               data-bind="text: $root.orchestrationLogText"
                               placeholder="Orchestration logs will be shown here."></textarea>
                    </div>
                    <div class="tab-pane" id="orchestration-error">
                        <textarea class="form-control"
                               rows="20"
                               id="orchestration_error_logs" 
                               data-bind="text: $root.orchestrationErrorLogText"
                               placeholder="Orchestration error logs will be shown here."></textarea>
                    </div>
                    <div class="tab-pane" id="provisioning">
                        <textarea class="form-control"
                               rows="20"
                               id="provisioning_logs" 
                               data-bind="text: $root.provisioningLogText"
                               placeholder="Provisioning logs will be shown here."></textarea>
                    </div>
                    <div class="tab-pane" id="provisioning-error">
                        <textarea class="form-control"
                               rows="20"
                               id="provisioning_error_logs" 
                               data-bind="text: $root.provisioningErrorLogText"
                               placeholder="Provisioning error logs will be shown here."></textarea>
                    </div>
                </div>
            </div>
            <div class="tab-pane" id="access" data-bind="visible: editMode() === 'update'">
                <table id="stack-access" class="table table-bordered">
                    <thead>
                        <tr>
                            <td>Host Type</td>
                            <td>Host Description</td>
                            <td>Current Rules</td>
                            <td>Add New Rule</td>
                        </tr>
                    </thead>
                    <tbody data-bind="foreach: StackSecurityGroupStore.collection">
                        <tr>
                            <td data-bind="text: $data.blueprint_host_definition.title"></td>
                            <td data-bind="text: $data.blueprint_host_definition.description"></td>
                            <td data-bind="foreach: $data.rules">
                                <form role="form" data-bind="attr: { id : $data.uid }">
                                    <div style="line-height:15px !important;" data-bind="if: $data.from_port == $data.to_port">
                                      <span data-bind="text: $data.protocol.toUpperCase()"></span> port <span data-bind="text: $data.from_port"></span> allows <span data-bind="text: $data.rule"></span>
                                    <button type="submit" data-bind="click: $root.deleteRule">Delete</button>
                                    </div>
                                    <div style="line-height:15px !important;" data-bind="if: $data.from_port != $data.to_port">
                                      <span data-bind="text: $data.protocol.toUpperCase()"></span> ports <span data-bind="text: $data.from_port"></span>-<span data-bind="text: $data.to_port"></span> allow <span data-bind="text: $data.rule"></span>
                                    <button type="submit" data-bind="click: $root.deleteRule">Delete</button>
                                    </div>
                                    <input type="hidden" id="rule_protocol" data-bind="attr: { value : $data.protocol }" />
                                    <input type="hidden" id="rule_from_port" data-bind="attr: { value : $data.from_port }" />
                                    <input type="hidden" id="rule_to_port" data-bind="attr: { value : $data.to_port }" />
                                    <input type="hidden" id="rule_rule" data-bind="attr: { value : $data.rule }" />
                                </form>
                            </td>
                            <td>
                                <form class="form-inline" data-bind="attr: { id : $data.id }" role="form">
                                    <div class="form-group">
                                        <label class="sr-only" for="rule_protocol">Protocol</label>
                                        <select id="add_rule_protocol"
                                          data-bind="options: ['tcp','udp','icmp']",
                                          data-container="body"
                                          class="form-control selectpicker input-sm"></select>
                                    </div>

                                    <div class="form-group">
                                        <label for="rule_from_port" class="sr-only">Port Range</label>
                                        <input type="text" class="form-control input-sm" id="add_rule_port_range" placeholder="Port Range (ex 22 or 0-500)" autofocus>
                                    </div><commit_msg>minor UI change to prettify the rule list slightly<commit_after><div>
    <div class="view">
        <ol class="breadcrumb">
            <li><a href="#" data-bind="click: function () { $galaxy.transport('stack.list'); }">Stacks</a></li>
            <li data-bind="text: stackTitle"></li>
        </ol>

        <ul id="stack-tabs" class="nav nav-tabs">
            <li class="active"><a href="#detail" class="small-heading" data-toggle="tab">Stack Details</a></li>
            <li><a href="#hosts" class="small-heading" data-toggle="tab" data-bind="visible: editMode() === 'update'">Stack Hosts</a></li>
            <li><a href="#logs" class="small-heading" data-toggle="tab" data-bind="visible: editMode() === 'update'">Stack Logs</a></li>
            <li><a href="#access" class="small-heading" data-toggle="tab" data-bind="visible: editMode() === 'update'">Stack Access Rules</a></li>
        </ul>

        <div class="tab-content">
            <div class="tab-pane active" id="detail">
                <form id="stack-launch-form" role="form">
                    <div class="form-group">
                        <label for="blueprint_title" class=" control-label">Blueprint</label>
                        <input type="text" class="form-control" id="blueprint_title" data-bind="value: blueprintTitle" disabled>
                    </div>

                    <div class="form-group">
                        <label for="stack_title" class=" control-label">Title</label>
                        <input type="text" class="form-control" id="stack_title" placeholder="Stack title">
                    </div>

                    <div class="form-group">
                        <label for="stack_description" class=" control-label">Description</label>
                        <input type="text" class="form-control" id="stack_description" placeholder="Purpose of Stack">
                    </div>

                    <div class="form-group">
                        <label class="control-label" for="stack_namespace">Namespace</label>
                        <input type="text" class="form-control" id="stack_namespace" placeholder="Optionally provide a namespace for this stack">
                    </div>

                    <div class="form-group">
                        <label class="control-label" for="stack_properties_preview">Stack Properties</label>
                        <textarea  
                            class="form-control" 
                            rows="20"
                            id="stack_properties_preview" 
                            data-bind="text: $root.stackPropertiesStringified()"
                            placeholder="The formulas for the selected Blueprint do not contain properties"></textarea>
                    </div>

                    <div class="row">
                        <div class="col-md-3 col-md-offset-9  pull-right">
                            <button class="btn" data-bind="click: cancelChanges">Cancel</button>
                            <button class="btn btn-primary" data-bind="visible: editMode() === 'create', click: $root.provisionStack">Begin Provisioning</button>
                            <button class="btn btn-primary" data-bind="visible: editMode() === 'update', click: $root.updateStack">Save</button>
                        </div>
                    </div>
                </form>
                <div class="row">
                    <hr/>
                </div>
            </div>

            <div class="tab-pane" id="hosts" data-bind="visible: editMode() === 'update'">
                <table id="stack-hosts" class="table table-bordered">
                    <thead>
                        <tr>
                            <th>FQDN</th>
                            <th>State</th>
                            <th>Provider DNS</th>
                            <th>Hostname</th>
                        </tr>
                    </thead>
                    <tbody data-bind="foreach: StackHostStore.collection">
                        <tr>
                            <td data-bind="text: $data.fqdn"></td>
                            <td data-bind="text: $data.state"></td>
                            <td data-bind="text: $data.provider_dns"></td>
                            <td data-bind="text: $data.hostname"></td>
                        </tr>     
                    </tbody>
                </table>
            </div>

            <div class="tab-pane" id="logs" data-bind="visible: editMode() === 'update'">

                <ul class="nav nav-tabs" data-bind="visible: editMode() === 'update'">
                    <li class="active"><a href="#historical" data-toggle="tab">Historical</a></li>
                    <li><a href="#launch" data-toggle="tab">Launch</a></li>
                    <li><a href="#orchestration" data-toggle="tab">Orchestration</a></li>
                    <li><a href="#orchestration-error" data-toggle="tab">Orchestration Error</a></li>
                    <li><a href="#provisioning" data-toggle="tab">Provisioning</a></li>
                    <li><a href="#provisioning-error" data-toggle="tab">Provisioning Error</a></li>
                </ul>

                <div class="tab-content" data-bind="visible: editMode() === 'update'">
                    <div class="tab-pane active" id="historical">
                        <textarea class="form-control"
                               rows="20"
                               id="historical_logs" 
                               data-bind="text: $root.historicalLogText"
                               placeholder="Historical logs will be shown here."></textarea>
                    </div>
                    <div class="tab-pane" id="launch">
                        <textarea class="form-control"
                               rows="20"
                               id="launch_logs" 
                               data-bind="text: $root.launchLogText"
                               placeholder="Launch logs will be shown here."></textarea>
                    </div>
                    <div class="tab-pane" id="orchestration">
                        <textarea class="form-control"
                               rows="20"
                               id="orchestration_logs" 
                               data-bind="text: $root.orchestrationLogText"
                               placeholder="Orchestration logs will be shown here."></textarea>
                    </div>
                    <div class="tab-pane" id="orchestration-error">
                        <textarea class="form-control"
                               rows="20"
                               id="orchestration_error_logs" 
                               data-bind="text: $root.orchestrationErrorLogText"
                               placeholder="Orchestration error logs will be shown here."></textarea>
                    </div>
                    <div class="tab-pane" id="provisioning">
                        <textarea class="form-control"
                               rows="20"
                               id="provisioning_logs" 
                               data-bind="text: $root.provisioningLogText"
                               placeholder="Provisioning logs will be shown here."></textarea>
                    </div>
                    <div class="tab-pane" id="provisioning-error">
                        <textarea class="form-control"
                               rows="20"
                               id="provisioning_error_logs" 
                               data-bind="text: $root.provisioningErrorLogText"
                               placeholder="Provisioning error logs will be shown here."></textarea>
                    </div>
                </div>
            </div>
            <div class="tab-pane" id="access" data-bind="visible: editMode() === 'update'">
                <table id="stack-access" class="table table-bordered">
                    <thead>
                        <tr>
                            <td>Host Type</td>
                            <td>Host Description</td>
                            <td>Current Rules</td>
                            <td>Add New Rule</td>
                        </tr>
                    </thead>
                    <tbody data-bind="foreach: StackSecurityGroupStore.collection">
                        <tr>
                            <td data-bind="text: $data.blueprint_host_definition.title"></td>
                            <td data-bind="text: $data.blueprint_host_definition.description"></td>
                            <td>
                              <ul class="list-group" data-bind="foreach: $data.rules">
                                <li class="list-group-item">
                                <form role="form" data-bind="attr: { id : $data.uid }">
                                    <span data-bind="visible: $data.from_port == $data.to_port">
                                        <span data-bind="text: $data.protocol.toUpperCase()"></span> 
                                        port <span data-bind="text: $data.from_port"></span> 
                                        allows <span data-bind="text: $data.rule"></span>
                                    </span>
                                    <span data-bind="visible: $data.from_port != $data.to_port">
                                        <span data-bind="text: $data.protocol.toUpperCase()"></span> 
                                        ports <span data-bind="text: $data.from_port"></span>-<span data-bind="text: $data.to_port"></span> 
                                        allow <span data-bind="text: $data.rule"></span>
                                    </span>
                                    <input type="hidden" id="rule_protocol" 
                                           data-bind="attr: { value : $data.protocol }" />
                                    <input type="hidden" id="rule_from_port" 
                                           data-bind="attr: { value : $data.from_port }" />
                                    <input type="hidden" id="rule_to_port" 
                                           data-bind="attr: { value : $data.to_port }" />
                                    <input type="hidden" id="rule_rule" 
                                           data-bind="attr: { value : $data.rule }" />
                                    <button type="submit" class="btn btn-danger btn-xs" 
                                           data-bind="click: $root.deleteRule">Delete</button>
                                </form>
                                </li>
                              </ul>
                            </td>
                            <td>
                                <form class="form-inline" data-bind="attr: { id : $data.id }" role="form">
                                    <div class="form-group">
                                        <label class="sr-only" for="rule_protocol">Protocol</label>
                                        <select id="add_rule_protocol"
                                          data-bind="options: ['tcp','udp','icmp']",
                                          data-container="body"
                                          class="form-control selectpicker input-sm"></select>
                                    </div>

                                    <div class="form-group">
                                        <label for="rule_from_port" class="sr-only">Port Range</label>
                                        <input type="text" class="form-control input-sm" id="add_rule_port_range" placeholder="Port Range (ex 22 or 0-500)" autofocus>
                                    </div>
{'fraction_non_alphanumeric': 0.13353822179897845, 'fraction_numerical': 0.0020777421868236516, 'mean_word_length': 1.2044847328244275, 'pattern_counts': {'":': 0, '<': 439, '<?xml version=': 0, '>': 439, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 74, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6637930', 'n_tokens_mistral': 5699, 'n_tokens_neox': 5372, 'n_words': 1024}