Compare commits
10 Commits
feature/do
...
v0.4.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 07be7dece8 | |||
| b5418a15c8 | |||
| 0ee09d99ce | |||
| 456e1f15fb | |||
| e865ffe073 | |||
| b49cb5c50e | |||
| 92d4b5c73d | |||
| a121128d28 | |||
| ea587b502b | |||
| 579757dee2 |
35
README.md
35
README.md
@@ -1,7 +1,27 @@
|
||||
# inspektor
|
||||
# RS Inspektor
|
||||
|
||||
This README outlines the details of collaborating on this Ember application.
|
||||
A short introduction of this app could easily go here.
|
||||
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
|
||||
|
||||
## Features
|
||||
|
||||
* [x] Connect RS accounts
|
||||
* [x] Traverse/inspect directories
|
||||
* [x] View document details
|
||||
* [x] Render images in details
|
||||
* [x] Render text content in details (e.g. JSON)
|
||||
* [ ] Render other types content (e.g. audio and video)
|
||||
* [ ] Edit text content (and save changes)
|
||||
* [ ] Delete documents
|
||||
* [ ] Delete directories
|
||||
* [ ] Copy/move documents
|
||||
* [ ] Copy/move directories (and enclosed files)
|
||||
* [ ] Loading indicator for any view change that loads remote data
|
||||
* [ ] Logo/icon
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -40,7 +60,14 @@ Make use of the many generators for code, try `ember help generate` for more det
|
||||
|
||||
### Deploying
|
||||
|
||||
Specify what it takes to deploy your app.
|
||||
With the 5apps remote added correctly (and push access to the GitLab repo),
|
||||
just run:
|
||||
|
||||
npm run deploy
|
||||
|
||||
If you want to deploy this from and to different repos, have a look at the
|
||||
`scripts` section in `package.json`, as well as `scripts/deploy.sh` for how it
|
||||
works.
|
||||
|
||||
## Further Reading / Useful Links
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import Controller from '@ember/controller';
|
||||
import EmberObject from '@ember/object';
|
||||
import { observer } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { alias } from '@ember/object/computed';
|
||||
import { observer } from '@ember/object';
|
||||
import { isEmpty } from '@ember/utils';
|
||||
|
||||
export default Controller.extend({
|
||||
@@ -12,10 +12,7 @@ export default Controller.extend({
|
||||
connecting: alias('storage.connecting'),
|
||||
connected: alias('storage.connected'),
|
||||
rootListing: alias('storage.rootListing'),
|
||||
|
||||
handleConnected: observer('connected', function() {
|
||||
this.get('storage').fetchRootListing();
|
||||
}),
|
||||
currentDirPath: null,
|
||||
|
||||
categories: function() {
|
||||
let categories = [];
|
||||
@@ -33,8 +30,14 @@ export default Controller.extend({
|
||||
});
|
||||
|
||||
return categories;
|
||||
}.property('rootListing')
|
||||
|
||||
}.property('rootListing'),
|
||||
|
||||
connectedChange: observer('connected', function() {
|
||||
if (this.get('connected')) {
|
||||
// console.debug('connectedChange connected');
|
||||
} else {
|
||||
this.set('currentDirPath', null);
|
||||
}
|
||||
}),
|
||||
|
||||
});
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Controller from '@ember/controller';
|
||||
import { inject as controller } from '@ember/controller';
|
||||
import { observer } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { alias } from '@ember/object/computed';
|
||||
import { isPresent } from '@ember/utils';
|
||||
@@ -9,8 +10,7 @@ export default Controller.extend({
|
||||
application: controller(),
|
||||
storage: service(),
|
||||
|
||||
// connecting: alias('storage.connecting'),
|
||||
// connected: alias('storage.connected'),
|
||||
connected: alias('storage.connected'),
|
||||
rootListing: alias('storage.rootListing'),
|
||||
currentDirPath: alias('application.currentDirPath'),
|
||||
|
||||
@@ -22,6 +22,15 @@ export default Controller.extend({
|
||||
} else {
|
||||
return this.get('rootListing');
|
||||
}
|
||||
}.property('rootListing.[]', 'model.[]')
|
||||
}.property('rootListing.[]', 'model.[]'),
|
||||
|
||||
connectedChange: observer('connected', function() {
|
||||
if (this.get('connected')) {
|
||||
// console.debug('connectedChange connected');
|
||||
} else {
|
||||
this.set('model', null);
|
||||
this.set('path', null);
|
||||
}
|
||||
}),
|
||||
|
||||
});
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import Route from '@ember/routing/route';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { isEmpty, isPresent } from '@ember/utils';
|
||||
import { hash } from 'rsvp';
|
||||
import { later } from '@ember/runloop';
|
||||
import { hash, Promise } from 'rsvp';
|
||||
|
||||
export default Route.extend({
|
||||
|
||||
@@ -13,7 +14,13 @@ export default Route.extend({
|
||||
}
|
||||
},
|
||||
|
||||
beforeModel() {
|
||||
return this.waitForConnectionState();
|
||||
},
|
||||
|
||||
model(params) {
|
||||
if (this.get('storage.disconnected')) { return null; }
|
||||
|
||||
let path = params.path;
|
||||
|
||||
if (isEmpty(params.path)) { return null; }
|
||||
@@ -28,6 +35,7 @@ export default Route.extend({
|
||||
|
||||
setupController(controller, model) {
|
||||
this._super(controller, model);
|
||||
if (this.get('storage.disconnected')) { return true; }
|
||||
|
||||
if (isEmpty(this.get('storage.categories')) && this.get('storage.connected')) {
|
||||
this.get('storage').fetchRootListing();
|
||||
@@ -36,6 +44,21 @@ export default Route.extend({
|
||||
if (isPresent(model)) {
|
||||
controller.set('currentDirPath', model.currentDirPath);
|
||||
}
|
||||
},
|
||||
|
||||
waitForConnectionState() {
|
||||
let self = this;
|
||||
|
||||
return new Promise(resolve => {
|
||||
function checkConnectingDone() {
|
||||
if (self.get('storage.connecting')) {
|
||||
later(checkConnectingDone, 20);
|
||||
} else {
|
||||
resolve();
|
||||
}
|
||||
}
|
||||
checkConnectingDone();
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import EmberObject from '@ember/object';
|
||||
import { computed, observer } from '@ember/object';
|
||||
import Service from '@ember/service';
|
||||
import RemoteStorage from 'npm:remotestoragejs';
|
||||
import Widget from 'npm:remotestorage-widget';
|
||||
@@ -10,6 +11,7 @@ export default Service.extend({
|
||||
widget: null,
|
||||
connecting: true,
|
||||
connected: false,
|
||||
disconnected: computed.not('connected'),
|
||||
client: null,
|
||||
rootListing: null,
|
||||
|
||||
@@ -72,6 +74,14 @@ export default Service.extend({
|
||||
this.set('client', rs.scope('/'));
|
||||
}.on('init'),
|
||||
|
||||
connectedChange: observer('connected', function() {
|
||||
if (this.get('connected')) {
|
||||
this.fetchRootListing();
|
||||
} else {
|
||||
this.set('rootListing', null);
|
||||
}
|
||||
}),
|
||||
|
||||
fetchRootListing() {
|
||||
this.fetchListing('').then(items => {
|
||||
this.set('rootListing', items.sortBy('name'));
|
||||
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "inspektor",
|
||||
"version": "0.0.0",
|
||||
"version": "0.4.0",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
11
package.json
11
package.json
@@ -1,19 +1,22 @@
|
||||
{
|
||||
"name": "inspektor",
|
||||
"version": "0.0.0",
|
||||
"version": "0.4.0",
|
||||
"private": true,
|
||||
"description": "Small description for inspektor goes here",
|
||||
"description": "Inspect the contents of your remote storage",
|
||||
"license": "MIT",
|
||||
"author": "",
|
||||
"directories": {
|
||||
"doc": "doc",
|
||||
"test": "tests"
|
||||
},
|
||||
"repository": "",
|
||||
"repository": "gitlab:skddc/inspektor",
|
||||
"scripts": {
|
||||
"build": "ember build",
|
||||
"build-prod": "ember build --environment production && npm run update-version-file",
|
||||
"start": "ember server",
|
||||
"test": "ember test"
|
||||
"test": "ember test",
|
||||
"deploy": "npm run build-prod && bash scripts/deploy.sh",
|
||||
"update-version-file": "bash scripts/update-version-file.sh"
|
||||
},
|
||||
"devDependencies": {
|
||||
"broccoli-asset-rev": "^2.4.5",
|
||||
|
||||
17
scripts/deploy.sh
Executable file
17
scripts/deploy.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -xe
|
||||
|
||||
# Check out build branch
|
||||
git checkout build-production
|
||||
# Copy from build dir to root
|
||||
cp -r dist/* .
|
||||
# Add all files
|
||||
git add --all
|
||||
# Commit build files
|
||||
git commit -m "Update build - `date -u`"
|
||||
# Push to 5apps for deployment
|
||||
git push 5apps build-production:master
|
||||
# Push build branch to collab repo
|
||||
git push origin build-production:build-production
|
||||
# Go back to master branch
|
||||
git checkout master
|
||||
10
scripts/update-version-file.sh
Executable file
10
scripts/update-version-file.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
PACKAGE_VERSION=$(cat package.json \
|
||||
| grep version \
|
||||
| head -1 \
|
||||
| awk -F: '{ print $2 }' \
|
||||
| sed 's/[",]//g' \
|
||||
| tr -d '[[:space:]]')
|
||||
|
||||
echo $PACKAGE_VERSION > dist/VERSION
|
||||
Reference in New Issue
Block a user