aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/index.html')
-rw-r--r--frontend/index.html261
1 files changed, 83 insertions, 178 deletions
diff --git a/frontend/index.html b/frontend/index.html
index e86e8fc..93ea3e3 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -2,104 +2,73 @@
2<head> 2<head>
3 <title> Cloudron Surfer </title> 3 <title> Cloudron Surfer </title>
4 4
5 <link rel="stylesheet" href="/_admin/css/font-awesome.min.css"> 5 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
6 <link rel="stylesheet" href="/_admin/css/bootstrap.min.css"> 6
7 <link rel="icon" type="image/png" href="/_admin/img/logo.png">
8
9 <link rel="stylesheet" href="/_admin/css/theme-chalk.css">
7 <link rel="stylesheet" href="/_admin/css/style.css"> 10 <link rel="stylesheet" href="/_admin/css/style.css">
8 11
9 <link href="/_admin/img/logo.png" rel="icon" type="image/png"> 12 <script src="/_admin/js/jquery-1.12.1.min.js"></script>
13 <script src="/_admin/js/vue.js"></script>
14 <script src="/_admin/js/element-ui.js"></script>
15 <script src="/_admin/js/filesize.min.js"></script>
16 <script src="/_admin/js/superagent.js"></script>
17 <script src="/_admin/js/sorttable.js"></script>
10 18
11</head> 19</head>
12<body id="app" @drop="drop" @dragover="dragOver"> 20<body>
13 21
14 <nav class="navbar navbar-default" v-cloak> 22<el-container id="app" @drop="drop" @dragover="dragOver">
15 <div class="container-fluid"> 23 <input type="file" ref="upload" style="display: none" id="uploadInput" multiple/>
16 <!-- Brand and toggle get grouped for better mobile display -->
17 <div class="navbar-header">
18 <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
19 <span class="sr-only">Toggle navigation</span>
20 <span class="icon-bar"></span>
21 <span class="icon-bar"></span>
22 <span class="icon-bar"></span>
23 </button>
24 <a class="navbar-brand" href="#">Surfer</a>
25 </div>
26 24
27 <!-- Collect the nav links, forms, and other content for toggling --> 25 <el-dialog title="Login" :visible.sync="ready && !session.valid" width="30%" :close-on-press-escape="false" :show-close="false">
28 <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> 26 <el-form :model="loginData" label-position="top" @submit.native.prevent>
29 <ul class="nav navbar-nav navbar-right"> 27 <el-form-item label="Username"><el-input v-model="loginData.username" required autofocus></el-input></el-form-item>
30 <li v-show="session.valid"><a href="#" v-on:click="logout()" id="logoutButton">Logout</a></li> 28 <el-form-item label="Password"><el-input v-model="loginData.password" type="password" required></el-input></el-form-item>
31 </ul> 29 <input type="submit" @click="onLogin" v-show="false"/>
32 </div> 30 </el-form>
33 </div> 31 <span slot="footer" class="dialog-footer">
34 </nav> 32 <el-button type="primary" @click="onLogin"><i class="el-icon-loading" v-show="busy"></i><span v-show="!busy">Login</span></el-button>
33 </span>
34 </el-dialog>
35 35
36 <div class="modal fade" tabindex="-1" role="dialog" id="modalDelete" v-cloak> 36 <el-header>
37 <div class="modal-dialog"> 37 <el-row type="flex" justify="space-between">
38 <div class="modal-content"> 38 <div style="padding: 7px;">
39 <div class="modal-header"> 39 <span>Surfer</span>
40 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> 40 </div>
41 </div> 41 <div style="flex-grow: 2; padding: 0 7px;" v-show="session.valid">
42 <div class="modal-body"> 42 <el-breadcrumb separator-class="el-icon-arrow-right">
43 <h5 v-show="deleteData.isFile">Really delete <span style="font-weight: bold;">{{ deleteData.filePath }}</span>?</h5> 43 <el-breadcrumb-item><a href="#/">Path /</a></el-breadcrumb-item>
44 <h5 v-show="deleteData.isDirectory">Really delete folder <span style="font-weight: bold;">{{ deleteData.filePath }}</span> and all its content?</h5> 44 <el-breadcrumb-item v-for="part in pathParts.slice(0, -1)"><a :href="part.link">{{ part.name }}</a></el-breadcrumb-item>
45 </div> 45 <el-breadcrumb-item v-show="pathParts.slice(-1).length">{{ pathParts.slice(-1).length ? pathParts.slice(-1)[0].name : '' }}</el-breadcrumb-item>
46 <div class="modal-footer"> 46 </el-breadcrumb>
47 <button type="button" class="btn btn-default" data-dismiss="modal">No</button> 47 </div>
48 <button type="button" class="btn btn-danger" v-on:click="del(deleteData)">Yes</button> 48 <div align="right" v-show="session.valid">
49 </div> 49 <el-button-group>
50 </div> 50 <el-button type="primary" icon="el-icon-upload" size="small" @click="onUpload">Upload</el-button>
51 </div> 51 <el-button type="primary" icon="el-icon-plus" size="small" @click="onNewFolder">New Folder</el-button>
52 </div>
53
54 <div class="modal fade" tabindex="-1" role="dialog" id="modalRename" v-cloak>
55 <div class="modal-dialog">
56 <div class="modal-content">
57 <div class="modal-header">
58 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
59 <h4 class="modal-title">Rename {{ renameData.entry.filePath }}</h4>
60 </div>
61 <div class="modal-body">
62 <form v-on:submit.prevent="rename(renameData)">
63 <div class="form-group" v-bind:class="{ 'has-error': renameData.error }">
64 <input type="text" class="form-control" v-model="renameData.newFilePath" placeholder="Name" autofocus="true">
65 <label class="control-label">{{ renameData.error }}</label>
66 </div>
67 <button type="submit" style="display: none;"></button>
68 </form>
69 </div>
70 <div class="modal-footer">
71 <button type="button" class="btn btn-default" data-dismiss="modal">No</button>
72 <button type="button" class="btn btn-success" v-on:click="rename(renameData)">Yes</button>
73 </div>
74 </div>
75 </div>
76 </div>
77 52
78 <div class="modal fade" tabindex="-1" role="dialog" id="modalcreateDirectory" v-cloak> 53 </el-button-group>
79 <div class="modal-dialog"> 54 <el-dropdown @command="onOptionsMenu">
80 <div class="modal-content"> 55 <el-button size="small" icon="el-icon-more"></el-button>
81 <div class="modal-header"> 56 <el-dropdown-menu slot="dropdown">
82 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> 57 <el-dropdown-item disabled>Public Folder Listing</el-dropdown-item>
83 <h4 class="modal-title">New directory name</h4> 58 <el-dropdown-item command="folderListing">
84 </div> 59 <el-switch v-model="folderListingEnabled" active-text="Enabled" inactive-text="Disabled">
85 <div class="modal-body"> 60 </el-switch>
86 <form v-on:submit.prevent="createDirectory(createDirectoryData)"> 61 </el-dropdown-item>
87 <div class="form-group" v-bind:class="{ 'has-error': createDirectoryError }"> 62 <el-dropdown-item command="about" divided><i class="el-icon-info"></i> About</el-dropdown-item>
88 <input type="text" class="form-control" v-model="createDirectoryData" id="inputDirectoryName" placeholder="Name" autofocus="true"> 63 <el-dropdown-item command="logout"><i class="el-icon-circle-close"></i> Logout</el-dropdown-item>
89 <label class="control-label" for="inputDirectoryName">{{ createDirectoryError }}</label> 64 </el-dropdown-menu>
90 </div> 65 </el-dropdown>
91 <button type="submit" style="display: none;"></button> 66 </div>
92 </form> 67 </el-row>
93 </div> 68 </el-header>
94 <div class="modal-footer"> 69 <el-main>
95 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
96 <button type="button" class="btn btn-primary" v-on:click="createDirectory(createDirectoryData)">Create</button>
97 </div>
98 </div>
99 </div>
100 </div>
101 70
102 <div class="container" v-show="uploadStatus.busy" v-cloak> 71 <!-- <div class="container" v-show="uploadStatus.busy" v-cloak>
103 <div class="row"> 72 <div class="row">
104 <div class="col-lg-12"> 73 <div class="col-lg-12">
105 <p>Uploading... ({{ uploadStatus.done }} / {{ uploadStatus.count }}) </p> 74 <p>Uploading... ({{ uploadStatus.done }} / {{ uploadStatus.count }}) </p>
@@ -112,101 +81,37 @@
112 </center> 81 </center>
113 </div> 82 </div>
114 </div> 83 </div>
115 </div> 84 </div> -->
116 85
117 <div class="container" v-show="!session.valid && !busy" v-cloak> 86 <div v-show="busy">
118 <div class="row"> 87 <center><h1><i class="el-icon-loading"></i></h1></center>
119 <div class="col-lg-6 col-lg-offset-3">
120 <form id="loginForm" v-on:submit.prevent="login()">
121 <div class="form-group">
122 <label for="inputUsername">Username</label>
123 <input type="text" class="form-control" id="inputUsername" v-model="loginData.username" placeholder="Username">
124 </div>
125 <div class="form-group">
126 <label for="inputPassword">Password</label>
127 <input type="password" class="form-control" id="inputPassword" v-model="loginData.password" placeholder="Password">
128 </div>
129 <button type="submit" class="btn btn-default">Submit</button>
130 </form>
131 </div>
132 </div>
133 </div> 88 </div>
134 89
135 <div class="container main" v-show="session.valid" v-cloak> 90 <div v-show="!busy && session.valid" v-cloak>
136 <div class="row"> 91 <el-table :data="entries" style="width: 100%" height="100%" empty-text="Folder is emtpy" :default-sort="{ prop: 'filePath', order: 'descending' }" @row-click="open">
137 <div class="col-lg-12"> 92 <el-table-column prop="previewUrl" label="Type" width="100px" sortable>
138 <center v-show="!uploadStatus.busy"> 93 <template slot-scope="scope">
139 <form id="fileUploadForm"> 94 <img v-bind:src="scope.row.previewUrl" height="48px" width="48px"/>
140 <input type="file" v-el:upload style="display: none" id="uploadInput" multiple/> 95 </template>
141 <button class="btn btn-primary" v-on:click.stop.prevent="upload()" id="uploadButton">Upload</button> 96 </el-table-column>
142 </form> 97 <el-table-column prop="filePath" label="Name" sortable></el-table-column>
143 </center> 98 <el-table-column prop="size" label="Size" width="150px" sortable :formatter="prettyFileSize"></el-table-column>
144 </div> 99 <el-table-column prop="mtime" label="Modified" width="150px" sortable :formatter="prettyDate"></el-table-column>
145 <div class="col-lg-12"> 100 <el-table-column label="Actions" align="right" width="200px" class-name="list-actions">
146 <ol class="breadcrumb"> 101 <template slot-scope="scope">
147 <li><a href="#/"><i class="fa fa-home"></i></a></li> 102 <el-button size="small" icon="el-icon-download" circle v-show="scope.row.isFile" @click.stop="onDownload(scope.row)"></el-button>
148 <li v-for="part in pathParts.slice(0, -1)"> 103 <el-button size="small" icon="el-icon-edit" circle @click.stop="onRename(scope.row)"></el-button>
149 <a href="{{ part.link }}">{{ part.name }}</a> 104 <el-button size="small" icon="el-icon-delete" circle @click.stop="onDelete(scope.row)"></el-button>
150 </li> 105 </template>
151 <li>{{ pathParts.slice(-1)[0].name }}</li> 106 </el-table-column>
152 <button class="btn btn-default btn-sm pull-right" v-on:click="createDirectoryAsk()">Create Folder</button> 107 </el-table>
153 </ol>
154 </div>
155 <div class="col-lg-12" v-show="busy">
156 <br/>
157 <br/>
158 <center>
159 <i class="fa fa-refresh fa-4x fa-spin"></i>
160 </center>
161 </div>
162 <div class="col-lg-12" v-show="!busy">
163 <table class="table table-hover table-condensed sortable">
164 <thead>
165 <tr>
166 <th>Type</th>
167 <th>Name</th>
168 <th class="sorttable_numeric">Size</th>
169 <th class="sorttable_numeric">Modified</th>
170 <th class="sorttable_nosort" style="text-align: right;">Actions</th>
171 </tr>
172 </thead>
173 <tbody>
174 <tr v-show="entries.length === 0">
175 <td colspan="5"><i>Empty folder</i></td>
176 </tr>
177 <tr v-for="entry in entries" v-on:click="open(entry)" class="hand">
178 <td sorttable_customkey="{{ entry.extension }}">
179 <img v-bind:src="entry.previewUrl" height="48px" width="48px"/>
180 </td>
181 <td>{{ entry.filePath }}</td>
182 <td sorttable_customkey="{{ entry.size }}">{{ entry.size | prettyFileSize }}</td>
183 <td><span v-my-tooltip="foobar" data-toggle="tooltip" title="{{ entry.mtime }}">{{ entry.mtime | prettyDate }}</span></td>
184 <td style="text-align: right;">
185 <span class="entry-toolbar">
186 <button class="btn btn-sm btn-default" v-on:click.stop="download(entry)" title="Download" v-show="entry.isFile"><i class="fa fa-download"></i></button>
187 <button class="btn btn-sm btn-default" v-on:click.stop="renameAsk(entry)" title="Rename"><i class="fa fa-pencil"></i></button>
188 <button class="btn btn-sm btn-danger" v-on:click.stop="delAsk(entry)" title="Delete"><i class="fa fa-trash"></i></button>
189 </span>
190 </td>
191 </tr>
192 </tbody>
193 </table>
194 </div>
195 </div>
196 </div> 108 </div>
197 109
198 <!-- Footer --> 110 </el-main>
199 <footer class="text-center"> 111 <el-footer style="height: 24px">Built by the <a href="https://cloudron.io" target="_blank">Cloudron.io</a> team. <a href="https://git.cloudron.io/cloudron/surfer" target="_blank">Get the code</a></el-footer>
200 <span class="text-muted">Created by the <a href="https://cloudron.io" target="_blank">Cloudron</a> team. <a href="https://git.cloudron.io/cloudron/surfer" target="_blank">Get the code</a></span> 112</el-container>
201 </footer>
202 113
203 <script src="/_admin/js/jquery-1.12.1.min.js"></script> 114<script src="/_admin/js/app.js"></script>
204 <script src="/_admin/js/bootstrap.min.js"></script>
205 <script src="/_admin/js/vue.min.js"></script>
206 <script src="/_admin/js/filesize.min.js"></script>
207 <script src="/_admin/js/superagent.js"></script>
208 <script src="/_admin/js/sorttable.js"></script>
209 <script src="/_admin/js/app.js"></script>
210 115
211</body> 116</body>
212</html> 117</html>