Skip to content

Commit

Permalink
Migrated the OpenEO JS Web Editor to vue.js and into its own repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Feb 14, 2018
1 parent c0c31a9 commit 449a1f0
Show file tree
Hide file tree
Showing 23 changed files with 13,050 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"@vue/app"
]
}
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"plugin:vue/essential",
"eslint:recommended"
]
}
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.DS_Store
node_modules
/dist

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
5 changes: 5 additions & 0 deletions .postcssrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"plugins": {
"autoprefixer": {}
}
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@
A web-based editor for interactive usage of the OpenEO API (proof-of-concept).

Built with vue.js, bulma, leaflet and the OpenEO JS Client, of course.

## Development
Install dependencies: `npm install`
Run the development server: `npm run serve`
Build the project: `npm run build`
12,052 changes: 12,052 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "openeo-web-editor",
"version": "0.0.2",
"author": "OpenEO Team",
"contributors": [
{
"name": "Matthias Mohr"
},
{
"name": "Gustav Jv Rensburg"
},
{
"name": "Miha Kadunc"
}
],
"description": "A web-based editor for interactive usage of the OpenEO API (proof-of-concept).",
"license": "Apache-2.0",
"homepage": "https://github.com/Open-EO/openeo-web-editor",
"bugs": {
"url": "https://github.com/Open-EO/openeo-web-editor/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/Open-EO/openeo-web-editor.git"
},
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test": "vue-cli-service test"
},
"dependencies": {
"vue": "^2.5.13",
"openeo-js-client": "git+https://github.com/Open-EO/openeo-js-client.git",
"bulma": "^0.6.2",
"leaflet": "^1.2.0",
"codemirror": "^5.33.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.0-alpha.10",
"@vue/cli-service": "^3.0.0-alpha.10",
"vue-template-compiler": "^2.5.13"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
16 changes: 16 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>

<head>
<title>OpenEO Web Editor</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>

<body>
<div id="app"></div>
<noscript>Sorry, the <a href="http://www.openeo.org">OpenEO</a> Web Editor requires JavaScript to be enabled!</noscript>
</body>

</html>
201 changes: 201 additions & 0 deletions src/Editor.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
<template>
<div id="container">
<div id="ide">
<BackendPanel :serverUrl="serverUrl" />
<SourceEnvironment />
<div class="userTabs">
<div class="tabsHeader">
<button class="tabItem tabActive" name="accountTab" @click="changeTab">Account</button>
<button class="tabItem" name="filesTab" @click="changeTab">Files</button>
<button class="tabItem" name="processGraphsTab" @click="changeTab">Process Graphs</button>
<button class="tabItem" name="jobsTab" @click="changeTab">Jobs</button>
<button class="tabItem" name="servicesTab" @click="changeTab">Services</button>
</div>
<div class="tabContent tabActive" id="accountTab">
<AccountPanel />
</div>
<div class="tabContent" id="filesTab">
<FilePanel />
</div>
<div class="tabContent" id="processGraphsTab">
<ProcessGraphPanel />
</div>
<div class="tabContent" id="jobsTab">
<JobPanel />
</div>
<div class="tabContent" id="servicesTab">
<ServicePanel />
</div>
</div>
<footer>
<a href="http://www.openeo.org" target="_blank"><img src="./assets/logo.png" id="openeoLogo" /></a>
</footer>
</div>
<div id="map">
<Map />
</div>
</div>
</template>

<script>
import EventBus from './eventbus.js';
import AccountPanel from './components/AccountPanel.vue'
import BackendPanel from './components/BackendPanel.vue'
import FilePanel from './components/FilePanel.vue'
import JobPanel from './components/JobPanel.vue'
import Map from './components/Map.vue'
import ProcessGraphPanel from './components/ProcessGraphPanel.vue'
import ServicePanel from './components/ServicePanel.vue'
import SourceEnvironment from './components/SourceEnvironment.vue'
export default {
name: 'openeo-web-editor',
components: {
AccountPanel,
BackendPanel,
FilePanel,
JobPanel,
Map,
ProcessGraphPanel,
ServicePanel,
SourceEnvironment
},
data() {
return {}
},
computed: {
serverUrl: {
get: function () {
return this.$OpenEO.API.baseUrl;
},
set: function(value) {
this.$OpenEO.API.baseUrl = value;
}
}
},
created() {
this.setServerUrl(this.$config.serverUrl);
EventBus.$on('changeServerUrl', this.setServerUrl);
},
mounted() {
},
methods: {
setServerUrl(url) {
this.$OpenEO.API.driver = 'openeo-sentinelhub-driver'; // ToDo: Remove this after proof-of-concept
this.serverUrl = url;
},
changeTab: function(evt) {
var i, x, tablinks;
var tabName = evt.currentTarget.name;
x = document.getElementsByClassName("tabContent");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tabItem");
for (i = 0; i < x.length; i++) {
tablinks[i].className = tablinks[i].className.replace(" tabActive", "");
}
document.getElementById(tabName).style.display = "block";
evt.currentTarget.className += " tabActive";
}
}
}
</script>

<style>
body {
margin: 0;
overflow: hidden;
font-family: sans-serif;
font-size: 90%;
}
ul, ol {
margin-bottom: 0;
margin-top: 0;
padding-bottom: 0;
padding-top: 0;
}
#map {
position: absolute;
top: 0px;
left: 50%;
width: 50%;
height: 100vh;
}
#ide {
position: absolute;
top: 0px;
left: 0px;
width: 50%;
height: 100vh;
overflow-y: auto;
}
.toolbar {
border: solid 1px #676767;
background-color: #f7f7f7;
margin: 1%;
padding: 5px;
vertical-align: middle;
}
.data-toolbar, .processes-toolbar, .server-toolbar, .vis-toolbar, .auth-toolbar {
display: inline-block;
margin-right: 3%;
}
#SourceEnvironment, .userTabs {
border: solid 1px #676767;
margin: 1%;
background-color: #f7f7f7;
}
.tabContent {
display: none;
padding: 5px;
background-color: white;
border-top: 1px solid #ddd;
min-height: 200px;
max-height: 350px;
overflow: auto;
}
.tabContent table {
width: 100%;
border-collapse: collapse;
}
.tabContent table td, .tabContent table th {
border: 1px solid #ddd;
padding: 3px;
}
.tabItem {
background-color: transparent;
border: 0;
margin: 5px 0 -1px 5px;
padding: 5px;
border: 1px solid #ddd;
border-bottom: 0;
border-radius: 5px 5px 0 0;
width: 10%;
min-width: 130px;
}
div.tabActive {
display: block;
}
button.tabActive {
font-weight: bold;
background-color: white;
}
h3 {
margin: 0;
padding: 0;
}
.running, .active {
color: green;
}
footer {
text-align: center;
}
#openeoLogo {
height: 60px;
}
</style>
Binary file added src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions src/components/AccountPanel.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<template>
<div id="filePanel">
<h3>Account</h3>
<ul>
<li>User Name: Guest</li>
<li>Credits: 0 <button id="topUpCredits">Top up</button></li>
</ul>
</div>
</template>

<script>
import EventBus from '../eventbus.js';
export default {
name: 'FilePanel',
data() {
return {}
},
mounted() {
},
methods: {
}
}
</script>
Loading

0 comments on commit 449a1f0

Please sign in to comment.