Skip to content

Commit 82371bd

Browse files
authored
Merge pull request #5 from zero4994/electron
Electron
2 parents 1e3b7a9 + fe2c831 commit 82371bd

File tree

8 files changed

+35
-301
lines changed

8 files changed

+35
-301
lines changed

index.js

-25
This file was deleted.

package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "docker-dashboard",
3-
"version": "1.4.20",
3+
"version": "1.4.26a",
44
"author": "zero4994 <[email protected]>",
55
"scripts": {
66
"lint": "vue-cli-service lint",
@@ -13,7 +13,6 @@
1313
"main": "background.js",
1414
"dependencies": {
1515
"dockerode": "^2.5.8",
16-
"express": "^4.16.4",
1716
"moment": "^2.24.0",
1817
"vue": "^2.5.16",
1918
"vue-command": "^6.2.3",

server/callbacks/index.js

-151
This file was deleted.

server/config.js

-7
This file was deleted.

server/index.js

-77
This file was deleted.

server/utils/container.js

-35
This file was deleted.

src/components/Volumes/VolumesList.vue

+23-3
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,32 @@
1313
<v-icon class="icon-padding-left">refresh</v-icon>
1414
</v-btn>
1515
</v-layout>
16+
<v-layout>
17+
<v-flex md8></v-flex>
18+
<v-flex md4>
19+
<v-spacer></v-spacer>
20+
<v-text-field
21+
v-model="search"
22+
append-icon="search"
23+
label="Search"
24+
single-line
25+
hide-details
26+
></v-text-field>
27+
</v-flex>
28+
</v-layout>
1629
<v-data-table
1730
:headers="headers"
1831
:items="this.volumes"
1932
class="elevation-1 mt-4 mb-4"
2033
:rows-per-page-items="[10]"
34+
:search="search"
2135
>
2236
<template v-slot:items="props">
23-
<td>{{ props.item.Name }}</td>
37+
<td>{{ formatText(props.item.Name) }}</td>
2438
<td>{{ formatDate(props.item.CreatedAt) }}</td>
2539
<td>{{ props.item.Driver }}</td>
2640
<td>{{ props.item.Scope }}</td>
27-
<td>{{ props.item.Mountpoint }}</td>
41+
<td>{{ formatText(props.item.Mountpoint, 50) }}</td>
2842
<v-btn icon @click="deleteVolume(props.item.Name)">
2943
<v-icon>delete</v-icon>
3044
</v-btn>
@@ -83,7 +97,8 @@ export default {
8397
sortable: false,
8498
value: "Mountpoint"
8599
}
86-
]
100+
],
101+
search: ""
87102
}),
88103
methods: {
89104
fetchAllVolumes: async function() {
@@ -100,6 +115,11 @@ export default {
100115
formatDate: function(date) {
101116
return moment(date).format("LLL");
102117
},
118+
formatText: function(text, maxLength = 20) {
119+
return text.length <= maxLength
120+
? text
121+
: `${text.substr(0, maxLength)}...`;
122+
},
103123
createVolume: async function() {
104124
try {
105125
const volumeName = await this.$dialog.prompt({

src/services/VolumeService.js

+11-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@ import { docker } from "./config";
22

33
export const allVolumes = async function() {
44
console.log("Querying all volumes");
5-
return await docker.listVolumes();
5+
const volumes = await docker.listVolumes();
6+
volumes.Volumes.sort((a, b) => {
7+
if (a.Name.toLowerCase() < b.Name.toLowerCase()) {
8+
return -1;
9+
} else if (a.Name.toLowerCase() > b.Name.toLowerCase()) {
10+
return 1;
11+
} else {
12+
return 0;
13+
}
14+
});
15+
return volumes;
616
};
717

818
export const createVolume = async function(name) {

0 commit comments

Comments
 (0)