Giter VIP home page Giter VIP logo

hello's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hello's Issues

[SwiftUI] No symbol named 'gear.circle' found

Hi Erik,

i discover this issue on Big Sur during my testing Hello 0.2.2 .
Screenshot 2021-07-22 at 17 45 29

2021-07-22 18:46:22.523077+0200 hello[40018:764438] [SwiftUI] No symbol named 'gear.circle' found in system symbol set
2021-07-22 18:46:22.554990+0200 hello[40018:764438] [SwiftUI] No symbol named 'gear.circle' found in system symbol set
2021-07-22 18:46:25.067170+0200 hello[40018:764438] [SwiftUI] No symbol named 'gear.circle' found in system symbol set
2021-07-22 18:46:25.166747+0200 hello[40018:764438] [SwiftUI] No symbol named 'circle.dashed.inset.filled' found in system symbol set

Add Profiles function

Hi Erik,

I was thinking about maybe mobileconfig check will be as well interesting.
Here is some adjustment i did in your code, but still not working but maybe help, as i'm not really expert in Swift :-)
PrimaryStatus:

`// Stage Status (Dynamic Row)
struct StageRow: View {
@ObservedObject var settings: HelloHelper
var installstage: DeviceStage
@State var installedPkg = false
@State var installedProfile = false
var body: some View {
HStack {
// Icon
// TODO: Figure out how to refresh AsyncImage if it fails to download the first time
if #available(macOS 12.0, *) {
AsyncImage(url: URL(string: installstage.iconPath)) { image in
image.resizable()
} placeholder: {
Utils().randomPlaceholderColor()
.opacity(0)
}
.aspectRatio(contentMode: .fit)
.scaledToFit()
.frame(width: 40, height: 40)
} else {
WebImage(url: URL(string: installstage.iconPath))
.renderingMode(.original)
.resizable()
.aspectRatio(contentMode: .fit)
.scaledToFit()
.frame(width: 40, height: 40)
}

        // Stage Name
        Text(installstage.title)
            .font(.body)
            .fontWeight(.bold)
        
        Spacer()
        
        // Current Stage Status
        if Utils().pathExists(path: installstage.installedPath) || PkgInfo(receipt: installstage.installedPath) , Profile(receipt: installstage.installedPath) {
            Image(systemName: "checkmark.circle.fill")
                .foregroundColor(.green)
            Text("Completed")
                .frame(width: 75)
                .onAppear {
                    settings.applicationState[installstage.id] = "installed"
                }
        } else {
            // First stage - auto trigger installing
            if settings.applicationState.isEmpty && installstage.id == 1 {
                ProgressView()
                    .progressViewStyle(.circular)
                    .scaleEffect(0.4)
                Text("Installing")
                    .frame(width: 75)
                    .onAppear {
                        settings.applicationState[installstage.id] = "installing"
                        settings.applicationInstalling = installstage.title
                        settings.applicationInstallingIconPath = installstage.iconPath
                    }
            // Stage has already sent its state - no need to resend
            } else if settings.applicationState[installstage.id] == "installing" {
                ProgressView()
                    .progressViewStyle(.circular)
                    .scaleEffect(0.4)
                Text("Installing")
                    .frame(width: 75)
            // Previous stage has completed - trigger installing
            } else if settings.applicationState[installstage.id-1] == "installed" {
                ProgressView()
                    .progressViewStyle(.circular)
                    .scaleEffect(0.4)
                Text("Installing")
                    .frame(width: 75)
                    .onAppear {
                        settings.applicationState[installstage.id] = "installing"
                        settings.applicationInstalling = installstage.title
                        settings.applicationInstallingIconPath = installstage.iconPath
                    }
            // Catchall for pending
            } else {
                Image(systemName: "checkmark.circle.fill")
                    .foregroundColor(.secondary)
                Text("Pending")
                    .frame(width: 75)
                    .onAppear {
                        settings.applicationState[installstage.id] = "pending"
                    }
            }
        }
    }
}

func PkgInfo(receipt: String) -> Bool {
    DispatchQueue.main.async {
        self.installedPkg = Utils().pkgInfo(receipt: receipt)
    }
    return self.installedPkg
}
func Profile(receipt: String) -> Bool {
    DispatchQueue.main.async {
        self.installedProfile = Utils().profiles(receipt: receipt)
    }
    return self.installedProfile
}

}`

Utils:

func profiles(receipt: String) -> Bool {
let task = Process()
task.launchPath = "/usr/bin/profiles"
task.arguments = ["-P", receipt]

    let outputPipe = Pipe()
    let errorPipe = Pipe()

    task.standardOutput = outputPipe
    task.standardError = errorPipe

    do {
        try task.run()
    } catch {
        let msg = "Error processing profiles"
        print(msg)
        return false
    }
    
    task.waitUntilExit()

    if task.terminationStatus != 0 {
        return false
    } else {
        return true
    }

}

Screenshot 2021-07-23 at 15 06 33

Thx

Hello Not closing after software has been installed

Good day

I have added Managed Software Centre and after it being installed , the Hello app doesn't close
How do get it to close after installation has completed ?

Or instead of closing , open the last windows of the hello app

Compatibility Questions

macOS version 11.4
Xcode version: 12.5

The project at '/hello-main/hello.xcodeproj' cannot be opened because it is in a future Xcode project file format. Adjust the project format using a compatible version of Xcode to allow it to be opened by this version of Xcode.

Editing /hello-main/hello.xcodeproj/project.pbxproj (objectVersion) manually from 55 to 54, allows me to open it, but some of the Beta tools and commands are not available.
A few Cannot find 'AsyncImage' in scope errors and Cannot infer contextual base in reference to member 'link' errors.
https://developer.apple.com/documentation/swiftui/asyncimage?changes=_6 (AsyncImage view 10.12+ only?)

Thus the macOS 10.12+ beta compatibility question.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.