Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agent/app/dto/request/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type DiskMountRequest struct {
MountPoint string `json:"mountPoint" validate:"required"`
Filesystem string `json:"filesystem" validate:"required,oneof=ext4 xfs"`
AutoMount bool `json:"autoMount"`
NoFail bool `json:"noFail"`
}

type DiskUnmountRequest struct {
Expand Down
6 changes: 5 additions & 1 deletion agent/app/service/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ func (s *DiskService) MountDisk(req request.DiskMountRequest) error {
return buserr.WithErr("MountDiskErr", err)
}
if req.AutoMount {
if err := addToFstabWithOptions(req.Device, req.MountPoint, req.Filesystem, ""); err != nil {
options := ""
if req.NoFail {
options = "defaults,nofail"
}
if err := addToFstabWithOptions(req.Device, req.MountPoint, req.Filesystem, options); err != nil {
return buserr.WithErr("MountDiskErr", err)
}
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/api/interface/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ export namespace Host {
label: string;
autoMount: boolean;
mountPoint: string;
noFail: boolean;
}

export interface DiskMount {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3189,6 +3189,7 @@ const message = {
model: 'Device Model',
diskType: 'Disk Type',
serial: 'Serial Number',
noFail: 'Mount failure does not affect system startup',
},
xpack: {
expiresTrialAlert:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/es-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3176,6 +3176,7 @@ const message = {
model: 'Modelo del dispositivo',
diskType: 'Tipo de disco',
serial: 'Núm. de serie',
noFail: 'El fallo de montaje no afecta al inicio del sistema',
},
xpack: {
expiresTrialAlert:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3090,6 +3090,7 @@ const message = {
model: 'デバイスモデル',
diskType: 'ディスクタイプ',
serial: 'シリアルナンバー',
noFail: 'マウント失敗はシステム起動に影響しません',
},
xpack: {
expiresTrialAlert:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3035,6 +3035,7 @@ const message = {
model: '장치 모델',
diskType: '디스크 유형',
serial: '시리얼 번호',
noFail: '마운트 실패는 시스템 시작에 영향을 미치지 않습니다',
},
xpack: {
expiresTrialAlert:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3147,6 +3147,7 @@ const message = {
model: 'Model Peranti',
diskType: 'Jenis Cakera',
serial: 'Nombor Siri',
noFail: 'Kegagalan pemasangan tidak menjejaskan permulaan sistem',
},
xpack: {
expiresTrialAlert:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/pt-br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3161,6 +3161,7 @@ const message = {
model: 'Modelo do Dispositivo',
diskType: 'Tipo de Disco',
serial: 'Número de Série',
noFail: 'Falha na montagem não afeta a inicialização do sistema',
},
xpack: {
expiresTrialAlert:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3150,6 +3150,7 @@ const message = {
model: 'Модель устройства',
diskType: 'Тип диска',
serial: 'Серийный номер',
noFail: 'Сбой монтирования не влияет на запуск системы',
},
xpack: {
expiresTrialAlert:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3231,6 +3231,7 @@ const message = {
model: 'Cihaz Modeli',
diskType: 'Disk Türü',
serial: 'Seri Numarası',
noFail: 'Bağlama hatası sistem başlangıcını etkilemez',
},
xpack: {
expiresTrialAlert:
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2962,6 +2962,7 @@ const message = {
model: '裝置型號',
diskType: '磁碟類型',
serial: '序號',
noFail: '掛載失敗不影響系統啟動',
},
xpack: {
expiresAlert: '溫馨提醒:您的專業版許可證將在 {0} 天後到期,屆時所有專業版功能將無法繼續使用。',
Expand Down
1 change: 1 addition & 0 deletions frontend/src/lang/modules/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2962,6 +2962,7 @@ const message = {
model: '设备型号',
diskType: '磁盘类型',
serial: '序列号',
noFail: '挂载失败不影响系统启动',
},
xpack: {
expiresAlert: '温馨提醒:专业版试用将于 [{0}] 天后到期,届时将停止使用所有专业版功能。',
Expand Down
12 changes: 11 additions & 1 deletion frontend/src/views/host/disk-management/partition/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/>
<el-form
@submit.prevent
ref="partitionRef"
ref="formRef"
:rules="rules"
label-position="top"
:model="form"
Expand All @@ -37,6 +37,9 @@
<el-form-item :label="$t('disk.autoMount')" prop="autoMount">
<el-switch v-model="form.autoMount" />
</el-form-item>
<el-form-item :label="$t('disk.noFail')" prop="noFail" v-if="form.autoMount">
<el-switch v-model="form.noFail" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="handleClose" :disabled="loading">{{ $t('commons.button.cancel') }}</el-button>
Expand Down Expand Up @@ -66,13 +69,15 @@ const form = reactive({
autoMount: true,
mountPoint: '',
label: '',
noFail: true,
});
const open = ref(false);
const loading = ref(false);
const operate = ref('mount');
const fileRef = ref();
const emit = defineEmits(['search']);
const filesystem = ref('');
const formRef = ref();

const loadBuildDir = async (path: string) => {
form.mountPoint = path;
Expand All @@ -91,6 +96,11 @@ const acceptParams = (diskInfo: Host.DiskInfo, operateType: string) => {

const submit = async () => {
try {
const isValid = await formRef.value.validate();
if (!isValid) {
loading.value = false;
return;
}
loading.value = true;
if (operate.value == 'mount') {
await mountDisk(form);
Expand Down
Loading