Skip to content

Commit

Permalink
checkpoint before more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
msfrisbie committed Jan 13, 2023
1 parent ec90870 commit 9f4736d
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 78 deletions.
199 changes: 125 additions & 74 deletions src/components/overlay-widget/package/PackageHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,77 +11,47 @@
:selectAllPackageTypes="true"
></single-package-picker>
</template>
<template v-else>
<div class="flex flex-col gap-4 items-center">
<div class="flex flex-row items-start gap-8">
<div class="flex flex-col items-stretch gap-4 w-60">
<template v-if="status === PackageHistoryStatus.INFLIGHT">
<b-button @click="halt({})" variant="outline-primary"> STOP </b-button>
<b-form-group>
<b-form-input
v-model="maxLookupDepth"
@change="maybeSetMaxVisibleDepth($event)"
placeholder="Generation limit"
type="number"
step="1"
min="0"
></b-form-input>
<div class="text-xs text-gray-300">
How many generations to look up? A smaller number will finish faster.
</div>
</b-form-group>
</template>
<template v-if="status === PackageHistoryStatus.ERROR">
<div class="text-red-500">
<span
>Something went wrong while generating the history. See log for detail.</span
>
</div>
</template>

<template
v-if="
status === PackageHistoryStatus.SUCCESS ||
status === PackageHistoryStatus.ERROR ||
status === PackageHistoryStatus.HALTED
"
>
<b-button @click="setPackage({ pkg: null })" variant="outline-primary">
RESET
</b-button>
</template>
</div>
</div>
</div>

<div v-if="maxLookupDepth !== null" class="text-red-500 text-center">
You have set a generation limit of {{ maxLookupDepth }}. The displayed results may not
be complete.
</div>

<div v-if="status === PackageHistoryStatus.HALTED" class="text-red-500 text-center">
You stopped the lookup process. The displayed results may not be complete.
</div>

<template v-if="status == PackageHistoryStatus.INFLIGHT">
<div class="flex flex-row justify-center items-center gap-2">
<b-spinner small></b-spinner>
<span>Building history, this can take a minute...</span>
</div>
</template>
</template>

<b-card no-body>
<b-tabs card pills align="center" content-class="" nav-wrapper-class="bg-purple-200">
<b-tab no-body title="Parent Packages" active>
<b-tabs
pills
align="center"
vertical
content-class="p-2"
nav-wrapper-class="bg-purple-100 py-2"
>
<b-tab no-body title="Tree" active>
<div class="p-2 flex flex-row justify-center gap-4">
<b-dropdown
class="pb-2"
toggle-class="flex flex-row items-center gap-2"
variant="outline-primary"
>
<template #button-content>
<font-awesome-icon icon="sliders-h"></font-awesome-icon>
</template>
<b-dropdown-text>
<b-form-group label="Visible generations" class="w-36">
<vue-slider
v-model="maxVisibleDepth"
:min="1"
:max="20"
:interval="1"
></vue-slider>
</b-form-group>
</b-dropdown-text>
<b-dropdown-text>
<b-form-group label="Tree zoom" class="w-36">
<vue-slider
v-model="zoom"
:min="0.1"
:max="1"
:interval="0.05"
></vue-slider> </b-form-group
></b-dropdown-text>
</b-dropdown>
<!-- <div class="p-2 flex flex-row justify-center gap-4">
<b-form-group label="Visible generations" class="w-36">
<vue-slider
v-model="maxVisibleDepth"
Expand All @@ -94,7 +64,7 @@
<b-form-group label="Tree zoom" class="w-36">
<vue-slider v-model="zoom" :min="0.1" :max="1" :interval="0.05"></vue-slider>
</b-form-group>
</div>
</div> -->
<div class="flex flex-col items-start overflow-auto toolkit-scroll pb-4">
<package-history-tile
:ancestorTree="ancestorTree"
Expand Down Expand Up @@ -173,25 +143,42 @@
<b-tab no-body title="Child Packages">
<b-tabs
pills
vertical
align="center"
content-class="p-2"
nav-wrapper-class="bg-purple-100 py-2"
>
<b-tab no-body title="Tree">
<div class="p-2 flex flex-row justify-center gap-4">
<b-form-group label="Visible generations" class="w-36">
<vue-slider
v-model="maxVisibleDepth"
:min="1"
:max="20"
:interval="1"
></vue-slider>
</b-form-group>
<b-dropdown
class="pb-2"
toggle-class="flex flex-row items-center gap-2"
variant="outline-primary"
>
<template #button-content>
<font-awesome-icon icon="sliders-h"></font-awesome-icon>
</template>
<b-dropdown-text>
<b-form-group label="Visible generations" class="w-36">
<vue-slider
v-model="maxVisibleDepth"
:min="1"
:max="20"
:interval="1"
></vue-slider>
</b-form-group>
</b-dropdown-text>
<b-dropdown-text>
<b-form-group label="Tree zoom" class="w-36">
<vue-slider
v-model="zoom"
:min="0.1"
:max="1"
:interval="0.05"
></vue-slider> </b-form-group
></b-dropdown-text>
</b-dropdown>

<b-form-group label="Tree zoom" class="w-36">
<vue-slider v-model="zoom" :min="0.1" :max="1" :interval="0.05"></vue-slider>
</b-form-group>
</div>
<!-- <div class="p-2 flex flex-row justify-center gap-4"></div> -->
<div class="flex flex-col items-start overflow-auto toolkit-scroll pb-4">
<package-history-tile
:childTree="childTree"
Expand Down Expand Up @@ -351,6 +338,70 @@
</div>
</b-tab>
</b-tabs>
<template v-if="sourcePackage">
<b-card-footer>
<div class="flex flex-col gap-4 items-center">
<div v-if="maxLookupDepth !== null" class="text-red-500 text-center">
You have set a generation limit of {{ maxLookupDepth }}. The displayed results may
not be complete.
</div>

<div v-if="status === PackageHistoryStatus.HALTED" class="text-red-500 text-center">
You stopped the lookup process. The displayed results may not be complete.
</div>

<template v-if="status == PackageHistoryStatus.INFLIGHT">
<div class="flex flex-row justify-center items-center gap-2">
<b-spinner small></b-spinner>
<span>Building history, this can take a minute...</span>
</div>
</template>
<div class="flex flex-row justify-center items-center gap-8 w-60">
<template v-if="status === PackageHistoryStatus.INFLIGHT">
<b-button @click="halt({})" variant="outline-danger"> STOP </b-button>
<div class="flex flex-row items-center gap-2">
<b-form-input
class="w-48"
v-model="maxLookupDepth"
@change="maybeSetMaxVisibleDepth($event)"
placeholder="Generation limit"
type="number"
step="1"
min="0"
></b-form-input>

<b-badge
variant="info"
v-b-tooltip.hover
title="How many generations to look up? A smaller number will finish faster."
>?</b-badge
>
</div>
</template>
<template v-if="status === PackageHistoryStatus.ERROR">
<div class="text-red-500">
<span
>Something went wrong while generating the history. See log for
detail.</span
>
</div>
</template>

<template
v-if="
status === PackageHistoryStatus.SUCCESS ||
status === PackageHistoryStatus.ERROR ||
status === PackageHistoryStatus.HALTED
"
>
<b-button @click="setPackage({ pkg: null })" variant="outline-primary">
RESET
</b-button>
</template>
</div>
</div>
</b-card-footer>
</template>
</b-card>
</div>
<!-- </template> -->
Expand Down
4 changes: 0 additions & 4 deletions src/utils/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,6 @@ export async function getParentPackageHistoryTreeImpl({
rootContext: IRootAncestorHistoryContext;
depth: number;
}): Promise<IPackageAncestorTreeNode> {
// if (store.state.packageHistory.status !== PackageHistoryStatus.INFLIGHT) {
// throw new Error(`Status: ${store.state.packageHistory.status}, exiting`);
// }

if (rootContext.treeNodeCache.has(label)) {
store.dispatch(`packageHistory/${PackageHistoryActions.LOG_EVENT}`, {
event: `Cache hit for ${label}`,
Expand Down

0 comments on commit 9f4736d

Please sign in to comment.