|
25 | 25 |
|
26 | 26 | @section('scripts') |
27 | 27 | @parent |
28 | | - <script src="{{ asset('js/binaryjs.js') }}"></script> |
| 28 | + {!! Theme::js('js/binaryjs.js') !!} |
| 29 | + {!! Theme::js('js/vendor/lodash/lodash.js') !!} |
29 | 30 | @endsection |
30 | 31 |
|
31 | 32 | @section('content') |
|
36 | 37 | </ul> |
37 | 38 | <div class="tab-content"> |
38 | 39 | <div class="tab-pane active" id="create"> |
39 | | - <div id="write_status" style="display:none;width: 100%; margin: 10px 0 5px;"></div> |
40 | | - <form method="post" id="new_file"> |
41 | | - <h4>/home/container/{{ $directory }} <input type="text" id="file_name" class="filename" value="newfile.txt" /></h4> |
42 | | - <div class="form-group"> |
43 | | - <div id="fileContents" style="height:500px;"></div> |
| 40 | + <div class="row" style="margin: 15px 0 0;"> |
| 41 | + <div class="col-md-8" style="padding-left:0;"> |
| 42 | + <div class="input-group" style="margin-bottom:5px;"> |
| 43 | + <span class="input-group-addon">Save As:</span> |
| 44 | + <input type="text" class="form-control" id="file_name" placeholder="filename.json" value="{{ $directory}}"> |
| 45 | + </div> |
| 46 | + <small><p class="text-muted">All files are saved relative to <code>/home/container</code>. You can enter more of the path into the Save As field to save the file into a specific folder.</p></small> |
44 | 47 | </div> |
45 | | - <div class="form-group"> |
46 | | - <div class="row"> |
47 | | - <div class="col-md-8"> |
48 | | - <button class="btn btn-primary btn-sm" id="create_file">{{ trans('strings.save') }}</button> |
49 | | - <button class="btn btn-default btn-sm" onclick="window.location='/server/{{ $server->uuidShort }}/files?dir=/{{ $directory }}';return false;">{{ trans('server.files.back') }}</button> |
50 | | - </div> |
51 | | - <div class="col-md-4 pull-right"> |
52 | | - <select name="aceMode" id="aceMode" class="form-control"> |
53 | | - <option value="assembly_x86">Assembly x86</option> |
54 | | - <option value="c_cpp">C/C++</option> |
55 | | - <option value="coffee">CoffeeScript</option> |
56 | | - <option value="csharp">C#</option> |
57 | | - <option value="css">CSS</option> |
58 | | - <option value="golang">Go</option> |
59 | | - <option value="haml">HAML</option> |
60 | | - <option value="html">HTML</option> |
61 | | - <option value="ini">INI</option> |
62 | | - <option value="java">Java</option> |
63 | | - <option value="javascript">JavaScript</option> |
64 | | - <option value="json">JSON</option> |
65 | | - <option value="lua">Lua</option> |
66 | | - <option value="markdown">Markdown</option> |
67 | | - <option value="mysql">MySQL</option> |
68 | | - <option value="objectivec">Objective-C</option> |
69 | | - <option value="perl">Perl</option> |
70 | | - <option value="php">PHP</option> |
71 | | - <option value="properties">Properties</option> |
72 | | - <option value="python">Python</option> |
73 | | - <option value="ruby">Ruby</option> |
74 | | - <option value="rust">Rust</option> |
75 | | - <option value="smarty">Smarty</option> |
76 | | - <option value="textile" selected="selected">Plain Text</option> |
77 | | - <option value="xml">XML</option> |
78 | | - <option value="yaml">YAML</option> |
79 | | - </select> |
80 | | - </div> |
| 48 | + </div> |
| 49 | + <div class="row"> |
| 50 | + <div class="col-md-12"> |
| 51 | + <div class="form-group"> |
| 52 | + <div id="fileContents" style="height:500px;"></div> |
81 | 53 | </div> |
82 | 54 | </div> |
83 | | - </form> |
| 55 | + </div> |
| 56 | + <div class="row"> |
| 57 | + <div class="col-md-8"> |
| 58 | + <button class="btn btn-primary btn-sm" id="create_file">{{ trans('strings.save') }}</button> |
| 59 | + <button class="btn btn-default btn-sm" onclick="window.location='/server/{{ $server->uuidShort }}/files?dir=/{{ $directory }}';return false;">{{ trans('server.files.back') }}</button> |
| 60 | + </div> |
| 61 | + <div class="col-md-4 pull-right"> |
| 62 | + <select name="aceMode" id="aceMode" class="form-control"> |
| 63 | + <option value="assembly_x86">Assembly x86</option> |
| 64 | + <option value="c_cpp">C/C++</option> |
| 65 | + <option value="coffee">CoffeeScript</option> |
| 66 | + <option value="csharp">C#</option> |
| 67 | + <option value="css">CSS</option> |
| 68 | + <option value="golang">Go</option> |
| 69 | + <option value="haml">HAML</option> |
| 70 | + <option value="html">HTML</option> |
| 71 | + <option value="ini">INI</option> |
| 72 | + <option value="java">Java</option> |
| 73 | + <option value="javascript">JavaScript</option> |
| 74 | + <option value="json">JSON</option> |
| 75 | + <option value="lua">Lua</option> |
| 76 | + <option value="markdown">Markdown</option> |
| 77 | + <option value="mysql">MySQL</option> |
| 78 | + <option value="objectivec">Objective-C</option> |
| 79 | + <option value="perl">Perl</option> |
| 80 | + <option value="php">PHP</option> |
| 81 | + <option value="properties">Properties</option> |
| 82 | + <option value="python">Python</option> |
| 83 | + <option value="ruby">Ruby</option> |
| 84 | + <option value="rust">Rust</option> |
| 85 | + <option value="smarty">Smarty</option> |
| 86 | + <option value="textile" selected="selected">Plain Text</option> |
| 87 | + <option value="xml">XML</option> |
| 88 | + <option value="yaml">YAML</option> |
| 89 | + </select> |
| 90 | + </div> |
| 91 | + </div> |
84 | 92 | </div> |
85 | 93 | @can('upload-files', $server) |
86 | 94 | <div class="tab-pane" id="upload"> |
87 | | - <h4>/home/container/ <input type="text" id="u_file_name" value="{{ $directory }}" style='outline: none;width:450px;background: transparent;margin-left:-5px;padding:0;border: 0px;font-family: "Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-weight: 250;line-height: 1.1;color: inherit;font-size: 19px;'/></h4> |
88 | | - <div class="alert alert-warning">Please edit the path location above <strong>before you upload files</strong>. They will automatically be placed in the directory you specify above. Simply click next to <code>/home/container/</code> and begin typing. You can change this each time you upload a new file without having to press anything else.</div> |
| 95 | + <div class="row" style="margin: 15px 0 0;"> |
| 96 | + <div class="col-md-8" style="padding-left:0;"> |
| 97 | + <div class="input-group" style="margin-bottom:5px;"> |
| 98 | + <span class="input-group-addon">Upload Directory:</span> |
| 99 | + <input type="text" class="form-control" id="u_file_name" placeholder="logs/" value="{{ $directory}}"> |
| 100 | + </div> |
| 101 | + <small><p class="text-muted">All files are saved relative to <code>/home/container</code>. You can enter more of the path into the Save As field to save the file into a specific folder.</p></small> |
| 102 | + </div> |
| 103 | + </div> |
| 104 | + |
| 105 | + <div class="alert alert-warning">Edit the path location above <strong>before you upload files</strong>. They will automatically be placed in the directory you specify above. You can change this each time you upload a new file without having to press anything else.</div> |
89 | 106 | <div class="alert alert-danger" id="upload_error" style="display: none;"></div> |
90 | 107 | <input type="file" id="fileinput" name="fileUpload[]" multiple="" style="display:none;"/> |
91 | 108 | <div id="uploader_box" class="well well-sm" style="cursor:pointer;"> |
@@ -227,7 +244,14 @@ function doNothing (e){ |
227 | 244 | }); |
228 | 245 |
|
229 | 246 | function save() { |
230 | | - var fileName = $('input[name="file"]').val(); |
| 247 | + if (_.isEmpty($('#file_name').val())) { |
| 248 | + $.notify({ |
| 249 | + message: 'No filename was passed.' |
| 250 | + }, { |
| 251 | + type: 'danger' |
| 252 | + }); |
| 253 | + return; |
| 254 | + } |
231 | 255 | $('#create_file').append(' <i class="fa fa-spinner fa fa-spin"></i>').addClass('disabled'); |
232 | 256 | $.ajax({ |
233 | 257 | type: 'POST', |
|
0 commit comments