mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-21 09:58:56 +02:00
fix: add dependency graph toggle with persistent state
- Changed button label to "Dependency Graph" for clarity - Implemented session-persistent state using localStorage for graph visibility - Set graph to be hidden by default on page load - Note: Cannot prevent page reload on graph node click as RepoActionView component performs full page navigation when switching between jobs
This commit is contained in:
parent
b2fbe35399
commit
e0ac31528f
@ -110,6 +110,7 @@ function isLogElementInViewport(el: Element, {extraViewPortHeight}={extraViewPor
|
||||
type LocaleStorageOptions = {
|
||||
autoScroll: boolean;
|
||||
expandRunning: boolean;
|
||||
showSummary: boolean;
|
||||
};
|
||||
|
||||
export default defineComponent({
|
||||
@ -139,8 +140,8 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
data() {
|
||||
const defaultViewOptions: LocaleStorageOptions = {autoScroll: true, expandRunning: false};
|
||||
const {autoScroll, expandRunning} = localUserSettings.getJsonObject('actions-view-options', defaultViewOptions);
|
||||
const defaultViewOptions: LocaleStorageOptions = {autoScroll: true, expandRunning: false, showSummary: false};
|
||||
const {autoScroll, expandRunning, showSummary} = localUserSettings.getJsonObject('actions-view-options', defaultViewOptions);
|
||||
return {
|
||||
// internal state
|
||||
loadingAbortController: null as AbortController | null,
|
||||
@ -149,7 +150,7 @@ export default defineComponent({
|
||||
artifacts: [] as Array<Record<string, any>>,
|
||||
menuVisible: false,
|
||||
isFullScreen: false,
|
||||
showSummary: true,
|
||||
showSummary: showSummary ?? false,
|
||||
timeVisible: {
|
||||
'log-time-stamp': false,
|
||||
'log-time-seconds': false,
|
||||
@ -217,6 +218,9 @@ export default defineComponent({
|
||||
optionAlwaysExpandRunning() {
|
||||
this.saveLocaleStorageOptions();
|
||||
},
|
||||
showSummary() {
|
||||
this.saveLocaleStorageOptions();
|
||||
},
|
||||
},
|
||||
|
||||
async mounted() {
|
||||
@ -258,7 +262,7 @@ export default defineComponent({
|
||||
|
||||
methods: {
|
||||
saveLocaleStorageOptions() {
|
||||
const opts: LocaleStorageOptions = {autoScroll: this.optionAlwaysAutoScroll, expandRunning: this.optionAlwaysExpandRunning};
|
||||
const opts: LocaleStorageOptions = {autoScroll: this.optionAlwaysAutoScroll, expandRunning: this.optionAlwaysExpandRunning, showSummary: this.showSummary};
|
||||
localUserSettings.setJsonObject('actions-view-options', opts);
|
||||
},
|
||||
|
||||
@ -547,7 +551,7 @@ export default defineComponent({
|
||||
:class="{ active: showSummary }"
|
||||
>
|
||||
<SvgIcon :name="showSummary ? 'octicon-chevron-down' : 'octicon-chevron-right'"/>
|
||||
Summary
|
||||
Dependency Graph
|
||||
</button>
|
||||
</div>
|
||||
<div class="job-group-section">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user