-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
send application tasks to frontend when updated (#102)
* send application tasks to frontend when updated * Models page also uses the store * fix import
- Loading branch information
Showing
12 changed files
with
76 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { Readable } from 'svelte/store'; | ||
import { derived, readable } from 'svelte/store'; | ||
import { MSG_NEW_RECIPE_STATE } from '@shared/Messages'; | ||
import { rpcBrowser, studioClient } from '/@/utils/client'; | ||
import type { RecipeStatus } from '@shared/src/models/IRecipeStatus'; | ||
|
||
export const recipes: Readable<Map<string, RecipeStatus>> = readable<Map<string, RecipeStatus>>( | ||
new Map<string, RecipeStatus>(), | ||
set => { | ||
const sub = rpcBrowser.subscribe(MSG_NEW_RECIPE_STATE, msg => { | ||
set(msg); | ||
}); | ||
// Initialize the store manually | ||
studioClient.getPullingStatuses().then(state => { | ||
set(state); | ||
}); | ||
return () => { | ||
sub.unsubscribe(); | ||
}; | ||
}, | ||
); | ||
|
||
export const modelsPulling = derived(recipes, $recipes => { | ||
return Array.from($recipes.values()) | ||
.flatMap(recipe => recipe.tasks) | ||
.filter(task => 'model-pulling' in (task.labels || {})); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export const MSG_PLAYGROUNDS_STATE_UPDATE = 'playgrounds-state-update'; | ||
export const MSG_NEW_PLAYGROUND_QUERIES_STATE = 'new-playground-queries-state'; | ||
export const MSG_NEW_CATALOG_STATE = 'new-catalog-state'; | ||
export const MSG_NEW_RECIPE_STATE = 'new-recipe-state'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters