Skip to content

Commit

Permalink
-runApp-port and fix API output
Browse files Browse the repository at this point in the history
  • Loading branch information
jnnngs committed Jun 24, 2024
1 parent 81e0f4d commit 6b785f5
Show file tree
Hide file tree
Showing 18 changed files with 73 additions and 62 deletions.
Binary file modified 3270Connect
Binary file not shown.
Binary file modified 3270Connect.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion app/static/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ <h1>404 - Not found</h1>
<div class="md-progress" data-md-component="progress" role="progressbar"></div>


<script id="__config" type="application/json">{"base": "/", "features": ["navigation.instant", "navigation.instant.progress", "toc.integrate", "navigation.expand", "navigation.top", "navigation.footer"], "search": "/assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "1.0.6"}</script>
<script id="__config" type="application/json">{"base": "/", "features": ["navigation.instant", "navigation.instant.progress", "toc.integrate", "navigation.expand", "navigation.top", "navigation.footer"], "search": "/assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "1.0.7"}</script>


<script src="/assets/javascripts/bundle.ad660dcc.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion app/static/advanced-features/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ <h3 id="3270connect-api-usage">3270Connect API Usage</h3>
<div class="md-progress" data-md-component="progress" role="progressbar"></div>


<script id="__config" type="application/json">{"base": "..", "features": ["navigation.instant", "navigation.instant.progress", "toc.integrate", "navigation.expand", "navigation.top", "navigation.footer"], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "1.0.6"}</script>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.instant", "navigation.instant.progress", "toc.integrate", "navigation.expand", "navigation.top", "navigation.footer"], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "1.0.7"}</script>


<script src="../assets/javascripts/bundle.ad660dcc.min.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions app/static/basic-usage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -735,8 +735,8 @@ <h3 id="windows">Windows</h3>
<p>Run a test 3270 sample application:</p>
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>-p<span class="w"> </span><span class="m">3270</span>:3270<span class="w"> </span>3270io/3270connect-windows:latest<span class="w"> </span>-runApp
</code></pre></div>
<p>Run a specific test 3270 sample application:</p>
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>-p<span class="w"> </span><span class="m">3270</span>:3270<span class="w"> </span>3270io/3270connect-windows:latest<span class="w"> </span>-runApp<span class="w"> </span><span class="o">[</span>number<span class="o">]</span>
<p>Run a specific test 3270 sample application and listening port:</p>
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>-p<span class="w"> </span><span class="m">3270</span>:3270<span class="w"> </span>3270io/3270connect-windows:latest<span class="w"> </span>-runApp<span class="w"> </span><span class="o">[</span>number<span class="o">]</span><span class="w"> </span>-runApp-port<span class="w"> </span><span class="o">[</span>portNumber<span class="o">]</span>
</code></pre></div>
<h3 id="3270connect-basic-usage">3270Connect Basic Usage</h3>
<p><div class="video-container"><video style controls alt="type:video"><source src="../3270Connect_1_0_3_9.mp4" type="video/mp4"></source></video></div></p>
Expand Down Expand Up @@ -841,7 +841,7 @@ <h2 id="conclusion">Conclusion</h2>
<div class="md-progress" data-md-component="progress" role="progressbar"></div>


<script id="__config" type="application/json">{"base": "..", "features": ["navigation.instant", "navigation.instant.progress", "toc.integrate", "navigation.expand", "navigation.top", "navigation.footer"], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "1.0.6"}</script>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.instant", "navigation.instant.progress", "toc.integrate", "navigation.expand", "navigation.top", "navigation.footer"], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "1.0.7"}</script>


<script src="../assets/javascripts/bundle.ad660dcc.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion app/static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ <h3 id="3270connect-api-usage">3270Connect API Usage</h3>
<div class="md-progress" data-md-component="progress" role="progressbar"></div>


<script id="__config" type="application/json">{"base": ".", "features": ["navigation.instant", "navigation.instant.progress", "toc.integrate", "navigation.expand", "navigation.top", "navigation.footer"], "search": "assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "1.0.6"}</script>
<script id="__config" type="application/json">{"base": ".", "features": ["navigation.instant", "navigation.instant.progress", "toc.integrate", "navigation.expand", "navigation.top", "navigation.footer"], "search": "assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "1.0.7"}</script>


<script src="assets/javascripts/bundle.ad660dcc.min.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions app/static/installation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@ <h4 id="additional-docker-run-examples-windows">Additional Docker Run Examples (
<p>Run a test 3270 sample application:</p>
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>-p<span class="w"> </span><span class="m">3270</span>:3270<span class="w"> </span>3270io/3270connect-windows:latest<span class="w"> </span>-runApp
</code></pre></div>
<p>Run a specific test 3270 sample application:</p>
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>-p<span class="w"> </span><span class="m">3270</span>:3270<span class="w"> </span>3270io/3270connect-windows:latest<span class="w"> </span>-runApp<span class="w"> </span><span class="o">[</span>number<span class="o">]</span>
<p>Run a specific test 3270 sample application and listening port:</p>
<div class="highlight"><pre><span></span><code>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>-p<span class="w"> </span><span class="m">3270</span>:3270<span class="w"> </span>3270io/3270connect-windows:latest<span class="w"> </span>-runApp<span class="w"> </span><span class="o">[</span>number<span class="o">]</span><span class="w"> </span>-runApp-port<span class="w"> </span><span class="o">[</span>portNumber<span class="o">]</span>
</code></pre></div></div>


Expand Down Expand Up @@ -630,7 +630,7 @@ <h4 id="additional-docker-run-examples-windows">Additional Docker Run Examples (
<div class="md-progress" data-md-component="progress" role="progressbar"></div>


<script id="__config" type="application/json">{"base": "..", "features": ["navigation.instant", "navigation.instant.progress", "toc.integrate", "navigation.expand", "navigation.top", "navigation.footer"], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "1.0.6"}</script>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.instant", "navigation.instant.progress", "toc.integrate", "navigation.expand", "navigation.top", "navigation.footer"], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "1.0.7"}</script>


<script src="../assets/javascripts/bundle.ad660dcc.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion app/static/search/search_index.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions app/static/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://3270.io/</loc>
<lastmod>2024-06-19</lastmod>
<lastmod>2024-06-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://3270.io/advanced-features/</loc>
<lastmod>2024-06-19</lastmod>
<lastmod>2024-06-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://3270.io/basic-usage/</loc>
<lastmod>2024-06-19</lastmod>
<lastmod>2024-06-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://3270.io/installation/</loc>
<lastmod>2024-06-19</lastmod>
<lastmod>2024-06-24</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://3270.io/workflow/</loc>
<lastmod>2024-06-19</lastmod>
<lastmod>2024-06-24</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified app/static/sitemap.xml.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion app/static/workflow/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ <h2 id="example-workflow">Example Workflow</h2>
<div class="md-progress" data-md-component="progress" role="progressbar"></div>


<script id="__config" type="application/json">{"base": "..", "features": ["navigation.instant", "navigation.instant.progress", "toc.integrate", "navigation.expand", "navigation.top", "navigation.footer"], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "1.0.6"}</script>
<script id="__config" type="application/json">{"base": "..", "features": ["navigation.instant", "navigation.instant.progress", "toc.integrate", "navigation.expand", "navigation.top", "navigation.footer"], "search": "../assets/javascripts/workers/search.b8dbb3d2.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": "1.0.7"}</script>


<script src="../assets/javascripts/bundle.ad660dcc.min.js"></script>
Expand Down
13 changes: 10 additions & 3 deletions connect3270/emulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ func (e *Emulator) execCommandOutput(command string) (string, error) {
return string(output), nil
}

// Initialize output file with run details
// InitializeOutput initializes the output file with run details
func (e *Emulator) InitializeOutput(filePath string, runAPI bool) error {
if Verbose {
log.Printf("Initializing Output file at path: %s", filePath)
Expand All @@ -510,8 +510,15 @@ func (e *Emulator) InitializeOutput(filePath string, runAPI bool) error {
outputContent += fmt.Sprintf("<p>Run Date and Time: %s</p>", currentTime)
}

// Open or create the output file for overwriting
file, err := os.Create(filePath)
// Open or create the output file for overwriting if in API mode
// and for appending if not in API mode
var file *os.File
var err error
if runAPI {
file, err = os.Create(filePath) // Clears the file in API mode
} else {
file, err = os.OpenFile(filePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) // Appends in non-API mode
}
if err != nil {
return fmt.Errorf("error opening or creating file: %v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions docs/basic-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,10 @@ Run a test 3270 sample application:
docker run -it -p 3270:3270 3270io/3270connect-windows:latest -runApp
```

Run a specific test 3270 sample application:
Run a specific test 3270 sample application and listening port:

```bash
docker run -it -p 3270:3270 3270io/3270connect-windows:latest -runApp [number]
docker run -it -p 3270:3270 3270io/3270connect-windows:latest -runApp [number] -runApp-port [portNumber]
```

### 3270Connect Basic Usage
Expand Down
4 changes: 2 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ Run a test 3270 sample application:
docker run -it -p 3270:3270 3270io/3270connect-windows:latest -runApp
```

Run a specific test 3270 sample application:
Run a specific test 3270 sample application and listening port:

```shell
docker run -it -p 3270:3270 3270io/3270connect-windows:latest -runApp [number]
docker run -it -p 3270:3270 3270io/3270connect-windows:latest -runApp [number] -runApp-port [portNumber]
```
Loading

0 comments on commit 6b785f5

Please sign in to comment.