Skip to content

Commit c2472a5

Browse files
authored
Refine install script generator (hestiacp#4069)
1 parent 2f01eaa commit c2472a5

File tree

2 files changed

+54
-43
lines changed

2 files changed

+54
-43
lines changed

docs/.vitepress/theme/components/CopyToClipboardInput.vue

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
<template>
22
<div class="CopyToClipboardInput" v-bind="$attrs">
3-
<input type="text" class="CopyToClipboardInput-input" readonly :value="value" />
3+
<input
4+
type="text"
5+
class="CopyToClipboardInput-input"
6+
:value="value"
7+
@focus="selectText"
8+
readonly
9+
/>
410
<button
511
type="button"
612
class="CopyToClipboardInput-button"
@@ -20,6 +26,12 @@ defineProps({
2026
},
2127
});
2228
29+
const selectText = (event) => {
30+
const inputElement = event.target;
31+
inputElement.select();
32+
inputElement.removeEventListener("focus", selectText);
33+
};
34+
2335
const copyToClipboard = (event) => {
2436
const inputValue = event.target.previousSibling.value;
2537
navigator.clipboard.writeText(inputValue).then(
@@ -38,36 +50,35 @@ const copyToClipboard = (event) => {
3850

3951
<style scoped>
4052
.CopyToClipboardInput {
41-
position: relative;
53+
display: flex;
4254
}
4355
.CopyToClipboardInput-input {
4456
font-size: 0.9em;
4557
font-family: monospace;
58+
flex-grow: 1;
4659
border: 1px solid var(--vp-c-border);
47-
border-radius: 4px;
60+
border-top-left-radius: 4px;
61+
border-bottom-left-radius: 4px;
4862
background-color: var(--vp-c-bg);
49-
width: 100%;
5063
padding: 8px 13px;
51-
padding-right: 53px;
52-
53-
&:hover {
54-
border-color: var(--vp-c-border-hover);
55-
}
5664
5765
&:focus {
58-
border-color: var(--vp-c-brand);
66+
border-color: var(--vp-button-brand-bg);
5967
}
6068
}
6169
.CopyToClipboardInput-button {
62-
position: absolute;
63-
top: 1px;
64-
right: 1px;
65-
bottom: 1px;
66-
border-top-right-radius: 3px;
67-
border-bottom-right-radius: 3px;
68-
color: var(--vp-c-brand);
70+
font-size: 14px;
71+
border-top-right-radius: 4px;
72+
border-bottom-right-radius: 4px;
73+
color: var(--vp-button-brand-text);
74+
min-width: 73px;
6975
font-weight: 600;
70-
padding: 6px 10px;
71-
background-color: var(--vp-c-bg);
76+
padding: 5px 10px;
77+
background-color: var(--vp-button-brand-bg);
78+
transition: background-color 0.25s;
79+
80+
&:hover {
81+
background-color: var(--vp-button-brand-hover-bg);
82+
}
7283
}
7384
</style>

docs/_data/options.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ export const options = [
22
{
33
flag: 'port',
44
label: 'Port',
5-
description: 'Change the port Hestia uses.',
5+
description: 'Change the port Hestia uses',
66
type: 'text',
77
default: '8083',
88
},
99
{
1010
flag: 'lang',
1111
label: 'Language',
12-
description: 'Change the ISO 639-1 language code.',
12+
description: 'Change the ISO 639-1 language code',
1313
type: 'select',
1414
default: 'en',
1515
options: [
@@ -60,124 +60,124 @@ export const options = [
6060
{
6161
flag: 'hostname',
6262
label: 'Hostname',
63-
description: 'Set a custom hostname.',
63+
description: 'Set a custom hostname',
6464
type: 'text',
6565
default: '',
6666
},
6767
{
6868
flag: 'email',
6969
label: 'Email',
70-
description: 'Set the admin account email.',
70+
description: 'Set the admin account email',
7171
type: 'text',
7272
default: '',
7373
},
7474
{
7575
flag: 'password',
7676
label: 'Password',
77-
description: 'Set the admin account password.',
77+
description: 'Set the admin account password',
7878
type: 'text',
7979
default: '',
8080
},
8181
{
8282
flag: 'apache',
8383
label: 'Apache',
84-
description: 'Web server with htaccess support.',
84+
description: 'Web server with htaccess support',
8585
default: 'yes',
8686
},
8787
{
8888
flag: 'phpfpm',
8989
label: 'PHP-FPM',
90-
description: 'Process manager for executing PHP scripts.',
90+
description: 'Process manager for executing PHP scripts',
9191
default: 'yes',
9292
},
9393
{
9494
flag: 'multiphp',
9595
label: 'MultiPHP',
96-
description: 'Allows installing multiple PHP versions.',
96+
description: 'Allows installing multiple PHP versions',
9797
default: 'no',
9898
},
9999
{
100100
flag: 'vsftpd',
101101
label: 'VSFTPD',
102-
description: 'Lightweight, minimalist and secure FTP server.',
102+
description: 'Lightweight, minimalist and secure FTP server',
103103
default: 'yes',
104104
},
105105
{
106106
flag: 'proftpd',
107107
label: 'ProFTPD',
108-
description: 'Advanced, modular FTP server that supports LDAP.',
108+
description: 'Advanced, modular FTP server that supports LDAP',
109109
default: 'no',
110110
},
111111
{
112112
flag: 'named',
113113
label: 'BIND',
114-
description: 'Custom DNS name server.',
114+
description: 'Custom DNS name server',
115115
default: 'yes',
116116
},
117117
{
118118
flag: 'mysql',
119119
label: 'MariaDB',
120-
description: 'Fork of MySQL with additional features and improvements.',
120+
description: 'Fork of MySQL with additional features and improvements',
121121
default: 'yes',
122122
},
123123
{
124124
flag: 'mysql8',
125125
label: 'MySQL 8',
126-
description: 'Open-source relational database management system.',
126+
description: 'Open-source relational database management system',
127127
default: 'no',
128128
},
129129
{
130130
flag: 'postgresql',
131131
label: 'PostgreSQL',
132-
description: 'Open-source relational database management system.',
132+
description: 'Open-source relational database management system',
133133
default: 'no',
134134
},
135135
{
136136
flag: 'exim',
137137
label: 'Exim',
138-
description: 'Allows sending emails from web-mail or via SMTP.',
138+
description: 'Allows sending emails from web-mail or via SMTP',
139139
default: 'yes',
140140
},
141141
{
142142
flag: 'dovecot',
143143
label: 'Dovecot',
144-
description: 'Receive emails and connect with email clients via IMAP/POP3.',
144+
description: 'Receive emails and connect with email clients via IMAP/POP3',
145145
default: 'yes',
146146
},
147147
{
148148
flag: 'sieve',
149149
label: 'Sieve',
150-
description: 'Language for managing your own custom email filters.',
150+
description: 'Language for managing your own custom email filters',
151151
default: 'no',
152152
},
153153
{
154154
flag: 'clamav',
155155
label: 'ClamAV',
156-
description: 'Scans your email inbox for viruses.',
156+
description: 'Scans your email inbox for viruses',
157157
default: 'yes',
158158
},
159159
{
160160
flag: 'spamassassin',
161161
label: 'SpamAssassin',
162-
description: 'Filter out spam emails from your inbox.',
162+
description: 'Filter out spam emails from your inbox',
163163
default: 'yes',
164164
},
165165
{
166166
flag: 'iptables',
167167
label: 'iptables',
168-
description: 'Allows firewall rule management within Hestia.',
168+
description: 'Allows firewall rule management within Hestia',
169169
default: 'yes',
170170
},
171171
{
172172
flag: 'fail2ban',
173173
label: 'Fail2Ban',
174-
description: 'Provides brute force protection for SSH, email, FTP and databases.',
174+
description: 'Provides brute force protection for SSH, email, FTP and databases',
175175
default: 'yes',
176176
},
177177
{
178178
flag: 'quota',
179179
label: 'Filesystem quota',
180-
description: 'Use hard disk space limits on user packages.',
180+
description: 'Use hard disk space limits on user packages',
181181
default: 'no',
182182
},
183183
{
@@ -189,13 +189,13 @@ export const options = [
189189
{
190190
flag: 'interactive',
191191
label: 'Interactive install',
192-
description: 'Run the install interactively.',
192+
description: 'Run the install interactively',
193193
default: 'yes',
194194
},
195195
{
196196
flag: 'force',
197197
label: 'Force installation',
198-
description: 'Force the installation.',
198+
description: 'Force the installation',
199199
default: 'no',
200200
},
201201
];

0 commit comments

Comments
 (0)