github source v1
This commit is contained in:
parent
71f89dde9c
commit
caf870d05e
50 changed files with 4139 additions and 131 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use aim_core::domain::source::SourceRef;
|
||||
use aim_core::app::add::AddPlan;
|
||||
|
||||
use crate::DispatchResult;
|
||||
|
||||
|
|
@ -8,8 +8,9 @@ pub fn render_update_summary(total: usize, selected: usize, failed: usize) -> St
|
|||
|
||||
pub fn render_dispatch_result(result: &DispatchResult) -> String {
|
||||
match result {
|
||||
DispatchResult::AddPlan(source) => render_add_plan(source),
|
||||
DispatchResult::Added(added) => render_added_app(added),
|
||||
DispatchResult::List(rows) => render_list(rows),
|
||||
DispatchResult::PendingAdd(plan) => render_pending_add(plan),
|
||||
DispatchResult::Removed(display_name) => format!("removed: {display_name}"),
|
||||
DispatchResult::UpdatePlan(plan) => {
|
||||
render_update_summary(plan.items.len(), plan.items.len(), 0)
|
||||
|
|
@ -18,11 +19,26 @@ pub fn render_dispatch_result(result: &DispatchResult) -> String {
|
|||
}
|
||||
}
|
||||
|
||||
fn render_add_plan(source: &SourceRef) -> String {
|
||||
fn render_added_app(added: &crate::AddedApp) -> String {
|
||||
format!(
|
||||
"resolved source: {} {}",
|
||||
source.kind.as_str(),
|
||||
source.locator
|
||||
"tracked app: {} ({})\nsource: {} {}\nselected artifact: {} [{}]",
|
||||
added.record.display_name,
|
||||
added.record.stable_id,
|
||||
added.source.kind.as_str(),
|
||||
added.source.locator,
|
||||
added.selected_artifact.url,
|
||||
added.selected_artifact.selection_reason,
|
||||
)
|
||||
}
|
||||
|
||||
fn render_pending_add(plan: &AddPlan) -> String {
|
||||
let prompts = crate::ui::prompt::render_interactions(&plan.interactions);
|
||||
format!(
|
||||
"resolved source: {} {}\nselected artifact: {} [{}]\n{prompts}",
|
||||
plan.resolution.source.kind.as_str(),
|
||||
plan.resolution.source.locator,
|
||||
plan.selected_artifact.url,
|
||||
plan.selected_artifact.selection_reason,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue