🐛Fix file management not work in agent server

This commit is contained in:
zhengyi 2024-03-27 21:50:24 +08:00
parent 4324209003
commit 92072b4091
4 changed files with 23 additions and 3 deletions

View File

@ -23,7 +23,7 @@
<!-- TODO -->
<div v-if="false" class="header-filter">
<!--<StackListFilter :filterState="filterState" @update-filter="updateFilter" />-->
<!-- <StackListFilter :filterState="filterState" @update-filter="updateFilter" />-->
</div>
<!-- TODO: Selection Controls -->

View File

@ -330,7 +330,11 @@ export default {
computed: {
filesLink() {
return `/files/${this.stack.name}`;
if (this.stack.endpoint) {
return `/files/${this.stack.name}/${this.stack.endpoint}`;
} else {
return `/files/${this.stack.name}`;
}
},
endpointDisplay() {

View File

@ -17,6 +17,7 @@ export default defineComponent({
isFolder: false,
fileName: "",
},
stack: {}
};
},
computed: {
@ -25,7 +26,7 @@ export default defineComponent({
},
endpoint() {
return this.$route.params.endpoint || "";
return this.stack.endpoint || this.$route.params.endpoint || "";
},
newFileLabel() {
@ -103,6 +104,17 @@ export default defineComponent({
}
});
},
loadStack() {
this.processing = true;
this.$root.emitAgent(this.endpoint, "getStack", this.stack.name, (res) => {
if (res.ok) {
this.stack = res.stack;
} else {
this.$root.toastRes(res);
}
})
}
},
});
</script>

View File

@ -47,6 +47,10 @@ const routes : RouteRecordRaw[] = [
path: "/files/:stackName",
component: Files,
},
{
path: "/files/:stackName/:endpoint",
component: Files,
},
{
path: "/terminal/:stackName/:serviceName/:type",
component: ContainerTerminal,