4242</template >
4343
4444<script >
45- // @flow
4645import map from ' lodash/map' ;
4746import { mapState } from ' vuex' ;
48- import type { Route } from ' vue-router' ;
4947import FileManagerFileRow from ' ../components/filemanager/FileManagerFileRow' ;
5048import FileManagerFolderRow from ' ../components/filemanager/FileManagerFolderRow' ;
51- import { getDirectoryContents , DirectoryContentsResponse } from ' ../../../api/server/getDirectoryContents' ;
49+ import { getDirectoryContents } from ' ../../../api/server/getDirectoryContents' ;
5250
5351export default {
5452 name: ' file-manager-page' ,
@@ -62,13 +60,13 @@ export default {
6260 * Configure the breadcrumbs that display on the filemanager based on the directory that the
6361 * user is currently in.
6462 */
65- breadcrumbs : function (): Array<Object> {
66- const directories: Array < string > = this .currentDirectory .replace (/ ^ \/ | \/ $ / , ' ' ).split (' /' );
63+ breadcrumbs : function () {
64+ const directories = this .currentDirectory .replace (/ ^ \/ | \/ $ / , ' ' ).split (' /' );
6765 if (directories .length < 1 || ! directories[0 ]) {
6866 return [];
6967 }
7068
71- return map (directories, function (value : string , key : number ) {
69+ return map (directories, function (value , key ) {
7270 if (key === directories .length - 1 ) {
7371 return { directoryName: value };
7472 }
@@ -85,22 +83,22 @@ export default {
8583 /**
8684 * When the route changes reload the directory.
8785 */
88- ' $route ' : function (to : Route ) {
86+ ' $route ' : function (to ) {
8987 this .currentDirectory = to .params .path || ' /' ;
9088 },
9189
9290 /**
9391 * Watch the current directory setting and when it changes update the file listing.
9492 */
95- currentDirectory : function (): void {
93+ currentDirectory : function () {
9694 this .listDirectory ();
9795 },
9896
9997 /**
10098 * When we reconnect to the Daemon make sure we grab a listing of all of the files
10199 * so that the error message disappears and we then load in a fresh listing.
102100 */
103- connected : function (): void {
101+ connected : function () {
104102 if (this .connected ) {
105103 this .listDirectory ();
106104 }
@@ -127,18 +125,18 @@ export default {
127125 /**
128126 * List the contents of a directory.
129127 */
130- listDirectory : function (): void {
128+ listDirectory : function () {
131129 this .loading = true ;
132130
133- const directory: string = encodeURI (this .currentDirectory .replace (/ ^ \/ | \/ $ / , ' ' ));
131+ const directory = encodeURI (this .currentDirectory .replace (/ ^ \/ | \/ $ / , ' ' ));
134132 getDirectoryContents (this .$route .params .id , directory)
135- .then ((response : DirectoryContentsResponse ) => {
133+ .then ((response ) => {
136134 this .files = response .files ;
137135 this .directories = response .directories ;
138136 this .editableFiles = response .editable ;
139137 this .errorMessage = null ;
140138 })
141- .catch ((err : string | Object ) => {
139+ .catch ((err ) => {
142140 if (err instanceof String ) {
143141 this .errorMessage = err;
144142 return ;
0 commit comments