How to use the platform.os function in platform

To help you get started, we’ve selected a few platform examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yinxin630 / fiora / client / modules / main / login / Login.jsx View on Github external
handleLogin = () => {
        socket.emit('login', {
            username: this.loginUsername.getValue(),
            password: this.loginPassword.getValue(),
            os: platform.os.family,
            browser: platform.name,
            environment: platform.description,
        }, (res) => {
            if (typeof res === 'string') {
                Message.error(res);
            } else {
                action.setUser(res);
                action.closeLoginDialog();
                window.localStorage.setItem('token', res.token);
            }
        });
    }
github jtorhoff / flier / src / tg / Session / DataCenter.ts View on Github external
private initConnection() {
        const getConfig = new API.help.GetConfig();
        const initConnection = new API.InitConnection(
            new TLInt(this.apiId),
            new TLString(platform.name || "Web"),
            new TLString(platform.os ?
                platform.os.family + " " + platform.os.version :
                "Unknown"),
            new TLString(VERSION),
            new TLString(navigator.language),
            getConfig,
        );
        const invokeWithLayer = new API.InvokeWithLayer(
            new TLInt(API.layer),
            initConnection);

        this.send(invokeWithLayer, result => {
            if (result instanceof API.Config) {
                this.dcId = result.thisDc.value;
                this.configSubject.next(result);
                this.dcOptionsSubject.next(result.dcOptions.items);
                this.worker.postMessage({
github HubPress / hubpress.io / src / hubpress / scripts / services / AuthServices.js View on Github external
function _getTokenNote() {
  return slug(`hubpress-${platform.name}-${platform.os}`);
}
github wireapp / wire-webapp / src / script / util / Environment.ts View on Github external
const _isWindows = (): boolean => platform.os.family && platform.os.family.includes(PLATFORM_NAME.WINDOWS);
github ailabstw / pttai.js / src / containers / MultiDeviceModal.js View on Github external
<div>
                  <div>Version</div>
                  <div>{platform.version}</div>
                </div>
                <div>
                  <div>Manufacturer</div>
                  <div>{platform.manufacturer}</div>
                </div>
                <div>
                  <div>Layout</div>
                  <div>{platform.layout}</div>
                </div>
                <div>
                  <div>OS</div>
                  <div title="{platform.os}">{platform.os.toString()}</div>
                </div>
                <div>
                  <div>Description</div>
                  <div>{platform.description}</div>
                </div>
              

              {
                device.data.map((item, index) =&gt; {
                  return (
                    <div>
                      <div>
                        <div>{(index + 1) + '. ' + item.NodeName}</div>
                      </div>
                      <div>
                        <div>Node ID</div></div></div>
github patternplate / patternplate / packages / client / source / assets / script / index.js View on Github external
function getPlatformData() {
  return {
    clientRuntimeName: platform.name,
    clientRuntimeVersion: platform.version,
    clientOsName: platform.os.name,
    clientOsVersion: platform.os.version
  };
}
github MixinNetwork / desktop-app / src / views / SignIn.vue View on Github external
decryptProvision: function(envelopeDecoded) {
      const messageStr = signalProtocol.decryptProvision(this.keyPair.priv, envelopeDecoded)
      if (!messageStr) {
        this.showRetry = true
        return
      }
      const message = JSON.parse(messageStr)
      const keyPair = signalProtocol.createKeyPair(message.identity_key_private)
      const code = message.provisioning_code
      const userId = message.user_id
      const primarySessionId = message.session_id
      const platform = 'Desktop'
      const purpose = 'SESSION'
      const platformVersion = platformInfo.os.toString()
      const appVersion = this.$electron.remote.app.getVersion()
      const registrationId = signalProtocol.generateRegId()
      const sessionKeyPair = new Bot().generateSessionKeypair()
      clearSignal()
      accountAPI
        .verifyProvisioning({
          code: code,
          user_id: userId,
          session_id: primarySessionId,
          platform: platform,
          platform_version: platformVersion,
          app_version: appVersion,
          purpose: purpose,
          registration_id: registrationId,
          session_secret: sessionKeyPair.public
        })
github collective-soundworks / soundworks / client / ClientPlatform.es6.js View on Github external
if (this.bypass) 
      return this.done();

    if (!audioContext) {
      if (os === 'ios') {
        msg = this.messages.iosVersion;
      } else if (os === 'android') {
        msg = this.messages.androidVersion;
      } else {
        msg = this.messages.wrongOS;
      }
    } else if (!isMobile || client.platform.os === 'other') {
      msg = this.messages.wrongOS;
    } else if (client.platform.os === 'ios' &amp;&amp; platform.os.version &lt; '7') {
      msg = this.messages.iosVersion;
    } else if (client.platform.os === 'android' &amp;&amp; platform.os.version &lt; '4.2') {
      msg = this.messages.androidVersion;
    }

    if (msg !== null) {
      this.setCenteredViewContent(this.prefix + '<p>' + msg + '</p>' + this.postfix);
    } else {
      this.done();
    }
  }
github patternplate / patternplate / packages / client / src / client.js View on Github external
function getPlatformData() {
  return {
    clientRuntimeName: platform.name,
    clientRuntimeVersion: platform.version,
    clientOsName: platform.os.name,
    clientOsVersion: platform.os.version
  };
}