mirror of
https://github.com/louislam/dockge.git
synced 2025-02-26 05:25:56 +00:00
Compare commits
7 commits
04708c2f02
...
dffbc72e37
Author | SHA1 | Date | |
---|---|---|---|
|
dffbc72e37 | ||
|
d451e06e84 | ||
|
2674226ce3 | ||
|
59d941f128 | ||
|
b9f135bdaa | ||
|
bd4a012404 | ||
|
f08ba9b889 |
5 changed files with 336 additions and 169 deletions
1
frontend/components.d.ts
vendored
1
frontend/components.d.ts
vendored
|
@ -8,6 +8,7 @@ export {}
|
||||||
declare module 'vue' {
|
declare module 'vue' {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
About: typeof import('./src/components/settings/About.vue')['default']
|
About: typeof import('./src/components/settings/About.vue')['default']
|
||||||
|
AgentStackList: typeof import('./src/components/AgentStackList.vue')['default']
|
||||||
Appearance: typeof import('./src/components/settings/Appearance.vue')['default']
|
Appearance: typeof import('./src/components/settings/Appearance.vue')['default']
|
||||||
ArrayInput: typeof import('./src/components/ArrayInput.vue')['default']
|
ArrayInput: typeof import('./src/components/ArrayInput.vue')['default']
|
||||||
ArraySelect: typeof import('./src/components/ArraySelect.vue')['default']
|
ArraySelect: typeof import('./src/components/ArraySelect.vue')['default']
|
||||||
|
|
46
frontend/src/components/AgentStackList.vue
Normal file
46
frontend/src/components/AgentStackList.vue
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
<template>
|
||||||
|
<div class="wrapper">
|
||||||
|
<div class="group-header">
|
||||||
|
{{ agentName }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
interface AgentStackListProps {
|
||||||
|
agentName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
defineProps<AgentStackListProps>();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
@import "../styles/vars.scss";
|
||||||
|
|
||||||
|
.group-header {
|
||||||
|
border-bottom: 1px solid #dee2e6;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
.dark & {
|
||||||
|
background-color: darken($color: $dark-header-bg, $amount: 1.90);
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 770px) {
|
||||||
|
.group-header {
|
||||||
|
margin: -20px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
|
@ -42,7 +42,22 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div ref="stackList" class="stack-list" :class="{ scrollbar: scrollbar }" :style="stackListStyle">
|
|
||||||
|
<div v-if="searchText === '' && $root.agentCount > 1" ref="stackList" :style="stackListStyle" class="stack-list">
|
||||||
|
<AgentStackList v-for="[agentName, stacks] in stackListByAgent" :agentName="agentName" :key="agentName">
|
||||||
|
<StackListItem
|
||||||
|
v-for="(stack, index) in stacks"
|
||||||
|
:key="index"
|
||||||
|
:stack="stack"
|
||||||
|
:isSelectMode="selectMode"
|
||||||
|
:isSelected="isSelected"
|
||||||
|
:select="select"
|
||||||
|
:deselect="deselect"
|
||||||
|
/>
|
||||||
|
</AgentStackList>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else ref="stackList" class="stack-list" :class="{ scrollbar: scrollbar }" :style="stackListStyle">
|
||||||
<div v-if="Object.keys(sortedStackList).length === 0" class="text-center mt-3">
|
<div v-if="Object.keys(sortedStackList).length === 0" class="text-center mt-3">
|
||||||
<router-link to="/compose">{{ $t("addFirstStackMsg") }}</router-link>
|
<router-link to="/compose">{{ $t("addFirstStackMsg") }}</router-link>
|
||||||
</div>
|
</div>
|
||||||
|
@ -189,7 +204,30 @@ export default {
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Groups all stacks by it's agent
|
||||||
|
* @returns {Map<string, object} A map containing all agents with their stacks
|
||||||
|
*/
|
||||||
|
stackListByAgent() {
|
||||||
|
const stacksByAgent = new Map();
|
||||||
|
const stacks = this.$root.completeStackList;
|
||||||
|
|
||||||
|
for (const key of Object.keys(stacks)) {
|
||||||
|
// Handle stacks with no suffix (from the current endpoint)
|
||||||
|
let [ stackName, agent ] = key.split("_");
|
||||||
|
const stackHasEndpoint = agent !== "";
|
||||||
|
agent = stackHasEndpoint ? agent : this.$t("currentEndpoint");
|
||||||
|
|
||||||
|
if (!stacksByAgent.has(agent)) {
|
||||||
|
stacksByAgent.set(agent, []);
|
||||||
|
}
|
||||||
|
|
||||||
|
const stack = stacks[!stackHasEndpoint ? `${stackName}_` : `${stackName}_${agent}`];
|
||||||
|
stacksByAgent.get(agent).push(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
return stacksByAgent;
|
||||||
|
},
|
||||||
isDarkTheme() {
|
isDarkTheme() {
|
||||||
return document.body.classList.contains("dark");
|
return document.body.classList.contains("dark");
|
||||||
},
|
},
|
||||||
|
|
18
package.json
18
package.json
|
@ -40,7 +40,7 @@
|
||||||
"dotenv": "~16.3.2",
|
"dotenv": "~16.3.2",
|
||||||
"express": "~4.21.2",
|
"express": "~4.21.2",
|
||||||
"express-static-gzip": "~2.1.8",
|
"express-static-gzip": "~2.1.8",
|
||||||
"http-graceful-shutdown": "~3.1.13",
|
"http-graceful-shutdown": "~3.1.14",
|
||||||
"jsonwebtoken": "~9.0.2",
|
"jsonwebtoken": "~9.0.2",
|
||||||
"jwt-decode": "~3.1.2",
|
"jwt-decode": "~3.1.2",
|
||||||
"knex": "~2.5.1",
|
"knex": "~2.5.1",
|
||||||
|
@ -49,8 +49,8 @@
|
||||||
"promisify-child-process": "~4.1.2",
|
"promisify-child-process": "~4.1.2",
|
||||||
"redbean-node": "~0.3.3",
|
"redbean-node": "~0.3.3",
|
||||||
"semver": "^7.6.3",
|
"semver": "^7.6.3",
|
||||||
"socket.io": "~4.8.0",
|
"socket.io": "~4.8.1",
|
||||||
"socket.io-client": "~4.8.0",
|
"socket.io-client": "~4.8.1",
|
||||||
"timezones-list": "~3.0.3",
|
"timezones-list": "~3.0.3",
|
||||||
"ts-command-line-args": "~2.5.1",
|
"ts-command-line-args": "~2.5.1",
|
||||||
"tsx": "~4.19.2",
|
"tsx": "~4.19.2",
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@actions/github": "^6.0.0",
|
"@actions/github": "^6.0.0",
|
||||||
"@fontsource/jetbrains-mono": "^5.1.1",
|
"@fontsource/jetbrains-mono": "^5.1.2",
|
||||||
"@fortawesome/fontawesome-svg-core": "6.4.2",
|
"@fortawesome/fontawesome-svg-core": "6.4.2",
|
||||||
"@fortawesome/free-regular-svg-icons": "6.4.2",
|
"@fortawesome/free-regular-svg-icons": "6.4.2",
|
||||||
"@fortawesome/free-solid-svg-icons": "6.4.2",
|
"@fortawesome/free-solid-svg-icons": "6.4.2",
|
||||||
|
@ -81,19 +81,19 @@
|
||||||
"cross-env": "~7.0.3",
|
"cross-env": "~7.0.3",
|
||||||
"eslint": "~8.50.0",
|
"eslint": "~8.50.0",
|
||||||
"eslint-plugin-jsdoc": "~46.8.2",
|
"eslint-plugin-jsdoc": "~46.8.2",
|
||||||
"eslint-plugin-vue": "~9.17.0",
|
"eslint-plugin-vue": "~9.32.0",
|
||||||
"prismjs": "~1.29.0",
|
"prismjs": "~1.29.0",
|
||||||
"sass": "~1.68.0",
|
"sass": "~1.68.0",
|
||||||
"typescript": "~5.2.2",
|
"typescript": "~5.2.2",
|
||||||
"unplugin-vue-components": "~0.25.2",
|
"unplugin-vue-components": "~0.25.2",
|
||||||
"vite": "~5.4.8",
|
"vite": "~5.4.11",
|
||||||
"vite-plugin-compression": "~0.5.1",
|
"vite-plugin-compression": "~0.5.1",
|
||||||
"vue": "~3.5.12",
|
"vue": "~3.5.13",
|
||||||
"vue-eslint-parser": "~9.3.2",
|
"vue-eslint-parser": "~9.3.2",
|
||||||
"vue-i18n": "~9.5.0",
|
"vue-i18n": "~10.0.5",
|
||||||
"vue-prism-editor": "2.0.0-alpha.2",
|
"vue-prism-editor": "2.0.0-alpha.2",
|
||||||
"vue-qrcode": "~2.2.2",
|
"vue-qrcode": "~2.2.2",
|
||||||
"vue-router": "~4.2.5",
|
"vue-router": "~4.5.0",
|
||||||
"vue-toastification": "2.0.0-rc.5",
|
"vue-toastification": "2.0.0-rc.5",
|
||||||
"wait-on": "^7.2.0",
|
"wait-on": "^7.2.0",
|
||||||
"xterm-addon-web-links": "~0.9.0"
|
"xterm-addon-web-links": "~0.9.0"
|
||||||
|
|
400
pnpm-lock.yaml
generated
400
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue