添加更新提醒

This commit is contained in:
fofolee 2024-03-01 09:24:57 +08:00
parent f34b80ee42
commit 209da5e869
3 changed files with 91 additions and 147 deletions

View File

@ -0,0 +1,18 @@
const changeLog = [
{
version: "4.1.2",
log: `一、功能调整、新增
现在会自动对特殊变量里的单反引号反斜杠换行符等特殊符号进行转义这意味用户不再需要手动处理这些特殊情况比如在js中使用反引号(\`)或者在 python中 使用三引号(''')来解决换行的问题。
<b style="color: #e60012"> ! ! ! </b>js使 String.raw python 使 r String.raw\`{{input}}\`, "{{input}}"
添加 quickcommand.runAppleScript quickcommand.runPowerShell 两个方法
quickcommand.showConfirmBox 现在支持渲染html以及设置宽度
Mac下环境变量顺序调整为 /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/local/sbin:$PATH
BUG 修复
修复某些情况下调整页面大小报错的 BUG
修复非 quickcommand 环境自动补全重复出现的 BUG
修复 alt+z 无法换行的 BUG
更新内置命令-网址二维码中 qrcode 的引用地址`,
},
];
export default changeLog;

View File

@ -2,37 +2,19 @@
<div class="relative">
<!-- 标签栏 -->
<!-- 面板视图不显示标签栏 -->
<q-scroll-area
v-show="commandCardStyle !== 'mini'"
class="absolute-left"
:thumb-style="{
width: '2px',
}"
:style="{
width: tabBarWidth,
zIndex: 1,
}"
>
<q-tabs
v-model="currentTag"
vertical
switch-indicator
active-class="text-primary text-weight-bolder"
content-class="text-blue-grey"
:key="$root.profile.denseTagBar"
:dense="$root.profile.denseTagBar"
>
<q-scroll-area v-show="commandCardStyle !== 'mini'" class="absolute-left" :thumb-style="{
width: '2px',
}" :style="{
width: tabBarWidth,
zIndex: 1,
}">
<q-tabs v-model="currentTag" vertical switch-indicator active-class="text-primary text-weight-bolder"
content-class="text-blue-grey" :key="$root.profile.denseTagBar" :dense="$root.profile.denseTagBar">
<!-- 所有标签 -->
<q-tab
v-for="tag in allQuickCommandTags"
:key="tag"
:name="tag"
:content-class="
tag === '搜索结果' || activatedQuickPanels.includes(tag)
? 'text-blue-7 text-weight-bolder'
: ''
"
>
<q-tab v-for="tag in allQuickCommandTags" :key="tag" :name="tag" :content-class="tag === '搜索结果' || activatedQuickPanels.includes(tag)
? 'text-blue-7 text-weight-bolder'
: ''
">
{{ tag }}
<q-tooltip v-if="tag === '未分类'">
所有没有添加标签的命令都会归在未分类 <br />
@ -42,78 +24,43 @@
</q-tabs>
</q-scroll-area>
<!-- 面板栏 -->
<q-tab-panels
animated
class="absolute-right"
:style="{
bottom: footerBarHeight,
left: tabBarWidth,
background:
commandCardStyle === 'mini' && $root.profile.backgroundImg
? `url('${$root.profile.backgroundImg}')`
: 'none',
backgroundSize: 'cover',
}"
v-model="currentTag"
transition-prev="fade"
transition-next="fade"
swipeable
>
<q-tab-panel
style="padding: 0"
v-for="tag in allQuickCommandTags"
:key="tag"
:name="tag"
>
<q-scroll-area
style="height: 100%"
:thumb-style="{
background: 'grey',
width: '6px',
opacity: 0.5,
}"
>
<q-tab-panels animated class="absolute-right" :style="{
bottom: footerBarHeight,
left: tabBarWidth,
background:
commandCardStyle === 'mini' && $root.profile.backgroundImg
? `url('${$root.profile.backgroundImg}')`
: 'none',
backgroundSize: 'cover',
}" v-model="currentTag" transition-prev="fade" transition-next="fade" swipeable>
<q-tab-panel style="padding: 0" v-for="tag in allQuickCommandTags" :key="tag" :name="tag">
<q-scroll-area style="height: 100%" :thumb-style="{
background: 'grey',
width: '6px',
opacity: 0.5,
}">
<div class="row center q-pa-xs">
<CommandCard
v-for="commandInfo in currentTagQuickCommands"
:key="commandInfo.features.code"
:commandInfo="commandInfo"
:isCommandActivated="
activatedQuickCommandFeatureCodes.includes(
commandInfo.features.code
)
"
:cardStyle="commandCardStyleSheet[commandCardStyle]"
@commandChanged="commandChanged"
:style="{
width: commandCardStyleSheet[commandCardStyle].width,
}"
class="relative-position q-pa-sm"
></CommandCard>
<CommandCard v-for="commandInfo in currentTagQuickCommands" :key="commandInfo.features.code"
:commandInfo="commandInfo" :isCommandActivated="activatedQuickCommandFeatureCodes.includes(
commandInfo.features.code
)
" :cardStyle="commandCardStyleSheet[commandCardStyle]" @commandChanged="commandChanged" :style="{
width: commandCardStyleSheet[commandCardStyle].width,
}" class="relative-position q-pa-sm"></CommandCard>
</div>
</q-scroll-area>
</q-tab-panel>
</q-tab-panels>
<!-- 底栏 -->
<div
class="absolute-bottom"
:style="{
height: footerBarHeight,
left: tabBarWidth,
}"
>
<div class="absolute-bottom" :style="{
height: footerBarHeight,
left: tabBarWidth,
}">
<div class="row">
<!-- 搜索栏 -->
<div class="col">
<q-input
v-model="commandSearchKeyword"
debounce="200"
filled
dense
:autofocus="$root.profile.autofocusSearch"
@update:model-value="updateSearch"
placeholder="搜索,支持拼音首字母"
>
<q-input v-model="commandSearchKeyword" debounce="200" filled dense :autofocus="$root.profile.autofocusSearch"
@update:model-value="updateSearch" placeholder="搜索,支持拼音首字母">
<template v-slot:prepend>
<q-icon name="search" />
</template>
@ -123,88 +70,51 @@
<div class="col-auto justify-end flex">
<q-btn-group>
<!-- 切换视图 -->
<q-btn-toggle
v-model="commandCardStyle"
@click="$root.profile.commandCardStyle = commandCardStyle"
toggle-color="primary"
flat
:options="[
<q-btn-toggle v-model="commandCardStyle" @click="$root.profile.commandCardStyle = commandCardStyle"
toggle-color="primary" flat :options="[
{ slot: 'normal', value: 'normal' },
{ slot: 'dense', value: 'dense' },
{ slot: 'mini', value: 'mini' },
]"
>
]">
<template v-slot:normal>
<q-icon name="dashboard" />普通
<q-tooltip>按两列排列的基础视图</q-tooltip>
</template>
<template v-slot:dense>
<q-icon name="apps" />紧凑
<q-tooltip
>按三列排列的紧凑视图但不会显示适用的操作系统</q-tooltip
>
<q-tooltip>按三列排列的紧凑视图但不会显示适用的操作系统</q-tooltip>
</template>
<template v-slot:mini>
<q-icon name="view_comfy" />面板
<q-tooltip
>按四列排列的面板视图<br />
<q-tooltip>按四列排列的面板视图<br />
老版本的快捷面板已被弃用取而代之的是新版的面板视图<br />
注意<br />
1.未启用匹配类型为窗口的命令在此视图下不显示<br />
2.只显示图标描述和匹配类型<br />
3.点击卡片时会直接运行命令而不是编辑命令</q-tooltip
>
3.点击卡片时会直接运行命令而不是编辑命令</q-tooltip>
</template>
</q-btn-toggle>
<q-separator vertical />
<!-- 新建按钮 -->
<q-btn
split
flat
@click="addNewCommand"
color="primary"
label="新建"
icon="add"
/>
<q-btn split flat @click="addNewCommand" color="primary" label="新建" icon="add" />
<q-separator vertical />
<q-btn
stretch
color="primary"
flat
size="xs"
:style="{
height: footerBarHeight,
}"
><q-spinner-bars color="primary" size="1.5em" />
<q-btn stretch color="primary" flat size="xs" :style="{
height: footerBarHeight,
}"><q-spinner-bars color="primary" size="1.5em" />
<!-- 菜单 -->
<ConfigurationMenu
:isTagStared="activatedQuickPanels.includes(currentTag)"
:currentTag="currentTag"
></ConfigurationMenu>
<ConfigurationMenu :isTagStared="activatedQuickPanels.includes(currentTag)" :currentTag="currentTag">
</ConfigurationMenu>
</q-btn>
</q-btn-group>
</div>
</div>
</div>
<!-- 命令编辑界面 -->
<q-dialog
v-model="isCommandEditorShow"
persistent
maximized
:transition-show="newCommandDirect ? '' : 'slide-up'"
transition-hide="slide-down"
style="overflow: hidden"
>
<CommandEditor
ref="commandEditor"
:action="commandEditorAction"
@editorEvent="editorEvent"
></CommandEditor>
<q-dialog v-model="isCommandEditorShow" persistent maximized :transition-show="newCommandDirect ? '' : 'slide-up'"
transition-hide="slide-down" style="overflow: hidden">
<CommandEditor ref="commandEditor" :action="commandEditorAction" @editorEvent="editorEvent"></CommandEditor>
</q-dialog>
<CommandRunResult
:action="{ type: 'config' }"
ref="result"
></CommandRunResult>
<CommandRunResult :action="{ type: 'config' }" ref="result"></CommandRunResult>
</div>
</template>
@ -212,6 +122,7 @@
import { defineAsyncComponent } from "vue";
import quickcommandParser from "../js/common/quickcommandParser.js";
import importAll from "../js/common/importAll.js";
import changeLog from "../js/options/changeLog.js"
import pinyinMatch from "pinyin-match";
import CommandCard from "components/CommandCard";
import CommandEditor from "components/CommandEditor";
@ -326,6 +237,7 @@ export default {
this.changeCurrentTag(window.hexDecode(this.$route.params.tags));
this.commandCardStyle = "mini";
}
this.showChangeLog();
//
setTimeout(this.getActivatedFeatures, 0);
setTimeout(this.getAllQuickCommands, 0);
@ -602,6 +514,15 @@ export default {
return;
}
},
showChangeLog() {
let lastNeedLogEvent = changeLog[changeLog.length - 1];
let loggedVersion =
this.$root.utools.whole.dbStorage.getItem("cfg_loggedVersion") || '0.0.0';
if (loggedVersion < lastNeedLogEvent.version) {
quickcommand.showConfirmBox('<pre style="white-space: pre-wrap;word-wrap: break-word;">' + lastNeedLogEvent.log + '</pre>', '更新日志', true, 700)
this.$root.utools.whole.dbStorage.setItem("cfg_loggedVersion", lastNeedLogEvent.version)
}
},
},
};
</script>

View File

@ -156,8 +156,13 @@ interface quickcommandApi {
* ```
* @param message
* @param title
* @param html html false
*/
showConfirmBox(message?: string, title?: string): Promise<boolean>;
showConfirmBox(
message?: string,
title?: string,
isHtml?: boolean
): Promise<boolean>;
/**
*