Skip to content

Commit

Permalink
Removed accordions
Browse files Browse the repository at this point in the history
  • Loading branch information
4cello committed Apr 1, 2024
1 parent a965a2f commit 9acd960
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 54 deletions.
84 changes: 48 additions & 36 deletions src/components/TheSelectPrinterDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -83,24 +83,26 @@
dense></v-text-field>
</v-col>
</v-row>
<sub-panel
:title="$t('SelectPrinterDialog.AdvancedSettings')"
sub-panel-class="add-printer-advanced"
expand="false">
<v-row>
<v-col class="col-6">
<v-text-field
v-model="dialogAddPrinter.path"
:rules="[(v) => !v || v.startsWith('/') || 'Path must start with /']"
:label="$t('SelectPrinterDialog.Path')"
hide-details="auto"
outlined
dense></v-text-field>
</v-col>
</v-row>
</sub-panel>
<v-row v-if="showOptionalSettings">
<v-col class="col-12">
<v-text-field
v-model="dialogAddPrinter.path"
:rules="[(v) => !v || v.startsWith('/') || 'Path must start with /']"
:label="$t('SelectPrinterDialog.Path')"
hide-details="auto"
outlined
dense></v-text-field>
</v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-checkbox
class="ml-2"
:on-icon="mdiShowOptional"
:off-icon="mdiHideOptional"
:true-value="false"
:false-value="true"
v-model="showOptionalSettings"></v-checkbox>

Check warning on line 105 in src/components/TheSelectPrinterDialog.vue

View workflow job for this annotation

GitHub Actions / ESLint

src/components/TheSelectPrinterDialog.vue#L105

Attribute "v-model" should go before ":false-value" (vue/attributes-order)
<v-spacer></v-spacer>
<v-btn color="primary" text class="middle" type="submit" :disabled="!addPrinterValid">
{{ $t('SelectPrinterDialog.AddPrinter') }}
Expand Down Expand Up @@ -137,27 +139,32 @@
hide-details="auto"></v-text-field>
</v-col>
</v-row>
<sub-panel
:title="$t('SelectPrinterDialog.AdvancedSettings')"
sub-panel-class="edit-printer-advanced"
expand="false">
<v-row>
<v-col class="col-6">
<v-text-field
v-model="dialogEditPrinter.path"
:rules="[(v) => !v || v.startsWith('/') || 'Path must start with /']"
:label="$t('SelectPrinterDialog.Path')"
hide-details="auto"
outlined
dense></v-text-field>
</v-col>
</v-row>
</sub-panel>
<v-row v-if="showOptionalSettings">
<v-col class="col-12">
<v-text-field
v-model="dialogEditPrinter.path"
:rules="[(v) => !v || v.startsWith('/') || 'Path must start with /']"
:label="$t('SelectPrinterDialog.Path')"
hide-details="auto"
outlined
dense></v-text-field>
</v-col>
</v-row>
</v-card-text>
<v-card-actions>
<v-btn color="red" icon tile class="minwidth-0 rounded" @click="delPrinter">
<v-icon small>{{ mdiDelete }}</v-icon>
</v-btn>
<v-checkbox
class="ml-2"
icon
tile
small
:on-icon="mdiShowOptional"
:off-icon="mdiHideOptional"
:true-value="false"
:false-value="true"
v-model="showOptionalSettings"></v-checkbox>

Check warning on line 167 in src/components/TheSelectPrinterDialog.vue

View workflow job for this annotation

GitHub Actions / ESLint

src/components/TheSelectPrinterDialog.vue#L167

Attribute "v-model" should go before ":false-value" (vue/attributes-order)
<v-spacer></v-spacer>
<v-btn color="primary" text type="submit" :disabled="!editPrinterValid">
{{ $t('SelectPrinterDialog.UpdatePrinter') }}
Expand Down Expand Up @@ -257,6 +264,8 @@ import {
mdiCloseThick,
mdiConnection,
mdiDelete,
mdiCog,
mdiCogOff,
mdiPencil,
mdiSync,
} from '@mdi/js'
Expand All @@ -270,16 +279,17 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) {
bool: false,
hostname: '',
port: 7125,
path: '',
path: '/',
}
private editPrinterValid = false
private dialogEditPrinter = {
bool: false,
id: '',
hostname: '',
port: 0,
path: '',
path: '/',
}
private showOptionalSettings = false
/**
* Icons
Expand All @@ -291,6 +301,8 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) {
mdiPencil = mdiPencil
mdiCheckboxMarkedCircle = mdiCheckboxMarkedCircle
mdiCancel = mdiCancel
mdiShowOptional = mdiCog
mdiHideOptional = mdiCogOff
get printers() {
return this.$store.getters['gui/remoteprinters/getRemoteprinters'] ?? []
Expand Down Expand Up @@ -389,14 +401,14 @@ export default class TheSelectPrinterDialog extends Mixins(BaseMixin) {
this.dialogAddPrinter.hostname = ''
this.dialogAddPrinter.bool = false
this.dialogAddPrinter.path = ''
this.dialogAddPrinter.path = '/'
}
editPrinter(printer: GuiRemoteprintersStatePrinter) {
this.dialogEditPrinter.hostname = printer.hostname
this.dialogEditPrinter.port = printer.port
this.dialogEditPrinter.id = printer.id ?? ''
this.dialogEditPrinter.path = printer.path ?? ''
this.dialogEditPrinter.path = printer.path ?? '/'
this.dialogEditPrinter.bool = true
}
Expand Down
30 changes: 13 additions & 17 deletions src/components/settings/SettingsRemotePrintersTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,15 @@
dense
outlined></v-text-field>
</settings-row>
<sub-panel
:title="$t('Settings.RemotePrintersTab.AdvancedSettings')"
sub-panel-class="remote-printer-advanced"
expand="false">
<settings-row :title="$t('Settings.RemotePrintersTab.Path')">
<v-text-field
v-model="form.path"
:rules="[(v) => !v || v.startsWith('/') || 'Path must start with /']"
hide-details="auto"
outlined
dense></v-text-field>
</settings-row>
</sub-panel>
<v-divider class="my-2"></v-divider>
<settings-row :title="$t('Settings.RemotePrintersTab.Path')">
<v-text-field
v-model="form.path"
:rules="[(v) => !v || v.startsWith('/') || 'Path must start with /']"
hide-details="auto"
outlined
dense></v-text-field>
</settings-row>
</v-card-text>
<v-card-actions class="d-flex justify-end">
<v-btn text @click="form.bool = false">{{ $t('Settings.Cancel') }}</v-btn>
Expand Down Expand Up @@ -123,7 +119,7 @@ export default class SettingsRemotePrintersTab extends Mixins(BaseMixin) {
bool: false,
hostname: '',
port: 7125,
path: '',
path: '/',
id: null,
namespace: null,
}
Expand All @@ -147,7 +143,7 @@ export default class SettingsRemotePrintersTab extends Mixins(BaseMixin) {
createPrinter() {
this.form.hostname = ''
this.form.port = 7125
this.form.path = ''
this.form.path = '/'
this.form.id = null
this.form.namespace = null
this.form.bool = true
Expand All @@ -172,7 +168,7 @@ export default class SettingsRemotePrintersTab extends Mixins(BaseMixin) {
this.form.id = printer.id ?? null
this.form.hostname = printer.hostname
this.form.port = printer.port
this.form.path = printer.path ?? null
this.form.path = printer.path ?? '/'
this.form.bool = true
}
Expand All @@ -188,7 +184,7 @@ export default class SettingsRemotePrintersTab extends Mixins(BaseMixin) {
this.form.id = null
this.form.hostname = ''
this.form.port = 7125
this.form.path = ''
this.form.path = '/'
this.form.bool = false
}
Expand Down
1 change: 0 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,6 @@
},
"RemotePrintersTab": {
"AddPrinter": "Add Printer",
"AdvancedSettings": "Advanced Settings",
"EditPrinter": "Edit Printer",
"Hostname": "Hostname",
"Path": "Path",
Expand Down

0 comments on commit 9acd960

Please sign in to comment.