-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandLineInterface.vue
More file actions
53 lines (49 loc) · 1.79 KB
/
CommandLineInterface.vue
File metadata and controls
53 lines (49 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<script setup lang="ts">
import VueCommand, { createStdout } from "vue-command";
import "vue-command/dist/vue-command.css";
import { useMainStore } from '../store';
import LoginPanel from './LoginPanel.vue';
import DebugPanel from './DebugPanel.vue';
const mainStore = useMainStore();
const commands = {
"help": () => createStdout("Available commands: hello, login, debug"),
"login": () => {
mainStore.toggleLogin();
const status = mainStore.showLogin ? "Activated" : "Disabled";
return createStdout(`Login interface ${status}.`);
},
"hello": () => createStdout("Hello world! #wip"),
"debug": () => {
mainStore.toggleDebugPanel();
const status = mainStore.showDebugPanel ? "Activated" : "Disabled";
return createStdout(`Debug panel ${status}.`);
},
};
</script>
<template>
<div class="cli-container">
<vue-command :commands="commands" :hide-buttons="true" :show-help="true" :cursor-position="0" :is-fullscreen="true">
<template #title>Command Line Interface v0.2 -- type "help" for instructions</template>
<template #prompt>
<span class="prompt">
<span class="prompt-user">guest</span>
<span class="prompt-path">~</span>
<span class="prompt-symbol">$ </span>
</span>
</template>
<template #show-help>true</template>
<template #help-text>asdfasdf</template>
<template #invert>true</template>
<template #font></template>
</vue-command>
<LoginPanel v-if="mainStore.showLogin" />
<DebugPanel v-if="mainStore.showDebugPanel" />
</div>
</template>
<style scoped>
.cli-container {
/* Adjust the border-radius as needed */
border-radius: 10px; /* This will give rounded corners to the container */
overflow: hidden; /* Ensures that the child elements adhere to the container's border radius */
}
</style>