]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/blob - app/index.html
Add element ids for better testability
[perso/Immae/Projets/Nodejs/Surfer.git] / app / index.html
1 <html>
2 <head>
3 <title> Cloudron Surfer </title>
4
5 <link rel="stylesheet" href="/_admin/css/font-awesome.min.css">
6 <link rel="stylesheet" href="/_admin/css/bootstrap.min.css">
7 <link rel="stylesheet" href="/_admin/css/style.css">
8
9 <link href="/_admin/img/logo.png" rel="icon" type="image/png">
10
11 </head>
12 <body id="app">
13
14 <nav class="navbar navbar-default" v-cloak>
15 <div class="container-fluid">
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
27 <!-- Collect the nav links, forms, and other content for toggling -->
28 <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
29 <ul class="nav navbar-nav navbar-right">
30 <li v-show="session.valid"><a href="#" v-on:click="logout()" id="logoutButton">Logout</a></li>
31 </ul>
32 </div>
33 </div>
34 </nav>
35
36 <div class="modal fade" tabindex="-1" role="dialog" id="modalDelete">
37 <div class="modal-dialog">
38 <div class="modal-content">
39 <div class="modal-header">
40 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
41 </div>
42 <div class="modal-body">
43 <h5 v-show="deleteData.isFile">Really delete <span style="font-weight: bold;">{{ deleteData.filePath }}</span>?</h5>
44 <h5 v-show="deleteData.isDirectory">Really delete directory <span style="font-weight: bold;">{{ deleteData.filePath }}</span> and all its content?</h5>
45 </div>
46 <div class="modal-footer">
47 <button type="button" class="btn btn-default" data-dismiss="modal">No</button>
48 <button type="button" class="btn btn-danger" v-on:click="del(deleteData)">Yes</button>
49 </div>
50 </div>
51 </div>
52 </div>
53
54 <div class="modal fade" tabindex="-1" role="dialog" id="modalcreateDirectory">
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">New Directory Name</h4>
60 </div>
61 <div class="modal-body">
62 <form v-on:submit.prevent="createDirectory(createDirectoryData)">
63 <div class="form-group" v-bind:class="{ 'has-error': createDirectoryError }">
64 <input type="text" class="form-control" v-model="createDirectoryData" id="inputDirectoryName" placeholder="Name" autofocus="true">
65 <label class="control-label" for="inputDirectoryName">{{ createDirectoryError }}</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">Close</button>
72 <button type="button" class="btn btn-primary" v-on:click="createDirectory(createDirectoryData)">Create</button>
73 </div>
74 </div>
75 </div>
76 </div>
77
78 <div class="container" v-show="busy" v-cloak>
79 <div class="row">
80 <div class="col-lg-12">
81 <center>
82 <i class="fa fa-refresh fa-4x fa-spin"></i>
83 </center>
84 </div>
85 </div>
86 </div>
87
88 <div class="container" v-show="!session.valid && !busy" v-cloak>
89 <div class="row">
90 <div class="col-lg-6 col-lg-offset-3">
91 <form id="loginForm" v-on:submit.prevent="login()">
92 <div class="form-group">
93 <label for="inputUsername">Username</label>
94 <input type="text" class="form-control" id="inputUsername" v-model="loginData.username" placeholder="Username">
95 </div>
96 <div class="form-group">
97 <label for="inputPassword">Password</label>
98 <input type="password" class="form-control" id="inputPassword" v-model="loginData.password" placeholder="Password">
99 </div>
100 <button type="submit" class="btn btn-default">Submit</button>
101 </form>
102 </div>
103 </div>
104 </div>
105
106 <div class="container main" v-show="session.valid && !busy" v-cloak>
107 <div class="row">
108 <div class="col-lg-12">
109 <center>
110 <input type='file' v-el:upload style="display: none" id="uploadInput"/>
111 <button class="btn btn-primary" v-on:click="upload()" id="uploadButton">Upload</button>
112 </center>
113 <br/>
114 </div>
115 <div class="col-lg-12">
116 <ol class="breadcrumb">
117 <li><i class="fa fa-home"></i>&nbsp;</li>
118 <li v-for="part in pathParts">
119 {{ part }}
120 </li>
121 </ol>
122 </div>
123 <div class="col-lg-12" style="text-align: right;">
124 <button class="btn btn-default btn-sm" v-on:click="createDirectoryAsk()">Create Directory</button>
125 </div>
126 <div class="col-lg-12">
127 <table class="table table-hover table-condensed">
128 <thead>
129 <tr>
130 <th>Type</th>
131 <th>Name</th>
132 <th>Size</th>
133 <th>Modified</th>
134 <th style="text-align: right;">Action</th>
135 </tr>
136 </thead>
137 <tbody>
138 <tr v-show="path !== '/'" v-on:click="up()" class="hand">
139 <th><i class="fa fa-chevron-up"></i></th>
140 <th>..</th>
141 <th></th>
142 <th></th>
143 <th></th>
144 </tr>
145 <tr v-for="entry in entries" v-on:click="open(entry)" class="hand">
146 <th>
147 <img v-bind:src="entry.previewUrl" height="48px" width="48px"/>
148 </th>
149 <th>{{ entry.filePath }}</th>
150 <th>{{ entry.size | prettyFileSize }}</th>
151 <th><span v-my-tooltip="foobar" data-toggle="tooltip" title="{{ entry.mtime }}">{{ entry.mtime | prettyDate }}</span></th>
152 <th style="text-align: right;"><button class="btn btn-sm btn-danger" v-on:click.stop="delAsk(entry)"><i class="fa fa-trash"></i></button></th>
153 </tr>
154 </tbody>
155 </table>
156 </div>
157 </div>
158 </div>
159
160 <!-- Footer -->
161 <footer class="text-center">
162 <span class="text-muted">Created by the <a href="https://cloudron.io" target="_blank">Cloudron</a> team <a href="https://github.com/nebulade/surfer" target="_blank">hosted on Github</a></span>
163 </footer>
164
165 <script src="/_admin/js/jquery-1.12.1.min.js"></script>
166 <script src="/_admin/js/bootstrap.min.js"></script>
167 <script src="/_admin/js/vue.min.js"></script>
168 <script src="/_admin/js/filesize.min.js"></script>
169 <script src="/_admin/js/superagent.js"></script>
170 <script src="/_admin/js/app.js"></script>
171
172 </body>
173 </html>