-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FE add NotebookConsole view, update router, Navbar
- Loading branch information
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
SpringDataPlatform/frontend/data-platform-ui/src/views/Zeppelin/NotebookConsole.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<template> | ||
<div> | ||
<h1>Notebook console</h1> | ||
<button @click="addCell">Add Cell</button> | ||
<div v-for="(cell, index) in cells" :key="index"> | ||
<textarea v-model="cell.code" placeholder="Type your code here"></textarea> | ||
<button @click="executeCode(index)">Run Code</button> | ||
<div v-if="cell.result !== undefined"> | ||
<strong>Result:</strong> | ||
<pre>{{ cell.result }}</pre> | ||
</div> | ||
<hr /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
data() { | ||
return { | ||
cells: [ | ||
{ | ||
code: '', | ||
result: undefined, | ||
}, | ||
], | ||
}; | ||
}, | ||
methods: { | ||
addCell() { | ||
this.cells.push({ | ||
code: '', | ||
result: undefined, | ||
}); | ||
}, | ||
executeCode(index) { | ||
// Mock code execution, replace with actual execution logic | ||
const result = this.mockExecuteCode(this.cells[index].code); | ||
this.$set(this.cells, index, { | ||
...this.cells[index], | ||
result, | ||
}); | ||
}, | ||
mockExecuteCode(code) { | ||
// Mock execution, replace with actual code execution logic | ||
return `Mock Result: ${code}`; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style scoped> | ||
textarea { | ||
width: 100%; | ||
height: 100px; | ||
} | ||
</style> | ||
|