Plugins are now a unified format for both sources and actions. Actions dictate what to do with a link and can now be added through a plugin JSON file. Backups have also been versioned to improve performance and add action support. Tags are used to give small amounts of information before a user installs a plugin. Signed-off-by: kingbri <bdashore3@proton.me>
38 lines
913 B
Swift
38 lines
913 B
Swift
//
|
|
// SourceCatalogButtonView.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 8/5/22.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct SourceCatalogButtonView: View {
|
|
@EnvironmentObject var pluginManager: PluginManager
|
|
|
|
let availableSource: SourceJson
|
|
|
|
var body: some View {
|
|
HStack {
|
|
VStack(alignment: .leading, spacing: 5) {
|
|
HStack {
|
|
Text(availableSource.name)
|
|
Text("v\(availableSource.version)")
|
|
.foregroundColor(.secondary)
|
|
}
|
|
|
|
Text("by \(availableSource.author ?? "Unknown")")
|
|
.foregroundColor(.secondary)
|
|
}
|
|
|
|
Spacer()
|
|
|
|
Button("Install") {
|
|
Task {
|
|
await pluginManager.installSource(sourceJson: availableSource)
|
|
}
|
|
}
|
|
}
|
|
.padding(.vertical, 2)
|
|
}
|
|
}
|