Widget desktop 224x224 che mostra: - residuo sessione (5h) e settimanale (7d) con barre colorate - conteggio richieste, costo 4 settimane, modello top - timer di reset stimati (calibrati al primo reset osservato) - backend bash che chiama https://ollama.com/api/usage - legge la chiave API da ~/.pi/agent/auth.json (provider ollama-cloud)
70 lines
1.8 KiB
QML
70 lines
1.8 KiB
QML
/*
|
|
* configGeneral.qml — pagina di configurazione del plasmoide Ollama Cloud Usage.
|
|
* Le property alias "cfg_<key>" si collegano automaticamente alle voci di
|
|
* contents/config/main.xml.
|
|
*/
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import org.kde.plasma.components 3.0 as PC3
|
|
import org.kde.kirigami as Kirigami
|
|
|
|
Item {
|
|
id: page
|
|
|
|
property alias cfg_refreshIntervalSec: refreshSpin.value
|
|
property alias cfg_warnThreshold: warnSpin.value
|
|
property alias cfg_critThreshold: critSpin.value
|
|
property alias cfg_showActivity: activityCheck.checked
|
|
property alias cfg_showModels: modelsCheck.checked
|
|
|
|
ColumnLayout {
|
|
anchors.fill: parent
|
|
anchors.margins: Kirigami.Units.largeSpacing
|
|
spacing: Kirigami.Units.smallSpacing
|
|
|
|
PC3.Label {
|
|
text: i18n("Intervallo di aggiornamento (secondi)")
|
|
font.bold: true
|
|
}
|
|
PC3.SpinBox {
|
|
id: refreshSpin
|
|
from: 30
|
|
to: 3600
|
|
stepSize: 30
|
|
Layout.fillWidth: true
|
|
}
|
|
|
|
PC3.Label {
|
|
text: i18n("Soglia residuo giallo (%)")
|
|
font.bold: true
|
|
}
|
|
PC3.SpinBox {
|
|
id: warnSpin
|
|
from: 0
|
|
to: 100
|
|
Layout.fillWidth: true
|
|
}
|
|
|
|
PC3.Label {
|
|
text: i18n("Soglia residuo rosso (%)")
|
|
font.bold: true
|
|
}
|
|
PC3.SpinBox {
|
|
id: critSpin
|
|
from: 0
|
|
to: 100
|
|
Layout.fillWidth: true
|
|
}
|
|
|
|
PC3.CheckBox {
|
|
id: activityCheck
|
|
text: i18n("Mostra costo attività (ultime 4 settimane)")
|
|
}
|
|
PC3.CheckBox {
|
|
id: modelsCheck
|
|
text: i18n("Mostra conteggio richieste per modello")
|
|
}
|
|
|
|
Item { Layout.fillHeight: true }
|
|
}
|
|
} |