TelegramAktienBot/documentation/frontend/interfaces/Share.html

627 lines
27 KiB
HTML
Raw Permalink Normal View History

2022-05-03 08:59:36 +00:00
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>aktienbot documentation</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
2022-05-10 11:03:10 +00:00
<link rel="stylesheet" href="../styles/style.css">
2022-05-03 08:59:36 +00:00
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top visible-xs">
<a href="../" class="navbar-brand">aktienbot documentation</a>
2022-05-10 11:03:10 +00:00
<button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>
2022-05-03 08:59:36 +00:00
</div>
<div class="xs-menu menu" id="mobile-menu">
2022-05-10 11:03:10 +00:00
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-modules-links"
></span>
</a>
<ul class="links collapse in"
id="xs-modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-components-links"
></span>
</div>
<ul class="links collapse in"
id="xs-components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-injectables-links"
></span>
</div>
<ul class="links collapse in"
id="xs-injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#xs-interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="xs-interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" class="active" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
2022-05-03 08:59:36 +00:00
</div>
<div class="container-fluid main">
<div class="row main">
<div class="hidden-xs menu">
2022-05-10 11:03:10 +00:00
<nav>
<ul class="list">
<li class="title">
<a href="../">aktienbot documentation</a>
</li>
<li class="divider"></li>
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search">
</div>
<li class="chapter">
<a data-type="chapter-link" href="../"><span class="fa fa-home"></span>Getting started</a>
<ul class="links">
<li class="link">
<a href="../" ><span class="fa fa-file-text-o"></span>README</a>
</li>
<li class="link">
<a
href="../overview.html"
href="../overview.html"
>
<span class="fa fa-th"></span>Overview
</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="./modules.html" >
<span class="fa fa-archive"></span>
<span>Modules</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#modules-links"
></span>
</a>
<ul class="links collapse in"
id="modules-links"
>
<li class="link">
<a href="../modules/AppModule.html" >AppModule</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-cogs"></span>
<span>Components</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#components-links"
></span>
</div>
<ul class="links collapse in"
id="components-links"
>
<li class="link">
<a href="../components/AppComponent.html" >AppComponent</a>
</li>
<li class="link">
<a href="../components/BotSettingsComponent.html" >BotSettingsComponent</a>
</li>
<li class="link">
<a href="../components/ConfirmationDialogComponent.html" >ConfirmationDialogComponent</a>
</li>
<li class="link">
<a href="../components/DashboardComponent.html" >DashboardComponent</a>
</li>
<li class="link">
<a href="../components/HeaderComponent.html" >HeaderComponent</a>
</li>
<li class="link">
<a href="../components/HelpDialogComponent.html" >HelpDialogComponent</a>
</li>
<li class="link">
<a href="../components/LoginComponent.html" >LoginComponent</a>
</li>
<li class="link">
<a href="../components/ProfileComponent.html" >ProfileComponent</a>
</li>
<li class="link">
<a href="../components/RegisterComponent.html" >RegisterComponent</a>
</li>
<li class="link">
<a href="../components/UserDialogComponent.html" >UserDialogComponent</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-long-arrow-down"></span>
<span>Injectables</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#injectables-links"
></span>
</div>
<ul class="links collapse in"
id="injectables-links"
>
<li class="link">
<a href="../injectables/AuthInterceptor.html" >AuthInterceptor</a>
</li>
<li class="link">
<a href="../injectables/AuthService.html" >AuthService</a>
</li>
<li class="link">
<a href="../injectables/BotService.html" >BotService</a>
</li>
<li class="link">
<a href="../injectables/DataService.html" >DataService</a>
</li>
<li class="link">
<a href="../injectables/HelperService.html" >HelperService</a>
</li>
<li class="link">
<a href="../injectables/ProfileService.html" >ProfileService</a>
</li>
<li class="link">
<a href="../injectables/TokenStorageService.html" >TokenStorageService</a>
</li>
</ul>
</li>
<li class="chapter">
<div class="simple">
<span class="fa fa-info"></span>
<span>Interfaces</span>
<span class="menu-toggler fa fa-angle-up" data-toggle="collapse"
data-target="#interfaces-links"
></span>
</div>
<ul class="links collapse in"
id="interfaces-links"
>
<li class="link">
<a href="../interfaces/Keyword.html" >Keyword</a>
</li>
<li class="link">
<a href="../interfaces/Share.html" class="active" >Share</a>
</li>
<li class="link">
<a href="../interfaces/Stock.html" >Stock</a>
</li>
<li class="link">
<a href="../interfaces/TransactionData.html" >TransactionData</a>
</li>
</ul>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../miscellaneous.html" ><span class="fa fa-cubes"></span>Miscellaneous</a>
</li>
<li class="chapter">
<a data-type="chapter-link" href="../coverage.html" ><span class="fa fa-tasks"></span>Documentation coverage</a>
</li>
<li class="divider"></li>
<li class="copyright">
Documentation generated using <a href="https://compodoc.github.io/compodoc/" target="_blank">
<img src="..//images/compodoc-vectorise.svg" class="img-responsive">
</a>
</li>
</ul>
</nav>
2022-05-03 08:59:36 +00:00
</div>
<div class="content interface">
<div class="content-data">
<ol class="breadcrumb">
<li>Interfaces</li>
2022-05-10 11:03:10 +00:00
<li>Share</li>
2022-05-03 08:59:36 +00:00
</ol>
<ul class="nav nav-tabs" role="tablist">
2022-05-10 11:03:10 +00:00
<li class="active">
<a href="#infos" id="infos-tab" role="tab" data-toggle="tab">Infos</a>
</li>
<li>
<a href="#source" role="tab" id="source-tab" data-toggle="tab">Source</a>
</li>
2022-05-03 08:59:36 +00:00
</ul>
<div class="tab-content">
2022-05-10 11:03:10 +00:00
<div class="tab-pane fade active in" id="infos">
2022-05-03 08:59:36 +00:00
<p class="comment">
<h3>File</h3>
</p>
<p class="comment">
<code>src/app/Views/bot-settings/bot-settings.component.ts</code>
</p>
<section>
<h3 id="inputs">Properties</h3>
<table class="table table-sm table-bordered">
<tbody>
<tr>
<td class="col-md-4">
2022-05-10 11:03:10 +00:00
<b>isin</b>
2022-05-03 08:59:36 +00:00
</td>
</tr>
<tr>
<td class="col-md-4">
2022-05-10 11:03:10 +00:00
<code>isin: <code>string</code>
</bcode>
2022-05-03 08:59:36 +00:00
</td>
</tr>
<tr>
<td class="col-md-4">
2022-05-10 11:03:10 +00:00
<i>Type : </i> <code>string</code>
2022-05-03 08:59:36 +00:00
</td>
</tr>
</tbody>
</table>
</section>
</div>
2022-05-10 11:03:10 +00:00
<div class="tab-pane fade tab-source-code" id="source">
<pre><code class="hljs javascript">import { Component, OnInit } from &#x27;@angular/core&#x27;;
2022-05-03 08:59:36 +00:00
import { C, COMMA, ENTER, F } from &#x27;@angular/cdk/keycodes&#x27;;
import { MatChipInputEvent } from &#x27;@angular/material/chips&#x27;;
import { CronOptions } from &#x27;ngx-cron-editor&#x27;;
import { BotService } from &#x27;src/app/Services/bot.service&#x27;;
import { HelperService } from &#x27;src/app/Helpers/helper.service&#x27;;
import { ProfileService } from &#x27;src/app/Services/profile.service&#x27;;
import { FormControl } from &#x27;@angular/forms&#x27;;
export interface Share {
isin: string;
}
export interface Keyword {
name: string;
}
@Component({
selector: &#x27;app-bot-settings&#x27;,
templateUrl: &#x27;./bot-settings.component.html&#x27;,
styleUrls: [&#x27;./bot-settings.component.scss&#x27;],
})
export class BotSettingsComponent implements OnInit {
keywords: Keyword[] &#x3D; [];
shares: Share[] &#x3D; [];
constructor(
private botService: BotService,
private helper: HelperService,
private profileService: ProfileService
) {}
ngOnInit(): void {
this.shares &#x3D; this.helper.formatShareData();
this.keywords &#x3D; this.helper.formatKeywordsData();
}
addOnBlur &#x3D; true;
readonly separatorKeysCodes &#x3D; [ENTER, COMMA] as const;
async addKeyword(event: MatChipInputEvent): Promise&lt;void&gt; {
const value &#x3D; (event.value || &#x27;&#x27;).trim();
// Add keyword to database
if (value &amp;&amp; !this.keywords.includes({ name: value })) {
console.log(&#x27;Added: &#x27; + value);
this.botService.createKeyword(value.toLowerCase()).subscribe((result) &#x3D;&gt; {
console.log(result);
});
}
// Clear the input value
event.chipInput!.clear();
if (value) {
await this.helper.delay(1000);
this.keywords &#x3D; [];
this.keywords &#x3D; this.helper.formatKeywordsData();
}
}
async removeKeyword(keyword: Keyword): Promise&lt;void&gt; {
this.botService.deleteKeyword(keyword.name).subscribe((result) &#x3D;&gt; {
console.log(result);
});
await this.helper.delay(1000);
this.keywords &#x3D; [];
this.keywords &#x3D; this.helper.formatKeywordsData();
}
async addShare(event: MatChipInputEvent): Promise&lt;void&gt; {
const value &#x3D; (event.value || &#x27;&#x27;).trim();
// Add share to database
if (value &amp;&amp; !this.shares.includes({ isin: value.toLowerCase() })) {
console.log(&#x27;Added: &#x27; + value);
this.botService.createShare(value, &#x27;Comment&#x27;).subscribe((result) &#x3D;&gt; {
console.log(result);
});
}
// Clear the input value
event.chipInput!.clear();
if (value) {
await this.helper.delay(1000);
this.shares &#x3D; [];
this.shares &#x3D; this.helper.formatShareData();
}
}
async removeShare(share: Share): Promise&lt;void&gt; {
this.botService.deleteShare(share.isin).subscribe((result) &#x3D;&gt; {
console.log(result);
});
await this.helper.delay(1000);
this.shares &#x3D; [];
this.shares &#x3D; this.helper.formatShareData();
}
setCronString() {
this.profileService
.addCronString(this.cronForm.value)
.subscribe((result) &#x3D;&gt; {
console.log(result);
});
}
cronForm &#x3D; new FormControl(&#x27;0 0 1/1 * *&#x27;);
public cronOptions: CronOptions &#x3D; {
defaultTime: &#x27;00:00:00&#x27;,
hideMinutesTab: true,
hideHourlyTab: true,
hideDailyTab: false,
hideWeeklyTab: true,
hideMonthlyTab: true,
hideYearlyTab: true,
hideAdvancedTab: true,
hideSpecificWeekDayTab: true,
hideSpecificMonthWeekTab: true,
use24HourTime: true,
hideSeconds: true,
cronFlavor: &#x27;quartz&#x27;, //standard or quartz
};
}
</code></pre>
</div>
</div>
</div><div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
<script src="../js/libs/bootstrap-native.js"></script>
<script src="../js/libs/es6-shim.min.js"></script>
<script src="../js/libs/EventDispatcher.js"></script>
<script src="../js/libs/promise.min.js"></script>
<script src="../js/libs/zepto.min.js"></script>
<script src="../js/compodoc.js"></script>
2022-05-10 11:03:10 +00:00
<script src="../js/search/search.js"></script>
<script src="../js/search/lunr.min.js"></script>
<script src="../js/search/search-lunr.js"></script>
2022-05-03 08:59:36 +00:00
2022-05-10 11:03:10 +00:00
<script src="../js/menu.js"></script>
<script src="../js/libs/highlight.pack.js"></script>
<script src="../js/libs/highlightjs-line-numbers.min.js"></script>
<script src="../js/search/search_index.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
hljs.initHighlightingOnLoad();
hljs.initLineNumbersOnLoad();
});
</script>
2022-05-03 08:59:36 +00:00
</body>
</html>