mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-09-23 00:00:52 +00:00
style: Optimize watermark style (#10630)
This commit is contained in:
@@ -1503,15 +1503,18 @@ func loadConfigInfo(isCreate bool, req dto.ContainerOperate, oldContainer *conta
|
||||
hostConf.DNS = req.DNS
|
||||
config.Volumes = make(map[string]struct{})
|
||||
for _, volume := range req.Volumes {
|
||||
hostConf.Mounts = append(hostConf.Mounts, mount.Mount{
|
||||
item := mount.Mount{
|
||||
Type: mount.Type(volume.Type),
|
||||
Source: volume.SourceDir,
|
||||
Target: volume.ContainerDir,
|
||||
ReadOnly: volume.Mode == "ro",
|
||||
BindOptions: &mount.BindOptions{
|
||||
}
|
||||
if volume.Type == "mount" {
|
||||
item.BindOptions = &mount.BindOptions{
|
||||
Propagation: mount.Propagation(volume.Shared),
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
hostConf.Mounts = append(hostConf.Mounts, item)
|
||||
config.Volumes[volume.ContainerDir] = struct{}{}
|
||||
}
|
||||
return &config, &hostConf, &networkConf, nil
|
||||
|
||||
@@ -751,12 +751,11 @@ func (f FileOp) Decompress(srcFile string, dst string, cType CompressType, secre
|
||||
if err = shellArchiver.Extract(srcFile, dst, secret); err == nil {
|
||||
return nil
|
||||
}
|
||||
if cType == TarGz && strings.Contains(err.Error(), "bad decrypt") {
|
||||
return buserr.New("ErrBadDecrypt")
|
||||
}
|
||||
if cType == TarGz && cmd.Which("file") {
|
||||
std, _ := cmd.RunDefaultWithStdoutBashCf("file %s", srcFile)
|
||||
if strings.Contains(std, "openssl enc'd data with salted password") && len(secret) == 0 {
|
||||
if cType == TarGz {
|
||||
if strings.Contains(err.Error(), "bad decrypt") {
|
||||
return buserr.New("ErrBadDecrypt")
|
||||
}
|
||||
if err := shellArchiver.Extract(srcFile, dst, "-"); strings.Contains(err.Error(), "bad decrypt") {
|
||||
return buserr.New("ErrBadDecrypt")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1642,7 +1642,8 @@ const message = {
|
||||
emailHelper: 'For password retrieval',
|
||||
watermark: 'Watermark Settings',
|
||||
watermarkContent: 'Watermark Content',
|
||||
contentHelper: 'Use {0} to represent the current node name and node IP',
|
||||
contentHelper:
|
||||
'Tip: ${nodeName} represents node name, ${nodeAddr} represents node address. You can use variables or fill in custom names.',
|
||||
watermarkColor: 'Watermark Color',
|
||||
watermarkFont: 'Watermark Font Size',
|
||||
watermarkHeight: 'Watermark Height',
|
||||
|
||||
@@ -1640,7 +1640,8 @@ const message = {
|
||||
emailHelper: 'Para recuperación de contraseña',
|
||||
watermark: 'Configuración de marca de agua',
|
||||
watermarkContent: 'Contenido de la marca de agua',
|
||||
contentHelper: 'Usa {0} para representar el nombre e IP del nodo actual',
|
||||
contentHelper:
|
||||
'Sugerencia: ${nodeName} representa el nombre del nodo, ${nodeAddr} representa la dirección del nodo. Puede usar variables o ingresar nombres personalizados.',
|
||||
watermarkColor: 'Color de la marca de agua',
|
||||
watermarkFont: 'Tamaño de fuente de la marca de agua',
|
||||
watermarkHeight: 'Altura de la marca de agua',
|
||||
|
||||
@@ -1586,7 +1586,8 @@ const message = {
|
||||
emailHelper: 'パスワード取得用',
|
||||
watermark: '透かし設定',
|
||||
watermarkContent: '透かし内容',
|
||||
contentHelper: '{0} を使用して現在のノード名とノードIPを表す',
|
||||
contentHelper:
|
||||
'ヒント:${nodeName}はノード名、${nodeAddr}はノードアドレスを表します。変数を使用するか、カスタム名を入力できます。',
|
||||
watermarkColor: '透かしの色',
|
||||
watermarkFont: '透かしのフォントサイズ',
|
||||
watermarkHeight: '透かしの高さ',
|
||||
|
||||
@@ -1567,7 +1567,8 @@ const message = {
|
||||
emailHelper: '비밀번호 복구용',
|
||||
watermark: '워터마크 설정',
|
||||
watermarkContent: '워터마크 내용',
|
||||
contentHelper: '{0}을 사용하여 현재 노드 이름과 노드 IP를 나타냅니다',
|
||||
contentHelper:
|
||||
'팁: ${nodeName}은 노드 이름, ${nodeAddr}은 노드 주소를 나타냅니다. 변수를 사용하거나 사용자 정의 이름을 입력할 수 있습니다.',
|
||||
watermarkColor: '워터마크 색상',
|
||||
watermarkFont: '워터마크 글꼴 크기',
|
||||
watermarkHeight: '워터마크 높이',
|
||||
|
||||
@@ -1632,7 +1632,8 @@ const message = {
|
||||
emailHelper: 'Untuk pemulihan kata laluan',
|
||||
watermark: 'Tetapan Tanda Air',
|
||||
watermarkContent: 'Kandungan Tanda Air',
|
||||
contentHelper: 'Gunakan {0} untuk mewakili nama nod semasa dan IP nod',
|
||||
contentHelper:
|
||||
'Petua: ${nodeName} mewakili nama nod, ${nodeAddr} mewakili alamat nod. Anda boleh menggunakan pembolehubah atau mengisi nama tersuai.',
|
||||
watermarkColor: 'Warna Tanda Air',
|
||||
watermarkFont: 'Saiz Fon Tanda Air',
|
||||
watermarkHeight: 'Ketinggian Tanda Air',
|
||||
|
||||
@@ -1622,7 +1622,8 @@ const message = {
|
||||
emailHelper: 'Para recuperação de senha',
|
||||
watermark: 'Configurações de Marca d Água',
|
||||
watermarkContent: 'Conteúdo da Marca d Água',
|
||||
contentHelper: 'Use {0} para representar o nome do nó atual e o IP do nó',
|
||||
contentHelper:
|
||||
'Dica: ${nodeName} representa o nome do nó, ${nodeAddr} representa o endereço do nó. Você pode usar variáveis ou preencher nomes personalizados.',
|
||||
watermarkColor: 'Cor da Marca d Água',
|
||||
watermarkFont: 'Tamanho da Fonte da Marca d Água',
|
||||
watermarkHeight: 'Altura da Marca d Água',
|
||||
|
||||
@@ -1624,7 +1624,8 @@ const message = {
|
||||
emailHelper: 'Для восстановления пароля',
|
||||
watermark: 'Настройки Водяного Знака',
|
||||
watermarkContent: 'Содержимое Водяного Знака',
|
||||
contentHelper: 'Используйте {0} для обозначения текущего имени узла и IP-адреса узла',
|
||||
contentHelper:
|
||||
'Подсказка: ${nodeName} представляет имя узла, ${nodeAddr} представляет адрес узла. Вы можете использовать переменные или ввести пользовательские имена.',
|
||||
watermarkColor: 'Цвет Водяного Знака',
|
||||
watermarkFont: 'Размер Шрифта Водяного Знака',
|
||||
watermarkHeight: 'Высота Водяного Знака',
|
||||
|
||||
@@ -1662,7 +1662,8 @@ const message = {
|
||||
emailHelper: 'Parola kurtarma için',
|
||||
watermark: 'Filigran Ayarları',
|
||||
watermarkContent: 'Filigran İçeriği',
|
||||
contentHelper: 'Mevcut düğüm adını ve düğüm IP sini temsil etmek için {0} kullanın',
|
||||
contentHelper:
|
||||
'İpucu: ${nodeName} düğüm adını, ${nodeAddr} düğüm adresini temsil eder. Değişkenleri kullanabilir veya özel adlar girebilirsiniz.',
|
||||
watermarkColor: 'Filigran Rengi',
|
||||
watermarkFont: 'Filigran Yazı Tipi Boyutu',
|
||||
watermarkHeight: 'Filigran Yüksekliği',
|
||||
|
||||
@@ -1559,7 +1559,7 @@ const message = {
|
||||
emailHelper: '用於密碼找回',
|
||||
watermark: '浮水印設定',
|
||||
watermarkContent: '浮水印內容',
|
||||
contentHelper: '使用 {0} 作為目前節點名稱和節點 IP',
|
||||
contentHelper: '提示:${nodeName} 表示節點名稱,${nodeAddr} 表示節點地址,既可以使用變數,也可以填寫自訂名稱。',
|
||||
watermarkColor: '浮水印顏色',
|
||||
watermarkFont: '浮水印字型大小',
|
||||
watermarkHeight: '浮水印高度',
|
||||
|
||||
@@ -1555,7 +1555,8 @@ const message = {
|
||||
emailHelper: '用于密码找回',
|
||||
watermark: '水印设置',
|
||||
watermarkContent: '水印内容',
|
||||
contentHelper: '使用 {0} 作为当前节点名称和节点 IP',
|
||||
contentHelper:
|
||||
'提示:${nodeName} 表示节点名称,${nodeAddr} 表示节点地址,既可以使用变量,也可以填写自定义名称。',
|
||||
watermarkColor: '水印颜色',
|
||||
watermarkFont: '水印字号',
|
||||
watermarkHeight: '水印高度',
|
||||
|
||||
@@ -102,7 +102,7 @@ const loadContent = () => {
|
||||
'${nodeName}',
|
||||
globalStore.currentNode === 'local' ? globalStore.getMasterAlias() : globalStore.currentNode,
|
||||
);
|
||||
itemName = itemName.replaceAll('${nodeAddr}', globalStore.currentNodeAddr);
|
||||
itemName = itemName.replaceAll('${nodeAddr}', globalStore.currentNodeAddr || '127.0.0.1');
|
||||
return itemName;
|
||||
};
|
||||
|
||||
|
||||
@@ -34,5 +34,5 @@ export const changeToLocal = async () => {
|
||||
|
||||
export const setDefaultNodeInfo = () => {
|
||||
globalStore.currentNode = 'local';
|
||||
globalStore.currentNodeAddr = '';
|
||||
globalStore.currentNodeAddr = '127.0.0.1';
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
<el-table-column :label="$t('container.sharedLabel')" min-width="180">
|
||||
<template #default="{ row }">
|
||||
<el-select popper-class="tall-options" v-model="row.shared">
|
||||
<el-select v-if="row.type !== 'volume'" popper-class="tall-options" v-model="row.shared">
|
||||
<el-option value="private" :label="$t('container.private')">
|
||||
<div class="title">{{ $t('container.private') }}</div>
|
||||
<div class="description">{{ $t('container.privateHelper') }}</div>
|
||||
@@ -64,6 +64,7 @@
|
||||
<div class="description">{{ $t('container.rslaveHelper') }}</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column min-width="80" :fixed="'right'">
|
||||
|
||||
@@ -372,6 +372,11 @@ const search = async () => {
|
||||
globalStore.themeConfig.theme = form.theme;
|
||||
form.proxyDocker = xpackRes.data.proxyDocker;
|
||||
form.watermark = xpackRes.data.watermark;
|
||||
try {
|
||||
globalStore.watermark = JSON.parse(xpackRes.data.watermark);
|
||||
} catch {
|
||||
globalStore.watermark = null;
|
||||
}
|
||||
form.watermarkItem = xpackRes.data.watermark ? 'Enable' : 'Disable';
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
>
|
||||
<el-form-item :label="$t('setting.watermarkContent')" prop="content">
|
||||
<el-input clearable v-model.trim="form.content" />
|
||||
<span class="input-help">{{ $t('setting.contentHelper', ['${nodeName} ${nodeAddr}']) }}</span>
|
||||
<span class="input-help">{{ $t('setting.contentHelper') }}</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('setting.watermarkColor')" prop="color">
|
||||
<el-color-picker v-model="form.color" show-alpha />
|
||||
@@ -37,8 +37,8 @@
|
||||
</el-form>
|
||||
</el-watermark>
|
||||
<template #footer>
|
||||
<el-button @click="setDefault">{{ $t('commons.button.setDefault') }}</el-button>
|
||||
<el-button @click="drawerVisible = false">{{ $t('commons.button.cancel') }}</el-button>
|
||||
<el-button @click="setDefault">{{ $t('website.setDefault') }}</el-button>
|
||||
<el-button :disabled="loading" type="primary" @click="onSave(formRef)">
|
||||
{{ $t('commons.button.confirm') }}
|
||||
</el-button>
|
||||
@@ -61,7 +61,7 @@ const drawerVisible = ref();
|
||||
const loading = ref();
|
||||
|
||||
let form = reactive({
|
||||
color: 'rgba(0, 0, 0, 0.15)',
|
||||
color: globalStore.isDarkTheme ? 'rgba(255, 255, 255, 0.15)' : 'rgba(0, 0, 0, 0.15)',
|
||||
fontSize: 16,
|
||||
content: '${nodeName} - ${nodeAddr}',
|
||||
rotate: -22,
|
||||
@@ -91,7 +91,7 @@ const loadContent = () => {
|
||||
};
|
||||
|
||||
const setDefault = () => {
|
||||
form.color = 'rgba(0, 0, 0, 0.15)';
|
||||
form.color = globalStore.isDarkTheme ? 'rgba(255, 255, 255, 0.15)' : 'rgba(0, 0, 0, 0.15)';
|
||||
form.fontSize = 16;
|
||||
form.content = '${nodeName} - ${nodeAddr}';
|
||||
form.rotate = -22;
|
||||
|
||||
Reference in New Issue
Block a user