Skip to content

Commit

Permalink
fix: 💄 Optimize wireless connection user interface
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Jul 25, 2024
1 parent d72202b commit 50ae742
Show file tree
Hide file tree
Showing 6 changed files with 249 additions and 201 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
registry=https://registry.npmmirror.com/
shamefully-hoist=true
virtual-store-dir-max-length=70

ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/
ELECTRON_CUSTOM_DIR="{{ version }}"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"electron-store": "^9.0.0",
"electron-updater": "^6.1.8",
"element-plus": "^2.7.2",
"eslint": "^9.2.0",
"eslint": "^8.57.0",
"fix-path": "^4.0.0",
"fs-extra": "^11.2.0",
"hono": "^4.3.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,143 +8,147 @@
destroy-on-close
@closed="onClosed"
>
<ele-form-row
ref="formRef"
:model="model"
:rules="rules"
label-width="180px"
class="!pr-24 !pt-4"
>
<ele-form-item-col
:label="$t('device.task.type')"
:span="24"
prop="taskType"
<div class="pr-24 pt-4">
<ele-form-row
ref="formRef"
:model="model"
:rules="rules"
label-width="180px"
class=""
>
<el-select
v-model="model.taskType"
:placeholder="$t('common.select.please')"
clearable
filterable
@change="onTaskChange"
<ele-form-item-col
:label="$t('device.task.type')"
:span="24"
prop="taskType"
>
<el-option
v-for="item in taskModel"
:key="item.value"
:label="$t(item.label)"
:value="item.value"
<el-select
v-model="model.taskType"
:placeholder="$t('common.select.please')"
clearable
filterable
@change="onTaskChange"
>
</el-option>
</el-select>
</ele-form-item-col>
<ele-form-item-col
:label="$t('device.task.frequency')"
:span="24"
prop="timerType"
>
<el-radio-group v-model="model.timerType">
<el-radio
v-for="(item, index) of timerModel"
:key="index"
:value="item.value"
>
{{ $t(item.label) }}
</el-radio>
</el-radio-group>
</ele-form-item-col>

<ele-form-item-col
v-if="['timeout'].includes(model.timerType)"
:label="$t('device.task.timeout')"
:span="24"
prop="timeout"
>
<el-date-picker
v-model="model.timeout"
type="datetime"
placeholder="0000-00-00 00:00:00"
clearable
v-bind="{ disabledDate, defaultTime }"
></el-date-picker>
</ele-form-item-col>

<ele-form-item-col
v-if="['interval'].includes(model.timerType)"
:label="$t('device.task.interval')"
:span="24"
prop="interval"
>
<el-input
v-model="model.interval"
type="number"
placeholder="0"
clearable
<el-option
v-for="item in taskModel"
:key="item.value"
:label="$t(item.label)"
:value="item.value"
>
</el-option>
</el-select>
</ele-form-item-col>
<ele-form-item-col
:label="$t('device.task.frequency')"
:span="24"
prop="timerType"
>
<template #append>
<el-select
v-model="model.intervalType"
:placeholder="$t('common.select.please')"
filterable
class="!w-36"
<el-radio-group v-model="model.timerType">
<el-radio
v-for="(item, index) of timerModel"
:key="index"
:value="item.value"
>
<el-option
v-for="(item, index) of intervalModel"
:key="index"
:label="$t(item.label)"
:value="item.value"
/>
</el-select>
</template>
</el-input>
</ele-form-item-col>

<ele-form-item-col
v-if="['install'].includes(model.taskType)"
:label="$t('device.task.extra.app')"
:span="24"
prop="extra"
>
<InputPath
v-model="model.extra"
:placeholder="$t('device.control.install.placeholder')"
:data="{
properties: ['openFile', 'multiSelections'],
filters: [
{
name: $t('device.control.install.placeholder'),
extensions: ['apk'],
},
],
}"
/>
</ele-form-item-col>

<ele-form-item-col
v-if="['shell'].includes(model.taskType)"
:label="$t('device.task.extra.shell')"
:span="24"
prop="extra"
>
<InputPath
v-model="model.extra"
:placeholder="$t('device.control.shell.select')"
:data="{
properties: ['openFile'],
filters: [
{
name: $t('device.control.shell.select'),
extensions: ['sh'],
},
],
}"
/>
</ele-form-item-col>

<ele-form-item-col :span="24" label="">
<div class="text-red-200 hover:text-red-500 transition-colors">
{{ $t('device.task.tips') }}
</div>
</ele-form-item-col>
</ele-form-row>
{{ $t(item.label) }}
</el-radio>
</el-radio-group>
</ele-form-item-col>

<ele-form-item-col
v-if="['timeout'].includes(model.timerType)"
:label="$t('device.task.timeout')"
:span="24"
prop="timeout"
>
<el-date-picker
v-model="model.timeout"
type="datetime"
placeholder="0000-00-00 00:00:00"
clearable
v-bind="{ disabledDate, defaultTime }"
></el-date-picker>
</ele-form-item-col>

<ele-form-item-col
v-if="['interval'].includes(model.timerType)"
:label="$t('device.task.interval')"
:span="24"
prop="interval"
>
<el-input
v-model="model.interval"
type="number"
placeholder="0"
clearable
>
<template #append>
<el-select
v-model="model.intervalType"
:placeholder="$t('common.select.please')"
filterable
class="!w-36"
>
<el-option
v-for="(item, index) of intervalModel"
:key="index"
:label="$t(item.label)"
:value="item.value"
/>
</el-select>
</template>
</el-input>
</ele-form-item-col>

<ele-form-item-col
v-if="['install'].includes(model.taskType)"
:label="$t('device.task.extra.app')"
:span="24"
prop="extra"
>
<InputPath
v-model="model.extra"
:placeholder="$t('device.control.install.placeholder')"
:data="{
properties: ['openFile', 'multiSelections'],
filters: [
{
name: $t('device.control.install.placeholder'),
extensions: ['apk'],
},
],
}"
/>
</ele-form-item-col>

<ele-form-item-col
v-if="['shell'].includes(model.taskType)"
:label="$t('device.task.extra.shell')"
:span="24"
prop="extra"
>
<InputPath
v-model="model.extra"
:placeholder="$t('device.control.shell.select')"
:data="{
properties: ['openFile'],
filters: [
{
name: $t('device.control.shell.select'),
extensions: ['sh'],
},
],
}"
/>
</ele-form-item-col>

<ele-form-item-col :span="24" label="">
<div
class="text-red-200 dark:text-red-900 !hover:text-red-500 transition-colors"
>
{{ $t('device.task.tips') }}
</div>
</ele-form-item-col>
</ele-form-row>
</div>

<template #footer>
<el-button @click="close">
Expand Down
Loading

0 comments on commit 50ae742

Please sign in to comment.