mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-25 01:45:37 +00:00
Small fixes [stage]
This commit is contained in:
@@ -1074,18 +1074,12 @@ public abstract class DataStorage {
|
||||
return forStoreIdentity.get();
|
||||
}
|
||||
|
||||
var uuid = UuidHelper.generateFromObject(parent.getUuid(), name);
|
||||
var found = getStoreEntryIfPresent(uuid);
|
||||
if (found.isPresent()) {
|
||||
return found.get();
|
||||
}
|
||||
|
||||
var forStore = getStoreEntryIfPresent(store, false);
|
||||
if (forStore.isPresent()) {
|
||||
return forStore.get();
|
||||
}
|
||||
|
||||
return DataStoreEntry.createNew(uuid, parent.getCategoryUuid(), name, store);
|
||||
return DataStoreEntry.createNew(UUID.randomUUID(), parent.getCategoryUuid(), name, store);
|
||||
}
|
||||
|
||||
public DataStoreEntry getStoreEntry(UUID id) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.xpipe.app.util;
|
||||
|
||||
import io.xpipe.app.storage.DataStorage;
|
||||
import io.xpipe.core.process.CountDown;
|
||||
import io.xpipe.core.process.ElevationHandler;
|
||||
import io.xpipe.core.process.ShellControl;
|
||||
@@ -39,6 +40,10 @@ public class BaseElevationHandler implements ElevationHandler {
|
||||
|
||||
@Override
|
||||
public SecretReference getSecretRef() {
|
||||
return password != null && password.expectsQuery() ? new SecretReference(dataStore) : null;
|
||||
var id = DataStorage.get().getStoreEntryIfPresent(dataStore, true)
|
||||
.or(() -> {
|
||||
return DataStorage.get().getStoreEntryInProgressIfPresent(dataStore);
|
||||
}).map(e -> e.getUuid()).orElse(UUID.randomUUID());
|
||||
return password != null && password.expectsQuery() ? new SecretReference(id, 0) : null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,8 +86,7 @@ public class SecretManager {
|
||||
}
|
||||
}
|
||||
|
||||
public static synchronized void clearAll(Object store) {
|
||||
var id = UuidHelper.generateFromObject(store);
|
||||
public static synchronized void clearAll(UUID id) {
|
||||
secrets.entrySet()
|
||||
.removeIf(secretReferenceSecretValueEntry ->
|
||||
secretReferenceSecretValueEntry.getKey().getSecretId().equals(id));
|
||||
|
||||
@@ -22,7 +22,7 @@ public interface Validator {
|
||||
.dependsOn("val", s)
|
||||
.withMethod(c -> {
|
||||
if (c.get("val") == null) {
|
||||
c.error(AppI18n.get("app.mustNotBeEmpty", name != null ? name.getValue() : "null"));
|
||||
c.error(AppI18n.get("app.mustNotBeEmpty", name != null ? name.getValue() : AppI18n.get("value")));
|
||||
}
|
||||
})
|
||||
.immediate();
|
||||
@@ -35,7 +35,7 @@ public interface Validator {
|
||||
.dependsOn("if", checkIf)
|
||||
.withMethod(c -> {
|
||||
if (Boolean.TRUE.equals(c.get("if")) && c.get("val") == null) {
|
||||
c.error(AppI18n.get("app.mustNotBeEmpty", name != null ? name.getValue() : "null"));
|
||||
c.error(AppI18n.get("app.mustNotBeEmpty", name != null ? name.getValue() : AppI18n.get("value")));
|
||||
}
|
||||
})
|
||||
.immediate();
|
||||
@@ -46,7 +46,7 @@ public interface Validator {
|
||||
.dependsOn("val", s)
|
||||
.withMethod(c -> {
|
||||
if (((ObservableList<?>) c.get("val")).size() == 0) {
|
||||
c.error(AppI18n.get("app.mustNotBeEmpty", name != null ? name.getValue() : "null"));
|
||||
c.error(AppI18n.get("app.mustNotBeEmpty", name != null ? name.getValue() : AppI18n.get("value")));
|
||||
}
|
||||
})
|
||||
.immediate();
|
||||
|
||||
@@ -12,16 +12,6 @@ public class SecretReference {
|
||||
UUID secretId;
|
||||
int subId;
|
||||
|
||||
public SecretReference(Object store) {
|
||||
this.secretId = UuidHelper.generateFromObject(store);
|
||||
this.subId = 0;
|
||||
}
|
||||
|
||||
public SecretReference(Object store, int sub) {
|
||||
this.secretId = UuidHelper.generateFromObject(store);
|
||||
this.subId = sub;
|
||||
}
|
||||
|
||||
public static SecretReference ofUuid(UUID secretId) {
|
||||
return new SecretReference(secretId, 0);
|
||||
}
|
||||
|
||||
@@ -7,10 +7,6 @@ import java.util.UUID;
|
||||
|
||||
public class UuidHelper {
|
||||
|
||||
public static UUID generateFromObject(Object... o) {
|
||||
return UUID.nameUUIDFromBytes(Arrays.toString(o).getBytes(StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
public static Optional<UUID> parse(String s) {
|
||||
try {
|
||||
return Optional.of(UUID.fromString(s));
|
||||
|
||||
@@ -1268,3 +1268,4 @@ updateNagButton=Se udgivelser
|
||||
refreshServices=Opdater tjenester
|
||||
serviceProtocolType=Type serviceprotokol
|
||||
serviceProtocolTypeDescription=Den protokol, der skal bruges til at åbne tjenesten
|
||||
value=Værdi
|
||||
|
||||
@@ -1249,3 +1249,4 @@ updateNagButton=Siehe Veröffentlichungen
|
||||
refreshServices=Dienste aktualisieren
|
||||
serviceProtocolType=Dienstprotokolltyp
|
||||
serviceProtocolTypeDescription=Das Protokoll, das zum Öffnen des Dienstes verwendet wird
|
||||
value=Wert
|
||||
|
||||
@@ -1270,3 +1270,4 @@ updateNagButton=See releases
|
||||
refreshServices=Refresh services
|
||||
serviceProtocolType=Service protocol type
|
||||
serviceProtocolTypeDescription=The protocol to use to open the service
|
||||
value=Value
|
||||
|
||||
@@ -1220,3 +1220,4 @@ updateNagButton=Ver liberaciones
|
||||
refreshServices=Actualizar servicios
|
||||
serviceProtocolType=Tipo de protocolo de servicio
|
||||
serviceProtocolTypeDescription=El protocolo a utilizar para abrir el servicio
|
||||
value=Valor
|
||||
|
||||
@@ -1255,3 +1255,4 @@ updateNagButton=Voir les communiqués
|
||||
refreshServices=Services de rafraîchissement
|
||||
serviceProtocolType=Type de protocole de service
|
||||
serviceProtocolTypeDescription=Le protocole à utiliser pour ouvrir le service
|
||||
value=Valeur
|
||||
|
||||
@@ -1220,3 +1220,4 @@ updateNagButton=Lihat rilis
|
||||
refreshServices=Menyegarkan layanan
|
||||
serviceProtocolType=Jenis protokol layanan
|
||||
serviceProtocolTypeDescription=Protokol yang digunakan untuk membuka layanan
|
||||
value=Nilai
|
||||
|
||||
@@ -1220,3 +1220,4 @@ updateNagButton=Vedere i comunicati
|
||||
refreshServices=Aggiorna i servizi
|
||||
serviceProtocolType=Tipo di protocollo di servizio
|
||||
serviceProtocolTypeDescription=Il protocollo da utilizzare per aprire il servizio
|
||||
value=Valore
|
||||
|
||||
@@ -1220,3 +1220,4 @@ updateNagButton=リリースを見る
|
||||
refreshServices=リフレッシュ・サービス
|
||||
serviceProtocolType=サービスプロトコルタイプ
|
||||
serviceProtocolTypeDescription=サービスを開くために使用するプロトコル
|
||||
value=価値
|
||||
|
||||
@@ -1220,3 +1220,4 @@ updateNagButton=Bekijk uitgaven
|
||||
refreshServices=Diensten verversen
|
||||
serviceProtocolType=Type serviceprotocol
|
||||
serviceProtocolTypeDescription=Het te gebruiken protocol om de service te openen
|
||||
value=Waarde
|
||||
|
||||
@@ -1220,3 +1220,4 @@ updateNagButton=Zobacz wydania
|
||||
refreshServices=Usługi odświeżania
|
||||
serviceProtocolType=Typ protokołu usługi
|
||||
serviceProtocolTypeDescription=Protokół używany do otwarcia usługi
|
||||
value=Wartość
|
||||
|
||||
@@ -1220,3 +1220,4 @@ updateNagButton=Ver lançamentos
|
||||
refreshServices=Atualizar serviços
|
||||
serviceProtocolType=Tipo de protocolo de serviço
|
||||
serviceProtocolTypeDescription=O protocolo a utilizar para abrir o serviço
|
||||
value=Valoriza
|
||||
|
||||
@@ -1220,3 +1220,4 @@ updateNagButton=Смотри релизы
|
||||
refreshServices=Обновление сервисов
|
||||
serviceProtocolType=Тип протокола обслуживания
|
||||
serviceProtocolTypeDescription=Протокол, который нужно использовать для открытия сервиса
|
||||
value=Значение
|
||||
|
||||
@@ -1220,3 +1220,4 @@ updateNagButton=Se releaser
|
||||
refreshServices=Uppdatera tjänster
|
||||
serviceProtocolType=Typ av serviceprotokoll
|
||||
serviceProtocolTypeDescription=Protokollet som ska användas för att öppna tjänsten
|
||||
value=Värde
|
||||
|
||||
@@ -1220,3 +1220,4 @@ updateNagButton=Yayınlara bakın
|
||||
refreshServices=Yenileme hizmetleri
|
||||
serviceProtocolType=Hizmet protokolü türü
|
||||
serviceProtocolTypeDescription=Hizmeti açmak için kullanılacak protokol
|
||||
value=Değer
|
||||
|
||||
@@ -1220,3 +1220,4 @@ updateNagButton=参见发布
|
||||
refreshServices=刷新服务
|
||||
serviceProtocolType=服务协议类型
|
||||
serviceProtocolTypeDescription=用于打开服务的协议
|
||||
value=价值
|
||||
|
||||
Reference in New Issue
Block a user