Compare commits

...

31 Commits

Author SHA1 Message Date
Râu Cao 0bece35c44
Update README 2023-09-20 22:41:57 +02:00
Basti 9c48d30159
Update README 2021-02-25 19:52:16 +01:00
Basti a016b68355
Adjust resource limits
continuous-integration/drone/push Build is running Details
2019-03-04 13:52:35 +07:00
Basti afdef57808
Lower memory limit 2019-03-04 13:22:09 +07:00
Basti 4a3095625c
Add resource limits for Drone k8s jobs
continuous-integration/drone/push Build is running Details
2019-03-04 13:19:03 +07:00
Basti f1fc68e7bf
Fix Docker tag syntax
continuous-integration/drone/push Build was killed Details
2019-03-03 13:36:34 +07:00
Basti 825bbd63ea
Add Drone CI config
continuous-integration/drone/push Build was killed Details
2019-03-03 13:23:54 +07:00
Basti 25edfa775b Update rs.js 2018-12-09 09:12:50 +00:00
Basti 39686a55c3 0.9.0 2018-11-17 15:41:24 +00:00
Basti 9cfaedb1ea Remove macOS package from lockfile 2018-11-17 15:33:28 +00:00
Basti 2017da2af0 Render audio and video file preview
Audio and video files are not downloaded, but the element src is
fetching the content directly from storage. Unfortunately, one cannot
skip forward, when the RS server doesn't support content ranges.
2018-11-17 15:33:28 +00:00
Basti 4754bc4a89 Update README 2018-11-17 15:33:28 +00:00
Basti 96ddacae14 Style content buttons 2018-11-17 15:33:28 +00:00
Basti 3dbf1e1228 Formatting 2018-06-19 18:13:20 +02:00
Basti 2abd47712d For now only edit JSON
Plain text editing is not implemented yet.
2018-04-02 00:19:12 +02:00
Basti 4d8e25eaf7 Ensure previews are not opened in edit mode
Apparently component state can survive route changes there. o_O
2018-04-02 00:18:35 +02:00
Basti e3f1010d59 Make buttons fit with all possible buttons visible 2018-04-02 00:09:15 +02:00
Basti 6a63d63634 Fix button spacing for all possible combos 2018-04-02 00:04:58 +02:00
Basti 74e442ce8b Give delete button a warning color 2018-04-01 16:03:03 +02:00
Basti c7a4faf5b2 Disabled editor buttons while uploading changes 2018-04-01 15:55:57 +02:00
Basti f2fe1f5530 Reset JSON treeviews when editing is cancelled
And don't add all the event handlers by default.
2018-04-01 15:40:17 +02:00
Basti 103ccbdfdd Minimal styling for native content buttons 2018-04-01 15:39:55 +02:00
Basti 5748f83971 Use proper button groups
Improve styling of button groups, so they're more intuitive. Remove
button-group containers for single buttons.
2018-04-01 15:25:25 +02:00
Basti c979b13df5 Edit files via the JSON tree view editor 2018-04-01 13:59:34 +02:00
Basti ddecda8220 Add edit-content buttons and states 2018-03-31 19:35:46 +02:00
Basti 693769d41c Update remoteStorage.js 2018-03-31 19:04:56 +02:00
Basti 5cb30e384d Update README 2018-03-04 17:15:07 +02:00
Basti 0eaf248045 Update README 2018-03-04 17:09:48 +02:00
Basti 3cb6276f3b Lock custom tree-view dep 2018-02-25 17:06:41 +02:00
Basti 44b07c7dd1 Update RS widget 2018-02-25 17:04:54 +02:00
Basti 8db259d147 Add button for opening public docs in a new tab 2018-01-25 16:52:56 +00:00
22 changed files with 360 additions and 971 deletions

16
.drone.yml Normal file
View File

@ -0,0 +1,16 @@
kind: pipeline
name: test
steps:
- name: test
image: colthreepv/node-chrome:8
commands:
- npm install
- npm test
resources:
requests:
cpu: 250m
memory: 256Mi
limits:
cpu: 250m
memory: 256Mi

View File

@ -4,8 +4,11 @@ Inspektor is a simple file browser for inspecting the contents of a
[remoteStorage](https://remotestorage.io) account. It is intended for RS app
developers and power users.
Inspektor is beta software and currently under development. You're invited to
contribute and/or give feedback: https://gitlab.com/skddc/inspektor
You're invited to contribute to this app and/or submit feedback to improve it. Please use the
[RS Discourse forums](https://community.remotestorage.io/t/rs-inspektor-a-simple-remotestorage-file-browser/428)
to post issues or ideas, and/or to request an account for gitea.kosmos.org
if you want to submit pull requests directly to the upstream repository. You
may also submit Git patches via [e-mail](mailto:raucao@kip.pe).
## Features
@ -13,15 +16,18 @@ contribute and/or give feedback: https://gitlab.com/skddc/inspektor
* [x] Traverse/inspect directories
* [x] View document details
* [x] Render images in details
* [x] Render text content in details (e.g. JSON)
* [x] Render text content in details
* [x] Render JSON content tree view (optional source view)
* [x] Delete documents
* [ ] Delete directories
* [ ] Render other types content (e.g. audio and video)
* [ ] Edit text content (and save changes)
* [x] Edit JSON content in tree view
* [x] Delete directories
* [ ] Edit content source
* [ ] Render other types of content (e.g. audio and video)
* [ ] Copy/move documents
* [ ] Copy/move directories (and enclosed files)
* [ ] Loading indicator for any view change that loads remote data
* [ ] Logo/icon
* [ ] Layout/support for small screens
## Prerequisites

View File

@ -1,7 +1,7 @@
import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { observer } from '@ember/object';
import { alias } from '@ember/object/computed';
import { alias, none, not } from '@ember/object/computed';
import { scheduleOnce } from '@ember/runloop';
import JSONTreeView from 'npm:json-tree-view';
@ -12,6 +12,11 @@ export default Component.extend({
classNames: ['file-preview'],
fileLoaded: false,
uploadingChanges: false,
showEditor: null,
hideEditor: not('showEditor'),
fileContent: null,
objectURL: null,
metaData: null,
@ -19,8 +24,19 @@ export default Component.extend({
type: alias('metaData.type'),
isBinary: alias('metaData.isBinary'),
isUnknownBinary: none('isImage', 'isAudio', 'isVideo'),
isImage: function() {
return this.get('type').match(/^image\/.+$/); }.property('type'),
return this.get('type').match(/^image\/.+$/);
}.property('type'),
isAudio: function() {
return this.get('type').match(/^audio\/.+$/);
}.property('type'),
isVideo: function() {
return this.get('type').match(/^video\/.+$/);
}.property('type'),
isText: function() {
return !this.get('isBinary');
@ -29,8 +45,16 @@ export default Component.extend({
loadFile: function() {
let path = this.get('metaData.path');
if (this.get('isAudio') || this.get('isVideo')) {
this.set('fileLoaded', true);
this.set('objectURL', this.get('storage.client')
.getItemURL(path));
return;
}
// TODO don't fetch is size above certain limit
console.debug(`[file-preview] Loading file ${this.get('metaData.name')}`)
this.get('storage.client').getFile(path).then(file => {
if (this.get('isImage')) {
let view = new window.Uint8Array(file.data);
@ -60,8 +84,23 @@ export default Component.extend({
let value = JSON.parse(this.get('fileContent'));
let view = new JSONTreeView('content', value);
// this.attachJsonTreeEventHandlers(view);
// Listen for change events
const containerElement = document.getElementById('json-tree-view');
containerElement.innerHTML = ''; // Throw away any existing treeviews
containerElement.appendChild(view.dom);
window.jsonview = view;
view.expand(true);
view.withRootName = false;
view.readonly = this.get('hideEditor');
this.set('jsonTreeView', view);
},
attachJsonTreeEventHandlers (view) {
view.on('change', function(self, key, oldValue, newValue){
console.log('change', key, oldValue, '=>', newValue);
});
@ -86,18 +125,53 @@ export default Component.extend({
view.on('refresh', function(self, key, value) {
console.log('refresh', key, '=', value);
});
},
document.getElementById('json-tree-view')
.appendChild(view.dom);
onShowEditor: observer('showEditor', function(){
if (this.get('fileLoaded') && this.get('isJSON') && this.get('jsonShowTree')) {
const showEditor = this.get('showEditor');
window.jsonview = view;
if (showEditor) {
this.set('jsonTreeView.readonly', false);
} else {
this.set('jsonTreeView.readonly', true);
this.renderJsonTree();
}
}
}),
view.expand(true);
actions: {
view.withRootName = false;
view.readonly = true;
saveChanges () {
const path = this.get('metaData.path');
if (this.get('isJSON') && this.get('jsonShowTree')) {
const content = JSON.stringify(this.get('jsonTreeView.value'));
this.set('uploadingChanges', true);
this.get('storage.client')
.storeFile('application/json', path, content)
.then(etag => {
this.setProperties({
'metaData.etag': etag,
fileContent: content,
showEditor: false
});
}).catch(err => {
alert('Failed to update the file. Check the console for more info.');
console.error(err);
}).finally(() => {
this.set('uploadingChanges', false);
});
} else {
console.warn('not implemented');
}
},
cancelEditor () {
this.set('showEditor', false);
}
this.set('jsonTreeView', view);
}
});

View File

@ -1,9 +1,16 @@
{{#if fileLoaded}}
{{#if isBinary}}
{{#if isUnkownBinary}}
<p>No preview available for this content type.</p>
{{/if}}
{{#if isImage}}
<img src={{objectURL}} alt={{metaData.name}}>
{{else}}
<p>No preview available for this content type.</p>
{{/if}}
{{#if isAudio}}
<audio src={{objectURL}} controls />
{{/if}}
{{#if isVideo}}
<video src={{objectURL}} controls />
{{/if}}
{{/if}}
@ -18,4 +25,19 @@
<code>{{fileContent}}</code>
{{/if}}
{{/if}}
{{#if showEditor}}
<div class="actions">
<button {{action "saveChanges"}}
disabled={{uploadingChanges}}
class="primary">
Save changes
</button>
<button {{action "cancelEditor"}}
disabled={{uploadingChanges}}
class="secondary">
Cancel editing
</button>
</div>
{{/if}}
{{/if}}

View File

@ -14,6 +14,12 @@ export default Controller.extend({
queryParams: ['path'],
// documentIsEditable: computed.not('model.documentMetaData.isBinary'),
documentIsEditable: alias('documentIsJSON'),
documentShowEditor: false,
documentHideEditor: computed.not('documentShowEditor'),
documentIsJSON: computed('model.documentMetaData.type', function(){
if (isEmpty(this.get('model.documentMetaData'))) { return false; }
@ -24,6 +30,16 @@ export default Controller.extend({
jsonShowTree: computed.equal('jsonView', 'tree'),
jsonShowSource: computed.equal('jsonView', 'source'),
publicItemURL: computed('model.documentMetaData.path', function(){
let path = this.get('model.documentMetaData.path');
if (path.match(/public\//)) {
return this.get('storage.client').getItemURL(path);
} else {
return null;
}
}),
metadataHidden: false,
actions: {
@ -36,6 +52,15 @@ export default Controller.extend({
this.set('jsonView', 'source');
},
showEditor () {
this.set('documentShowEditor', true);
},
cancelEditor () {
this.set('documentShowEditor', false);
// TODO remove changes from tree/source
},
toggleMetadata () {
this.toggleProperty('metadataHidden');
},

View File

@ -32,7 +32,8 @@ export default Route.extend({
}).then(metaData => {
return {
documentMetaData: metaData,
currentDirPath: parentDirPath
// documentPublicURL: this.get()
currentDirPath: parentDirPath,
};
});
},
@ -47,6 +48,8 @@ export default Route.extend({
if (isPresent(model)) {
controller.set('currentDirPath', model.currentDirPath);
}
controller.set('documentShowEditor', false);
}
});

View File

@ -1,28 +1,60 @@
div.button-group {
display: inline-block;
}
button {
font-family: Open Sans, sans-serif;
font-size: 1rem;
color: #fff;
background-color: $dark-blue;
border: 1px solid $dark-blue;
div.button-group + button,
div.button-group + div.button-group {
margin-left: 1rem;
&:hover, &:active {
background-color: lighten($dark-blue, 5%);
}
&.delete {
background-color: transparent;
border-color: $dark-red;
color: $dark-red;
svg { path { fill: $dark-red; }
}
&:hover {
background-color: $dark-red;
color: #fff;
svg { path { fill: #fff; } }
}
}
&.primary {
// main button
}
&.secondary {
background-color: transparent;
color: $dark-blue;
&:hover {
background-color: $dark-blue;
color: #fff;
svg { path { fill: #fff; } }
}
}
}
header {
button {
button, a.button {
display: inline-block;
padding: 0.4rem 0 0.3rem;
width: 3rem;
border: 1px solid $dark-grey-2;
border-radius: 0.2em;
background-color: #fff;
color: $dark-grey-2;
font-size: 0.8rem;
text-align: center;
text-transform: uppercase;
width: 3rem;
svg {
height: 1rem;
path {
fill: $dark-grey-2;
}
path { fill: $dark-grey-2; }
}
&:hover {
@ -36,8 +68,8 @@ header {
}
}
&:disabled,
&:disabled:hover {
&:disabled:not(.active),
&:disabled:not(.active):hover {
border-color: $dark-grey-3;
background-color: #fff;
color: $dark-grey-3;
@ -48,5 +80,59 @@ header {
}
}
}
&.active {
border-color: lighten($dark-grey-2, 10%);
background-color: lighten($dark-grey-2, 10%);
color: lighten($dark-grey-2, 10%);
svg { path { fill: #fff; } }
}
}
button + button,
button + .button,
.button + .button,
button + .button-group,
.button + .button-group,
.button-group + button,
.button-group + .button-group {
margin-left: 0.5rem;
}
.button-group {
position: relative;
display: inline-flex;
flex-direction: row;
button {
position: relative;
margin-right: 0;
flex: 0 1 auto;
&:not(:last-child) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
}
button + button {
margin-left: -1px;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
}
}
main section.content {
button {
font-size: 0.86rem;
padding: 0.4rem 1rem;
border-radius: 3px;
}
button + button {
margin-left: 0.5rem;
}
}

View File

@ -3,6 +3,8 @@ $dark-grey-2: #344453;
$dark-grey-3: #aaa;
$light-grey-1: #b5c3d1;
$light-grey-2: #ececec;
$dark-red: #8b0000;
$dark-blue: #0067c7;
body {
background-color: #fff;

View File

@ -99,7 +99,7 @@
padding: 1.5rem 1px;
&.content {
overflow: auto;
overflow: hidden;
}
&.meta {

View File

@ -3,6 +3,11 @@
@import "colors";
@import "layout";
html {
font-family: Open Sans, sans-serif;
font-size: 15px;
}
body {
background-color: white;
font-size: 15px;

View File

@ -7,8 +7,16 @@
hyphens: none;
}
img {
img, audio, video {
max-width: 100%;
}
#json-tree-view {
overflow: auto;
}
.actions {
margin-top: 2rem;
}
}

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM32 80c0-8.8 7.2-16 16-16h48v64H32V80zm448 352c0 8.8-7.2 16-16 16H48c-8.8 0-16-7.2-16-16V160h448v272zm0-304H128V64h336c8.8 0 16 7.2 16 16v48z"/></svg>

After

Width:  |  Height:  |  Size: 326 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M417.8 315.5l20-20c3.8-3.8 10.2-1.1 10.2 4.2V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h292.3c5.3 0 8 6.5 4.2 10.2l-20 20c-1.1 1.1-2.7 1.8-4.2 1.8H48c-8.8 0-16 7.2-16 16v352c0 8.8 7.2 16 16 16h352c8.8 0 16-7.2 16-16V319.7c0-1.6.6-3.1 1.8-4.2zm145.9-191.2L251.2 436.8l-99.9 11.1c-13.4 1.5-24.7-9.8-23.2-23.2l11.1-99.9L451.7 12.3c16.4-16.4 43-16.4 59.4 0l52.6 52.6c16.4 16.4 16.4 43 0 59.4zm-93.6 48.4L403.4 106 169.8 339.5l-8.3 75.1 75.1-8.3 233.5-233.6zm71-85.2l-52.6-52.6c-3.8-3.8-10.2-4-14.1 0L426 83.3l66.7 66.7 48.4-48.4c3.9-3.8 3.9-10.2 0-14.1z"/></svg>

After

Width:  |  Height:  |  Size: 661 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M569.354 231.631C512.969 135.948 407.808 72 288 72 168.14 72 63.004 135.994 6.646 231.63a47.999 47.999 0 0 0 0 48.739C63.032 376.053 168.192 440 288 440c119.86 0 224.996-63.994 281.354-159.631a48.002 48.002 0 0 0 0-48.738zM416 228c0 68.483-57.308 124-128 124s-128-55.517-128-124 57.308-124 128-124 128 55.517 128 124zm125.784 36.123C489.837 352.277 393.865 408 288 408c-106.291 0-202.061-56.105-253.784-143.876a16.006 16.006 0 0 1 0-16.247c29.072-49.333 73.341-90.435 127.66-115.887C140.845 158.191 128 191.568 128 228c0 85.818 71.221 156 160 156 88.77 0 160-70.178 160-156 0-36.411-12.833-69.794-33.875-96.01 53.76 25.189 98.274 66.021 127.66 115.887a16.006 16.006 0 0 1-.001 16.246zM224 224c0-10.897 2.727-21.156 7.53-30.137v.02c0 14.554 11.799 26.353 26.353 26.353 14.554 0 26.353-11.799 26.353-26.353s-11.799-26.353-26.353-26.353h-.02c8.981-4.803 19.24-7.53 30.137-7.53 35.346 0 64 28.654 64 64s-28.654 64-64 64-64-28.654-64-64z"/></svg>

After

Width:  |  Height:  |  Size: 1012 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M564.907 196.35L388.91 12.366C364.216-13.45 320 3.746 320 40.016v88.154C154.548 130.155 0 160.103 0 331.19c0 94.98 55.84 150.231 89.13 174.571 24.233 17.722 58.021-4.992 49.68-34.51C100.937 336.887 165.575 321.972 320 320.16V408c0 36.239 44.19 53.494 68.91 27.65l175.998-184c14.79-15.47 14.79-39.83-.001-55.3zm-23.127 33.18l-176 184c-4.933 5.16-13.78 1.73-13.78-5.53V288c-171.396 0-295.313 9.707-243.98 191.7C72 453.36 32 405.59 32 331.19 32 171.18 194.886 160 352 160V40c0-7.262 8.851-10.69 13.78-5.53l176 184a7.978 7.978 0 0 1 0 11.06z"/></svg>

After

Width:  |  Height:  |  Size: 617 B

View File

@ -1,20 +1,24 @@
<header>
{{breadcrumb-nav currentDirPath=currentDirPath}}
<nav class="actions">
{{#if metadataHidden}}
<button {{action "toggleMetadata"}}
title="Show metadata">
{{partial "icons/arrow-from-right"}}
</button>
{{else}}
<button {{action "toggleMetadata"}}
title="Hide metadata">
{{partial "icons/arrow-to-right"}}
</button>
{{/if}}
{{#if publicItemURL}}
<a class="button" href={{publicItemURL}} target="_blank"
title="Open document in new tab">
{{partial "icons/share"}}
</a>
{{/if}}
{{#if documentIsJSON}}
<div class="button-group json-view">
{{#if metadataHidden}}
<button {{action "toggleMetadata"}}
title="Show metadata">
{{partial "icons/arrow-from-right"}}
</button>
{{else}}
<button {{action "toggleMetadata"}}
title="Hide metadata">
{{partial "icons/arrow-to-right"}}
</button>
{{/if}}
</div>
<div class="button-group json-view">
<button disabled={{jsonShowTree}}
class="{{if jsonShowTree "active"}}"
@ -30,6 +34,21 @@
</button>
</div>
{{/if}}
{{#if documentIsEditable}}
<div class="button-group editable">
<button disabled={{documentHideEditor}}
class="{{if documentHideEditor "active"}}"
title="{{if documentHideEditor "Cancel editing"}}"
{{action "cancelEditor"}}>
{{partial "icons/eye"}}
</button>
<button disabled={{documentShowEditor}}
class="{{if documentShowEditor "active"}}"
{{action "showEditor"}}>
{{partial "icons/edit"}}
</button>
</div>
{{/if}}
<button class="delete" title="Delete"
{{action "deleteItem"}}>{{partial "icons/trash"}}</button>
</nav>
@ -39,6 +58,8 @@
<section class="content">
{{file-preview metaData=model.documentMetaData
isJSON=documentIsJSON
isEditable=documentIsEditableHide
showEditor=documentShowEditor
jsonShowTree=jsonShowTree
jsonShowSource=jsonShowSource}}
</section>

927
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "inspektor",
"version": "0.8.0",
"version": "0.9.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -2529,7 +2529,6 @@
"requires": {
"anymatch": "1.3.2",
"async-each": "1.0.1",
"fsevents": "1.1.3",
"glob-parent": "2.0.0",
"inherits": "2.0.3",
"is-binary-path": "1.0.1",
@ -6017,910 +6016,6 @@
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
"fsevents": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz",
"integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==",
"dev": true,
"optional": true,
"requires": {
"nan": "2.7.0",
"node-pre-gyp": "0.6.39"
},
"dependencies": {
"abbrev": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
},
"ajv": {
"version": "4.11.8",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"co": "4.6.0",
"json-stable-stringify": "1.0.1"
}
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
},
"aproba": {
"version": "1.1.1",
"bundled": true,
"dev": true,
"optional": true
},
"are-we-there-yet": {
"version": "1.1.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"delegates": "1.0.0",
"readable-stream": "2.2.9"
}
},
"asn1": {
"version": "0.2.3",
"bundled": true,
"dev": true,
"optional": true
},
"assert-plus": {
"version": "0.2.0",
"bundled": true,
"dev": true,
"optional": true
},
"asynckit": {
"version": "0.4.0",
"bundled": true,
"dev": true,
"optional": true
},
"aws-sign2": {
"version": "0.6.0",
"bundled": true,
"dev": true,
"optional": true
},
"aws4": {
"version": "1.6.0",
"bundled": true,
"dev": true,
"optional": true
},
"balanced-match": {
"version": "0.4.2",
"bundled": true,
"dev": true
},
"bcrypt-pbkdf": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"tweetnacl": "0.14.5"
}
},
"block-stream": {
"version": "0.0.9",
"bundled": true,
"dev": true,
"requires": {
"inherits": "2.0.3"
}
},
"boom": {
"version": "2.10.1",
"bundled": true,
"dev": true,
"requires": {
"hoek": "2.16.3"
}
},
"brace-expansion": {
"version": "1.1.7",
"bundled": true,
"dev": true,
"requires": {
"balanced-match": "0.4.2",
"concat-map": "0.0.1"
}
},
"buffer-shims": {
"version": "1.0.0",
"bundled": true,
"dev": true
},
"caseless": {
"version": "0.12.0",
"bundled": true,
"dev": true,
"optional": true
},
"co": {
"version": "4.6.0",
"bundled": true,
"dev": true,
"optional": true
},
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
},
"combined-stream": {
"version": "1.0.5",
"bundled": true,
"dev": true,
"requires": {
"delayed-stream": "1.0.0"
}
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
},
"core-util-is": {
"version": "1.0.2",
"bundled": true,
"dev": true
},
"cryptiles": {
"version": "2.0.5",
"bundled": true,
"dev": true,
"requires": {
"boom": "2.10.1"
}
},
"dashdash": {
"version": "1.14.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"assert-plus": "1.0.0"
},
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
}
}
},
"debug": {
"version": "2.6.8",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ms": "2.0.0"
}
},
"deep-extend": {
"version": "0.4.2",
"bundled": true,
"dev": true,
"optional": true
},
"delayed-stream": {
"version": "1.0.0",
"bundled": true,
"dev": true
},
"delegates": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"detect-libc": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"ecc-jsbn": {
"version": "0.1.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"jsbn": "0.1.1"
}
},
"extend": {
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"extsprintf": {
"version": "1.0.2",
"bundled": true,
"dev": true
},
"forever-agent": {
"version": "0.6.1",
"bundled": true,
"dev": true,
"optional": true
},
"form-data": {
"version": "2.1.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"asynckit": "0.4.0",
"combined-stream": "1.0.5",
"mime-types": "2.1.15"
}
},
"fs.realpath": {
"version": "1.0.0",
"bundled": true,
"dev": true
},
"fstream": {
"version": "1.0.11",
"bundled": true,
"dev": true,
"requires": {
"graceful-fs": "4.1.11",
"inherits": "2.0.3",
"mkdirp": "0.5.1",
"rimraf": "2.6.1"
}
},
"fstream-ignore": {
"version": "1.0.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"fstream": "1.0.11",
"inherits": "2.0.3",
"minimatch": "3.0.4"
}
},
"gauge": {
"version": "2.7.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"aproba": "1.1.1",
"console-control-strings": "1.1.0",
"has-unicode": "2.0.1",
"object-assign": "4.1.1",
"signal-exit": "3.0.2",
"string-width": "1.0.2",
"strip-ansi": "3.0.1",
"wide-align": "1.1.2"
}
},
"getpass": {
"version": "0.1.7",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"assert-plus": "1.0.0"
},
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
}
}
},
"glob": {
"version": "7.1.2",
"bundled": true,
"dev": true,
"requires": {
"fs.realpath": "1.0.0",
"inflight": "1.0.6",
"inherits": "2.0.3",
"minimatch": "3.0.4",
"once": "1.4.0",
"path-is-absolute": "1.0.1"
}
},
"graceful-fs": {
"version": "4.1.11",
"bundled": true,
"dev": true
},
"har-schema": {
"version": "1.0.5",
"bundled": true,
"dev": true,
"optional": true
},
"har-validator": {
"version": "4.2.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ajv": "4.11.8",
"har-schema": "1.0.5"
}
},
"has-unicode": {
"version": "2.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"hawk": {
"version": "3.1.3",
"bundled": true,
"dev": true,
"requires": {
"boom": "2.10.1",
"cryptiles": "2.0.5",
"hoek": "2.16.3",
"sntp": "1.0.9"
}
},
"hoek": {
"version": "2.16.3",
"bundled": true,
"dev": true
},
"http-signature": {
"version": "1.1.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"assert-plus": "0.2.0",
"jsprim": "1.4.0",
"sshpk": "1.13.0"
}
},
"inflight": {
"version": "1.0.6",
"bundled": true,
"dev": true,
"requires": {
"once": "1.4.0",
"wrappy": "1.0.2"
}
},
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
},
"ini": {
"version": "1.3.4",
"bundled": true,
"dev": true,
"optional": true
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"requires": {
"number-is-nan": "1.0.1"
}
},
"is-typedarray": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"isarray": {
"version": "1.0.0",
"bundled": true,
"dev": true
},
"isstream": {
"version": "0.1.2",
"bundled": true,
"dev": true,
"optional": true
},
"jodid25519": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"jsbn": "0.1.1"
}
},
"jsbn": {
"version": "0.1.1",
"bundled": true,
"dev": true,
"optional": true
},
"json-schema": {
"version": "0.2.3",
"bundled": true,
"dev": true,
"optional": true
},
"json-stable-stringify": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"jsonify": "0.0.0"
}
},
"json-stringify-safe": {
"version": "5.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"jsonify": {
"version": "0.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"jsprim": {
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"assert-plus": "1.0.0",
"extsprintf": "1.0.2",
"json-schema": "0.2.3",
"verror": "1.3.6"
},
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
}
}
},
"mime-db": {
"version": "1.27.0",
"bundled": true,
"dev": true
},
"mime-types": {
"version": "2.1.15",
"bundled": true,
"dev": true,
"requires": {
"mime-db": "1.27.0"
}
},
"minimatch": {
"version": "3.0.4",
"bundled": true,
"dev": true,
"requires": {
"brace-expansion": "1.1.7"
}
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
},
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"dev": true,
"requires": {
"minimist": "0.0.8"
}
},
"ms": {
"version": "2.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"node-pre-gyp": {
"version": "0.6.39",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"detect-libc": "1.0.2",
"hawk": "3.1.3",
"mkdirp": "0.5.1",
"nopt": "4.0.1",
"npmlog": "4.1.0",
"rc": "1.2.1",
"request": "2.81.0",
"rimraf": "2.6.1",
"semver": "5.3.0",
"tar": "2.2.1",
"tar-pack": "3.4.0"
}
},
"nopt": {
"version": "4.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"abbrev": "1.1.0",
"osenv": "0.1.4"
}
},
"npmlog": {
"version": "4.1.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"are-we-there-yet": "1.1.4",
"console-control-strings": "1.1.0",
"gauge": "2.7.4",
"set-blocking": "2.0.0"
}
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
},
"oauth-sign": {
"version": "0.8.2",
"bundled": true,
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
"bundled": true,
"dev": true,
"optional": true
},
"once": {
"version": "1.4.0",
"bundled": true,
"dev": true,
"requires": {
"wrappy": "1.0.2"
}
},
"os-homedir": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"os-tmpdir": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"osenv": {
"version": "0.1.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"os-homedir": "1.0.2",
"os-tmpdir": "1.0.2"
}
},
"path-is-absolute": {
"version": "1.0.1",
"bundled": true,
"dev": true
},
"performance-now": {
"version": "0.2.0",
"bundled": true,
"dev": true,
"optional": true
},
"process-nextick-args": {
"version": "1.0.7",
"bundled": true,
"dev": true
},
"punycode": {
"version": "1.4.1",
"bundled": true,
"dev": true,
"optional": true
},
"qs": {
"version": "6.4.0",
"bundled": true,
"dev": true,
"optional": true
},
"rc": {
"version": "1.2.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"deep-extend": "0.4.2",
"ini": "1.3.4",
"minimist": "1.2.0",
"strip-json-comments": "2.0.1"
},
"dependencies": {
"minimist": {
"version": "1.2.0",
"bundled": true,
"dev": true,
"optional": true
}
}
},
"readable-stream": {
"version": "2.2.9",
"bundled": true,
"dev": true,
"requires": {
"buffer-shims": "1.0.0",
"core-util-is": "1.0.2",
"inherits": "2.0.3",
"isarray": "1.0.0",
"process-nextick-args": "1.0.7",
"string_decoder": "1.0.1",
"util-deprecate": "1.0.2"
}
},
"request": {
"version": "2.81.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"aws-sign2": "0.6.0",
"aws4": "1.6.0",
"caseless": "0.12.0",
"combined-stream": "1.0.5",
"extend": "3.0.1",
"forever-agent": "0.6.1",
"form-data": "2.1.4",
"har-validator": "4.2.1",
"hawk": "3.1.3",
"http-signature": "1.1.1",
"is-typedarray": "1.0.0",
"isstream": "0.1.2",
"json-stringify-safe": "5.0.1",
"mime-types": "2.1.15",
"oauth-sign": "0.8.2",
"performance-now": "0.2.0",
"qs": "6.4.0",
"safe-buffer": "5.0.1",
"stringstream": "0.0.5",
"tough-cookie": "2.3.2",
"tunnel-agent": "0.6.0",
"uuid": "3.0.1"
}
},
"rimraf": {
"version": "2.6.1",
"bundled": true,
"dev": true,
"requires": {
"glob": "7.1.2"
}
},
"safe-buffer": {
"version": "5.0.1",
"bundled": true,
"dev": true
},
"semver": {
"version": "5.3.0",
"bundled": true,
"dev": true,
"optional": true
},
"set-blocking": {
"version": "2.0.0",
"bundled": true,
"dev": true,
"optional": true
},
"signal-exit": {
"version": "3.0.2",
"bundled": true,
"dev": true,
"optional": true
},
"sntp": {
"version": "1.0.9",
"bundled": true,
"dev": true,
"requires": {
"hoek": "2.16.3"
}
},
"sshpk": {
"version": "1.13.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"asn1": "0.2.3",
"assert-plus": "1.0.0",
"bcrypt-pbkdf": "1.0.1",
"dashdash": "1.14.1",
"ecc-jsbn": "0.1.1",
"getpass": "0.1.7",
"jodid25519": "1.0.2",
"jsbn": "0.1.1",
"tweetnacl": "0.14.5"
},
"dependencies": {
"assert-plus": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
}
}
},
"string-width": {
"version": "1.0.2",
"bundled": true,
"dev": true,
"requires": {
"code-point-at": "1.1.0",
"is-fullwidth-code-point": "1.0.0",
"strip-ansi": "3.0.1"
}
},
"string_decoder": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"requires": {
"safe-buffer": "5.0.1"
}
},
"stringstream": {
"version": "0.0.5",
"bundled": true,
"dev": true,
"optional": true
},
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"dev": true,
"requires": {
"ansi-regex": "2.1.1"
}
},
"strip-json-comments": {
"version": "2.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"tar": {
"version": "2.2.1",
"bundled": true,
"dev": true,
"requires": {
"block-stream": "0.0.9",
"fstream": "1.0.11",
"inherits": "2.0.3"
}
},
"tar-pack": {
"version": "3.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"debug": "2.6.8",
"fstream": "1.0.11",
"fstream-ignore": "1.0.5",
"once": "1.4.0",
"readable-stream": "2.2.9",
"rimraf": "2.6.1",
"tar": "2.2.1",
"uid-number": "0.0.6"
}
},
"tough-cookie": {
"version": "2.3.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"punycode": "1.4.1"
}
},
"tunnel-agent": {
"version": "0.6.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "5.0.1"
}
},
"tweetnacl": {
"version": "0.14.5",
"bundled": true,
"dev": true,
"optional": true
},
"uid-number": {
"version": "0.0.6",
"bundled": true,
"dev": true,
"optional": true
},
"util-deprecate": {
"version": "1.0.2",
"bundled": true,
"dev": true
},
"uuid": {
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true
},
"verror": {
"version": "1.3.6",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"extsprintf": "1.0.2"
}
},
"wide-align": {
"version": "1.1.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"string-width": "1.0.2"
}
},
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
}
}
},
"fstream": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz",
@ -10312,19 +9407,19 @@
}
},
"remotestorage-widget": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/remotestorage-widget/-/remotestorage-widget-1.2.0.tgz",
"integrity": "sha512-6SEJ87UiEew43iO53O9ZuJAjg9mPgpSNbehtflm3I7LO5FpQ6RnJZiiHpQzGOgozUFyK8g3UnnOBAzFwJ6jRcA==",
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/remotestorage-widget/-/remotestorage-widget-1.3.0.tgz",
"integrity": "sha512-RV9SjrSIXOcg/O6FkZzhlKTpB10vnxygErwi7ID+7urxxybTv8rPLvabsx8ahWjEHLfAeHXznmtuoz4clNc0Xw==",
"dev": true
},
"remotestoragejs": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/remotestoragejs/-/remotestoragejs-1.0.0.tgz",
"integrity": "sha512-Sq6Mj3fcGFhXFC9B1HuJR034x1Rq/7ECagSu/Z3z0FcCq2d+iM3zVVFR5zmvilbkwgYduzPZ+orOOhwK9QSCnQ==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/remotestoragejs/-/remotestoragejs-1.1.0.tgz",
"integrity": "sha512-No4HnSjrHYRv9m2UWGDPJjb0dyOC0F1Lhfr32dNw2PdQIXlp7pg7eJOGw/hHR6SPBkbkl6P0YEkhiFuSH7yY6g==",
"dev": true,
"requires": {
"tv4": "1.3.0",
"webfinger.js": "2.6.6",
"webfinger.js": "2.7.0",
"xhr2": "0.1.4"
}
},
@ -12116,9 +11211,9 @@
"dev": true
},
"webfinger.js": {
"version": "2.6.6",
"resolved": "https://registry.npmjs.org/webfinger.js/-/webfinger.js-2.6.6.tgz",
"integrity": "sha512-dQpuL01XtluQ9Ndgu62o3pEmIe/ssDoIE0CQsOyavGl04xyHal+Ge4gFerw5V0BFoLTQpD8ZZqaDzb43hG9atw==",
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/webfinger.js/-/webfinger.js-2.7.0.tgz",
"integrity": "sha512-l+UtsuV4zrBKyVAj9VCtwWgscTgadCsdGgL1OvbV102cvydWwJCGXlFIXauzWLzfheIDHfPNRWfgMuwyC6ZfIA==",
"dev": true,
"requires": {
"xhr2": "0.1.4"

View File

@ -1,6 +1,6 @@
{
"name": "inspektor",
"version": "0.8.0",
"version": "0.9.0",
"private": true,
"description": "Inspect the contents of your remote storage",
"license": "MIT",
@ -44,8 +44,8 @@
"ember-source": "~2.16.0",
"json-tree-view": "github:skddc/json-tree-view#bugfix/setters",
"loader.js": "^4.2.3",
"remotestorage-widget": "^1.2.0",
"remotestoragejs": "^1.0.0"
"remotestorage-widget": "^1.3.0",
"remotestoragejs": "^1.1.0"
},
"engines": {
"node": "6.* || >= 7.*"

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M464 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM32 80c0-8.8 7.2-16 16-16h48v64H32V80zm448 352c0 8.8-7.2 16-16 16H48c-8.8 0-16-7.2-16-16V160h448v272zm0-304H128V64h336c8.8 0 16 7.2 16 16v48z"/></svg>

After

Width:  |  Height:  |  Size: 326 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M564.907 196.35L388.91 12.366C364.216-13.45 320 3.746 320 40.016v88.154C154.548 130.155 0 160.103 0 331.19c0 94.98 55.84 150.231 89.13 174.571 24.233 17.722 58.021-4.992 49.68-34.51C100.937 336.887 165.575 321.972 320 320.16V408c0 36.239 44.19 53.494 68.91 27.65l175.998-184c14.79-15.47 14.79-39.83-.001-55.3zm-23.127 33.18l-176 184c-4.933 5.16-13.78 1.73-13.78-5.53V288c-171.396 0-295.313 9.707-243.98 191.7C72 453.36 32 405.59 32 331.19 32 171.18 194.886 160 352 160V40c0-7.262 8.851-10.69 13.78-5.53l176 184a7.978 7.978 0 0 1 0 11.06z"/></svg>

After

Width:  |  Height:  |  Size: 617 B

View File

@ -6,10 +6,17 @@ moduleForComponent('file-preview', 'Integration | Component | file preview', {
});
test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
this.set('metaData', {
etag: "714148227",
isBinary: false,
isFolder: false,
name: "fra-pdx",
path: "trips/2018/06/19/fra-pdx",
size: 92086791,
type: "application/json"
});
this.render(hbs`{{file-preview}}`);
this.render(hbs`{{file-preview metaData=metaData}}`);
assert.equal(this.$().text().trim(), '');
});

View File

@ -4,6 +4,19 @@ moduleFor('controller:inspect', 'Unit | Controller | inspect', {
needs: ['controller:application', 'service:storage']
});
test('#publicItemURL', function(assert) {
let controller = this.subject();
controller.set('model', {});
controller.set('model.documentMetaData', {
"name": "banjul-the-gambia",
"path": "/documents/notes/banjul-the-gambia",
});
assert.equal(controller.get('publicItemURL'), null, 'returns null when item is not in public folder');
});
test('#documentIsJSON', function(assert) {
let controller = this.subject();
@ -34,7 +47,7 @@ test('#documentIsJSON', function(assert) {
assert.notOk(controller.get('documentIsJSON'), 'is false when content type is not JSON');
});
test('jsonView actions/methods', function(assert) {
test('jsonView - switch between source and tree view', function(assert) {
let controller = this.subject();
controller.set('jsonView', null);