Skip to content

Commit

Permalink
1.6.8
Browse files Browse the repository at this point in the history
  • Loading branch information
niostack committed Aug 15, 2024
1 parent a4dcd91 commit 9dc61e7
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 32 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
增加批量关注功能, 可以控制矩阵账号关注目标用户
Add batch follow feature, you can control the target user of the matrix account
增加在发布视频的时候添加商品链接的功能
New feature preview: Add the function of adding product links when publishing videos
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package": {
"productName": "TikMatrix",
"version": "1.6.7"
"version": "1.6.8"
},
"tauri": {
"allowlist": {
Expand Down
33 changes: 33 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,37 @@ export default {
})
},
async download_ocr() {
let filename = 'PaddleOCR'
this.download_filename = 'PaddleOCR'
let url = "https://r2.tikmatrix.com/PaddleOCR-json.zip"
let work_path = await appDataDir();
console.log("work_path", work_path)
let name = url.split('/').pop()
let path = work_path + 'bin/' + url.split('/').pop()
let downloaded = await exists('bin/' + name, { dir: BaseDirectory.AppData })
console.log("downloaded", downloaded, "path", path)
if (downloaded) {
alert("Already downloaded")
return;
}
this.$refs.download_dialog.showModal()
console.log("download " + filename + " from " + url + " to " + path)
invoke('download_file', { url, path });
const unlistenProgress = await listen("DOWNLOAD_PROGRESS", (e) => {
this.download_progress = e.payload;
});
const unlistenFinished = await listen("DOWNLOAD_FINISHED", (e) => {
console.log("download finished")
if (path.endsWith('.zip')) {
invoke("unzip_file", { zipPath: path, destDir: work_path });
}
this.$refs.download_dialog.close()
unlistenProgress()
unlistenFinished()
})
},
async check_platform_tools(callback) {
Expand Down Expand Up @@ -344,6 +374,9 @@ export default {
this.$emitter.on('menuSelected', (item) => {
this.menu_selected(item)
});
this.$emitter.on('downloadOcr', () => {
this.download_ocr()
});
}
}
</script>
31 changes: 7 additions & 24 deletions src/components/General.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
<font-awesome-icon icon="fa-solid fa-link" class="h-3 w-3 text-white" />
{{ $t('setProxy') }}
</button>
<button
<!-- <button
class="btn btn-sm bg-blue-500 hover:bg-blue-300 border-0 text-white text-xs block font-normal ml-1 mb-1 min-w-max"
@click="$refs.scan_dialog.show()">
<font-awesome-icon icon="fa-solid fa-network-wired" class="h-3 w-3" />{{ $t('scanTCPDevice') }}
</button>
</button> -->
<button
class="btn btn-sm bg-blue-500 hover:bg-blue-300 border-0 text-white text-xs block font-normal ml-1 mb-1 min-w-max"
@click="$emitter.emit('initDevice')">
Expand All @@ -54,29 +54,12 @@
@click="open_dir('logs')">
<font-awesome-icon icon="fa-solid fa-file-lines" class="h-3 w-3" />{{ $t('openLogs') }}
</button>
<dialog ref="scan_dialog" class="modal">
<div class="modal-box">
<h3 class="font-bold text-lg">{{ $t('scanIpTitle') }}</h3>
<div class="flex flex-row items-center">
<input class="input input-bordered input-sm w-20" type="number" v-model="ip_1" />
<span class="font-bold p-1">.</span>
<input class="input input-bordered input-sm w-20" type="number" v-model="ip_2" />
<span class="font-bold p-1">.</span>
<input class="input input-bordered input-sm w-20" type="number" v-model="ip_3" />
<span class="font-bold p-1">.</span>
<input class="input input-bordered input-sm w-20" type="number" v-model="ip_4" />
<span class="font-bold p-2">-</span>
<input class="input input-bordered input-sm w-20" type="number" v-model="ip_5" />
</div>
<h5 class="font-bold">{{ $t('scanPortTip') }}</h5>
<input class="input input-bordered input-sm w-24" type="number" v-model="port" />
<MyButton @click="scan" label="startScan" :showLoading="scaning" />
<button
class="btn btn-sm bg-blue-500 hover:bg-blue-300 border-0 text-white text-xs block font-normal ml-1 mb-1 min-w-max"
@click="$emitter.emit('downloadOcr')">
<font-awesome-icon icon="fa fa-download" class="h-3 w-3" />{{ $t('downloadOcr') }}
</button>

</div>
<form method="dialog" class="modal-backdrop">
<button>close</button>
</form>
</dialog>
<dialog ref="proxy_dialog" class="modal">
<div class="modal-box">
<h3 class="font-bold text-lg">{{ $t('proxyServer') }}</h3>
Expand Down
7 changes: 4 additions & 3 deletions src/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -596,14 +596,15 @@ export default {
console.log(err)
})
},
publish() {
publish(addProductLink) {
if (this.selection.length == 0) {
this.$emitter.emit('showToast', this.$t('noDevicesSelected'))
return
}
this.$service
.publish_now({
serials: this.selection,
add_product_link: addProductLink ? 1 : 0
})
.then(res => {
console.log(res)
Expand Down Expand Up @@ -800,8 +801,8 @@ export default {
this.$emitter.on('train', () => {
this.train();
});
this.$emitter.on('publish', () => {
this.publish();
this.$emitter.on('publish', (addProductLink) => {
this.publish(addProductLink);
});
this.$emitter.on('message', () => {
this.message();
Expand Down
14 changes: 13 additions & 1 deletion src/components/Tools.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@
</button>
<button
class="btn btn-sm bg-blue-500 hover:bg-blue-300 border-0 text-white text-xs block font-normal ml-1 mb-1 min-w-max"
@click="$emitter.emit('publish')">
@click="$emitter.emit('publish', false)">
<font-awesome-icon icon="paper-plane" class="h-3 w-3" />{{ $t('startPublish') }}
</button>
<button
class="btn btn-sm bg-blue-500 hover:bg-blue-300 border-0 text-white text-xs block font-normal ml-1 mb-1 min-w-max"
@click="startPublish">
<font-awesome-icon icon="paper-plane" class="h-3 w-3" />{{ $t('startPublishBeta') }}
</button>
<button
class="btn btn-sm bg-blue-500 hover:bg-blue-300 border-0 text-white text-xs block font-normal ml-1 mb-1 min-w-max"
@click="$emitter.emit('message')">
Expand Down Expand Up @@ -122,6 +127,7 @@
</template>
<script>
import { invoke } from "@tauri-apps/api/tauri";
import { ask } from '@tauri-apps/api/dialog';
export default {
name: 'Tools',
props: ['settings'],
Expand All @@ -137,6 +143,12 @@ export default {
name
});
},
async startPublish() {
const yes = await ask(this.$t('addProductLinkConfirm'), this.$t('confirm'));
if (yes) {
this.$emitter.emit('publish', true)
}
},
startFollow() {
if (this.tartget_username == '') {
alert(this.$t('targetUsernameRequired'))
Expand Down
52 changes: 51 additions & 1 deletion src/components/device/ManageDevices.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Pagination ref="device_panel" :items="devices" :searchKeys="['serial', 'account']" @refresh="refreshPage">
<template v-slot:buttons>
<MyButton @click="$service.reset_all_index" label="resetIndex" icon="fa fa-refresh" />
<MyButton @click="$refs.scan_dialog.show()" label="scanTCPDevice" icon="fa-solid fa-network-wired" />
</template>
<template v-slot:default="slotProps">
<div class="flex flex-wrap gap-2 p-4">
Expand All @@ -27,6 +28,29 @@
</Pagination>

</div>
<dialog ref="scan_dialog" class="modal">
<div class="modal-box">
<h3 class="font-bold text-lg">{{ $t('scanIpTitle') }}</h3>
<div class="flex flex-row items-center">
<input class="input input-bordered input-sm w-20" type="number" v-model="ip_1" />
<span class="font-bold p-1">.</span>
<input class="input input-bordered input-sm w-20" type="number" v-model="ip_2" />
<span class="font-bold p-1">.</span>
<input class="input input-bordered input-sm w-20" type="number" v-model="ip_3" />
<span class="font-bold p-1">.</span>
<input class="input input-bordered input-sm w-20" type="number" v-model="ip_4" />
<span class="font-bold p-2">-</span>
<input class="input input-bordered input-sm w-20" type="number" v-model="ip_5" />
</div>
<h5 class="font-bold">{{ $t('scanPortTip') }}</h5>
<input class="input input-bordered input-sm w-24" type="number" v-model="port" />
<MyButton @click="scan" label="startScan" :showLoading="scaning" />

</div>
<form method="dialog" class="modal-backdrop">
<button>close</button>
</form>
</dialog>
</template>
<script>
import MyButton from '../Button.vue'
Expand All @@ -35,6 +59,7 @@ import Device from './Device.vue'
import Modal from '../Modal.vue'
import Pagination from '../Pagination.vue'
import { inject } from 'vue'
import * as util from '../../utils'
export default {
name: 'devices',
Expand All @@ -55,6 +80,15 @@ export default {
mydevices: [],
settings: {
},
ip_1: util.getData('ip_1') || 192,
ip_2: util.getData('ip_2') || 168,
ip_3: util.getData('ip_3') || 1,
ip_4: util.getData('ip_4') || 2,
ip_5: util.getData('ip_5') || 254,
port: util.getData('scan_port') || 5555,
proxy_host: util.getData('proxy_host') || '127.0.0.1',
proxy_port: util.getData('proxy_port') || 8080,
scaning: false
}
},
Expand Down Expand Up @@ -82,7 +116,23 @@ export default {
})
},
scan() {
this.scaning = true
util.setData('ip_1', this.ip_1)
util.setData('ip_2', this.ip_2)
util.setData('ip_3', this.ip_3)
util.setData('ip_4', this.ip_4)
util.setData('ip_5', this.ip_5)
util.setData('scan_port', this.port)
this.$service.scan_tcp({
start_ip: `${this.ip_1}.${this.ip_2}.${this.ip_3}.${this.ip_4}`,
end_ip: `${this.ip_1}.${this.ip_2}.${this.ip_3}.${this.ip_5}`,
port: this.port
}).then((res) => {
console.log(res)
this.scaning = false
})
},
},
Expand Down
6 changes: 6 additions & 0 deletions src/i18n.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,14 @@ export const i18n = createI18n({
startFollow: 'Start Follow',
followTitle: 'Follow Target Accounts',
followJobs: 'Follow Jobs',
downloadOcr: 'Download OCR',
startPublishBeta: 'Start Publish(Beta)',
addProductLinkConfirm: 'Do you want to add this product link? This is a beta feature, if you do not need it, please click No, if you need please click Yes, and make sure you have at least 1 item in your shelf',
},
'zh-CN': {
startPublishBeta: '开始发布(测试版)',
addProductLinkConfirm: '是否需要添加该商品链接? 这是一个内测功能,如果你不需要请点击No, 如果需要请点击Yes,并确保你的橱窗中已经添加了至少1个商品',
downloadOcr: '下载OCR',
followJobs: '关注任务',
followTitle: '关注账号',
startFollow: '开始关注',
Expand Down

0 comments on commit 9dc61e7

Please sign in to comment.