Skip to content

Commit

Permalink
Merge pull request #1656 from nextcloud/bugfix/noid/command-interface…
Browse files Browse the repository at this point in the history
…-finish

Add a description to the commands admin settings
  • Loading branch information
nickvergessen authored Apr 2, 2019
2 parents 9808645 + 2c2b6b4 commit f3bf14b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
8 changes: 8 additions & 0 deletions css/settings-admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@


.commands.section {
.icon-beta-feature {
@include icon-color('customization', 'categories', $color-warning, 1, true);
}

p.settings-hint > a {
text-decoration: underline !important;
}

#commands_list {
display: grid;
grid-template-columns: minmax(100px, 200px) minmax(100px, 200px) 1fr minmax(100px, 200px) minmax(100px, 200px);
Expand Down
2 changes: 1 addition & 1 deletion js/admin/commands.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/admin/commands.js.map

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions lib/Chat/Command/Executor.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ protected function execHelp(Room $room, IComment $message, string $arguments): s
}
}

if (empty($helps)) {
return $this->l->t('There are currently no commands available.');
}

// FIXME Implement a useful help
return implode("\n", $helps);
}
Expand Down
30 changes: 29 additions & 1 deletion vue/src/views/Commands.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@

<template>
<div id="chat_commands" class="commands section">
<h2>{{ t('spreed', 'Commands') }}</h2>
<h2>
{{ t('spreed', 'Commands') }}
<small>
{{ t('spreed', 'Beta') }}
<span class="icon icon-beta-feature" />
</small>
</h2>

<p class="settings-hint" v-html="commandHint" />

<div id="commands_list">
<div class="head name">
Expand Down Expand Up @@ -61,6 +69,14 @@ export default {
}
},

computed: {
commandHint() {
return t('spreed', 'Commands are a new beta feature in Nextcloud Talk. They allow you to run scripts on your Nextcloud server. You can define them with our command line interface. An example of a calculator script can be found in our <a {attributes}>documentation ↗</a>.', {
attributes: 'target="_blank" rel="noreferrer noopener" href="https://github.com/nextcloud/spreed/blob/master/docs/commands.md"'
}, undefined, { escape: false })
}
},

mounted() {
this.commands = OCP.InitialState.loadState('talk', 'commands')
}
Expand All @@ -80,5 +96,17 @@ export default {
font-weight: bold;
}
}
small {
color: var(--color-warning);
border: 1px solid var(--color-warning);
border-radius: 16px;
padding: 0 9px;

.icon {
width: 16px;
height: 16px;
margin-bottom: 4px;
}
}
}
</style>

0 comments on commit f3bf14b

Please sign in to comment.