Git Product home page Git Product logo

storjbrowser's Introduction

storj/browser

prettier

A Vue component for managing files on Storj, via gateway-mt.

screenshot

Development

Use Iris.

Integration

Install

Right now, storj/browser is not published to npm, so you have to install it from the git repo. This can be done by referencing a specific commit and adding it to your package.json.

"dependencies": {
    ...
    "browser": "git+https://github.com/storj/browser#e2f7fd2b7a8502c41ca13b5fa0987df659e58efa",
},
npm install

Add Vuex module

In order to use the file browser, we need to add the files module to our app store.

  • Import the files module in src/store/index.js
import { files } from "browser";
  • Add it to the modules
export default new Vuex.Store({
  state: {
      ...
  },
  mutations: {
      ...
  },
  actions: {
      ...
  },
  modules: {
    files
  }
})

Create page to instantiate FileBrowser

  • In src/views/MyFileBrowserPage.vue, import the css
<style scoped>
	@import "../node_modules/browser/dist/browser.css";
</style>
  • Instantiate the FileBrowser component inside a <div> with class file-browser.
<template>
	<div class="home">
		<div class="file-browser">
			<file-browser></file-browser>
		</div>
	</div>
</template>
  • Initialize the store with gateway-mt credentials and an already-existing bucket
<script>
	import { FileBrowser } from "browser";

	export default {
		name: "FileBrowserPage",
		data: () => ({
			displayCredentials: true,
			endpoint: "gateway.tardigradeshare.io",
			accessKey: "",
			secretKey: "",
			bucket: "",
			browserRoot: "/"
		}),
		created() {
			this.$store.commit("files/init", {
				endpoint: this.endpoint,
				accessKey: this.accessKey,
				secretKey: this.secretKey,
				bucket: this.bucket,
				browserRoot: this.browserRoot
			});
		}
	};
</script>

Add MyFileBrowserPage.vue to your router

  • In src/router/index.js, add MyFileBrowserPage with a wildcard for all sub-paths.
import MyFileBrowserPage from "../views/MyFileBrowserPage.vue";

const routes = [
	{
		path: "/",
		name: "Home",
		component: MyFileBrowserPage,
		children: [
			{
				path: "*",
				component: MyFileBrowserPage
			}
		]
	}
];

storjbrowser's People

Contributors

boshevski avatar dependabot-preview[bot] avatar dependabot[bot] avatar egonelbre avatar gabedealmeida avatar montyanderson avatar oliverredman avatar super3 avatar zeebo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.