-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: 💄 Optimized operation button layout
- Loading branch information
Showing
15 changed files
with
118 additions
and
54 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
File renamed without changes.
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<template> | ||
<div class="" @click="handleClick"> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
function handleClick() { | ||
window.appLog.openInEditor() | ||
} | ||
</script> | ||
|
||
<style lang="postcss"></style> |
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,13 @@ | ||
<template> | ||
<div class="" @click="handleClick"> | ||
<slot /> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
function handleClick() { | ||
window.electron.ipcRenderer.send('restart-app') | ||
} | ||
</script> | ||
|
||
<style lang="postcss"></style> |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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,73 @@ | ||
<template> | ||
<div class="flex items-center space-x-4 relative z-10"> | ||
<component | ||
:is="item.component || 'div'" | ||
v-for="(item, index) in actionModel" | ||
:key="index" | ||
class="flex-none" | ||
v-bind="{ | ||
...(item.command | ||
? { | ||
onClick: () => handleCommand(item), | ||
} | ||
: {}), | ||
}" | ||
> | ||
<template #default="{ loading = false } = {}"> | ||
<el-button | ||
circle | ||
size="small" | ||
:title="$t(item.tips || item.label)" | ||
:loading="loading" | ||
> | ||
<template #icon> | ||
<svg-icon | ||
v-if="item.svgIcon" | ||
:name="item.svgIcon" | ||
:class="item.iconClass" | ||
></svg-icon> | ||
<el-icon v-else-if="item.elIcon" :class="item.iconClass"> | ||
<component :is="item.elIcon" /> | ||
</el-icon> | ||
</template> | ||
</el-button> | ||
</template> | ||
</component> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import Search from './components/Search/index.vue' | ||
import Restart from './components/Restart/index.vue' | ||
import Log from './components/Log/index.vue' | ||
import Terminal from './components/Terminal/index.vue' | ||
const props = defineProps({}) | ||
const actionModel = [ | ||
{ | ||
label: 'device.terminal.name', | ||
svgIcon: 'command', | ||
component: Terminal, | ||
}, | ||
{ | ||
label: 'device.log.name', | ||
elIcon: 'View', | ||
component: Log, | ||
}, | ||
{ | ||
label: 'device.restart.name', | ||
elIcon: 'RefreshRight', | ||
component: Restart, | ||
}, | ||
{ | ||
label: 'common.search', | ||
elIcon: 'Search', | ||
component: Search, | ||
}, | ||
] | ||
function handleCommand() {} | ||
</script> | ||
|
||
<style></style> |