Skip to content
This repository was archived by the owner on Mar 8, 2024. It is now read-only.

Commit 06f5261

Browse files
FelixKirschJWittmeyerlumburovskalinaJWittmeyerdependabot[bot]
authored
Release v1.2.0 (#52)
* Update LICENSE * Documentation link on tokenizer fixed * Links to public repos * Removes retry from http failure * Adds check for demo application * Changes logic slightly admins * Adds demo banner * Discord link and icon on sidebar menu * Saving forever fix and opacity tooltip fixed * Long embedding names that break modal for zero-shot fixed * Heuristic statuses shared component * Removed function on name click on heuristics * Zero shot module renamed and tooltips fixed on zero-shot page * Renamed items to records on heuristics page * Condition for continue project based on a new state for sample projects * Removes user check on information source websocket update * Adds badge & call to action * Removed unused code * 3/5 changed to 4/5, wrong percentage * Refactor heuristic statuses component * Navigation link on record IDE fixed * Modal configuration fixes * Reduced margin-top between icons on sidebar menu for smaller devices * Changed onInit to onChanges * Changed public links * Transfers import options to backend * Bump eventsource from 1.1.0 to 1.1.2 Bumps [eventsource](https://github.com/EventSource/eventsource) from 1.1.0 to 1.1.2. - [Release notes](https://github.com/EventSource/eventsource/releases) - [Changelog](https://github.com/EventSource/eventsource/blob/master/HISTORY.md) - [Commits](EventSource/eventsource@v1.1.0...v1.1.2) --- updated-dependencies: - dependency-name: eventsource dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Adds .github - dependabot yml * Bump minimist from 1.2.5 to 1.2.6 Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. - [Release notes](https://github.com/substack/minimist/releases) - [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6) --- updated-dependencies: - dependency-name: minimist dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump nanoid from 3.1.30 to 3.3.4 Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.30 to 3.3.4. - [Release notes](https://github.com/ai/nanoid/releases) - [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md) - [Commits](ai/nanoid@3.1.30...3.3.4) --- updated-dependencies: - dependency-name: nanoid dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump async from 2.6.3 to 2.6.4 Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4. - [Release notes](https://github.com/caolan/async/releases) - [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md) - [Commits](caolan/async@v2.6.3...v2.6.4) --- updated-dependencies: - dependency-name: async dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Small yml change * Bump async from 2.6.3 to 2.6.4 Bumps [async](https://github.com/caolan/async) from 2.6.3 to 2.6.4. - [Release notes](https://github.com/caolan/async/releases) - [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md) - [Commits](caolan/async@v2.6.3...v2.6.4) --- updated-dependencies: - dependency-name: async dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump url-parse from 1.5.3 to 1.5.10 Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.3 to 1.5.10. - [Release notes](https://github.com/unshiftio/url-parse/releases) - [Commits](unshiftio/url-parse@1.5.3...1.5.10) --- updated-dependencies: - dependency-name: url-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Bump karma from 6.3.6 to 6.4.0 Bumps [karma](https://github.com/karma-runner/karma) from 6.3.6 to 6.4.0. - [Release notes](https://github.com/karma-runner/karma/releases) - [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) - [Commits](karma-runner/karma@v6.3.6...v6.4.0) --- updated-dependencies: - dependency-name: karma dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump karma from 6.3.6 to 6.4.0 Bumps [karma](https://github.com/karma-runner/karma) from 6.3.6 to 6.4.0. - [Release notes](https://github.com/karma-runner/karma/releases) - [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md) - [Commits](karma-runner/karma@v6.3.6...v6.4.0) --- updated-dependencies: - dependency-name: karma dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Bump follow-redirects from 1.14.5 to 1.15.1 Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.5 to 1.15.1. - [Release notes](https://github.com/follow-redirects/follow-redirects/releases) - [Commits](follow-redirects/follow-redirects@v1.14.5...v1.15.1) --- updated-dependencies: - dependency-name: follow-redirects dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> * Shared component dropdown (#10) * Kern dropdowns refactor * Add checkboxes option to kern dropdown * Remove unused code * Removed unused code * Kern dropdown improvements for disabled buttons * Removed unused code * Remove commented code * Adds first (unfinished) version of iteration * With icon option * Adds checkbox logic * Replaced dropdown with one component * Removed unused code * Removed unused code * Renamed existing component to kern dropdown * Reverted change * Removed dummy code * Removed commented code * Header zindex over sticky header on heuristics and lookup lists * Console log removed * Improvements on dropdown shared component * Prefilled heuristics * Updated dropdown options * More flexible dropdown * Updated helped with more explanations * Adds differnt logic for color generation * Remove debug values * Width changes * Small fixes on dropdown * Function name changed Co-authored-by: JWittmeyer <jens.wittmeyer@onetask.ai> Co-authored-by: JWittmeyer <91723236+JWittmeyer@users.noreply.github.com> * Upgrade Angular 13 (#32) * Upgrade Angular 13 * Consistency improvements * Added home icon on header * Adds notification center data tip * Demo user restrictions on front end (#33) * Demo user restrictions on front end * Demo user check fix * Removes trigger for testing * Bump node version to 16.10.5 * Updates lock file * Removes unused drone trigger * Fixes Bugs in the record ide (#36) * runs record ide for next or prev record * pr comment * changes notification center icon (#37) * sets version number to v1.1 (#38) * Readd mixed results (#39) * Adds hotfix (#40) * Demo changes (#42) * Checks for demo flag for local org creation * Adds timeout for databrowser alert * Adds chrome check * Adds star button with call to action * Fixes no label AND filter bug * increases version to v1.1.1 * Fix typo in browser check * Removed console log Co-authored-by: felix0496 <felix.kirsch@kern.ai> Co-authored-by: Felix Kirsch <40427105+FelixKirsch@users.noreply.github.com> Co-authored-by: Lina <lina.lumburovska@kern.ai> * Model download page (#44) * Downloaded models page start * Queries and mutations * Model download mutations and queries * Model providers page improvements * Seconds to milliseconds * Model name parameter changed * Model name changes * Changes modelname * Model download page improvements * Sizes changed * changes method and api names * adds status to model provider info query * Typo downaloded fixed * Changed select option bar * Spinner, refetch added * Invalid date fix * Icons for downaloded models added * Console error fix * Green color when the models are downloaded * Align icons and disable add when duplicate is added * Added green color to the downloaded models as part of the kern dropdown component * Comments from PR * Delete model modal and moved the right page to pages * Parce date and combine requests added * Optimized code * applies api changes in the gateway, global notifications * Added button disabled for OS version * Aligned icons * Separator for models, and types with icon instead of column * Added info on hover * Adds config manager error on request before init * PR comments * Update config check * Align elements on project settings * Global changes for the modal center alignment Co-authored-by: felix0496 <felix.kirsch@kern.ai> Co-authored-by: JWittmeyer <jens.wittmeyer@onetask.ai> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: JWittmeyer <91723236+JWittmeyer@users.noreply.github.com> Co-authored-by: Lina <lina.lumburovska@kern.ai> Co-authored-by: JWittmeyer <jens.wittmeyer@onetask.ai> Co-authored-by: lumburovskalina <104008550+lumburovskalina@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 679955a commit 06f5261

29 files changed

+727
-49
lines changed

src/app/app-routing.module.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { ProjectNewComponent } from './projects/components/project-new/project-n
1616
import { ProjectAddComponent } from './projects/components/project-add/project-add.component';
1717
import { RecordIDEComponent } from './record-ide/components/record-ide.component';
1818
import { ConfigComponent } from './config/components/config.component';
19+
import { ModelDownloadComponent } from './model-download/pages/model-download/model-download.component';
1920

2021
const routes: Routes = [
2122
{
@@ -27,6 +28,7 @@ const routes: Routes = [
2728
{ path: 'notification-center', component: NotificationCenterComponent, data: { name: 'NotificationCenterComponent' } },
2829
{ path: 'projects/new', component: ProjectNewComponent, data: { name: 'ProjectNewComponent' } },
2930
{ path: 'config', component: ConfigComponent, data: { name: 'ConfigComponent' } },
31+
3032
{
3133
path: 'projects/:projectId',
3234
component: ProjectComponent,
@@ -54,6 +56,7 @@ const routes: Routes = [
5456
path: 'knowledge-base/:knowledgeBaseId',
5557
component: KnowledgeBaseDetailsComponent, data: { name: 'KnowledgeBaseDetailsComponent' }
5658
},
59+
{ path: 'model-download', component: ModelDownloadComponent, data: { name: 'ModelDownloadComponent' } },
5760
{ path: '**', component: ProjectOverviewComponent, data: { name: 'ProjectOverviewComponent' } },
5861
//TODO: redirecting to projects overview page and errors
5962
],

src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { ConfigModule } from './config/config.module'
2222
import { IntercomModule } from 'ng-intercom';
2323
import { NotificationCenterModule } from './notification-center/notification-center.module';
2424
import { RecordIDEModule } from './record-ide/record-ide.module';
25+
import { ModelDownloadModule } from './model-download/model-download.module';
2526

2627
@NgModule({
2728
declarations: [AppComponent],
@@ -40,6 +41,7 @@ import { RecordIDEModule } from './record-ide/record-ide.module';
4041
ZeroShotModule,
4142
LabelingModule,
4243
RecordIDEModule,
44+
ModelDownloadModule,
4345
NotificationCenterModule,
4446
MonacoEditorModule.forRoot(),
4547
KnowledgeBasesModule,

src/app/base/components/dropdown/dropdown-helper.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { FormArray } from "@angular/forms";
2323
* @textHoverColor {string, optional} - text color on hover for the dropdown options
2424
* @textSize {string, optional} - text size for the dropdown options
2525
* @isButtonSampleProjects {boolean, optional} - checks if the button is the specific one for sample project
26+
* @isModelDownloaded {boolean[], optional} - checks if the model is downloaded and if so the color of the text is green
2627
*/
2728
export type DropdownOptions = {
2829
optionArray: string[] | FormArray[] | any[];
@@ -46,5 +47,6 @@ export type DropdownOptions = {
4647
textHoverColor?: string;
4748
textSize?: string;
4849
isButtonSampleProjects?: boolean;
50+
isModelDownloaded: boolean[];
4951
};
5052

src/app/base/components/dropdown/dropdown.component.html

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<div class="relative" [ngClass]="dropdownOptions.buttonVersion == 'default' ? ' w-max' : '' ">
2-
<button #dropdownOpenButton type="button" [attr.data-tip]="dropdownOptions.buttonTooltip" *ngIf="dropdownOptions.buttonVersion == 'default'"
2+
<button #dropdownOpenButton type="button" [attr.data-tip]="dropdownOptions.buttonTooltip"
3+
*ngIf="dropdownOptions.buttonVersion == 'default'"
34
class="inline-flex rounded-md border shadow-sm px-4 items-center text-xs font-semibold cursor-pointer focus:ring-offset-2 focus:ring-offset-gray-400"
45
id="menu-button" aria-expanded="true" aria-haspopup="true" [disabled]="dropdownOptions.isDisabled"
56
[ngClass]="buttonClassList" (isMenuOpen)="toggleVisible($event, dropdownOptionsDiv)" appDropdown>
@@ -18,29 +19,28 @@
1819
</svg>
1920
</button>
2021

21-
<svg *ngIf="dropdownOptions.buttonVersion== '...'" (isMenuOpen)="toggleVisible($event, dropdownOptionsDiv)" appDropdown
22-
xmlns="http://www.w3.org/2000/svg"
23-
class="h-5 w-5 float-right cursor-pointer text-gray-500" viewBox="0 0 20 20"
24-
fill="currentColor">
25-
<path
26-
d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" />
22+
<svg *ngIf="dropdownOptions.buttonVersion== '...'" (isMenuOpen)="toggleVisible($event, dropdownOptionsDiv)"
23+
appDropdown xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 float-right cursor-pointer text-gray-500"
24+
viewBox="0 0 20 20" fill="currentColor">
25+
<path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" />
2726
</svg>
2827
<a *ngIf="dropdownOptions.buttonVersion== 'userIcon'" tabindex="0" class="w-full cursor-pointer">
29-
<div data-intercom-target="User Avatar Button" (isMenuOpen)="toggleVisible($event, dropdownOptionsDiv)" appDropdown>
28+
<div data-intercom-target="User Avatar Button" (isMenuOpen)="toggleVisible($event, dropdownOptionsDiv)"
29+
appDropdown>
3030
<img class="h-8 w-8" [src]="dropdownOptions.avatarUri">
3131
</div>
3232
</a>
3333

3434
<div #dropdownOptionsDiv
3535
class="origin-top-right absolute mt-2 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none hidden"
36-
[ngClass]="[dropdownClassList, dropdownOptions.isButtonSampleProjects ? 'width-sample-projects' : '', dropdownOptions.buttonVersion != '...' ? 'min-w-full': '']"
36+
[ngClass]="[dropdownClassList, dropdownOptions.isButtonSampleProjects ? 'width-sample-projects' : '', dropdownOptions.buttonVersion != '...' ? 'min-w-full': '']"
3737
role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1">
3838
<div class="py-1 cursor-pointer" role="none">
3939
<div *ngFor="let caption of dropdownOptionCaptions;let i = index" (click)="performActionOnOption($event,i)"
40-
[ngClass]="[dropdownOptions.textSize,dropdownOptions.textColor,dropdownOptions.optionDescriptions ? '' : 'flex' ,dropdownOptions.isOptionDisabled?.length && dropdownOptions.isOptionDisabled[i]?'opacity-50 cursor-not-allowed':'',!dropdownOptions.hasCheckboxes ? dropdownOptions.hoverColor + ' ' +dropdownOptions.textHoverColor:'']"
40+
[ngClass]="[dropdownOptions.textSize,dropdownOptions.textColor,dropdownOptions.optionDescriptions ? '' : 'flex' ,dropdownOptions.isOptionDisabled?.length && dropdownOptions.isOptionDisabled[i]?'opacity-50 cursor-not-allowed':'',!dropdownOptions.hasCheckboxes ? dropdownOptions.hoverColor + ' ' +dropdownOptions.textHoverColor:'', dropdownOptions.isModelDownloaded?.length && dropdownOptions.isModelDownloaded[i] ? 'text-green-700 hover:text-lime-300': '']"
4141
[ngStyle]="{'border-bottom': dropdownOptions.isButtonSampleProjects && i%2 == 0 && i!=dropdownOptionCaptions.length-1 ? '1px dashed #e2e8f0' : (dropdownOptions.isButtonSampleProjects && i%2 != 0 && i!=dropdownOptionCaptions.length-1 ? '1px solid #e2e8f0' : null) }"
42-
class="block px-2 py-1.5 flex-row flex-nowrap items-center gap-x-2 w-max min-w-full"
43-
role="menuitem" tabindex="-1" id="menu-item-0">
42+
class="block px-2 py-1.5 flex-row flex-nowrap items-center gap-x-2 w-max min-w-full" role="menuitem"
43+
tabindex="-1" id="menu-item-0">
4444
<ng-template [ngIf]="dropdownOptions.hasCheckboxes">
4545
<div class="h-4 w-4 border-gray-300 border rounded hover:bg-gray-200"
4646
[ngStyle]="{'background-color':getActiveNegateGroupColor(dropdownOptions.optionArray[i]), 'border-color':getActiveNegateGroupColor(dropdownOptions.optionArray[i])}">
@@ -53,7 +53,8 @@
5353
</ng-template>
5454
{{ caption }}
5555

56-
<p *ngIf="dropdownOptions.optionDescriptions && dropdownOptions.optionDescriptions[i] != ''" class="mt-2">
56+
<p *ngIf="dropdownOptions.optionDescriptions && dropdownOptions.optionDescriptions[i] != ''"
57+
class="mt-2">
5758
{{dropdownOptions.optionDescriptions[i]}}
5859
</p>
5960
</div>
@@ -67,8 +68,8 @@
6768
<ng-template ngSwitchDefault>
6869
</ng-template>
6970
<ng-template ngSwitchCase="clickbait">
70-
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-fish-hook inline-block" width="20"
71-
height="20" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
71+
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-fish-hook inline-block"
72+
width="20" height="20" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
7273
stroke-linecap="round" stroke-linejoin="round">
7374
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
7475
<path d="M16 9v6a5 5 0 0 1 -10 0v-4l3 3"></path>
@@ -77,8 +78,8 @@
7778
</svg>
7879
</ng-template>
7980
<ng-template ngSwitchCase="conversational-ai">
80-
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-message-circle inline-block" width="20"
81-
height="20" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
81+
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-message-circle inline-block"
82+
width="20" height="20" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
8283
stroke-linecap="round" stroke-linejoin="round">
8384
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
8485
<path d="M3 20l1.3 -3.9a9 8 0 1 1 3.4 2.9l-4.7 1"></path>
@@ -88,9 +89,9 @@
8889
</svg>
8990
</ng-template>
9091
<ng-template ngSwitchCase="ag-news">
91-
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-news inline-block" width="20" height="20"
92-
viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
93-
stroke-linejoin="round">
92+
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-news inline-block" width="20"
93+
height="20" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
94+
stroke-linecap="round" stroke-linejoin="round">
9495
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
9596
<path
9697
d="M16 6h3a1 1 0 0 1 1 1v11a2 2 0 0 1 -4 0v-13a1 1 0 0 0 -1 -1h-10a1 1 0 0 0 -1 1v12a3 3 0 0 0 3 3h11">
@@ -159,33 +160,33 @@
159160
</svg>
160161
</ng-template>
161162
<ng-template ngSwitchCase="delete-selected">
162-
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline-block" fill="none"
163-
viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
163+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline-block" fill="none" viewBox="0 0 24 24"
164+
stroke="currentColor" stroke-width="2">
164165
<path stroke-linecap="round" stroke-linejoin="round"
165166
d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
166167
</svg>
167168
</ng-template>
168169
<ng-template ngSwitchCase="labeling-function">
169-
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline-block"
170-
viewBox="0 0 20 20" fill="currentColor">
170+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline-block" viewBox="0 0 20 20"
171+
fill="currentColor">
171172
<path fill-rule="evenodd"
172173
d="M12.316 3.051a1 1 0 01.633 1.265l-4 12a1 1 0 11-1.898-.632l4-12a1 1 0 011.265-.633zM5.707 6.293a1 1 0 010 1.414L3.414 10l2.293 2.293a1 1 0 11-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0zm8.586 0a1 1 0 011.414 0l3 3a1 1 0 010 1.414l-3 3a1 1 0 11-1.414-1.414L16.586 10l-2.293-2.293a1 1 0 010-1.414z"
173174
clip-rule="evenodd" />
174175
</svg>
175176
</ng-template>
176177

177178
<ng-template ngSwitchCase="active-learning">
178-
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline-block"
179-
viewBox="0 0 20 20" fill="currentColor">
179+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline-block" viewBox="0 0 20 20"
180+
fill="currentColor">
180181
<path fill-rule="evenodd"
181182
d="M11.3 1.046A1 1 0 0112 2v5h4a1 1 0 01.82 1.573l-7 10A1 1 0 018 18v-5H4a1 1 0 01-.82-1.573l7-10a1 1 0 011.12-.38z"
182183
clip-rule="evenodd" />
183184
</svg>
184185
</ng-template>
185186

186187
<ng-template ngSwitchCase="zero-shot">
187-
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline-block"
188-
viewBox="0 0 20 20" fill="currentColor">
188+
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 inline-block" viewBox="0 0 20 20"
189+
fill="currentColor">
189190
<path fill-rule="evenodd"
190191
d="M5 2a1 1 0 011 1v1h1a1 1 0 010 2H6v1a1 1 0 01-2 0V6H3a1 1 0 010-2h1V3a1 1 0 011-1zm0 10a1 1 0 011 1v1h1a1 1 0 110 2H6v1a1 1 0 11-2 0v-1H3a1 1 0 110-2h1v-1a1 1 0 011-1zM12 2a1 1 0 01.967.744L14.146 7.2 17.5 9.134a1 1 0 010 1.732l-3.354 1.935-1.18 4.455a1 1 0 01-1.933 0L9.854 12.8 6.5 10.866a1 1 0 010-1.732l3.354-1.935 1.18-4.455A1 1 0 0112 2z"
191192
clip-rule="evenodd" />

src/app/base/components/dropdown/dropdown.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export class DropdownComponent implements OnChanges {
7979
if (this.dropdownOptions.optionDescriptions && this.dropdownOptions.optionArray.length != this.dropdownOptions.optionDescriptions.length) this.hasInputErrors = "array options != optionDescriptions length\n";
8080
if (this.dropdownOptions.optionIcons && this.dropdownOptions.optionIcons.length != this.dropdownOptions.optionIcons.length) this.hasInputErrors = "array options != optionIcons length\n";
8181
if (!this.dropdownOptions.buttonVersion) this.dropdownOptions.buttonVersion = "default";
82+
if (this.dropdownOptions.isModelDownloaded && this.dropdownOptions.isModelDownloaded.length != this.dropdownOptions.optionArray.length) this.hasInputErrors = "array options != isModelDownloaded length\n";
8283

8384
this.buttonClassList = "";
8485
if (!this.dropdownOptions.buttonBgColor) this.dropdownOptions.buttonBgColor = "bg-white ";

src/app/base/services/base/apollo-checker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export class ApolloChecker {
2929
}
3030

3131
private static checkBlackWhiteList(type: string, queryText: string) {
32-
if (!ConfigManager.getIsDemo()) return;
33-
if (ConfigManager.getIsAdmin()) return;
32+
if (!ConfigManager.getIsDemo(true)) return;
33+
if (ConfigManager.getIsAdmin(true)) return;
3434
if (!queryText) throw new Error("Can't find query text");
3535
if (!ConfigManager.checkBlackWhiteList(type, queryText)) throw new DemoError(type, queryText);
3636
}

src/app/base/services/config-service.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ export class ConfigManager {
6868
return ConfigManager.config[key][subkey]
6969
}
7070

71-
public static getIsManaged(): boolean {
71+
public static getIsManaged(ignoreCheck: boolean = false): boolean {
72+
if (!ignoreCheck && !ConfigManager.isInit()) console.log("ConfigManager not initialized");
7273
return ConfigManager.isManaged;
7374
}
7475

@@ -86,14 +87,16 @@ export class ConfigManager {
8687
public static setIsAdmin(value: boolean) {
8788
ConfigManager.isAdmin = value;
8889
}
89-
public static getIsAdmin() {
90+
public static getIsAdmin(ignoreCheck: boolean = false): boolean {
91+
if (!ignoreCheck && !ConfigManager.isInit()) console.log("ConfigManager not initialized");
9092
return ConfigManager.isAdmin;
9193
}
9294

9395
public static setIsDemo(value: boolean) {
9496
ConfigManager.isDemo = value;
9597
}
96-
public static getIsDemo() {
98+
public static getIsDemo(ignoreCheck: boolean = false): boolean {
99+
if (!ignoreCheck && !ConfigManager.isInit()) console.log("ConfigManager not initialized");
97100
return ConfigManager.isDemo;
98101
}
99102

src/app/base/services/weak-source/weak-source-apollo.service.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,4 +428,40 @@ export class WeakSourceApolloService {
428428
});
429429
}
430430

431+
getModelProviderInfo() {
432+
const query = this.apollo
433+
.watchQuery({
434+
query: queries.GET_MODEL_PROVIDER_INFO,
435+
fetchPolicy: 'network-only', // Used for first execution
436+
nextFetchPolicy: 'cache-first', // Used for subsequent executions (refetch query updates the cache != triggers the function)
437+
});
438+
const vc = query.valueChanges.pipe(
439+
map((result) => result['data']['modelProviderInfo'])
440+
);
441+
return [query, vc]
442+
}
443+
444+
downloadModel(name: string) {
445+
return this.apollo.mutate({
446+
mutation: mutations.MODEL_PROVIDER_DOWNLOAD_MODEL,
447+
variables: {
448+
modelName: name
449+
}
450+
});
451+
}
452+
453+
deleteModel(name: string) {
454+
return this.apollo.mutate({
455+
mutation: mutations.MODEL_PROVIDER_DELETE_MODEL,
456+
variables: {
457+
modelName: name
458+
},
459+
refetchQueries: [
460+
{
461+
query: queries.GET_MODEL_PROVIDER_INFO
462+
},
463+
],
464+
});
465+
}
466+
431467
}

src/app/base/services/weak-source/weak-source-mutations.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,21 @@ export const mutations = {
9898
}
9999
}
100100
101-
`
101+
`,
102+
103+
MODEL_PROVIDER_DELETE_MODEL: gql`
104+
mutation($modelName: String!) {
105+
modelProviderDeleteModel(modelName: $modelName) {
106+
ok
107+
}
108+
}
109+
`,
110+
111+
MODEL_PROVIDER_DOWNLOAD_MODEL: gql`
112+
mutation($modelName: String!) {
113+
modelProviderDownloadModel(modelName: $modelName) {
114+
ok
115+
}
116+
}
117+
`,
102118
};

src/app/base/services/weak-source/weak-source-queries.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,17 @@ export const queries = {
9898
}
9999
`,
100100

101+
GET_MODEL_PROVIDER_INFO: gql`
102+
query{
103+
modelProviderInfo {
104+
name
105+
revision
106+
link
107+
date
108+
size
109+
status
110+
zeroShotPipeline
111+
}
112+
}
113+
`,
101114
};

0 commit comments

Comments
 (0)