Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
8cf31ee
Merge pull request #1 from apache/master
apurv-1 Apr 21, 2021
72ade9e
Merge branch 'apache:master' into master
apurv-1 May 19, 2021
e02f0af
Merge branch 'apache:master' into master
apurv-1 May 31, 2021
cd75136
Merge branch 'apache:master' into master
apurv-1 Jun 7, 2021
51f7d96
initialized vue-shortkey, new mutation type
apurv-1 Jun 10, 2021
8994d50
fix: toggle showshortkey
apurv-1 Jun 11, 2021
98d61e7
toggle show shortkeys with 'f'
apurv-1 Jun 17, 2021
a820ec9
added more shortkeys
apurv-1 Jun 17, 2021
9fbf02b
new: shortkey on breadcrumb
apurv-1 Jun 21, 2021
5f8f1b7
added more shortkeys
apurv-1 Jun 22, 2021
c323e2d
fix: minor bugs
apurv-1 Jun 22, 2021
9e0bb11
Merge branch 'apache:main' into main
apurv-1 Jun 22, 2021
a74b904
fix: side menu collapsed shortkeys
apurv-1 Jun 23, 2021
6dec8c5
auto disable shortkeys on forms
apurv-1 Jun 25, 2021
dccd4fc
updated
apurv-1 Jun 29, 2021
2df05c5
added more shortkeys
apurv-1 Jun 30, 2021
8433191
Update .env.local.example
apurv-1 Jun 30, 2021
265d9b6
complete: shortkeys on s-menu
apurv-1 Jul 2, 2021
f27778b
Merge branch 'keyboard-label-shortcut' of https://github.com/apurv-1/…
apurv-1 Jul 2, 2021
d46b715
Update DeployVM.vue
apurv-1 Jul 2, 2021
384c41d
Merge branch 'keyboard-label-shortcut' of https://github.com/apurv-1/…
apurv-1 Jul 2, 2021
b48d951
ready for review
apurv-1 Jul 2, 2021
5de4c91
Update DeployVM.vue
apurv-1 Jul 2, 2021
23acfc5
Revert "Update DeployVM.vue"
apurv-1 Jul 2, 2021
23e62fd
Revert "Update DeployVM.vue"
apurv-1 Jul 2, 2021
153875d
revert deployVm.vue
apurv-1 Jul 2, 2021
b877b37
fix: replace alt with shift
apurv-1 Jul 7, 2021
a565739
uninstalled vue-shortkeys, added custom-event-polyfill & element-matches
apurv-1 Jul 16, 2021
8c671ef
new: shortkey lib with multiple character combination
apurv-1 Jul 16, 2021
0d79c1e
Merge branch 'apache:main' into main
apurv-1 Jul 17, 2021
9a9125f
new: shortkeys, updated keys
apurv-1 Jul 21, 2021
45c688f
Merge branch 'apache:main' into main
apurv-1 Jul 21, 2021
43d42b0
resolved conflicts
apurv-1 Jul 21, 2021
13ed9ed
fix: keypress bug, button styles
apurv-1 Jul 21, 2021
b317823
fix: Navigation duplicate error, duplicate shortkeys
apurv-1 Jul 27, 2021
ec1d09b
fix: sidemItem via shortkey without expanding submenu
apurv-1 Aug 2, 2021
0382f2b
Merge branch 'apache:main' into main
apurv-1 Aug 4, 2021
9dee13b
fix: hidden action button bug
apurv-1 Aug 4, 2021
5fc9342
Merge branch 'main' of https://github.com/apurv-1/cloudstack into key…
apurv-1 Aug 4, 2021
ac13f4f
new: shortkey for tools
apurv-1 Aug 4, 2021
78e90c7
new: shortkey for dashboard
apurv-1 Aug 16, 2021
11e2366
Merge branch 'apache:main' into main
apurv-1 Aug 16, 2021
7951227
fix: merge conflicts & shortkey buttons
apurv-1 Aug 16, 2021
c56f75c
feat: backspace
apurv-1 Aug 19, 2021
456bbcb
fix: duplicates removed
apurv-1 Aug 20, 2021
e2e9679
new: update shortkeys
apurv-1 Aug 20, 2021
8d275f0
fix: backspace to newtab
apurv-1 Aug 20, 2021
b326fe5
Merge branch 'apache:main' into main
apurv-1 Aug 31, 2021
af961e8
resolved merge conflicts
apurv-1 Aug 31, 2021
0b4092d
Merge branch 'apache:main' into main
apurv-1 Nov 9, 2021
29e4bae
Merge branch 'apache:main' into main
apurv-1 Nov 18, 2021
9db704d
fix: merge conflicts
apurv-1 Jan 4, 2022
a7e38a7
Merge branch 'main' into keyboard-label-shortcut
apurv-1 Jan 4, 2022
5e5fb14
Merge branch 'apache:main' into main
apurv-1 Feb 7, 2022
ddc15d9
new/fix: shortkeys, collapse menu
apurv-1 Feb 8, 2022
60d8288
fix: conflits
apurv-1 Feb 8, 2022
656ea2a
Merge branch 'main' into keyboard-label-shortcut
apurv-1 Mar 6, 2022
4fe95bf
Merge branch 'apache:main' into main
apurv-1 Mar 20, 2022
f21f7de
Merge branch 'apache:main' into main
apurv-1 Apr 5, 2022
f7d5565
Merge branch 'apache:main' into main
apurv-1 Jun 23, 2022
37b30ae
fix: conflicts
apurv-1 Jun 23, 2022
1536847
fix: build errors
apurv-1 Jun 23, 2022
7c7a0d2
Merge branch 'main' into keyboard-label-shortcut
shwstppr Apr 12, 2023
a358c8a
partial fix
shwstppr Apr 12, 2023
b39cd0d
fix menu shortkey
shwstppr Apr 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,078 changes: 544 additions & 534 deletions ui/package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
"chart.js": "^3.7.1",
"chartjs-adapter-moment": "^1.0.0",
"core-js": "^3.21.1",
"custom-event-polyfill": "^1.0.7",
"element-matches": "^0.1.2",
"enquire.js": "^2.1.6",
"js-cookie": "^2.2.1",
"lodash": "^4.17.15",
Expand Down
1 change: 1 addition & 0 deletions ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,7 @@
"label.key": "Key",
"label.keyboard": "Keyboard language",
"label.keyboardtype": "Keyboard type",
"label.keyboard.show": "Show shortkeys [F]",
"label.keypair": "SSH key pair",
"label.keypairs": "SSH key pair(s)",
"label.kubeconfig.cluster": "Kubernetes cluster config",
Expand Down
26 changes: 25 additions & 1 deletion ui/src/components/header/Logo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
width: $config.theme['@logo-width'],
height: $config.theme['@logo-height']
}"
:src="$config.logo" />
:src="$config.logo"
v-shortkey="['f']"
@shortkey="toggleShowShortkey"
class="logo-image" />
<span class="none" v-shortkey="['backspace']" @shortkey="goBack"></span>
</div>
</template>

Expand All @@ -56,6 +60,26 @@ export default {
default: false,
required: false
}
},
methods: {
toggleShowShortkey () {
this.$store.dispatch('SetShowKeyboardShortkeys', !this.$store.getters.showshortkeys)
},
goBack () {
if (this.$route.path.includes('/')) {
this.$router.go(-1)
}
}
}
}
</script>

<style type="less" scoped>
.logo-image {
display: inline-block;
vertical-align: middle;
}
.none {
display: none;
}
</style>
11 changes: 11 additions & 0 deletions ui/src/components/header/UserMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
<span class="user-menu-item-name" style="margin-right: 5px">{{ $t('label.use.local.timezone') }}</span>
<a-switch :checked="$store.getters.usebrowsertimezone" />
</a-menu-item>
<a-menu-item class="user-menu-item" key="showshortkeys">
<EyeInvisibleOutlined class="user-menu-item-icon" />
<span class="user-menu-item-name" style="margin-right: 5px">{{ $t('label.keyboard.show') }}</span>
<a-switch :checked="$store.getters.showshortkeys" />
</a-menu-item>
<a-menu-item class="user-menu-item" key="document">
<QuestionCircleOutlined class="user-menu-item-icon" />
<span class="user-menu-item-name">{{ $t('label.help') }}</span>
Expand Down Expand Up @@ -118,6 +123,9 @@ export default {
toggleUseBrowserTimezone () {
this.$store.dispatch('SetUseBrowserTimezone', !this.$store.getters.usebrowsertimezone)
},
toggleShowShortkey () {
this.$store.dispatch('SetShowKeyboardShortkeys', !this.$store.getters.showshortkeys)
},
async getIcon () {
await this.fetchResourceIcon(this.$store.getters.userInfo.id)
},
Expand Down Expand Up @@ -145,6 +153,9 @@ export default {
case 'timezone':
this.toggleUseBrowserTimezone()
break
case 'showshortkeys':
this.toggleShowShortkey()
break
case 'document':
window.open(this.$config.docBase, '_blank')
break
Expand Down
78 changes: 61 additions & 17 deletions ui/src/components/menu/SMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,46 @@
<render-icon
v-if="item.meta.icon && typeof (item.meta.icon) === 'string'"
:icon="item.meta.icon"
@click="() => { handleClickParentMenu(item) }" />
@click="() => { handleClickParentMenu(item) }"
v-shortkey="item.meta.shortKey"
@shortkey="handleMenuItemShortKey(item, '1')" />
<span @click="() => { handleClickParentMenu(item) }">{{ $t(item.meta.title) }}</span>
<span class="show-shortkey" v-if="$store.getters.showshortkeys && item.meta.shortKey">
{{ getShortKeyLabel(item) }}
</span>
</span>
</template>
<template v-for="children in item.children" :key="children.path">
<a-menu-item :key="children.path" v-if="!children.hidden">
<router-link :to="{ name: children.name, target: children.meta.target || null }">
<template v-for="child in item.children" :key="child.path">
<a-menu-item :key="child.path" v-if="!child.hidden">
<router-link
:to="{ name: child.name, target: child.meta.target || null }"
v-shortkey="child.meta.shortKey"
@shortkey="handleMenuItemShortKey(child, '2')">
<render-icon
v-if="children.meta.icon && typeof (children.meta.icon) === 'string'"
:icon="children.meta.icon" />
<render-icon v-else :svgIcon="children.meta.icon" />
<span>{{ $t(children.meta.title) }}</span>
v-if="child.meta.icon && typeof (child.meta.icon) === 'string'"
:icon="child.meta.icon" />
<render-icon v-else :svgIcon="child.meta.icon" />
<span>{{ $t(child.meta.title) }}</span>
<span class="show-shortkey" v-if="$store.getters.showshortkeys && child.meta.shortKey">
{{ getShortKeyLabel(child) }}
</span>
</router-link>
</a-menu-item>
</template>
</a-sub-menu>
<a-menu-item v-else :key="item.path">
<router-link :to="{ name: item.name, target: item.meta.target || null }">
<router-link
:to="{ name: item.name, target: item.meta.target || null }"
v-shortkey="item.meta.shortKey"
@shortkey="handleMenuItemShortKey(item)">
<render-icon
v-if="item.meta.icon && typeof (item.meta.icon) === 'string'"
:icon="item.meta.icon"
@click="() => { handleClickParentMenu(item) }" />
<span>{{ $t(item.meta.title) }}</span>
<span class="show-shortkey" v-if="$store.getters.showshortkeys && item.meta.shortKey">
{{ getShortKeyLabel(item) }}
</span>
</router-link>
</a-menu-item>
</template>
Expand Down Expand Up @@ -149,21 +166,48 @@ export default {
this.openKeys = openKeys
}
},
handleClickParentMenu (menuItem) {
if (this.cachedPath === menuItem.redirect) {
routeMenuItem (redirect, path) {
if (this.cachedPath === redirect) {
return
}
if (menuItem.redirect) {
this.cachedPath = menuItem.redirect
setTimeout(() => this.$router.push({ path: menuItem.path }))
if (redirect) {
this.cachedPath = redirect
setTimeout(() => this.$router.push({ path: path }))
}
},
getShortKeyLabel (item) {
if (item.meta.shortKey) {
return item.meta.shortKey.join('+')
}
return null
},
handleClickParentMenu (menuItem) {
this.routeMenuItem(menuItem.redirect, menuItem.path)
},
handleMenuItemShortKey (item, type) {
if (type === 1) {
this.handleClickParentMenu(item)
} else {
this.routeMenuItem(item.path, item.path)
}
}
}
}
</script>

<style>
.sider .ant-menu-vertical .ant-menu-item {
margin-right: 0;
}
.sider .ant-menu-vertical .ant-menu-item {
margin-right: 0;
}
.show-shortkey {
font-size: 10px;
background-color: rgba(0, 0, 0, 0.9);
padding: 2px 6px 2px 6px;
border-radius: 4px;
color: #e9e9e9;
margin: 5px;
border: solid .1em transparent;
text-shadow: 2px 2px 2px rgba(255,255,255,0.1);
box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.8), -1px -1px 1px rgba(0, 0, 0, 0.9);
}
</style>
2 changes: 1 addition & 1 deletion ui/src/components/menu/SideMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<template>
<a-layout-sider
:class="['sider', isDesktop() ? null : 'shadow', theme, fixSiderbar ? 'ant-fixed-sidemenu' : null ]"
width="256px"
width="265px"
collapsible
v-model:collapsed="isCollapsed"
:trigger="null">
Expand Down
1 change: 1 addition & 0 deletions ui/src/components/menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
// specific language governing permissions and limitations
// under the License.

// import SMenu from './menu.vue'
import SMenu from './SMenu.vue'
export default SMenu
Loading